PhotoElectrochemical Cell Simulator
A Finite Element Based Simulator For Water Splitting Solar Cells
Public Member Functions | Private Types | Private Member Functions | Private Attributes
SOLARCELL::SolarCellProblem< dim > Class Template Reference

Public Member Functions

 SolarCellProblem (const unsigned int degree, ParameterHandler &param)
 
 ~SolarCellProblem ()
 
void run_full_system ()
 
void test_DD_Poisson (const unsigned int &n_refine, ConvergenceTable &Mixed_table, ConvergenceTable &LDG_table)
 Test the coupling of the mixed FEM to the LDG method. More...
 
void test_interface_coupling (const unsigned int &n_refine, ConvergenceTable &Table)
 Tests the LDG method for a pair of parabolic problems coupled across the interface. More...
 
void test_steady_state (const unsigned int &n_refine, ConvergenceTable &Mixed_table, ConvergenceTable &LDG_table)
 Solves test Poisson problem and prints convergence rates. More...
 
void test_transient (const unsigned int &n_refine, ConvergenceTable &LDG_table)
 Tests the LDG method with IMEX time stepping on the drift-diffusion eq. More...
 

Private Types

enum  { Interface, Dirichlet, Neumann, Schottky }
 

Private Member Functions

void assemble_electrolyte_rhs ()
 
void assemble_LDG_system (const double &transient_or_steady)
 
void assemble_local_coupled_DD_test_rhs (const typename DoFHandler< dim >::active_cell_iterator &cell, Assembly::AssemblyScratch< dim > &scratch, Assembly::DriftDiffusion::CopyData< dim > &data, const double &time, const double &penalty)
 
void assemble_local_coupled_Poisson_test_rhs (const typename DoFHandler< dim >::active_cell_iterator &cell, Assembly::AssemblyScratch< dim > &scratch, Assembly::Poisson::CopyData< dim > &data, const double &time)
 
void assemble_local_electrolyte_rhs (const typename DoFHandler< dim >::active_cell_iterator &cell, Assembly::AssemblyScratch< dim > &scratch, Assembly::DriftDiffusion::CopyData< dim > &data, const double &penalty)
 
void assemble_local_Poisson_rhs_for_electrolyte (const typename DoFHandler< dim >::active_cell_iterator &cell, Assembly::AssemblyScratch< dim > &scratch, Assembly::Poisson::CopyData< dim > &data)
 Assembles the local poisson rhs for the coupled problem in the electrolyte triangulation. More...
 
void assemble_local_Poisson_rhs_for_semiconductor (const typename DoFHandler< dim >::active_cell_iterator &cell, Assembly::AssemblyScratch< dim > &scratch, Assembly::Poisson::CopyData< dim > &data)
 Assembles the local poisson rhs for the coupled problem in the semiconductor triangulation. More...
 
void assemble_local_semiconductor_rhs (const typename DoFHandler< dim >::active_cell_iterator &cell, Assembly::AssemblyScratch< dim > &scratch, Assembly::DriftDiffusion::CopyData< dim > &data, const double &penalty)
 
void assemble_Poisson_matrix ()
 
void assemble_Poisson_rhs ()
 Assembles the global poisson rhs for the coupled problem. More...
 
void assemble_semiconductor_rhs ()
 
void copy_local_to_global_electrolyte_mass_matrix (const Assembly::DriftDiffusion::CopyData< dim > &data)
 
void copy_local_to_global_electrolyte_system_matrix (const Assembly::DriftDiffusion::CopyData< dim > &data)
 
void copy_local_to_global_electrolyte_system_rhs (const Assembly::DriftDiffusion::CopyData< dim > &data)
 
void copy_local_to_global_Poisson_matrix (const Assembly::Poisson::CopyData< dim > &data)
 
void copy_local_to_global_Poisson_rhs (const Assembly::Poisson::CopyData< dim > &data)
 
void copy_local_to_global_semiconductor_mass_matrix (const Assembly::DriftDiffusion::CopyData< dim > &data)
 
void copy_local_to_global_semiconductor_system_matrix (const Assembly::DriftDiffusion::CopyData< dim > &data)
 
void copy_local_to_global_semiconductor_system_rhs (const Assembly::DriftDiffusion::CopyData< dim > &data)
 
void print_results (unsigned int time_step_number)
 
void print_results_on_boundary (unsigned int time_step_number)
 
void print_sim_info ()
 
void set_solvers ()
 
void setup_dofs ()
 
