OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
FuelCell::Application::AppPemfc< dim > Class Template Reference

This class is used to solve the physical pheonoma on a complete membrane electrode assembly. More...

#include <app_pemfc.h>

Inheritance diagram for FuelCell::Application::AppPemfc< dim >:
Inheritance graph
[legend]
Collaboration diagram for FuelCell::Application::AppPemfc< dim >:
Collaboration graph
[legend]

Public Member Functions

 AppPemfc (boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData > data=boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData >())
 Constructor. More...
 
 ~AppPemfc ()
 Destructor. More...
 
virtual void declare_parameters (ParameterHandler &param)
 Declare all parameters that are needed for: More...
 
virtual void set_parameters (const std::vector< std::string > &name_dvar, const std::vector< double > &value_dvar, ParameterHandler &param)
 Function called by optimization loop in order to set the values in the ParameterHandler to the new design parameters. More...
 
virtual void initialize (ParameterHandler &param)
 Set up how many equations are needed and read in parameters for the parameter handler in order to initialize data. More...
 
virtual void initialize_solution (FEVector &initial_guess, std::shared_ptr< Function< dim > > initial_function=std::shared_ptr< Function< dim > >())
 Initialize nonlinear solution. More...
 
virtual void cell_matrix (MatrixVector &cell_matrices, const typename DoFApplication< dim >::CellInfo &cell)
 Integration of local bilinear form. More...
 
virtual void cell_residual (FuelCell::ApplicationCore::FEVector &cell_vector, const typename DoFApplication< dim >::CellInfo &cell)
 Integration of the rhs of the equations. More...
 
virtual void dirichlet_bc (std::map< unsigned int, double > &boundary_values) const
 Member function used to set dirichlet boundary conditions. More...
 
virtual void check_responses ()
 This class is called by responses to make sure that all responses requested are implemented in either cell_responses, global_responses or face_responses. More...
 
virtual void cell_responses (std::vector< double > &resp, const typename DoFApplication< dim >::CellInfo &info, const FuelCell::ApplicationCore::FEVector &sol)
 Compute the value of all objective function and constraints. More...
 
virtual void global_responses (std::vector< double > &resp, const FuelCell::ApplicationCore::FEVector &sol)
 This class is used to evaluate all responses that do not require looping over cells. More...
 
virtual void cell_dresponses_dl (std::vector< std::vector< double > > &, const typename DoFApplication< dim >::CellInfo &, const FuelCell::ApplicationCore::FEVector &)
 This class is used to evaluate the derivative of all the functionals that require looping over cells with respect to the design variables. More...
 
virtual void global_dresponses_dl (std::vector< std::vector< double > > &df_dl, const FuelCell::ApplicationCore::FEVector &sol)
 This class is used to evaluate the sensitivities of all responses that do not require looping over cells with respect of the design variables. More...
 
virtual void cell_dresponses_du (std::vector< FuelCell::ApplicationCore::FEVector > &, const typename DoFApplication< dim >::CellInfo &, std::vector< std::vector< double > > &)
 This class is used to evaluate the derivative of all the functionals that require looping over cells with respect of the unknowns of the system of governing equations. More...
 
virtual void global_dresponses_du (std::vector< FuelCell::ApplicationCore::FEVector > &df_du, const FuelCell::ApplicationCore::FEVector &src)
 This class is used to evaluate the sensitivities of all responses that do not require looping over cells with respecto of the unknowns of the system of governing equations. More...
 
virtual double evaluate (const FuelCell::ApplicationCore::FEVectors &src)
 Post-processing. More...
 
virtual void data_out (const std::string &basename, const FuelCell::ApplicationCore::FEVectors &src)
 Reimplementation of the routine in the base class BaseApplication in namespace AppFrame so that the right labels are outputed and so that I can compute and output the source term. More...
 
void data_out (std::string basename, const FuelCell::ApplicationCore::FEVectors vectors, std::vector< std::string > solution_names)
 
- Public Member Functions inherited from FuelCell::ApplicationCore::OptimizationBlockMatrixApplication< dim >
 OptimizationBlockMatrixApplication (FuelCell::ApplicationCore::DoFApplication< dim > &, bool triangulation_only)
 Constructor for an object, owning its own mesh and dof handler. More...
 
 OptimizationBlockMatrixApplication (boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData > data=boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData >())
 Constructor for an object, owning its own mesh and dof handler. More...
 
 ~OptimizationBlockMatrixApplication ()
 Destructor. More...
 
virtual void responses (std::vector< double > &f, const FuelCell::ApplicationCore::FEVectors &vectors)
 Post-processing. More...
 
virtual void bdry_responses (std::vector< double > &resp, const typename DoFApplication< dim >::FaceInfo &info, const FuelCell::ApplicationCore::FEVector &sol)
 This class is used to evaluate all the functionals that require looping over boundaries. More...
 
virtual void print_responses (std::vector< double > &resp)
 This function is used to print the responses to screen (FcstUtilities::log) More...
 
virtual void dresponses_dl (std::vector< std::vector< double > > &df_dl, const FuelCell::ApplicationCore::FEVectors &src)
 Post-processing. More...
 
virtual void dresponses_du (std::vector< FuelCell::ApplicationCore::FEVector > &dst, const FuelCell::ApplicationCore::FEVectors &src)
 Loop over all cells and assemble the vector

\[ \frac{\partial f_m}{\partial u_i} \]

