OpenFCST: The open-source Fuel Cell Simulation Toolbox
|
This class is used to solve the physical pheonoma on a complete membrane electrode assembly. More...
#include <app_pemfc.h>
Public Member Functions | |
AppPemfc (boost::shared_ptr< AppFrame::ApplicationData > data=boost::shared_ptr< AppFrame::ApplicationData >()) | |
Constructor. | |
~AppPemfc () | |
Destructor. | |
virtual void | declare_parameters (ParameterHandler ¶m) |
Declare all parameters that are needed for: | |
virtual void | set_parameters (const std::vector< std::string > &name_dvar, const std::vector< double > &value_dvar, ParameterHandler ¶m) |
Function called by optimization loop in order to set the values in the ParameterHandler to the new design parameters. | |
void | _initialize (ParameterHandler ¶m) |
Set up how many equations are needed and read in parameters for the parameter handler in order to initialize data. | |
void | initialize_grid (ParameterHandler ¶m) |
Initilize and create the grid Determines whether reading from a grid file or creating new. | |
virtual void | initialize (ParameterHandler ¶m) |
Call the other initialize routines from the inherited classes. | |
void | init_solution (AppFrame::FEVector &src) |
Initialize nonlinear solution. | |
virtual void | cell_matrix (MatrixVector &cell_matrices, const typename DoFApplication< dim >::CellInfo &cell) |
Integration of local bilinear form. | |
virtual void | cell_residual (AppFrame::FEVector &cell_vector, const typename DoFApplication< dim >::CellInfo &cell) |
Integration of the rhs of the equations. | |
virtual void | dirichlet_bc (std::map< unsigned int, double > &boundary_values) const |
Member function used to set dirichlet boundary conditions. | |
virtual void | solve (AppFrame::FEVector &start, const AppFrame::FEVectors &rhs) |
Solve the linear system of equations. | |
virtual double | estimate (const AppFrame::FEVectors &sol) |
Estimate error per cell. | |
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. | |
virtual void | cell_responses (std::vector< double > &resp, const typename DoFApplication< dim >::CellInfo &info, const AppFrame::FEVector &sol) |
Compute the value of all objective function and constraints. | |
virtual void | global_responses (std::vector< double > &resp, const AppFrame::FEVector &sol) |
This class is used to evaluate all responses that do not require looping over cells. | |
virtual void | cell_dresponses_dl (std::vector< std::vector< double > > &, const typename DoFApplication< dim >::CellInfo &, const AppFrame::FEVector &) |
This class is used to evaluate the derivative of all the functionals that require looping over cells with respect to the design variables. | |
virtual void | global_dresponses_dl (std::vector< std::vector< double > > &df_dl, const AppFrame::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. | |
virtual void | cell_dresponses_du (std::vector< AppFrame::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. | |
virtual void | global_dresponses_du (std::vector< AppFrame::FEVector > &df_du, const AppFrame::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. | |
virtual double | evaluate (const AppFrame::FEVectors &src) |
Post-processing. | |
virtual void | data_out (const std::string &basename, const AppFrame::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. | |
void | parse_init_solution (AppFrame::FEVector &src, FuelCell::OperatingConditions &OC, bool &good_solution) |
Check to see that the solution read from file can be used for the new simulation conditions. | |
bool | parse_init_solution_phi_s (AppFrame::FEVector &src, double &V_cell) |
Check to see that the initial solution for the solid phase potential is usable. | |
bool | parse_init_solution_x_O2 (AppFrame::FEVector &src, double &x_O2) |
Check to see that the initial solution for the oxygen mole fraction is usable. | |
bool | parse_init_solution_x_wv (AppFrame::FEVector &dst, double &x_wv_a, double &x_wv_c) |
Check to see that the initial solution for the water vapour mole fraction is usable. | |
void | data_out (std::string basename, const AppFrame::FEVectors vectors, std::vector< std::string > solution_names) |
Public Member Functions inherited from AppFrame::OptimizationBlockMatrixApplication< dim > | |
OptimizationBlockMatrixApplication (boost::shared_ptr< AppFrame::ApplicationData > data=boost::shared_ptr< AppFrame::ApplicationData >()) | |
Constructor for an object, owning its own mesh and dof handler. | |
OptimizationBlockMatrixApplication (AppFrame::DoFApplication< dim > &, bool triangulation_only) | |
Constructor for an object, borrowing mesh and dof handler from another object. | |
~OptimizationBlockMatrixApplication () | |
Destructor. | |
virtual void | responses (std::vector< double > &f, const AppFrame::FEVectors &vectors) |
Post-processing. | |
virtual void | print_responses (std::vector< double > &resp) |
This function is used to print the responses to screen (deallog) | |
virtual void | dresponses_dl (std::vector< std::vector< double > > &df_dl, const AppFrame::FEVectors &src) |
Post-processing. | |
virtual void | dresponses_du (std::vector< AppFrame::FEVector > &dst, const AppFrame::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. | |
virtual void | dresidual_dlambda (std::vector< AppFrame::FEVector > &dst, const AppFrame::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. | |
virtual void | cell_dresidual_dlambda (std::vector< AppFrame::FEVector > &cell_vector, const typename DoFApplication< dim >::CellInfo &cell, std::vector< std::vector< double > > &src) |
Integration of local bilinear form. | |
void | solve_direct (std::vector< std::vector< double > > &df_dl, const AppFrame::FEVectors &sol) |
Solver in order to obtain the analytical sensitivities for the given objective and constraints using the direct method. | |
void | solve_adjoint (std::vector< std::vector< double > > &df_dl, const AppFrame::FEVector &sol) |
Solver in order to obtain the analytical sensitivities for the given objective and constraints using the adjoint method. | |
unsigned int | get_n_resp () const |
Member function that returns the number of responses. | |
unsigned int | get_n_dvar () const |
Member function that returns the number of design variables. | |
std::vector< std::string > | get_name_dvar () const |
Member function that returns the name of the design variables. | |
std::vector< std::string > | get_name_responses () const |
Member function that returns the name of the responses. | |
void | print_default_parameter_file () |
Print the default parameter handler file. | |
bool | get_bool_transfer_solution () |
Function to see if we are transferring a solution on a refined grid to the initial coarse grid. | |
virtual void | set_read_initial_solution (bool &read) |
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. | |
void | set_output_variables (std::vector< std::string > &dakota_name_responses) |
Public Member Functions inherited from AppFrame::BlockMatrixApplication< dim > | |
void | do_assemble (const FEVectors &, typename DoFHandler< dim >::active_cell_iterator begin, typename DoFHandler< dim >::active_cell_iterator end, Threads::Mutex &mutex) |
Multithreaded assemble function called by assemble(). | |
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. | |
BlockMatrixApplication (boost::shared_ptr< ApplicationData > data=boost::shared_ptr< ApplicationData >()) | |
Constructor for an object, owning its own mesh and dof handler. | |
BlockMatrixApplication (DoFApplication< dim > &, bool triangulation_only) | |
Constructor for an object, borrowing mesh and dof handler from another object. | |
void | _initialize (ParameterHandler ¶m) |
Initialize data of this class. | |
void | add_vector_for_cell_matrix (std::string name, unsigned int block, unsigned int components, bool values, bool derivatives) |
Add a named vector from data to be handed to the cell_matrix() function via CellInfo::values and CellInfo::derivatives. | |
void | add_vector_for_flux_matrix (std::string name, unsigned int block, unsigned int components, bool values, bool derivatives) |
Add a named vector from data to be handed to the bdry_matrix() and face_matrix() functions via FaceInfo::values and FaceInfo::derivatives. | |
void | remesh_matrices () |
Initialize sparsity patterns and matrices for the new mesh. | |
virtual void | remesh () |
Refine grid accordingly to the Refinement options under "Grid Generation" in the parameter file. | |
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. | |
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} \] | |
void | residual_constraints (FEVector &dst) const |
Redefinition of residual_constraints() in DoFHandler. | |
virtual void | bdry_matrix (MatrixVector &face_matrices, const typename DoFApplication< dim >::FaceInfo &face) |
Integration of local bilinear form. | |
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. | |
Public Member Functions inherited from AppFrame::DoFApplication< dim > | |
DoFApplication (boost::shared_ptr< ApplicationData > data=boost::shared_ptr< ApplicationData >(), bool multigrid=false) | |
Constructor for an object, owning its own mesh and dof handler. | |
DoFApplication (bool multigrid) | |
Constructor for an object owning its own mesh and dof handler and creating new ApplicationData. | |
DoFApplication (DoFApplication< dim > &, bool triangulation_only, bool multigrid=false) | |
Constructor for an object, borrowing mesh and dof handler from another object. | |
~DoFApplication () | |
Destructor which deletes owned objects. | |
void | _initialize (ParameterHandler ¶m) |
Initialize from parameter values. | |
void | add_vector_for_transfer (FEVector *) |
Add the vector to be transfered from one mesh to the next. | |
void | delete_vector_for_transfer () |
Delete the vector to be transfered from one mesh to the next. | |
virtual void | remesh_dofs () |
Initialize dof handler, count the dofs in each block and renumber the dofs. | |
virtual void | init_vector (FEVector &dst) const |
Reinitialize the BlockVector dst such that it contains block_size.size() blocks. | |
virtual double | residual (FEVector &dst, const FEVectors &src, bool apply_boundaries=true) |
Loop over all cells to compute the residual. | |
unsigned int | memory_consumption () const |
Compute the amount of memory needed by this object. | |
virtual double | cell_estimate (const CellInfo &) |
Integration of estimate inside a cell. | |
virtual double | bdry_estimate (const FaceInfo &) |
Integration of estimate on a boundary face. | |
virtual double | face_estimate (const FaceInfo &, const FaceInfo &) |
Integration of estimate on an interior face. | |
virtual void | cell_residual (FEVector &cell_vector, const CellInfo &cell) |
Integration of local linear form. | |
virtual void | bdry_residual (FEVector &face_vector, const FaceInfo &face) |
Integration of local linear form. | |
virtual void | face_residual (FEVector &face_vector1, FEVector &face_vector2, const FaceInfo &face1, const FaceInfo &face2) |
Integration of local linear form. | |
template<class BOX , class WORKER > | |
void | integrate_1form (BOX &box, WORKER &local_forms, FEVector &dst, const FEVectors &src) |
The function integrating 1-forms as for instance used by residual(). | |
void | integrate_functional (LocalEstimate< dim > &local_forms, FEVectors &dst, const FEVectors &src) |
The function integrating functionals using local integrators. | |
void | store_triangulation (Triangulation< dim > &new_tr) |
Function to copy a triangulation object for use after refinement. | |
void | transfer_solution_to_coarse_mesh (Triangulation< dim > &tr_coarse, AppFrame::FEVector &coarse_solution, AppFrame::FEVector &refined_solution) |
Function to perform the transfer of a solution on a refined grid to the initial coarse grid. | |
void | read_init_solution (AppFrame::FEVector &dst, bool &good_solution) const |
Function to transfer a solution on a refined grid to the initial coarse grid. | |
template<class INFO , typename TYPE > | |
void | fill_local_data (const INFO &info, const std::vector< VectorSelector > &data_vector, std::vector< std::vector< std::vector< TYPE > > > &data) const |
Fill local data vector with values of the stored finite element function vectors. | |
virtual void | grid_out (const std::string &basename) |
Output the grid used to solve the problem. | |
virtual void | data_out (const std::string &basename, const FEVectors &src, const std::vector< std::string > &solution_names) |
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. | |
Public Member Functions inherited from AppFrame::ApplicationBase | |
ApplicationBase (boost::shared_ptr< ApplicationData > ex_data=boost::shared_ptr< ApplicationData >()) | |
Constructor for an application. | |
ApplicationBase (const ApplicationBase &other) | |
Copy constructor. | |
virtual | ~ApplicationBase () |
Virtual destructor. | |
void | print_parameters_to_file (ParameterHandler ¶m, const std::string &file_name, const ParameterHandler::OutputStyle &style) |
Print default parameters for the application to a file. | |
virtual void | start_vector (FEVector &dst, std::string caller) const |
Initialize vector to problem size. | |
virtual void | Tsolve (FEVector &start, const FEVectors &rhs) |
Solve the dual system assembled with right hand side rhs and return the result in start . | |
virtual void | grid_out (const std::string &filename) const |
Write the mesh in the format specified by the ParameterHandler. | |
virtual void | data_out (const std::string &filename, const FEVectors &src, const std::vector< std::string >) |
boost::shared_ptr < ApplicationData > | get_data () |
Get access to the protected variable data. | |
const boost::shared_ptr < ApplicationData > | get_data () const |
Get read-only access to the protected variable data. | |
virtual std::string | id () const |
Return a unique identification string for this application. | |
virtual void | notify (const Event &reason) |
Add a reason for assembling. | |
virtual void | clear () |
Reset the application class such that a call to initialize() is possible again and will produce the same result as if the object was fresh. | |
void | clear_events () |
Clear all notifications. | |
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. | |
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. | |
Other internal data | |
FuelCell::SystemManagement | system_management |
Class used to store all information related to the system of equations that is being solved such as variable_names, equation_names and couplings between equations. | |
std::vector< std::string > | equation_names |
Structure where we store the problem we want to solve. | |
std::vector< std::string > | component_names |
Structure where we store the name of each component in our problem. | |
Pre-processor and operating condition classes | |
OperatingConditions | OC |
Initial operating conditions class. | |
boost::shared_ptr < FuelCellShop::Geometry::GridBase < dim > > | grid |
Class used to generate the mesh and store geometry info. | |
Material classes | |
FuelCellShop::Material::Water | water |
Object used to calculate the properties of the electrolyte in the catalyst layer. | |
FuelCellShop::Material::Oxygen | oxygen |
The cathode contains water vapour, so we need to create an object water in order to compute viscosity, density, etc. | |
FuelCellShop::Material::Nitrogen | nitrogen |
The cathode contains water vapour, so we need to create an object water in order to compute viscosity, density, etc. | |
FuelCellShop::Material::Hydrogen | hydrogen |
The anode contains hydrogen, so we need to create an object water in order to compute viscosity, density, etc. | |
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. | |
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. | |
boost::shared_ptr < FuelCellShop::Layer::CatalystLayer < dim > > | ACL |
The object ACL layer will contain all the information relevant to the the anode catalyst layer. | |
boost::shared_ptr < FuelCellShop::Layer::MembraneLayer < dim > > | ML |
The object PEM layer will contain all the information relevant to the the polymer electrolyte membrane. | |
boost::shared_ptr < FuelCellShop::Layer::CatalystLayer < dim > > | CCL |
The object CCL layer will contain all the information relevant to the the catalyst layer. | |
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. | |
boost::shared_ptr < FuelCellShop::Layer::GasDiffusionLayer < dim > > | CGDL |
The object CGDL layer will contain all the information relevant to the the cathode GDL. | |
Physics Equations | |
FuelCellShop::Equation::ProtonTransportEquation < dim > | proton_transport |
ProtonTransportEquation object. | |
FuelCellShop::Equation::LambdaTransportEquation < dim > | lambda_transport |
LambdaTransportEquation object. | |
FuelCellShop::Equation::ElectronTransportEquation < dim > | electron_transport |
ElectronTransportEquation object. | |
FuelCellShop::Equation::NewFicksTransportEquation < dim > | ficks_oxygen_nitrogen |
FuelCellShop::Equation::NewFicksTransportEquation < dim > | ficks_water_nitrogen |
FuelCellShop::Equation::NewFicksTransportEquation < dim > | ficks_water_hydrogen |
FuelCellShop::Equation::ReactionSourceTerms < dim > | reaction_source_terms |
ReactionSourceTerms object. | |
FuelCellShop::Equation::SorptionSourceTerms < dim > | sorption_source_terms |
SorptionSourceTerms object. | |
Protected Attributes inherited from AppFrame::OptimizationBlockMatrixApplication< dim > | |
unsigned int | n_dvar |
Number of design variables. | |
unsigned int | n_obj |
Number of objective functions. | |
unsigned int | n_resp |
Number of responses = n_obj + n_con. | |
std::vector< std::string > | name_design_var |
Member that stores the name of the design variables. | |
std::vector< std::string > | name_responses |
Member that stores the name of the responses, i.e. | |
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. | |
bool | output_coarse_solution |
Decision variable for whether the solution is to be output for transfer. | |
bool | read_in_initial_solution |
Decision variable for whether the initial solution should be read from file. | |
bool | optimization |
Decision variable for whether the application is being used for optimization. | |
Protected Attributes inherited from AppFrame::BlockMatrixApplication< dim > | |
Table< 2, DoFTools::Coupling > | cell_couplings |
Couplings through cell bilinear forms. | |
Table< 2, DoFTools::Coupling > | flux_couplings |
Couplings through flux bilinear forms. | |
boost::shared_ptr< Quadrature < dim > > | quadrature_assemble_cell |
Quadrature rule for matrix assembling on cells. | |
boost::shared_ptr< Quadrature < dim-1 > > | quadrature_assemble_face |
Quadrature rule for matrix assembling on faces. | |
BlockSparseMatrix< double > | matrix |
Storage for the actual matrix. | |
FilteredMatrix< BlockVector < double > > | filtered_matrix |
Wrapper for the actual matrix that contains all the boundary conditions. | |
Protected Attributes inherited from AppFrame::DoFApplication< dim > | |
std::map< unsigned int, double > | boundary_constraints |
List of all nodes constrained by a strong boundary condition, together with a value to be assigned. | |
ConstraintMatrix | hanging_node_constraints |
Constraint Matrix object. | |
boost::shared_ptr< Mapping< dim > > | mapping |
The mapping used for the transformation of mesh cells. | |
unsigned int | mapping_degree |
Degree used for polynomial mapping of arbitrary order. | |
boost::shared_ptr < Triangulation< dim > > | tr |
Pointer to the Triangulation object. | |
boost::shared_ptr < FiniteElement< dim > > | element |
The finite element used in dof. | |
boost::shared_ptr< DoFHandler < dim > > | dof |
Pointer to the DoFHandler object. | |
boost::shared_ptr < MGDoFHandler< dim > > | mg_dof |
Pointer to the MGDoFHandler object. | |
MeshWorker::BlockInfo | block_info |
Vector< float > | cell_errors |
The result of error estimation by cell. | |
Vector< float > | face_errors |
The result of error estimation by face. | |
GridOut | g_out |
The object for writing grids. | |
DataOut< dim, DoFHandler< dim > > | d_out |
The object for writing data. | |
std::vector < DataComponentInterpretation::DataComponentInterpretation > | data_interpretation |
Vector for adjusting output to vector data. | |
std::string | refinement |
Refinement parameter from parameter file. | |
unsigned int | initial_refinement |
Initial refinement from parameter file. | |
double | refinement_threshold |
Refinement threshold for adaptive method from parameter file. | |
double | coarsening_threshold |
Coarsening threshold for adaptive method from parameter file. | |
bool | sort_cuthill |
Flag for sorting with Cuthill McKee algorithm. | |
Point< dim > | sort_direction |
Direction for downstream sorting. | |
std::vector< FEVector * > | transfer_vectors |
List of vector names to be transfered from one grid to the next. | |
Quadrature< dim > | quadrature_residual_cell |
Quadrature rule for residual computation on cells. | |
Quadrature< dim-1 > | quadrature_residual_bdry |
Quadrature rule for residual computation on boundary faces. | |
Quadrature< dim-1 > | quadrature_residual_face |
Quadrature rule for residual computation on faces. | |
bool | boundary_fluxes |
Extend the integration loops in assemble() and residual() also to boundary faces. | |
bool | interior_fluxes |
Extend the integration loops in assemble() and residual() also to interior faces. | |
Protected Attributes inherited from AppFrame::ApplicationBase | |
boost::shared_ptr < ApplicationData > | data |
Object for auxiliary data. | |
Event | notifications |
Accumulate reasons for reassembling here. | |
Private Attributes | |
double | l_channel |
Width of the channel. | |
double | l_land |
Width of the landing. | |
Additional Inherited Members | |
Public Types inherited from AppFrame::DoFApplication< dim > | |
typedef MeshWorker::InfoObjects::IntegrationInfo < dim, FEValuesBase< dim > > | CellInfo |
This is a redefinition of CellInfo in order to call MeshWorker objects instead of the previous implementation in AppFrame. | |
typedef MeshWorker::InfoObjects::IntegrationInfo < dim, FEFaceValuesBase< dim > > | FaceInfo |
This is a redefinition of CellInfo in order to call MeshWorker objects instead of the previous implementation in AppFrame. | |
Public Attributes inherited from AppFrame::DoFApplication< dim > | |
unsigned int | verbosity |
Controls verbosity of certain functions. | |
std::vector < DataComponentInterpretation::DataComponentInterpretation > | solution_interpretations |
solution_interpretations identifies whether some solution_names are scalars or parts of a vector. | |
std::vector < DataComponentInterpretation::DataComponentInterpretation > | postprocessing_interpretations |
postprocessing_interpretations identifies whether some postprocessing_names are scalars or parts of a vector. | |
bool | output_materials_and_levels |
output_materials_and_levels if true then visualized, otherwise suppressed. | |
Vector< double > | output_materials |
Vector that will be used by data_out to store the material ids. | |
Vector< double > | output_levels |
Vector that will be used by data_out to store the refinement levels at each cell. | |
Static Public Attributes inherited from AppFrame::OptimizationBlockMatrixApplication< dim > | |
static const AppFrame::Event | sensitivity_analysis |
The Event set by OptimizationMatrixApplication if if we want to compute the sensitivities and a new matrix should be assembled. | |
Protected Types inherited from AppFrame::OptimizationBlockMatrixApplication< dim > | |
typedef void(* | CELL_Dvalues )(std::vector< AppFrame::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. | |
Protected Member Functions inherited from AppFrame::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. | |
void | print_dresponses_du (std::vector< AppFrame::FEVector > df_du) |
Auxiliary routine to print the values of df_du This routine should be called once df_du is assembled. | |
void | dfunction (std::vector< AppFrame::FEVector > &dst, const AppFrame::FEVectors &src, bool dfunctional_du, bool dresidual_dlambda) |
This is an auxiliary function called by dresidual_dlambda and dfunctional_du. | |
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.
FuelCell::Application::AppPemfc< dim >::AppPemfc | ( | boost::shared_ptr< AppFrame::ApplicationData > | data = boost::shared_ptr< AppFrame::ApplicationData >() | ) |
Constructor.
FuelCell::Application::AppPemfc< dim >::~AppPemfc | ( | ) |
Destructor.
void FuelCell::Application::AppPemfc< dim >::_initialize | ( | ParameterHandler & | param | ) |
Set up how many equations are needed and read in parameters for the parameter handler in order to initialize data.
|
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 AppFrame::OptimizationBlockMatrixApplication< dim >.
|
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 AppFrame::OptimizationBlockMatrixApplication< dim >.
|
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 AppFrame::BlockMatrixApplication< dim >.
|
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
|
virtual |
Compute the value of all objective function and constraints.
Reimplemented from AppFrame::OptimizationBlockMatrixApplication< dim >.
|
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.
Reimplemented from AppFrame::OptimizationBlockMatrixApplication< dim >.
|
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 AppFrame::DoFApplication< dim >.
void FuelCell::Application::AppPemfc< dim >::data_out | ( | std::string | basename, |
const AppFrame::FEVectors | vectors, | ||
std::vector< std::string > | solution_names | ||
) |
|
virtual |
Declare all parameters that are needed for:
Reimplemented from AppFrame::OptimizationBlockMatrixApplication< dim >.
|
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 AppFrame::BlockMatrixApplication< dim >.
|
virtual |
Estimate error per cell.
Reimplemented from AppFrame::DoFApplication< dim >.
|
virtual |
Post-processing.
Evaluate a functional such as the objective function of an optimization problem
Reimplemented from AppFrame::DoFApplication< dim >.
|
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 AppFrame::OptimizationBlockMatrixApplication< dim >.
|
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 AppFrame::OptimizationBlockMatrixApplication< dim >.
|
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 AppFrame::OptimizationBlockMatrixApplication< dim >.
|
virtual |
Initialize nonlinear solution.
Implements AppFrame::OptimizationBlockMatrixApplication< dim >.
|
virtual |
Call the other initialize routines from the inherited classes.
Reimplemented from AppFrame::OptimizationBlockMatrixApplication< dim >.
void FuelCell::Application::AppPemfc< dim >::initialize_grid | ( | ParameterHandler & | param | ) |
Initilize and create the grid Determines whether reading from a grid file or creating new.
void FuelCell::Application::AppPemfc< dim >::parse_init_solution | ( | AppFrame::FEVector & | src, |
FuelCell::OperatingConditions & | OC, | ||
bool & | good_solution | ||
) |
Check to see that the solution read from file can be used for the new simulation conditions.
Uses member functions to compare the initial conditions in the parameter file to those in the loaded solution.
bool FuelCell::Application::AppPemfc< dim >::parse_init_solution_phi_s | ( | AppFrame::FEVector & | src, |
double & | V_cell | ||
) |
Check to see that the initial solution for the solid phase potential is usable.
If the variable varies by more than 30% at the boundary, the solution is considered unusable, and a default solution will be generated.
bool FuelCell::Application::AppPemfc< dim >::parse_init_solution_x_O2 | ( | AppFrame::FEVector & | src, |
double & | x_O2 | ||
) |
Check to see that the initial solution for the oxygen mole fraction is usable.
If the variable varies by more than 30% at the boundary, the solution is considered unusable, and a default solution will be generated.
bool FuelCell::Application::AppPemfc< dim >::parse_init_solution_x_wv | ( | AppFrame::FEVector & | dst, |
double & | x_wv_a, | ||
double & | x_wv_c | ||
) |
Check to see that the initial solution for the water vapour mole fraction is usable.
If the variable varies by more than 30% at the boundary, the solution is considered unusable, and a default solution will be generated.
|
virtual |
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.
Reimplemented from AppFrame::OptimizationBlockMatrixApplication< dim >.
|
virtual |
Solve the linear system of equations.
Reimplemented from AppFrame::ApplicationBase.
|
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
|
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
|
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
|
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
|
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
|
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
|
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.
|
protected |
Stores the design variable names so that the name can be appended to the .vtk file name.
|
protected |
Stores the values of the design variables so that the number can be appended to the .vtk file name.
|
protected |
ElectronTransportEquation object.
|
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()
|
protected |
|
protected |
|
protected |
|
protected |
Class used to generate the mesh and store geometry info.
|
protected |
The anode contains hydrogen, so we need to create an object water in order to compute viscosity, density, etc.
for waterHydrogen properties
|
private |
Width of the channel.
|
private |
Width of the landing.
|
protected |
LambdaTransportEquation object.
|
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
|
protected |
The cathode contains water vapour, so we need to create an object water in order to compute viscosity, density, etc.
for water
|
protected |
Initial operating conditions class.
|
protected |
The cathode contains water vapour, so we need to create an object water in order to compute viscosity, density, etc.
for water
|
protected |
ProtonTransportEquation object.
|
protected |
ReactionSourceTerms object.
|
protected |
SorptionSourceTerms object.
|
protected |
Class used to store all information related to the system of equations that is being solved such as variable_names, equation_names and couplings between equations.
|
protected |
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