void setup_mappings ()
 Create bijective mappings for assembling interface coupling terms. More...
 
void solve_electrolyte_system ()
 
void solve_full_system ()
 
void solve_Poisson ()
 
void solve_semiconductor_system ()
 

Private Attributes

Applied_Bias< dim > applied_bias
 \( \Phi_{\text{app.}} \)
 
Built_In_Bias< dim > built_in_bias
 \( \Phi_{\text{bi}} \)
 
Bulk_Bias< dim > bulk_bias
 \( \Phi^{\infty} \)
 
FESystem< dim > carrier_fe
 The finite element of the LDG Method DG^{2} and DG.
 
const unsigned int degree
 Degree of the polynomials used.
 
double delta_t
 Time step.
 
Vector< double > diff_electrons
 
Vector< double > diff_holes
 
Vector< double > diff_oxidants
 
Vector< double > diff_Poisson
 
Vector< double > diff_reductants
 
std::map< std::pair< unsigned int, unsigned int >, std::pair< unsigned int, unsigned int > > e_2_p_map
 Bijective mapping from electrolyte cells to Poisson cells.
 
std::vector< std::pair< unsigned int, unsigned int > > elec_interface_cells
 Vector of semiconductor cells on the interface: their level and index.
 
std::vector< unsigned int > elec_interface_faces
 Vector of semiconductor cells' faces that are on the interface.
 
std::map< std::pair< unsigned int, unsigned int >, unsigned int > elec_interface_map
 Bijective mapping from electrolyte cell to global interface face index.
 
DoFHandler< dim > electrolyte_dof_handler
 DoFHandler for the redox pair. They will have same distribution od dofs.
 
Triangulation< dim > electrolyte_triangulation
 Mesh for the electrolyte domain.
 
ChargeCarrierSpace::CarrierPair< dim > electron_hole_pair
 Holds the matrices, vectors etc for the electron/hole pair.
 
const Electrons_Equilibrium< dim > electrons_e
 \( \rho_{n}^{e}(\textbf{x}) \)
 
bool full_system
 
Generation< dim > generation
 
const Holes_Equilibrium< dim > holes_e
 \( \rho_{p}^{e} (\textbf{x}) \)
 
LDG_System::LDG< dim > LDG_Assembler
 
MixedPoisson::MixedFEM< dim > Mixed_Assembler
 
const Oxidants_Equilibrium< dim > oxidants_e
 \( \rho_{o}^{\infty} (\textbf{x}) \)
 
DoFHandler< dim > Poisson_dof_handler
 DofHandler for the Poisson equation.
 
FESystem< dim > Poisson_fe
 This will be there FE -> Raviart-Thomas + DG.
 
Poisson::PoissonData< dim > Poisson_object
 Holds the matrices, vectors, etc for Mixed method of Poisson.
 
Triangulation< dim > Poisson_triangulation
 The Poisson's equation mesh.
 
ParameterSpace::ParameterHandler & prm
 
ChargeCarrierSpace::CarrierPair< dim > redox_pair
 Holds the matrices, vectors etc for the reductant/oxidant pair.
 
const Reductants_Equilibrium< dim > reductants_e
 \( \rho_{r}^{\infty}(\textbf{x}) \)
 
std::map< std::pair< unsigned int, unsigned int >, std::pair< unsigned int, unsigned int > > s_2_p_map
 Bijective mapping from semiconductor cells to Poisson cells.
 
Schottky_Bias< dim > schottky_bias
 \( \Phi_{\text{Sch}} \)
 
std::vector< std::pair< unsigned int, unsigned int > > semi_interface_cells
 Vector of semiconductor cells on the interface: their level and index.
 
std::vector< unsigned int > semi_interface_faces
 Vector of semiconductor cells' faces that are on the interface.
 
std::map< std::pair< unsigned int, unsigned int >, unsigned int > semi_interface_map
 Bijective mapping from semiconductor cell to global interface face index.
 
DoFHandler< dim > semiconductor_dof_handler
 DoFHandler for electron and hole. They will have the same distribution of dofs.
 
Triangulation< dim > semiconductor_triangulation
 Mesh for the semiconductor domain.
 
ParameterSpace::Parameters sim_params
 

Member Enumeration Documentation

template<int dim>
anonymous enum
private
Enumerator
Interface 

Interface boundary id set in Grid_Maker::Grid.

Dirichlet 

Dirichlet boundary id set in Grid_Maker::Grid.

Neumann 

Neumann boundary id set in Grid_Maker::Grid.

Schottky 