that is used to solve the sensitivity equations by using the local matrix integration functions cell_dfunctional_du(), bdry_dfunctional_dlu() and edge_dfunctinal_du() provided by the derived class. More...

 
virtual void dresidual_dlambda (std::vector< FuelCell::ApplicationCore::FEVector > &dst, const FuelCell::ApplicationCore::FEVectors &src)
 Loop over all cells and assemble the vector

\[ \frac{\partial R_n}{\partial \lambda_k} \]

that is used to solve the sensitivity equations by using the local matrix integration functions cell_dresidual_dlambda(), bdry_dresidual_dlambda() and edge_dresidual_dlambda() provided by the derived class. More...

 
virtual void cell_dresidual_dlambda (std::vector< FuelCell::ApplicationCore::FEVector > &cell_vector, const typename DoFApplication< dim >::CellInfo &cell, std::vector< std::vector< double > > &src)
 Integration of local bilinear form. More...
 
void solve_direct (std::vector< std::vector< double > > &df_dl, const FuelCell::ApplicationCore::FEVectors &sol)
 Solver in order to obtain the analytical sensitivities for the given objective and constraints using the direct method. More...
 
void solve_adjoint (std::vector< std::vector< double > > &df_dl, const FuelCell::ApplicationCore::FEVector &sol)
 Solver in order to obtain the analytical sensitivities for the given objective and constraints using the adjoint method. More...
 
unsigned int get_n_resp () const
 Member function that returns the number of responses. More...
 
unsigned int get_n_dvar () const
 Member function that returns the number of design variables. More...
 
std::vector< std::string > get_name_dvar () const
 Member function that returns the name of the design variables. More...
 
std::vector< std::string > get_name_responses () const
 Member function that returns the name of the responses. More...
 
const std::vector< std::string > get_all_responses_names () const
 Function used to return all possible response names in OpenFCST. More...
 
void print_default_parameter_file ()
 Print the default parameter handler file. More...
 
bool get_bool_transfer_solution ()
 Function to see if we are transferring a solution on a refined grid to the initial coarse grid. More...
 
void set_optimization_parameters (unsigned int &n_dvar, unsigned int &n_resp, std::vector< std::string > &name_design_var, std::vector< std::string > &name_responses)
 This routine assigns the value of n_dvar, n_resp, name_design_var and name_responses to the internal variables n_dvar, n_resp, name_design_var and name_response. More...
 
void set_output_variables (std::vector< std::string > &dakota_name_responses)
 
virtual void compute_L1_L2_error_and_convergence_rate (const FuelCell::ApplicationCore::FEVector &solution, const unsigned int &refinement_cycle, std::vector< ConvergenceTable > &convergence_tables) const
 If the exact or analytical solution is available, then this function computes L1 and L2 norms of the error and convergence rates for each particular component of the numerical solution. More...
 
- Public Member Functions inherited from FuelCell::ApplicationCore::BlockMatrixApplication< dim >
void serial_assemble (const FEVectors &)
 serial and PETSc assemble functions called by assemble(). More...
 
virtual void post_cell_assemble ()
 A call back function for assemble(), called after all cell matrices have been entered, but before the face matrices are computed. More...
 
virtual void solve (FEVector &dst, const FEVectors &src)
 Solve the system assembled with right hand side in FEVectors src and return the result in FEVector dst. More...
 
void serial_solve (FuelCell::ApplicationCore::FEVector system_rhs, FEVector &solution)
 
 BlockMatrixApplication (boost::shared_ptr< ApplicationData > data=boost::shared_ptr< ApplicationData >())
 Constructor for an object, owning its own mesh and dof handler. More...
 
 BlockMatrixApplication (DoFApplication< dim > &, bool triangulation_only)
 Constructor for an object, borrowing mesh and dof handler from another object. More...
 
void _initialize (ParameterHandler &param)
 Initialize data of this class. More...
 
void remesh_matrices ()
 Initialize sparsity patterns and matrices for the new mesh. More...
 
virtual void remesh ()
 Refine grid accordingly to the Refinement options under "Grid Generation" in the parameter file. More...
 
void assemble (const FEVectors &)
 Loop over all cells and assemble the system #matrices by using the local matrix integration functions cell_matrix(), bdry_matrix() and face_matrix() provided by the derived class. More...
 
void assemble_numerically (const FEVectors &src, const double delta=1e-6)
 Compute the Jacobian of the system of equations,

\[ J(i,j) = \frac{\partial R_i}{\partial u_j} \]

by using forward differences. More...

 
void residual_constraints (FEVector &dst) const
 Redefinition of residual_constraints() in DoFHandler. More...
 
virtual void bdry_matrix (MatrixVector &face_matrices, const typename DoFApplication< dim >::FaceInfo &face)
 Integration of local bilinear form. More...
 
virtual void face_matrix (MatrixVector &matrices11, MatrixVector &matrices12, MatrixVector &matrices21, MatrixVector &matrices22, const typename DoFApplication< dim >::FaceInfo &face1, const typename DoFApplication< dim >::FaceInfo &face2)
 Integration of local bilinear form. More...
 
- Public Member Functions inherited from FuelCell::ApplicationCore::DoFApplication< dim >
 DoFApplication (boost::shared_ptr< ApplicationData > data=boost::shared_ptr< ApplicationData >())
 Constructor for an object owning its own mesh and dof handler. More...
 
 DoFApplication ()
 Constructor for an object owning its own mesh and dof handler and creating new ApplicationData. More...
 
 DoFApplication (DoFApplication< dim > &dof_app, bool triangulation_only)
 Constructor for an object, borrowing mesh and dof handler from another object. More...
 
 ~DoFApplication ()
 Destructor which deletes owned objects. More...
 
