OpenFCST: The open-source Fuel Cell Simulation Toolbox
|
Class that solves a water-filled agglomerate problem in 1D. More...
#include <agglomerate_water_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 | |
int | cont_tolerance (double start_tol, double end_tol) |
Function which implements a continuation based on the tolerance. More... | |
int | cont_cd () |
Function which implements a continuation based on lambda - modifying the source terms to scale back the equations. More... | |
void | setup_DAE_solver () |
Setup the variables in the problem required by the DAE Solver. More... | |
virtual double | get_film_thickness () |
virtual double | get_radius () |
void | set_structure () |
Set the composition and structure of the agglomerate. More... | |
WaterAgglomerate (int verbose=1) | |
Constructors. More... | |
WaterAgglomerate (std::string concrete_name) | |
virtual void | declare_parameters (ParameterHandler ¶m) const |
virtual void | initialize (ParameterHandler ¶m) |
double | compute_thickness_agg () |
Member function to compute the thickness of the agglomerate thin film based on the radius and structure. More... | |
virtual double | compute_epsilon_agg () |
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... | |
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... | |
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... | |
Static Protected 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[]) |
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 | |
FuelCellShop::Material::LiquidWater | water |
Object to store information on water, necessary for water filled agglomerate. More... | |
double | D_H_NAF |
Proton Diffusivity in Nafion and water. More... | |
double | D_H_Water |
double | D_O2_N |
Oxygen Diffusivity in Nafion and water. More... | |
double | DO2_Water |
double | HO2N |
Henry's Constant for oxygen in nafion. More... | |
double | rel_permittivity_water |
double | rel_permittivity_Naf |
double | core_charge_factor |
std::vector< std::string > | derivative_flags |
double | H_tol |
absolute tolerance in proton concentration More... | |
double | lambda |
double | lambda2 |
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... | |
Instance Delivery | |
static WaterAgglomerate 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 |
Class that solves a water-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 water filled model contributes to the porosity of the CL due to the presence of liquid water in the agglomerate primary pores.
Implements FuelCellShop::MicroScale::MicroScaleBase.
Reimplemented in FuelCellShop::MicroScale::HybridAgglomerate.
References FuelCellShop::MicroScale::SphericalAgglomerateGeometry::epsilon_agg, FuelCellShop::Layer::MultiScaleCL< dim >::get_properties(), and FuelCellShop::MicroScale::MicroScaleBase::layer.
Referenced by FuelCellShop::MicroScale::HybridAgglomerate::aux_volume_fraction().
|
virtual |
Main function of the class used to compute the current over the whole agglomerate at the local operating conditions.
Implements FuelCellShop::MicroScale::MicroScaleBase.
|
protectedvirtual |
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.
A Newton loop is used in order to obtain the correct value for the agglomerate porosity, .
Reimplemented in FuelCellShop::MicroScale::HybridAgglomerate.
|
protected |
Member function to compute the thickness of the agglomerate thin film based on the radius and structure.
For a given 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.
A Newton loop is used in order to obtain the correct value for the thickness of the agglomerate film,
|
protected |
Function which implements a continuation based on lambda - modifying the source terms to scale back the equations.
|
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.
Reimplemented in FuelCellShop::MicroScale::HybridAgglomerate.
|
inlineprotectedvirtual |
Reimplemented from FuelCellShop::MicroScale::NumericalAgglomerateBase.
Reimplemented in FuelCellShop::MicroScale::HybridAgglomerate.
References concrete_name, FuelCellShop::Material::LiquidWater::declare_parameters(), FuelCellShop::MicroScale::NumericalAgglomerateBase::declare_parameters(), and water.
|
protectedvirtual |
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.
|
staticprotected |
|
protectedvirtual |
The derivatives of the boundary conditions.
See COLDAE.f
Implements FuelCell::ApplicationCore::DAEWrapper.
|
staticprotected |
|
protectedvirtual |
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.
|
staticprotected |
|
inlineprotectedvirtual |
|
inlinevirtual |
Return name of class instance, i.e.
concrete name.
Implements FuelCellShop::MicroScale::MicroScaleBase.
Reimplemented in FuelCellShop::MicroScale::HybridAgglomerate.
References concrete_name.
|
inlineprotectedvirtual |
|
protectedvirtual |
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.
|
staticprotected |
|
protectedvirtual |
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.
|
staticprotected |
|
inlineprotectedvirtual |
Reimplemented from FuelCellShop::MicroScale::NumericalAgglomerateBase.
Reimplemented in FuelCellShop::MicroScale::HybridAgglomerate.
References concrete_name, core_charge_factor, FuelCellShop::Material::LiquidWater::initialize(), FuelCellShop::MicroScale::NumericalAgglomerateBase::initialize(), and water.
|
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().
|
protected |
Referenced by initialize().
|
protected |
Proton Diffusivity in Nafion and water.
|
protected |
|
protected |
Oxygen Diffusivity in Nafion and water.
|
protected |
|
protected |
|
protected |
absolute tolerance in proton concentration
|
protected |
Henry's Constant for oxygen in nafion.
|
protected |
|
protected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
Object to store information on water, necessary for water filled agglomerate.
Referenced by FuelCellShop::MicroScale::HybridAgglomerate::declare_parameters(), declare_parameters(), FuelCellShop::MicroScale::HybridAgglomerate::initialize(), and initialize().