This C++ code solves the coupled drift-diffusion-Poisson equations that model a photoelectrochemical solar cell in 2D using the deal.ii finite element library. It will automatically run in parallel using the Thread Building Blocks for multithreading. The main challenges in constructing numerical algorithms that produces reliable simulations of PECs are due to the highly nonlinear nature of the system and the different time scales of the semiconductor and electrolyte charge carrier. Furthermore, regions of stiffness caused by boundary layer formation where sharp transitions in densities and electric potential occur near the interface and pose severe constraints on the choice of discretization strategy in order to maintain numerical stability. To overcome these challenges I used a mixed finite element method to solve the Poisson equation and local discontinuous Galerkin method along with implicit-explicit time stepping method for the drift-diffusion equations.
The code is throughly tested and extensively documented using doxygen automatic documentation generation. The documentation can be found here: http://michael-harmon.com/PECS/