virtual void remesh_dofs ()
 Initialize dof handler, count the dofs in each block and renumber the dofs. More...
 
virtual void init_vector (FEVector &dst) const
 Reinitialize the BlockVector dst such that it contains block_size.size() blocks. More...
 
virtual double estimate (const FEVectors &src)
 Estimate the error. More...
 
virtual double residual (FEVector &dst, const FEVectors &src, bool apply_boundaries=true)
 Loop over all cells to compute the residual. More...
 
void store_triangulation (Triangulation< dim > &new_tr)
 Function to copy a triangulation object for use after refinement. More...
 
void add_vector_for_transfer (FEVector *src)
 Add the vector to be transfered from one mesh to the next. More...
 
void delete_vector_for_transfer ()
 Delete the vector to be transfered from one mesh to the next. More...
 
void transfer_solution_to_coarse_mesh (Triangulation< dim > &tr_coarse, FEVector &coarse_solution, FEVector &refined_solution)
 Function to perform the transfer of a solution on a refined grid to the initial coarse grid. More...
 
unsigned int memory_consumption () const
 Compute the amount of memory needed by this object. More...
 
virtual void grid_out (const std::string &basename)
 Output the grid used to solve the problem. More...
 
void print (const std::string &basename, const FEVector &src, const std::vector< unsigned int > &src_indices=std::vector< unsigned int >()) const
 This function prints FEVector src to a text file basename. More...
 
- Public Member Functions inherited from FuelCell::ApplicationCore::ApplicationBase
 ApplicationBase (boost::shared_ptr< ApplicationData > data=boost::shared_ptr< ApplicationData >())
 Constructor for an application. More...
 
 ApplicationBase (const ApplicationBase &other)
 Copy constructor. More...
 
virtual ~ApplicationBase ()
 Virtual destructor. More...
 
void print_parameters_to_file (ParameterHandler &param, const std::string &file_name, const ParameterHandler::OutputStyle &style)
 Print default parameters for the application to a file. More...
 
virtual void start_vector (FEVector &dst, std::string) const
 Initialize vector to problem size. More...
 
virtual void Tsolve (FEVector &, const FEVectors &)
 Solve the dual system assembled with right hand side rhs and return the result in start. More...
 
boost::shared_ptr
< ApplicationData
get_data ()
 Get access to the protected variable data. More...
 
const boost::shared_ptr
< ApplicationData
get_data () const
 Get read-only access to the protected variable data. More...
 
virtual std::string id () const
 Return a unique identification string for this application. More...
 
virtual void notify (const Event &reason)
 Add a reason for assembling. More...
 
virtual void clear ()
 All true in notifications. More...
 
virtual void clear_events ()
 All false in notifications. More...
 
virtual unsigned int get_solution_index ()
 Returns solution index. More...
 

Protected Attributes

std::vector< std::string > design_var
 Stores the design variable names so that the name can be appended to the .vtk file name. More...
 
std::vector< double > design_var_value
 Stores the values of the design variables so that the number can be appended to the .vtk file name. More...
 
Other internal data
std::vector< std::string > equation_names
 Structure where we store the problem we want to solve. More...
 
std::vector< std::string > component_names
 Structure where we store the name of each component in our problem. More...
 
Pre-processor and operating condition classes
OperatingConditions OC
 Initial operating conditions class. More...
 
Material classes
FuelCellShop::Material::WaterVapor water
 Object used to calculate the properties of the electrolyte in the catalyst layer. More...
 
FuelCellShop::Material::Oxygen oxygen
 The cathode contains water vapour, so we need to create an object water in order to compute viscosity, density, etc. More...
 
FuelCellShop::Material::Nitrogen nitrogen
 The cathode contains water vapour, so we need to create an object water in order to compute viscosity, density, etc. More...
 
FuelCellShop::Material::Hydrogen hydrogen
 The anode contains hydrogen, so we need to create an object water in order to compute viscosity, density, etc. More...
 
Layer classes
boost::shared_ptr
< FuelCellShop::Layer::GasDiffusionLayer
< dim > > 
AGDL
 The object AGDL layer will contain all the information relevant to the the anode GDL. More...
 
boost::shared_ptr
< FuelCellShop::Layer::MicroPorousLayer
< dim > > 
AMPL
 The object AMPL layer will contain all the information relevant to the the anode micro-porous layer. More...
 
boost::shared_ptr
< FuelCellShop::Layer::CatalystLayer
< dim > > 
ACL
 The object ACL layer will contain all the information relevant to the the anode catalyst layer. More...
 
boost::shared_ptr
< FuelCellShop::Layer::MembraneLayer
< dim > > 
ML
 The object PEM layer will contain all the information relevant to the the polymer electrolyte membrane. More...
 
boost::shared_ptr
< FuelCellShop::Layer::CatalystLayer
< dim > > 
CCL
 The object CCL layer will contain all the information relevant to the the catalyst layer. More...
 
boost::shared_ptr
< FuelCellShop::Layer::MicroPorousLayer
< dim > > 
CMPL
 The object CMPL layer will contain all the information relevant to the the cathode micro-porous layer. More...
 
boost::shared_ptr
< FuelCellShop::Layer::GasDiffusionLayer
< dim > > 
CGDL
 The object CGDL layer will contain all the information relevant to the the cathode GDL. More...
 
Post-processing classes (Functional evaluation)
FuelCellShop::PostProcessing::ORRCurrentDensityResponse
< dim
ORRCurrent
 Post-processing object to compute the ORR current density. More...
 
FuelCellShop::PostProcessing::HORCurrentDensityResponse
< dim
HORCurrent
 Post-processing object to compute the HOR current density. More...
 