Shottky boundary id set in Grid_Maker::Grid.

Constructor & Destructor Documentation

template<int dim>
SOLARCELL::SolarCellProblem< dim >::SolarCellProblem ( const unsigned int  degree,
ParameterHandler param 
)

The constructor for this problem. The parameter values are set here and the generation function is also set here.

template<int dim>
SOLARCELL::SolarCellProblem< dim >::~SolarCellProblem ( )

Destructor just deletes the dof_handlers.

Member Function Documentation

template<int dim>
void SOLARCELL::SolarCellProblem< dim >::assemble_electrolyte_rhs ( )
private

Builds the RHSes for the reductant and oxidant equations. This function loops through all the cells in the electrolyte triangulation. It does so by using electrolyte_dof_handler and calling SOLARCELL::SolarCellProblem::assemble_local_electrolyte_rhs uising workstream.

template<int dim>
void SOLARCELL::SolarCellProblem< dim >::assemble_LDG_system ( const double &  transient_or_steady)
private

Assembles the LDG system that asembles the mass matrix and system matrix for the electrons, holes, reductants and oxidants using the IMEX method and LDG discritizations.

template<int dim>
void SOLARCELL::SolarCellProblem< dim >::assemble_local_coupled_DD_test_rhs ( const typename DoFHandler< dim >::active_cell_iterator cell,
Assembly::AssemblyScratch< dim > &  scratch,
Assembly::DriftDiffusion::CopyData< dim > &  data,
const double &  time,
const double &  penalty 
)
private

Assembles the local cell rhs term for the LDG method applied to the drift-diffusion equation defined in SOLARCELL::SolarCellProblem::test_DD_Poisson.

template<int dim>
void SOLARCELL::SolarCellProblem< dim >::assemble_local_coupled_Poisson_test_rhs ( const typename DoFHandler< dim >::active_cell_iterator cell,
Assembly::AssemblyScratch< dim > &  scratch,
Assembly::Poisson::CopyData< dim > &  data,
const double &  time 
)
private

Assembles the local cell rhs term for the mixed FEM applied to the Poisson equation defined in SOLARCELL::SolarCellProblem::test_DD_Poisson.

template<int dim>
void SOLARCELL::SolarCellProblem< dim >::assemble_local_electrolyte_rhs ( const typename DoFHandler< dim >::active_cell_iterator cell,
Assembly::AssemblyScratch< dim > &  scratch,
Assembly::DriftDiffusion::CopyData< dim > &  data,
const double &  penalty 
)
private

Builds the local RHSes for the electron and hole equations. It stores the calculated data in Assembly::DriftDiffusion::CopyData the rhs at time \(k\) is,

\[ = - \langle v, K( u^{k-1}) \rangle_{\partial \Omega_{e} \cap \Sigma} + \left( s \textbf{P} \cdot \boldsymbol \nabla \Phi , u^{k-1} \right)_{\Omega_{e}} - \langle \textbf{p} , u_{D} \rangle_{ \partial \Omega_{e} \cap \Gamma_{E} } \]

For all \((v,\textbf{p}) \in W \times \textbf{W}^{d})\) and all \(\Omega_{e} \in \Omega_{E} \).

template<int dim>
void SOLARCELL::SolarCellProblem< dim >::assemble_local_Poisson_rhs_for_electrolyte ( const typename DoFHandler< dim >::active_cell_iterator cell,
Assembly::AssemblyScratch< dim > &  scratch,
Assembly::Poisson::CopyData< dim > &  data 
)
private

Assembles the local poisson rhs for the coupled problem in the electrolyte triangulation.

This function loops through all the cells in the electrolyte triangulation and performs the following calculation,

\[ \ = \ -\langle \textbf{p} \ , \ \Phi^{\infty} \rangle_{\partial \Omega_{e} \cap \Gamma_{E}} - \left( v, \left[ -\ \left( \rho_{r} \ - \ \rho_{o} \right) \ \right] \ \right)_{\Omega_{e}} \]

For all \(( v \ , \ \textbf{p} ) \, \in \, W \, \times\, \textbf{V}^{d}\) and all \(\Omega_{e} \in \Omega_{E}\). It stores the data in Assembly::Poisson::CopyData.

template<int dim>
void SOLARCELL::SolarCellProblem< dim >::assemble_local_Poisson_rhs_for_semiconductor ( const typename DoFHandler< dim >::active_cell_iterator cell,
Assembly::AssemblyScratch< dim > &  scratch,
Assembly::Poisson::CopyData< dim > &  data 
)
private

