OpenFCST: The open-source Fuel Cell Simulation Toolbox
|
Class that solves an ionomer-filled agglomerate problem in 1D. More...
#include <agglomerate_ionomer_1D.h>
Public Member Functions | |
virtual SolutionMap | compute_current () |
Main function of the class used to compute the current over the whole agglomerate at the local operating conditions. More... | |
virtual std::string | get_name () |
Return name of class instance, i.e. More... | |
virtual double | aux_volume_fraction () |
MicroScale object may have extra contribution to volume of layer, e.g. More... | |
Public Member Functions inherited from FuelCellShop::MicroScale::AgglomerateBase | |
virtual | ~AgglomerateBase () |
virtual void | print_properties () |
Print out key agglomerate information (name, radius, film thickness, porosity). More... | |
virtual std::vector< double > | compute_derivative_current () |
Function to compute the derivative of the current density at the local operating conditions. More... | |
virtual bool | has_derivatives () |
Returns true if the class instance can calculate current density derivatives. More... | |
virtual void | set_solution (const std::map< VariableNames, SolutionVariable > &, const VariableNames &, const int &) |
Function for setting the solution map(reactant concentration, phi_s, phi_m, etc.). More... | |
Public Member Functions inherited from FuelCellShop::MicroScale::MicroScaleBase | |
virtual | ~MicroScaleBase () |
Destructor. More... | |
Public Member Functions inherited from FuelCell::ApplicationCore::DAEWrapper | |
DAEWrapper () | |
Constructor. More... | |
~DAEWrapper () | |
Destructor. More... | |
double | integrate (double lb, double ub, std::vector< double > &W, std::vector< double > &F) |
Member function that integrates a solution between a lower and upper bound. More... | |
void | get_quadrature_points (double lb, double ub, std::vector< double > &X, std::vector< double > &W, FuelCell::ApplicationCore::DAESolver *prob) |
Function that obtains the gaussian quadrature points and weights. More... | |
void | verbosity (int i) |
Set the verbosity variable (controls output to screen) More... | |
void | DAE_Error (int flag) |
Indicates error in the solve function. More... | |
void | clear_memory () |
Static Public Attributes | |
static const std::string | concrete_name |
Protected Member Functions | |
void | setup_DAE_solver () |
Setup the variables in the problem required by the DAE Solver. More... | |
int | cont_tolerance (double start_tol, double end_tol) |
Function which implements a continuation based on the tolerance. More... | |
virtual double | get_film_thickness () |
virtual double | get_radius () |
virtual void | set_structure () |
Set the composition and structure of the agglomerate. More... | |
IonomerAgglomerate (int verbose=1) | |
Constructors. More... | |
IonomerAgglomerate (std::string name) | |
virtual void | declare_parameters (ParameterHandler ¶m) const |
virtual void | initialize (ParameterHandler ¶m) |
Protected Member Functions inherited from FuelCellShop::MicroScale::NumericalAgglomerateBase | |
void | setAV (double newAV) |
NumericalAgglomerateBase () | |
Constructor. More... | |
~NumericalAgglomerateBase () | |
Destructor. More... | |
void | update_initial_solution () |
void | save_initial_solution () |
double | getAV (double location) |
bool | use_initial_data (double z[], const double &x) |
virtual void | make_thread_safe (ParameterHandler ¶m, unsigned int thread_index) |
Protected Member Functions inherited from FuelCellShop::MicroScale::AgglomerateBase | |
void | _initialize_film_porosity () |
AgglomerateBase () | |
Protected Member Functions inherited from FuelCellShop::MicroScale::MicroScaleBase | |
void | set_layer (FuelCellShop::Layer::MultiScaleCL< deal_II_dimension > *_layer) |
MicroScaleBase () | |
Protected Member Functions inherited from FuelCellShop::MicroScale::SphericalAgglomerateGeometry | |
SphericalAgglomerateGeometry () | |
virtual double | compute_thickness_agg (FuelCellShop::Layer::MultiScaleCL< deal_II_dimension > *layer) |
Member function to compute the thickness of the agglomerate thin film based on the radius and structure. More... | |
virtual double | compute_epsilon_agg (FuelCellShop::Layer::MultiScaleCL< deal_II_dimension > *layer) |
Compute the volume fraction of nafion inside the agglomerate given the catalyst layer ionomer volume fraction , ; size of the agglomerate, ; and, porosity inside the agglomerate, , the necessary ionomer thin film thickness is computed such that the correct volume fractions are obtained. More... | |
virtual double | compute_epsilon_N (const double delta_agg, const double thickness_agg) const |
Function used to compute the amount of electrolyte in the catalyst layer. More... | |
virtual double | compute_depsilonN_dthickness (const double thickness_agg) const |
Function to compute
This function should only be used to calculate the thin film thickness using Newton's method. More... | |
virtual double | compute_depsilonN_depsilon_agg (FuelCellShop::Layer::MultiScaleCL< deal_II_dimension > *layer) const |
Function to compute
This function should only be used to calculate the thin film thickness using Newton's method. More... | |
virtual double | compute_n (FuelCellShop::Layer::MultiScaleCL< deal_II_dimension > *layer) const |
Member function to compute the number of agglomerates. More... | |
virtual double | compute_dn_depsilon_agg (FuelCellShop::Layer::MultiScaleCL< deal_II_dimension > *layer) const |
Compute the derivative of n with respect to the porosity of the agglomerate. More... | |
Private Member Functions | |
void | fsub (double &, double[], double[], double[]) |
Define the DAE function. More... | |
void | dfsub (double &, double[], double[], double[]) |
The Jacobian of fsub. More... | |
void | gsub (int &, double[], double &) |
Define the boundary conditions. More... | |
void | dgsub (int &, double[], double[]) |
The derivatives of the boundary conditions. More... | |
void | guess (double &, double[], double[], double[]) |
The initial guess. More... | |
Static Private Member Functions | |
static void | fsub_wrapper (double &, double[], double[], double[]) |
static void | dfsub_wrapper (double &, double[], double[], double[]) |
static void | gsub_wrapper (int &, double[], double &) |
static void | dgsub_wrapper (int &, double[], double[]) |
static void | guess_wrapper (double &, double[], double[], double[]) |
Private Attributes | |
double | cond_factor |
Used to modify the proton conductivity in agglomerate. More... | |
double | k_O2 |
Rate constant for non-equilibrium boundary condition. More... | |
bool | non_equil_bc |
Bool to determine if the non-equilibrium boundary condition is used. More... | |
double | sigma_p |
Proton conductivity. More... | |
double | lambda |
bool | uFD |
double | endTol |
double | prev_effectiveness |
Instance Delivery | |
static IonomerAgglomerate const * | PROTOTYPE |
virtual boost::shared_ptr < FuelCellShop::MicroScale::MicroScaleBase > | create_replica () |
This member function is used to create an object of type MicroScaleBase. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from FuelCellShop::MicroScale::MicroScaleBase | |
static void | declare_MicroScale_parameters (ParameterHandler ¶m) |
Function used to declare all the data necessary in the parameter files for all MicroScale children. More... | |
static boost::shared_ptr < FuelCellShop::MicroScale::MicroScaleBase > | create_MicroStructure (ParameterHandler ¶m, FuelCellShop::Layer::MultiScaleCL< deal_II_dimension > *layer) |
Function used to select the appropriate MicroScale type as specified in the ParameterHandler under line. More... | |
Protected Types inherited from FuelCellShop::MicroScale::AgglomerateBase | |
typedef FuelCellShop::Layer::MultiScaleCL < deal_II_dimension > ::Properties | CLPropNames |
typedef std::map< CLPropNames, double > | CL_Properties |
Protected Types inherited from FuelCellShop::MicroScale::MicroScaleBase | |
typedef std::map< std::string, MicroScaleBase * > | _mapFactory |
This object is used to store all objects of type MicroScaleBase. More... | |
Protected Types inherited from FuelCellShop::MicroScale::SphericalAgglomerateGeometry | |
typedef FuelCellShop::Layer::MultiScaleCL < deal_II_dimension > ::Properties | CLPropNames |
typedef std::map< CLPropNames, double > | CL_Properties |
Static Protected Member Functions inherited from FuelCellShop::MicroScale::MicroScaleBase | |
static _mapFactory * | get_mapFactory () |
This member function is used to create an object of type MicroScaleBase. More... | |
Protected Attributes inherited from FuelCellShop::MicroScale::NumericalAgglomerateBase | |
std::vector< std::vector < double > > | final_results |
std::vector< std::vector < double > > | initial_solution |
std::vector< std::string > | column_names |
double | R_tol |
Protected Attributes inherited from FuelCellShop::MicroScale::AgglomerateBase | |
boost::shared_ptr < FuelCellShop::Material::CatalystBase > | catalyst |
Boost shared pointer to catalyst object. More... | |
boost::shared_ptr < FuelCellShop::Material::PolymerElectrolyteBase > | electrolyte |
Boost shared pointer to electrolyte object. More... | |
boost::shared_ptr < FuelCellShop::Kinetics::BaseKinetics > | kinetics |
Boost shared pointer to kinetics object. More... | |
std::map< VariableNames, SolutionVariable > | solutions |
Member data for storing solutions. More... | |
std::vector< VariableNames > | sol_names |
VariableNames | reactant |
VariableNames | tempReactantName |
int | sol_index |
double | permittivity_0 |
Constants. More... | |
double | F |
double | R |
double | P |
double | AV |
double | c_R |
bool | has_derivatives_ |
double | c_H |
double | phi_M |
double | phi_S |
double | interface |
double | D_R_N |
double | H_R_N |
Henry's Constant for primary reactant in nafion, [Pa cm^3/mol]. More... | |
std::string | fixed_agg_variable |
Protected Attributes inherited from FuelCellShop::MicroScale::MicroScaleBase | |
FuelCellShop::Layer::MultiScaleCL < deal_II_dimension > * | layer |
Protected Attributes inherited from FuelCellShop::MicroScale::SphericalAgglomerateGeometry | |
double | pi |
double | r_agg |
double | delta_agg |
double | epsilon_agg |
double | n_agg |
Protected Attributes inherited from FuelCell::ApplicationCore::DAEWrapper | |
int | n_mesh |
Number of mesh points. More... | |
double * | mesh |
Array of mesh points. More... | |
int | n_colloc |
Number of collocation points. More... | |
int | n_output |
Output integer variable. More... | |
int | n_comp |
number of PDEs More... | |
int | n_y |
number of Algebraic constraints More... | |
int * | mm |
array of integers storing the order of each PDE More... | |
int | m_star |
Integer representing the total number of variables given by . More... | |
double | boundary_0 |
Left boundary point. More... | |
double | boundary_1 |
Right boundary point. More... | |
double * | zeta |
Array of boundary points. More... | |
FuelCell::ApplicationCore::DAESolver * | prob |
DAE problem solver object. More... | |
double * | fixpnt |
Array of fixed points on the mesh. More... | |
int * | ltol |
double * | tol |
double | cm_to_m |
Convert from centimetres to metres. More... | |
double | cm2_to_m2 |
Convert from centimetres squared to metres squared. More... | |
double | cm3_to_m3 |
Convert from centimetres cubed to metres cubed. More... | |
Class that solves an ionomer-filled agglomerate problem in 1D.
This class uses the DAE solver interface to solve the problem using COLDAE (included in the contrib folder) to solve a boundary value problem.
LIST OF INPUT PARAMETERS FOR THE CLASS.
|
protected |
Constructors.
|
protected |
|
inlinevirtual |
MicroScale object may have extra contribution to volume of layer, e.g.
water.
The ionomer filled agglomerate model does not modify macro scale porosity
Implements FuelCellShop::MicroScale::MicroScaleBase.
|
virtual |
Main function of the class used to compute the current over the whole agglomerate at the local operating conditions.
Implements FuelCellShop::MicroScale::MicroScaleBase.
|
protected |
Function which implements a continuation based on the tolerance.
|
inlineprotectedvirtual |
This member function is used to create an object of type MicroScaleBase.
Implements FuelCellShop::MicroScale::MicroScaleBase.
|
inlineprotectedvirtual |
Reimplemented from FuelCellShop::MicroScale::NumericalAgglomerateBase.
References concrete_name, and FuelCellShop::MicroScale::NumericalAgglomerateBase::declare_parameters().
|
privatevirtual |
The Jacobian of fsub.
Until we decide on how to get AD support in FCST, we must enter the Jacobian in manually. Note that a one-dimensional array must be passed back to COLDAE. However, it is easier to define a two-dimensional array as the matrix (see COLDAE.f). After, use c_to_for_matrix to convert it to the correct one-dimensional array.
Implements FuelCell::ApplicationCore::DAEWrapper.
|
staticprivate |
|
privatevirtual |
The derivatives of the boundary conditions.
See COLDAE.f
Implements FuelCell::ApplicationCore::DAEWrapper.
|
staticprivate |
|
privatevirtual |
Define the DAE function.
In this case,it is simply a system of ODES. COLDAE allows for the system to be defined as a system of 2 mixed-order ODEs. See COLDAE.f for additional information about how to define fsub. In particular, see COLDAE.f for the meaning of z and y. Note that because a BVP is solved, y is not used.
Implements FuelCell::ApplicationCore::DAEWrapper.
|
staticprivate |
|
inlineprotectedvirtual |
|
inlinevirtual |
Return name of class instance, i.e.
concrete name.
Implements FuelCellShop::MicroScale::MicroScaleBase.
References concrete_name.
|
inlineprotectedvirtual |
|
privatevirtual |
Define the boundary conditions.
There are 4 boundary conditions. Note that i refers to the ith boundary condition. See COLDAE.f
Implements FuelCell::ApplicationCore::DAEWrapper.
|
staticprivate |
|
privatevirtual |
The initial guess.
This is optional, but a good idea for this problem. If we do not provide this, CODAE will use a constant of 0.0 for an initial guess.
Implements FuelCell::ApplicationCore::DAEWrapper.
|
staticprivate |
|
inlineprotectedvirtual |
Reimplemented from FuelCellShop::MicroScale::NumericalAgglomerateBase.
References concrete_name, cond_factor, FuelCellShop::MicroScale::NumericalAgglomerateBase::initialize(), k_O2, and non_equil_bc.
|
protectedvirtual |
Set the composition and structure of the agglomerate.
Implements FuelCellShop::MicroScale::MicroScaleBase.
|
protectedvirtual |
Setup the variables in the problem required by the DAE Solver.
Implements FuelCell::ApplicationCore::DAEWrapper.
|
static |
Referenced by declare_parameters(), get_name(), and initialize().
|
private |
Used to modify the proton conductivity in agglomerate.
Referenced by initialize().
|
private |
|
private |
Rate constant for non-equilibrium boundary condition.
Referenced by initialize().
|
private |
|
private |
Bool to determine if the non-equilibrium boundary condition is used.
Referenced by initialize().
|
private |
|
staticprotected |
|
private |
Proton conductivity.
|
private |