FuelCellShop::PostProcessing::WaterSorptionResponse
< dim
WaterSorption
 Post-processing object to compute the water sorption in the CL. More...
 
Physics Equations
FuelCellShop::Equation::ProtonTransportEquation
< dim
proton_transport
 ProtonTransportEquation object. More...
 
FuelCellShop::Equation::LambdaTransportEquation
< dim
lambda_transport
 LambdaTransportEquation object. More...
 
FuelCellShop::Equation::ElectronTransportEquation
< dim
electron_transport
 ElectronTransportEquation object. More...
 
FuelCellShop::Equation::FicksTransportEquation
< dim
ficks_oxygen_nitrogen
 
FuelCellShop::Equation::FicksTransportEquation
< dim
ficks_water_nitrogen
 
FuelCellShop::Equation::FicksTransportEquation
< dim
ficks_water_hydrogen
 
FuelCellShop::Equation::ReactionSourceTerms
< dim
reaction_source_terms
 ReactionSourceTerms object. More...
 
FuelCellShop::Equation::SorptionSourceTerms
< dim
sorption_source_terms
 SorptionSourceTerms object. More...
 
- Protected Attributes inherited from FuelCell::ApplicationCore::OptimizationBlockMatrixApplication< dim >
unsigned int n_dvar
 Number of design variables. More...
 
unsigned int n_obj
 Number of objective functions. More...
 
unsigned int n_resp
 Number of responses = n_obj + n_con. More...
 
std::vector< std::string > name_design_var
 Member that stores the name of the design variables. More...
 
std::vector< std::string > name_responses
 Member that stores the name of the responses, i.e. More...
 
std::vector< std::string > name_output_var
 Member that stores the name of the output variables, These names will be written to name_responses if optimization is not being used and ignored otherwise. More...
 
bool output_coarse_solution
 Decision variable for whether the solution is to be output for transfer. More...
 
bool optimization
 Decision variable for whether the application is being used for optimization. More...
 
bool boundary_responses
 true, if boundary responses are supposed to be computed. More...
 
std::vector< std::string > all_response_names
 Variable that holds a list of response names. More...
 
std::vector< unsigned int > user_input_bdry
 Boundary id on which the boundary response is computed. More...
 
- Protected Attributes inherited from FuelCell::ApplicationCore::BlockMatrixApplication< dim >
boost::shared_ptr< Quadrature
< dim > > 
quadrature_assemble_cell
 Quadrature rule for matrix assembling on cells. More...
 
boost::shared_ptr< Quadrature
< dim-1 > > 
quadrature_assemble_face
 Quadrature rule for matrix assembling on faces. More...
 
bool repair_diagonal
 Bool determining whether or not to repair diagonal before solving. More...
 
std::map< unsigned int, double > boundary_values
 Variable to store boundary values, so they only need to be computed once per mesh refinement. More...
 
BlockSparseMatrix< double > matrix
 Storage for the actual matrix. More...
 
SolverControl solver_control
 Solver control object. More...
 
bool assemble_numerically_flag
 Variable used to select if assembly should be done analytically or numerically. More...
 
bool mumps_additional_mem
 Variable used for configuring MUMPS to use more memory in solve() function. More...
 
bool symmetric_matrix_flag
 Variable used to specify if the matrix is symmetric to the linear solver. More...
 
bool print_debug
 Flag specifying if the matrix and rhs should be printed at each iteration. More...
 
- Protected Attributes inherited from FuelCell::ApplicationCore::DoFApplication< dim >
GridOut g_out
 The object for writing grids. More...
 
DataOut< dim, DoFHandler< dim > > d_out
 The object for writing data. More...
 
FuelCell::SystemManagement system_management
 This object knows everything about FCST equations, variables, couplings, etc. More...
 
std::map< unsigned int, double > boundary_constraints
 List of all nodes constrained by a strong boundary condition, together with a value to be assigned. More...
 
ConstraintMatrix hanging_node_constraints
 Constraint Matrix object. More...
 
boost::shared_ptr< Mapping< dim > > mapping
 The mapping used for the transformation of mesh cells. More...
 
unsigned int mapping_degree
 Degree used for polynomial mapping of arbitrary order. More...
 
boost::shared_ptr
< FiniteElement< dim > > 
element
 The finite element used in dof. More...
 
boost::shared_ptr< DoFHandler
< dim > > 
dof
 Pointer to the DoFHandler object. More...
 
BlockInfo block_info
 
Vector< float > cell_errors
 The result of error estimation by cell. More...
 
Vector< float > face_errors
 The result of error estimation by face. More...
 
std::string refinement
 Refinement parameter from parameter file. More...
 
unsigned int initial_refinement
 Initial refinement from parameter file. More...
 
double refinement_threshold
 Refinement threshold for adaptive method from parameter file. More...
 
double coarsening_threshold
 Coarsening threshold for adaptive method from parameter file. More...
 
bool sort_cuthill
 Flag for sorting with Cuthill McKee algorithm. More...
 
Point< dimsort_direction
 Direction for downstream sorting. More...
 
std::vector< FEVector * > transfer_vectors
 List of vector names to be transfered from one grid to the next. More...
 
Quadrature< dimquadrature_residual_cell
 Quadrature rule for residual computation on cells. More...
 
Quadrature< dim-1 > quadrature_residual_bdry
 Quadrature rule for residual computation on boundary faces. More...
 
Quadrature< dim-1 > quadrature_residual_face
 Quadrature rule for residual computation on faces. More...
 
Table< 2, DoFTools::Coupling > cell_couplings
 Couplings through cell bilinear forms. More...
 
Table< 2, DoFTools::Coupling > flux_couplings
 Couplings through flux bilinear forms. More...
 
bool boundary_fluxes
 Extend the integration loops in assemble() and residual() also to boundary faces. More...
 
bool interior_fluxes
 Extend the integration loops in assemble() and residual() also to interior faces. More...
 
unsigned int verbosity
 Controls verbosity of certain functions. More...
 
std::vector
< component_materialID_value_map
component_materialID_value_maps
 Each entry of this std::vector reflects the following structure (see FuelCell::InitialAndBoundaryData namespace docs): More...
 
std::vector
< component_boundaryID_value_map
component_boundaryID_value_maps
 Each entry of this std::vector reflects the following structure (see FuelCell::InitialAndBoundaryData namespace docs): More...
 
boost::shared_ptr
< FuelCellShop::Geometry::GridBase
< dim > > 
mesh_generator
 Grid. More...
 
boost::shared_ptr
< Triangulation< dim > > 
tr
 Pointer to the Triangulation object. More...
 
- Protected Attributes inherited from FuelCell::ApplicationCore::ApplicationBase
boost::shared_ptr
< ApplicationData
data
 Object for auxiliary data. More...
 
Event notifications
 Accumulate reasons for assembling here. More...
 

Private Member Functions

void set_default_parameters_for_application (ParameterHandler &param)
 Function to modify the default values of the data file in order to make sure that the equations match those needed in the application. More...
 

Private Attributes

double l_channel
 Width of the channel. More...
 
double l_land
 Width of the landing. More...
 

Additional Inherited Members

- Public Types inherited from FuelCell::ApplicationCore::DoFApplication< dim >
typedef
FuelCell::ApplicationCore::IntegrationInfo
< dim, FEValuesBase< dim > > 
CellInfo
 Shortcut. More...
 
typedef
FuelCell::ApplicationCore::IntegrationInfo
< dim, FEFaceValuesBase< dim > > 
FaceInfo
 Shortcut. More...
 
- Public Attributes inherited from FuelCell::ApplicationCore::DoFApplication< dim >
boost::shared_ptr< Boundary
< dim > > 
curved_boundary
 Curved boundary. More...
 
types::boundary_id curved_bdry_id
 Curved boundary ID. More...
 
std::string filename_initial_sol
 Filename where to output the initial grid. More...
 
bool output_initial_sol
 Flag to output the initial solution used to start the solving process. More...
 
bool read_in_initial_solution
 Bool flag used to specify if the initial solution to the problem, specially important for non-linear problems, should be read from file. More...
 
bool use_predefined_solution
 Use user pre-defined initial solution. More...
 
bool output_coarse_solution
 Bool flag used to specify if the final solution should be stored in the coarse mesh in order to be used later as an initial solution to solve another problem using the flag read_in_initial_solution. More...
 
std::vector
< DataComponentInterpretation::DataComponentInterpretation > 
solution_interpretations
 solution_interpretations identifies whether some solution_names are scalars or parts of a vector. More...
 
std::vector
< DataComponentInterpretation::DataComponentInterpretation > 
postprocessing_interpretations
 postprocessing_interpretations identifies whether some postprocessing_names are scalars or parts of a vector. More...
 
std::vector
< DataComponentInterpretation::DataComponentInterpretation > 
data_interpretation
 
bool output_materials_and_levels
 output_materials_and_levels if true then visualized, otherwise suppressed. More...
 
Vector< double > output_materials
 Vector that will be used by data_out to store the material ids. More...
 
Vector< double > output_levels
 Vector that will be used by data_out to store the refinement levels at each cell. More...
 
bool output_actual_degree
 true, if you want to output solution and postprocessing data using actual finite element fields Q_n with n >= 1. More...
 
bool print_solution
 true, if you want to print FEVector solution to a text file. More...
 
bool print_postprocessing
 true, if you want to print FEVector postprocessing to a text file. More...
 
std::vector< unsigned int > solution_printing_indices
 The indices of the FEVector solution to be printed to a text file. More...
 
std::vector< unsigned int > postprocessing_printing_indices
 The indices of the FEVector postprocessing to be printed to a text file. More...
 
bool print_blocks_instead_of_indices
 true, if the whole blocks of FEVector solution or FEVector postprocessing to be printed to a text file instead of separate indices. More...
 
bool output_matrices_and_rhs
 If true, all cell matrices and right hand sides will be output. More...
 
- Static Public Attributes inherited from FuelCell::ApplicationCore::OptimizationBlockMatrixApplication< dim >
static const
FuelCell::ApplicationCore::Event 
sensitivity_analysis
 The Event set by OptimizationMatrixApplication if if we want to compute the sensitivities and a new matrix should be assembled. More...
 
- Protected Types inherited from FuelCell::ApplicationCore::OptimizationBlockMatrixApplication< dim >
typedef void(* CELL_Dvalues )(std::vector< FuelCell::ApplicationCore::FEVector > &, const typename DoFApplication< dim >::CellInfo &, std::vector< std::vector< double > > &)
 Definition of a pointer to a function that is called in a loop over cells to compute the derivatives of either residual or responses with respect to design variables. More...
 
- Protected Member Functions inherited from FuelCell::ApplicationCore::OptimizationBlockMatrixApplication< dim >
void print_dresponses_dl (std::vector< std::vector< double > > pdf_pdl)
 Auxiliary routine to print the values df_dl This routine should be called once df_df is assembled. More...
 