Assembles the local poisson rhs for the coupled problem in the semiconductor triangulation.

This function loops through all the cells in the semiconductor triangulation and performs the following calculation,

\[ \ = \ -\langle \textbf{p} \ , \ \Phi_{\text{app}} + \Phi_{\text{bi}} \rangle_{\partial \Omega_{e} \cap \Gamma_{S}} - \left( v, \left[ \ N_{D} \ - \ N_{A} \ -\ \left( \rho_{n} \ - \ \rho_{p} \right) \ \right] \ \right)_{\Omega_{e}} \]

For all \(( v \ , \ \textbf{p} ) \, \in \, W \, \times\, \textbf{V}^{d}\) and all \(\Omega_{e} \in \Omega_{S}\). It stores the data in Assembly::Poisson::CopyData.

template<int dim>
void SOLARCELL::SolarCellProblem< dim >::assemble_local_semiconductor_rhs ( const typename DoFHandler< dim >::active_cell_iterator cell,
Assembly::AssemblyScratch< dim > &  scratch,
Assembly::DriftDiffusion::CopyData< dim > &  data,
const double &  penalty 
)
private

Builds the local RHSes for the electron and hole equations. It stores the calculated data in Assembly::DriftDiffusion::CopyData the rhs at time \(k\) is,

\[ = \left( v , R(u^{k-1}) + G(\textbf{x}) \right)_{\Omega_{e}} - \langle v, K( u^{k-1}) \rangle_{\partial \Omega_{e} \cap \Sigma} + \left( s \textbf{P} \cdot \boldsymbol \nabla \Phi , u^{k-1} \right)_{\Omega_{e}} - \langle \textbf{p} , u_{D} \rangle_{ \partial \Omega_{e} \cap \Gamma_{S} } \]

For all \((v,\textbf{p}) \in W \times \textbf{W}^{d})\) and all \(\Omega_{e} \in \Omega_{S} \).

template<int dim>
void SOLARCELL::SolarCellProblem< dim >::assemble_Poisson_matrix ( )
private

Assembles the matrix corresponding to the mixed method for Poisson eq. See MixedPoisson::MixedFEM for more information.

template<int dim>
void SOLARCELL::SolarCellProblem< dim >::assemble_Poisson_rhs ( )
private

Assembles the global poisson rhs for the coupled problem.

It first uses the semiconductor_dof_handler to run over the cells in the semiconductor triangulation and calls SOLARCELL::SolarCellProblem::assemble_local_Poisson_rhs_for_semiconductor using workstream. It then uses the electrolyte_dof_handler to run over the cells in the electrolyte triangulation and calls SOLARCELL::SolarCellProblem::assemble_local_Poisson_rhs_for_electrolyte using workstream.

The general problem for the Poisson equation is,

\[ \begin{align} \epsilon_{r}^{-1} \ \textbf{D} \ + \ \nabla \Phi \ &= \ 0 && \text{in} \; \Omega \\ \ \lambda^{2} \ \nabla \ \cdot \ \textbf{D} \ &= \ f(\textbf{x}) && \text{in} \; \Omega \\ \textbf{D} \ \cdot \ \boldsymbol \eta \ &= \ 0 && \text{on} \; \partial \Omega_{N} \\ \Phi \ &= \ \Phi_{\text{app}} \ + \ \Phi_{\text{bi}} && \text{on} \; \Gamma_{S} \\ \Phi \ &= \ \Phi^{\infty} && \text{on} \; \Gamma_{E} \end{align} \]

For \(\lambda^{2} \ = \ \frac{\Phi^{*} \epsilon }{L^{2} q C^{*}}\). . \(f(\textbf{x})\) is defined as