void print_dresponses_du (std::vector< FuelCell::ApplicationCore::FEVector > df_du)
 Auxiliary routine to print the values of df_du This routine should be called once df_du is assembled. More...
 
const std::string extend_filename (const std::string &, const int precision=3) const
 Member function used in order to extend the name of a file with the design variable name and value. More...
 
void dfunction (std::vector< FuelCell::ApplicationCore::FEVector > &dst, const FuelCell::ApplicationCore::FEVectors &src, bool dfunctional_du, bool dresidual_dlambda)
 This is an auxiliary function called by dresidual_dlambda and dfunctional_du. More...
 
void set_all_response_names ()
 Initialize the data member all_response_names with all the available Responses in OpenFCST. More...
 
- Protected Member Functions inherited from FuelCell::ApplicationCore::BlockMatrixApplication< dim >
template<typename Vector >
void print_matrix_and_rhs (Vector &sys_rhs) const
 Internal routine to print matrix and rhs. More...
 
- Protected Member Functions inherited from FuelCell::ApplicationCore::DoFApplication< dim >
virtual void data_out (const std::string &basename, const FEVector &solution, const std::vector< std::string > &solution_names, const std::vector< DataPostprocessor< dim > * > &PostProcessing)
 This routine is used to write data in the format specified by the ParameterHandler. More...
 
virtual void data_out (const std::string &basename, const FEVector &solution, const std::vector< std::string > &solution_names, const FEVector &postprocessing=FEVector(), const std::vector< std::string > &postprocessing_names=std::vector< std::string >())
 This function outputs the results of a computation. More...
 
void constrain_boundary (FEVector &v, bool homogeneous) const
 Apply either homogeneous or inhomogeneous boundary_constraints. More...
 
void _initialize (ParameterHandler &param)
 Initialize from parameter values. More...
 
virtual void initialize_triangulation (ParameterHandler &param)
 Function used to read in a mesh and hand it over to the boost::shared_ptr<Triangulation<dim> > tr object. More...
 
void read_init_solution (FEVector &dst, bool &good_solution) const
 Create a mesh and assign it to object tr. More...
 
virtual void cell_residual (FEVector &cell_vector, const CellInfo &cell)
 Local integration. More...
 
virtual void bdry_residual (FEVector &face_vector, const FaceInfo &face)
 Local integration. More...
 
virtual void face_residual (FEVector &face_vector1, FEVector &face_vector2, const FaceInfo &face1, const FaceInfo &face2)
 Local integration. More...
 
virtual double cell_estimate (const CellInfo &src)
 Local estimation. More...
 
virtual double bdry_estimate (const FaceInfo &src)
 Local estimation. More...
 
virtual double face_estimate (const FaceInfo &src1, const FaceInfo &src2)
 Local estimation. More...
 
- Protected Member Functions inherited from FuelCell::ApplicationCore::ApplicationBase
void print_caller_name (const std::string &caller_name) const
 Print caller name. More...
 

Detailed Description

template<int dim>
class FuelCell::Application::AppPemfc< dim >

This class is used to solve the physical pheonoma on a complete membrane electrode assembly.

The anode hydrogen oxydation reaction is modelled using an aglomerate model with dual-pathway kinetics and the cathode oxygen reduction reaction using an agglomerate model and the kinetics in Sun et al., EA, 2006. The membrane is modelled using a modified Springer model.

Development suggestions (AP):

Constructor & Destructor Documentation

template<int dim>
FuelCell::Application::AppPemfc< dim >::AppPemfc ( boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData data = boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData >())

Constructor.

Note
the pointer data is initialized to boost::shared_ptr<> (), this means that the pointer is empty and when we do data.get() it will return 0. This is good because at ApplicationBase constructor an ApplicationData will be constructed.
template<int dim>
FuelCell::Application::AppPemfc< dim >::~AppPemfc ( )

Destructor.

Member Function Documentation

template<int dim>
virtual void FuelCell::Application::AppPemfc< dim >::cell_dresponses_dl ( std::vector< std::vector< double > > &  ,
const typename DoFApplication< dim >::CellInfo ,
const FuelCell::ApplicationCore::FEVector  
)
inlinevirtual

This class is used to evaluate the derivative of all the functionals that require looping over cells with respect to the design variables.

This class is called by responses to evaluate the response at each cell.

Reimplemented from FuelCell::ApplicationCore::OptimizationBlockMatrixApplication< dim >.

template<int dim>
virtual void FuelCell::Application::AppPemfc< dim >::cell_dresponses_du ( std::vector< FuelCell::ApplicationCore::FEVector > &  ,
const typename DoFApplication< dim >::CellInfo ,
std::vector< std::vector< double > > &   
)
inlinevirtual

This class is used to evaluate the derivative of all the functionals that require looping over cells with respect of the unknowns of the system of governing equations.

This class is called by responses to evaluate the response at each cell.

Reimplemented from FuelCell::ApplicationCore::OptimizationBlockMatrixApplication< dim >.

template<int dim>
virtual void FuelCell::Application::AppPemfc< dim >::cell_matrix ( MatrixVector cell_matrices,
const typename DoFApplication< dim >::CellInfo cell 
)
virtual

Integration of local bilinear form.

Here we loop over the quadrature points and over degrees of freedom in order to compute the matrix for the cell This routine depends on the problem at hand and is called by assemble() in DoF_Handler class The matrix to be assembled is: \ f[ * {array}{l} M(i,j).block(0) = {} a d + {} { f}{ u_0}|_n d \ M(i,j).block(1) = {} { f}{ u_1}|_n d \ M(i,j).block(2) = {} { f}{ u_2}|_n d {array} ]

Reimplemented from FuelCell::ApplicationCore::BlockMatrixApplication< dim >.

template<int dim>
virtual void FuelCell::Application::AppPemfc< dim >::cell_residual ( FuelCell::ApplicationCore::FEVector cell_vector,
const typename DoFApplication< dim >::CellInfo cell 
)
virtual

Integration of the rhs of the equations.

Here we loop over the quadrature points and over degrees of freedom in order to compute the right hand side for each cell This routine depends on the problem at hand and is called by residual() in DoF_Handler class

Note
This function is called residual because in the case of nonlinear systems the rhs is equivalent to the residual
template<int dim>
virtual void FuelCell::Application::AppPemfc< dim >::cell_responses ( std::vector< double > &  resp,
const typename DoFApplication< dim >::CellInfo info,
const FuelCell::ApplicationCore::FEVector sol 
)
virtual

Compute the value of all objective function and constraints.

Reimplemented from FuelCell::ApplicationCore::OptimizationBlockMatrixApplication< dim >.

template<int dim>
virtual void FuelCell::Application::AppPemfc< dim >::check_responses ( )
virtual

This class is called by responses to make sure that all responses requested are implemented in either cell_responses, global_responses or face_responses.

Note
Every time we add a new response that we can calculate we need to update this file.

Reimplemented from FuelCell::ApplicationCore::OptimizationBlockMatrixApplication< dim >.

template<int dim>
virtual void FuelCell::Application::AppPemfc< dim >::data_out ( const std::string &  basename,
const FuelCell::ApplicationCore::FEVectors src 
)
virtual

Reimplementation of the routine in the base class BaseApplication in namespace AppFrame so that the right labels are outputed and so that I can compute and output the source term.

Reimplemented from FuelCell::ApplicationCore::DoFApplication< dim >.

template<int dim>
void FuelCell::Application::AppPemfc< dim >::data_out ( std::string  basename,
const FuelCell::ApplicationCore::FEVectors  vectors,
std::vector< std::string >  solution_names 
)
template<int dim>
virtual void FuelCell::Application::AppPemfc< dim >::declare_parameters ( ParameterHandler &  param)
virtual

Declare all parameters that are needed for:

  • the computation of the equation coefficients
  • the control of the linear system solution
  • ...

Reimplemented from FuelCell::ApplicationCore::OptimizationBlockMatrixApplication< dim >.

template<int dim>
virtual void FuelCell::Application::AppPemfc< dim >::dirichlet_bc ( std::map< unsigned int, double > &  boundary_values) const
virtual

Member function used to set dirichlet boundary conditions.

This function is application specific and it only computes the boundary_value values that are used to constraint the linear system of equations that is being solved

Reimplemented from FuelCell::ApplicationCore::BlockMatrixApplication< dim >.

template<int dim>
virtual double FuelCell::Application::AppPemfc< dim >::evaluate ( const FuelCell::ApplicationCore::FEVectors src)
virtual

Post-processing.

Evaluate a functional such as the objective function of an optimization problem

Reimplemented from FuelCell::ApplicationCore::DoFApplication< dim >.

template<int dim>
virtual void FuelCell::Application::AppPemfc< dim >::global_dresponses_dl ( std::vector< std::vector< double > > &  df_dl,
const FuelCell::ApplicationCore::FEVector sol 
)
virtual

This class is used to evaluate the sensitivities of all responses that do not require looping over cells with respect of the design variables.

An example of one of this types of constraints is the solid volume fraction.

Reimplemented from FuelCell::ApplicationCore::OptimizationBlockMatrixApplication< dim >.

template<int dim>
virtual void FuelCell::Application::AppPemfc< dim >::global_dresponses_du ( std::vector< FuelCell::ApplicationCore::FEVector > &  df_du,
const FuelCell::ApplicationCore::FEVector src 
)
virtual

This class is used to evaluate the sensitivities of all responses that do not require looping over cells with respecto of the unknowns of the system of governing equations.

An example of one of this types of constraints is the solid volume fraction.

Reimplemented from FuelCell::ApplicationCore::OptimizationBlockMatrixApplication< dim >.

template<int dim>
virtual void FuelCell::Application::AppPemfc< dim >::global_responses ( std::vector< double > &  resp,
const FuelCell::ApplicationCore::FEVector sol 
)
virtual

This class is used to evaluate all responses that do not require looping over cells.

An example of one of this types of constraints is the solid volume fraction.

Reimplemented from FuelCell::ApplicationCore::OptimizationBlockMatrixApplication< dim >.

template<int dim>
virtual void FuelCell::Application::AppPemfc< dim >::initialize ( ParameterHandler &  param)
virtual

Set up how many equations are needed and read in parameters for the parameter handler in order to initialize data.

Call initialize from the parent class.

Reimplemented from FuelCell::ApplicationCore::OptimizationBlockMatrixApplication< dim >.

template<int dim>
virtual void FuelCell::Application::AppPemfc< dim >::initialize_solution ( FEVector initial_guess,
std::shared_ptr< Function< dim > >  initial_function = std::shared_ptr< Function< dim > >() 
)
virtual

Initialize nonlinear solution.

Reimplemented from FuelCell::ApplicationCore::DoFApplication< dim >.

template<int dim>
void FuelCell::Application::AppPemfc< dim >::set_default_parameters_for_application ( ParameterHandler &  param)
inlineprivate

Function to modify the default values of the data file in order to make sure that the equations match those needed in the application.

template<int dim>
virtual void FuelCell::Application::AppPemfc< dim >::set_parameters ( const std::vector< std::string > &  name_dvar,
const std::vector< double > &  value_dvar,
ParameterHandler &  param 
)
inlinevirtual

Function called by optimization loop in order to set the values in the ParameterHandler to the new design parameters.

Since ParameterHandler depends on the problem we are solving, set_parameters() is set at the most inner loop of the application.

Member Data Documentation

template<int dim>
boost::shared_ptr<FuelCellShop::Layer::CatalystLayer<dim> > FuelCell::Application::AppPemfc< dim >::ACL
protected

The object ACL layer will contain all the information relevant to the the anode catalyst layer.

We can request any effective property from this class

template<int dim>
boost::shared_ptr<FuelCellShop::Layer::GasDiffusionLayer<dim> > FuelCell::Application::AppPemfc< dim >::AGDL
protected

The object AGDL layer will contain all the information relevant to the the anode GDL.

We can request any effective property from this class

template<int dim>
boost::shared_ptr<FuelCellShop::Layer::MicroPorousLayer<dim> > FuelCell::Application::AppPemfc< dim >::AMPL
protected

The object AMPL layer will contain all the information relevant to the the anode micro-porous layer.

We can request any effective property from this class

template<int dim>
boost::shared_ptr<FuelCellShop::Layer::CatalystLayer<dim> > FuelCell::Application::AppPemfc< dim >::CCL
protected

The object CCL layer will contain all the information relevant to the the catalyst layer.

We can request any effective property from this class

template<int dim>
boost::shared_ptr<FuelCellShop::Layer::GasDiffusionLayer<dim> > FuelCell::Application::AppPemfc< dim >::CGDL
protected

The object CGDL layer will contain all the information relevant to the the cathode GDL.

We can request any effective property from this class

template<int dim>
boost::shared_ptr<FuelCellShop::Layer::MicroPorousLayer<dim> > FuelCell::Application::AppPemfc< dim >::CMPL
protected

The object CMPL layer will contain all the information relevant to the the cathode micro-porous layer.

We can request any effective property from this class

template<int dim>
std::vector<std::string> FuelCell::Application::AppPemfc< dim >::component_names
protected

Structure where we store the name of each component in our problem.

The component names are stored in the same way as they are stored in the solution.

template<int dim>
std::vector<std::string> FuelCell::Application::AppPemfc< dim >::design_var
protected

Stores the design variable names so that the name can be appended to the .vtk file name.

template<int dim>
std::vector<double> FuelCell::Application::AppPemfc< dim >::design_var_value
protected

Stores the values of the design variables so that the number can be appended to the .vtk file name.

ElectronTransportEquation object.

template<int dim>
std::vector<std::string> FuelCell::Application::AppPemfc< dim >::equation_names
protected

Structure where we store the problem we want to solve.

Each vector component contains a string with the name of the equation we want to solve Then, the number of components is equation_names.size()

template<int dim>
FuelCellShop::Equation::FicksTransportEquation<dim> FuelCell::Application::AppPemfc< dim >::ficks_oxygen_nitrogen
protected
template<int dim>
FuelCellShop::Equation::FicksTransportEquation<dim> FuelCell::Application::AppPemfc< dim >::ficks_water_hydrogen
protected
template<int dim>
FuelCellShop::Equation::FicksTransportEquation<dim> FuelCell::Application::AppPemfc< dim >::ficks_water_nitrogen
protected

Post-processing object to compute the HOR current density.

template<int dim>
FuelCellShop::Material::Hydrogen FuelCell::Application::AppPemfc< dim >::hydrogen
protected

The anode contains hydrogen, so we need to create an object water in order to compute viscosity, density, etc.

for waterHydrogen properties

template<int dim>
double FuelCell::Application::AppPemfc< dim >::l_channel
private

Width of the channel.

template<int dim>
double FuelCell::Application::AppPemfc< dim >::l_land
private

Width of the landing.

LambdaTransportEquation object.

template<int dim>
boost::shared_ptr<FuelCellShop::Layer::MembraneLayer<dim> > FuelCell::Application::AppPemfc< dim >::ML
protected

The object PEM layer will contain all the information relevant to the the polymer electrolyte membrane.

We can request any effective property from this class

template<int dim>
FuelCellShop::Material::Nitrogen FuelCell::Application::AppPemfc< dim >::nitrogen
protected

The cathode contains water vapour, so we need to create an object water in order to compute viscosity, density, etc.

for water

template<int dim>
OperatingConditions FuelCell::Application::AppPemfc< dim >::OC
protected

Initial operating conditions class.

Post-processing object to compute the ORR current density.

template<int dim>
FuelCellShop::Material::Oxygen FuelCell::Application::AppPemfc< dim >::oxygen
protected

The cathode contains water vapour, so we need to create an object water in order to compute viscosity, density, etc.

for water

ProtonTransportEquation object.

template<int dim>
FuelCellShop::Equation::ReactionSourceTerms<dim> FuelCell::Application::AppPemfc< dim >::reaction_source_terms
protected

ReactionSourceTerms object.

template<int dim>
FuelCellShop::Equation::SorptionSourceTerms<dim> FuelCell::Application::AppPemfc< dim >::sorption_source_terms
protected

SorptionSourceTerms object.

Object used to calculate the properties of the electrolyte in the catalyst layer.

In this case we assume is Nafion. Object used to calculate the carbon black conductivity in the catalyst layer. The catalyst object will contain the relevent parameters for the kinetics class, in this we are using a platinum catalyst. The cathode contains water vapour, so we need to create an object water in order to compute viscosity, density, etc. for water

Post-processing object to compute the water sorption in the CL.


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