\[ f(\textbf{x}) \ = \ \left\{ \begin{array}{cc} \left[ \ N_{D} \ - \ N_{A} \ -\ \left( \rho_{n} \ - \ \rho_{p} \right) \ \right] & \text{in} \; \Omega_{S} \\ -\ \left( \rho_{r} \ - \ \rho_{o} \right) & \text{in} \; \Omega_{E} \end{array} \right. \]

See MixedPoisson::MixedFEM on how to build the corresponding left hand side of the weak formulation. This function essentially constructs:

\[ = \ -\langle \textbf{p} \ , \ \Phi_{\text{app}} + \Phi_{\text{bi}} \rangle_{\Gamma_{S}} - \langle \textbf{p} \ , \Phi^{\infty} \ \rangle_{\Gamma_{E}} - \ \left( v,\ f(\textbf{x}) \right)_{\Omega} \]

For all \(( v \ , \ \textbf{p} ) \, \in \, W \, \times\, \textbf{V}^{d}\).

template<int dim>
void SOLARCELL::SolarCellProblem< dim >::assemble_semiconductor_rhs ( )
private

Builds the RHSes for the electron and hole equations. This function loops through all the cells in the semiconductor triangulation. It does so by using semiconductor_dof_handler and calling SOLARCELL::SolarCellProblem::assemble_local_semiconductor_rhs uising workstream. For more information on the LDG method used in this caee see LDG_System::LDG.

template<int dim>
void SOLARCELL::SolarCellProblem< dim >::copy_local_to_global_electrolyte_mass_matrix ( const Assembly::DriftDiffusion::CopyData< dim > &  data)
private

Copies the local calculations into the global mass matrix for the redox pair.

template<int dim>
void SOLARCELL::SolarCellProblem< dim >::copy_local_to_global_electrolyte_system_matrix ( const Assembly::DriftDiffusion::CopyData< dim > &  data)
private

Copies the local calculations into the global system matrix for the redox pair.

template<int dim>
void SOLARCELL::SolarCellProblem< dim >::copy_local_to_global_electrolyte_system_rhs ( const Assembly::DriftDiffusion::CopyData< dim > &  data)
private

Copies the local calculations into the global right hand side for the redox pair.

template<int dim>
void SOLARCELL::SolarCellProblem< dim >::copy_local_to_global_Poisson_matrix ( const Assembly::Poisson::CopyData< dim > &  data)
private

Copys the local matrices assembled my and MixedFEM object into the global matrix which is in Poisson_object. Used for assembly in parallel by workstream.

template<int dim>
void SOLARCELL::SolarCellProblem< dim >::copy_local_to_global_Poisson_rhs ( const Assembly::Poisson::CopyData< dim > &  data)
private

Copys the local right hand side vectors assembled my and this object into the global right hand side vector in Poisson_object. Used for assembly in parallel by workstream.

template<int dim>
void SOLARCELL::SolarCellProblem< dim >::copy_local_to_global_semiconductor_mass_matrix ( const Assembly::DriftDiffusion::CopyData< dim > &  data)
private

Copies the local calculations into the global mass matrix for the electron hole pair.

template<int dim>
void SOLARCELL::SolarCellProblem< dim >::copy_local_to_global_semiconductor_system_matrix ( const Assembly::DriftDiffusion::CopyData< dim > &  data)
private

Copies the local calculations into the global system matrix for the electron hole pair.

template<int dim>
void SOLARCELL::SolarCellProblem< dim >::copy_local_to_global_semiconductor_system_rhs ( const Assembly::DriftDiffusion::CopyData< dim > &  data)
private

Copies the local calculations into the global right hand side for the electron hole pair.

template<int dim>
void SOLARCELL::SolarCellProblem< dim >::print_results ( unsigned int  time_step_number)
private

Print the results into three .vtu files using multi-threading. One thread prints poisson, one thread prints electron/holes, one thread prints reductant/oxidant.

template<int dim>
void SOLARCELL::SolarCellProblem< dim >::print_results_on_boundary ( unsigned int  time_step_number)
private

Multi threaded printing that only prints the electron-hole and reductant-oxidant values on the boundary of their respective domains.

template<int dim>
void SOLARCELL::SolarCellProblem< dim >::print_sim_info ( )
private

Prints the number of cells and dofs.

template<int dim>
void SOLARCELL::SolarCellProblem< dim >::run_full_system ( )

Computes the parallel IMEX method on the semiconductor-electrolyte problem.

template<int dim>
void SOLARCELL::SolarCellProblem< dim >::set_solvers ( )
private

Factorizes all the matrices (Poisson and carriers).

template<int dim>
void SOLARCELL::SolarCellProblem< dim >::setup_dofs ( )
private

Distributes the dofs and allocates memory for matrices and vectors.

template<int dim>
void SOLARCELL::SolarCellProblem< dim >::setup_mappings ( )
private

Create bijective mappings for assembling interface coupling terms.

The bijection is from cells' faces that are on the interface to the corresponding global interface face index. If we are on a semiconductor cell's interface face we can get the corresponding face on the electrolyte triangulation from elec_interface_cell and elec_interface_face. And vice versa.

template<int dim>
void SOLARCELL::SolarCellProblem< dim >::solve_electrolyte_system ( )
private

Solve the linear systems of reductants and oxidants using one thread for each.

template<int dim>
void SOLARCELL::SolarCellProblem< dim >::solve_full_system ( )
private

Solve the linear systems for all the carriers. Using multi-threading so that each thread solves a linear system.

template<int dim>
void SOLARCELL::SolarCellProblem< dim >::solve_Poisson ( )
private

Solves Poisson equation.

template<int dim>
void SOLARCELL::SolarCellProblem< dim >::solve_semiconductor_system ( )
private

Solve the linear systems of electron and holes using one thread for each.

template<int dim>
void SOLARCELL::SolarCellProblem< dim >::test_DD_Poisson ( const unsigned int &  n_refine,
ConvergenceTable Mixed_table,
ConvergenceTable LDG_table 
)

Test the coupling of the mixed FEM to the LDG method.

The coupling of the drift-diffusion-Poisson problem using a LDG-IMEX and a mixed finite element method is tested on the problem,

\[ \begin{align} -\Delta \Phi(\textbf{x},t) \; &= \; C(\textbf{x},t) - u & \qquad \qquad & \text{in} \quad \Omega \times (0,T] \\ \Phi(\textbf{x}) \; &= \; \Phi_{D}(\textbf{x)} & & \text{on} \quad \partial \Omega \times (0,T] \\ u_{t} + \boldsymbol \nabla \cdot \left( -\nabla \Phi \, u - \boldsymbol \nabla u \right) \; &= \; f(\textbf{x},t) & \qquad \qquad & \text{in} \quad \Omega \times (0,T] \\ u \; &= \; g_{D}(\textbf{x},t) & & \text{on} \quad \partial \Omega \times (0,T] \\ u \; &= \; u_{0}(\textbf{x}) & & \text{in} \quad \Omega \times \{t=0\}. \end{align} \]

We take the domain to be $ = [0,1] [0,1]$. The solutions are,

\[ \Phi(x,y) \; = \; \cos(2 \pi y) - \sin(2 \pi x) - x, \]

and,

\[ u(x,y,t) \; = \; e^{-t} + \cos(2 \pi x) + \cos(2 \pi y). \]

We take the right hand side functions to be,

\[ C(x,y,t) \; = \; 4 \pi^{2} \, \left( \cos(2 \pi y) - \sin(2 \pi x) \right) + e^{-t} + \cos(2 \pi x) + \cos(2 \pi y), \]

and,

\[ \begin{align} f(x,y,t) \; = \; & 4 \pi^{2} \left(\cos(2 \pi y) - \sin(2 \pi x) \right) \left( e^{-t} + \cos(2 \pi x) + \cos(2 \pi y) \right) \\ & - 2 \pi \left( 2 \pi \cos(2 \pi x) + 1 \right) \sin(2 \pi x) - 4 \pi^{2} \sin(2 \pi y)^{2} \\ & -e^{-t} + 4\pi^{2} \cos(2 \pi x) + 4\pi^{2} \cos(2 \pi y). \end{align} \]

The Dirichlet boundary condition \(g_{D}(x,y,t)\) and \(\Phi_{D}(x,y)\) are taken to be the solutions \(u(x,y,t)\) on and \(\Phi(x,y,t)\) respectively. The initial condition \(u_{0}\) is the \(L^{2}\) projection of the solution \(u(x,y,0)\) onto the DG basis. To perform time stepping we use a first-order IMEX time strategy. In order to obtain the underlying errors of the LDG method we take time steps \(\Delta t = h^{k+1}\), integrating from \(t=0\) to \(T=1\) for polynomials of order \(k\). We see that this choice of time step causes the super convergence results for \(\textbf{D}_{h}\) to be deteriorated, however they will be restored with the choice of \(\Delta t = h^{k+2}\).

template<int dim>
void SOLARCELL::SolarCellProblem< dim >::test_interface_coupling ( const unsigned int &  n_refine,
ConvergenceTable Table 
)

Tests the LDG method for a pair of parabolic problems coupled across the interface.

Computes the solutions over a sequence of refined meshes and prints out the convergence rate. The problem is for \(u(\textbf{x},t) \in \Omega_{S} \times [0,T]\) and \(v(\textbf{x},t) \in \Omega_{E} \times [0,T] \) that are coupled across the interface \(\Sigma \) we solve the coupled parabolic problems,

\[ \begin{align} u_{t} - \boldsymbol \nabla \cdot \left( \boldsymbol \nabla u \right) \; &= \; f_{1} (\textbf{x},t) && \text{in} \quad \Omega_{S} \times (0,T] \\ -\left( \boldsymbol \nabla u \right) \cdot \boldsymbol \eta_{\Sigma} \; &= \; u(\textbf{x},t)v(\textbf{x},t) - I(\textbf{x},t) && \text{on} \quad \Sigma \times (0,T]\\ u \; &= \; g_{1,D}(\textbf{x},t) && \text{on} \quad \Gamma_{S,D} \times (0,T] \\ u \; &= \; u_{0}(\textbf{x}) && \text{in} \quad \Omega_{S} \times \{t=0\}. \end{align} \]

and,

\[ \begin{align} v_{t} - \boldsymbol \nabla \cdot \left( \boldsymbol \nabla v \right) \; &= \; f_{2} (\textbf{x},t) && \text{in} \quad \Omega_{E} \times (0,T] \\ -\left(\boldsymbol \nabla v \right) \cdot \boldsymbol \eta_{\Sigma} \; &= \; -u(\textbf{x},t)v(\textbf{x},t) + I(\textbf{x},t) && \text{on} \quad \Sigma \times (0,T] \\ v \; &= \; g_{2,D}(\textbf{x},t) && \text{on} \quad \Gamma_{E,D} \times (0,T]\\ v \; &= \; v_{0}(\textbf{x}) && \text{in} \quad \Omega_{E} \times \{t=0\}. \end{align} \]

We take the domain to be \(\Omega = [0,1] \times [0,1]\) with \(\Omega_{S} = [0,1/2] \times [0,1]\) and \(\Omega_{E} = [1/2,1] \times [0,1]\). The interface is \(\Sigma = \{x \, = \, 1/2 \} \times [0,1]\) and the boundaries are \(\Gamma_{1,D} = \{x \, = \, 0\} \times [0,1] \cup [0,1/2] \times \{y \, = \, 0,1 \}\) and \(\Gamma_{2,D} = \{x \, = \, 1\} \times [0,1] \cup [1/2,1] \times \{y \, = \, 0,1 \}\). We remark that the interface vector \(\boldsymbol \eta_{\Sigma} = \langle 1, 0 \rangle\) The manufactured solutions for this problem are,

\[ \begin{equation} u(x,y,t) \; = \; v(x,y,t) \; = \; e^{-t} + \cos(2 \pi x) + \cos(2 \pi y). \end{equation} \]

The right hand side functions are,

\[ \begin{equation} f_{1} (x,y,t) \; = \; f_{1} (x,y,t) \; = \; -e^{-t} + 4\pi^{2} \cos(2 \pi x) + 4\pi^{2} \cos(2 \pi y) + 2 \pi \sin(2\pi x) . \end{equation} \]

The Dirichlet boundary conditions \(g_{1,D}(x,y,t)\) is taken to be \(u(x,y,t)\) on \(\Gamma_{1,D}\) and \(g_{2,D}(x,y,t)\) is taken to be \(v(x,y,t)\) on \(\Gamma_{2,D}\). The interface condition function is,

\[ \begin{equation} I(x,y,t) \; = \; \left(e^{-t} + \cos(\pi y) - 1\right)^{2}. \end{equation} \]

The initial conditions \( u_{0} \), \( v_{0} \) are the \( L^{2} \) projection of the solutions \( u(x,y,0) \) and \(v(x,y,0)\) onto the DG basis. In order to obtain the underlying errors of the LDG method we take time steps \(\Delta t = h^{2}\) for \(k=1\) and \(\Delta t = h^{3}\) for \(k=2\).

Note
\(h\) will be the same value for both of the triangulations of \(\Omega_{S}\) and \(\Omega_{E}\) since they are basically the same mesh.
template<int dim>
void SOLARCELL::SolarCellProblem< dim >::test_steady_state ( const unsigned int &  n_refine,
ConvergenceTable Mixed_table,
ConvergenceTable LDG_table 
)

Solves test Poisson problem and prints convergence rates.

Runs mixed method and LDG method sovler for a test Poisson problem with Dirichlet and Neumann boundary conditions. Computes solutions over a sequence of refined meshes and prints out the convergence rate of the methods. The problem is solves is,

\[ \begin{align} -\Delta \Phi(\textbf{x}) \; &= \; f(\textbf{x}) && \text{in} \quad [0,1] \times [0,1] \\ -\nabla \Phi(\textbf{x}) \cdot \boldsymbol \eta \; &= \; 0 && \text{on} \quad [0,1] \times \{y \, = \, 0, 1\} \\ \Phi(\textbf{x}) \; &= \; \Phi_{D}(\textbf{x)} && \text{on} \quad \{x \, = \, 0, 1\} \times [0,1] \end{align} \]

We use the manufactured solution,

\[ \Phi(x,y) \; = \; \cos(2 \pi y) - \sin(2 \pi x) - x, \]

with right hand side function.

\[ f(x,y) \; = \; 4 \pi^{2} \, \left( \cos(2 \pi y) - \sin(2 \pi x) \right). \]

Note
This is used by the LDG and mixed method.
template<int dim>
void SOLARCELL::SolarCellProblem< dim >::test_transient ( const unsigned int &  n_refine,
ConvergenceTable LDG_table 
)

Tests the LDG method with IMEX time stepping on the drift-diffusion eq.

Solves the drift-diffusion equation using the LDG method with IMEX time stepping. The drift-diffusion equation has a fixed electric field and Dirichlet boundary conditions. Computes the solution over a sequence of refined meshes and prints out the convergence rate.

To test the time-dependent linear drift-diffusion equation we solve the problem,

\[ \begin{align} u_{t} + \boldsymbol \nabla \cdot \left( \textbf{E} u - \boldsymbol \nabla u \right) \; &= \; f(\textbf{x},t) && \text{in} \quad \Omega \times (0,T] \\ \left( \textbf{E} u - \boldsymbol \nabla u \right) \cdot \boldsymbol \eta \; &= \; g_{I}(\textbf{x},t) && \text{on} \quad \Gamma_{I} \times (0,T] \\ u \; &= \; g_{D}(\textbf{x},t) && \text{on} \quad \Gamma_{D} \times (0,T] \\ u \; &= \; u_{0}(\textbf{x}) && \text{in} \quad \Omega \times \{t=0\}. \end{align} \]

We take the domain to be \(\Omega = [0,1] \times [0,1]\) with boundaries \(\Gamma_{I} = \{x \, = \, 1 \} \times [0,1]\), and \(\Gamma_{D} = \{x \, = \, 0\} \times [0,1] \cup [0,1] \times \{y \, = \, 0,1 \}\). For simplicity we assumed \(\textbf{E}(x,y) = \langle 1, 0 \rangle\) and \(T=1\). The manufactured solution is,

\[ u(x,y,t) \; = \; e^{-t} + \cos(2 \pi x) + \cos(2 \pi y). \]

This has a corresponding right hand side function,

\[ f(x,y,t) \; = \; -e^{-t} + 4\pi^{2} \cos(2 \pi x) + 4\pi^{2} \cos(2 \pi y) + 2 \pi \sin(2\pi x) . \]

The Dirichlet boundary conditions \(g_{D}(x,y,t)\) are taken to be \(u(x,y,t)\) on \(\Gamma_{D}\), while the Neumann boundary condition function is,

\[ g_{N}(x,y,t) \; = \; -e^{-t} - \cos(2 \pi y) - 1. \]

The initial condition \(u_{0}\) is the \(L^{2}\) projection of the solution \(u(x,y,0)\) onto the DG basis. The time step is chosen to be \( \Delta t = h^{k+1}\) so as to not ruin the spatial discritization convergence rate.

Field Documentation

template<int dim>
bool SOLARCELL::SolarCellProblem< dim >::full_system
private

Boolean that keeps track of whether we are solving semiconductor-Poisson problem or semiconductor-electrolyte-Poisson. This is for testing.

template<int dim>
Generation<dim> SOLARCELL::SolarCellProblem< dim >::generation
private

Generation function \(G(\textbf{x})\). The incident location is set here.

template<int dim>
LDG_System::LDG<dim> SOLARCELL::SolarCellProblem< dim >::LDG_Assembler
private

Object holds the assembling and printing routines for the Mixed FEM Poisson equation on the whole domain.

template<int dim>
MixedPoisson::MixedFEM<dim> SOLARCELL::SolarCellProblem< dim >::Mixed_Assembler
private

Object holds the assembling and printing routines for the LDG/ semiconductor/electrolyte carrier system.

template<int dim>
ParameterSpace::ParameterHandler& SOLARCELL::SolarCellProblem< dim >::prm
private

The parameter handlers reads in the paramter values from the input file and assigns them to sim_params.

template<int dim>
ParameterSpace::Parameters SOLARCELL::SolarCellProblem< dim >::sim_params
private

sim_parms holds all the parameter values.


The documentation for this class was generated from the following file: