OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Private Attributes | List of all members
FuelCellShop::MicroScale::HybridAgglomerate Class Reference

Class that solves a Hybrid (water/ionomer filled) agglomerate problem in 1D. More...

#include <agglomerate_hybrid_1D.h>

Inheritance diagram for FuelCellShop::MicroScale::HybridAgglomerate:
Inheritance graph
[legend]
Collaboration diagram for FuelCellShop::MicroScale::HybridAgglomerate:
Collaboration graph
[legend]

Public Member Functions

virtual std::string get_name ()
 Return name of class instance, i.e. More...
 
virtual double aux_volume_fraction ()
 Functions directly inherited from parent. More...
 
virtual void print_properties ()
 Print out key agglomerate information (name, radius, film thickness, porosity). More...
 
- Public Member Functions inherited from FuelCellShop::MicroScale::WaterAgglomerate
virtual SolutionMap compute_current ()
 Main function of the class used to compute the current over the whole agglomerate at the local operating conditions. More...
 
- Public Member Functions inherited from FuelCellShop::MicroScale::AgglomerateBase
virtual ~AgglomerateBase ()
 
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
 
- Static Public Attributes inherited from FuelCellShop::MicroScale::WaterAgglomerate
static const std::string concrete_name
 

Protected Member Functions

void set_structure ()
 Functions directly inherited from parent. More...
 
 HybridAgglomerate (int verbose=1)
 Constructors. More...
 
 HybridAgglomerate (std::string concrete_name)
 
virtual void declare_parameters (ParameterHandler &param) const
 
virtual void initialize (ParameterHandler &param)
 
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 , $ \epsilon_N $; size of the agglomerate, $ r_{agg} $; and, porosity inside the agglomerate, $ \epsilon_{agg} $, 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...
 
- Protected Member Functions inherited from FuelCellShop::MicroScale::WaterAgglomerate
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)
 
double compute_thickness_agg ()
 Member function to compute the thickness of the agglomerate thin film based on the radius and structure. 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 &param, 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 , $ \epsilon_N $; size of the agglomerate, $ r_{agg} $; and, porosity inside the agglomerate, $ \epsilon_{agg} $, 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

\[ \frac{\partial \epsilon_N^{cat}}{\partial thickness_{agg}} \]

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

\[ \frac{\partial \epsilon_N^{cat}}{\partial \epsilon_{agg}} \]

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 Protected Member Functions inherited from FuelCellShop::MicroScale::WaterAgglomerate
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 _mapFactoryget_mapFactory ()
 This member function is used to create an object of type MicroScaleBase. More...
 

Private Attributes

double hybrid_interface
 Object inheritted from water filled agglomerate. More...
 
double hybrid_core_volume_fraction
 

Instance Delivery

static HybridAgglomerate 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 &param)
 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 &param, 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
 
- Protected Attributes inherited from FuelCellShop::MicroScale::WaterAgglomerate
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< VariableNamessol_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 $ \sum mm[i] $. More...
 
double boundary_0
 Left boundary point. More...
 
double boundary_1
 Right boundary point. More...
 
double * zeta
 Array of boundary points. More...
 
FuelCell::ApplicationCore::DAESolverprob
 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...
 
- Static Protected Attributes inherited from FuelCellShop::MicroScale::WaterAgglomerate
static WaterAgglomerate const * PROTOTYPE
 

Detailed Description

Class that solves a Hybrid (water/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.

Constructor & Destructor Documentation

FuelCellShop::MicroScale::HybridAgglomerate::HybridAgglomerate ( int  verbose = 1)
protected

Constructors.

FuelCellShop::MicroScale::HybridAgglomerate::HybridAgglomerate ( std::string  concrete_name)
protected

Member Function Documentation

virtual double FuelCellShop::MicroScale::HybridAgglomerate::aux_volume_fraction ( )
inlinevirtual

Functions directly inherited from parent.

-double compute_current ( double &E_r) -virtual std::string get_name() MicroScale object may have extra contribution to volume of layer, e.g. water.

The assumption of a hybrid core means that this contribution is different than in the pure water filled case, thus it is reimplemented here.

Reimplemented from FuelCellShop::MicroScale::WaterAgglomerate.

References FuelCellShop::MicroScale::WaterAgglomerate::aux_volume_fraction(), and hybrid_core_volume_fraction.

Here is the call graph for this function:

virtual double FuelCellShop::MicroScale::HybridAgglomerate::compute_epsilon_agg ( )
protectedvirtual

Compute the volume fraction of nafion inside the agglomerate given the catalyst layer ionomer volume fraction , $ \epsilon_N $; size of the agglomerate, $ r_{agg} $; and, porosity inside the agglomerate, $ \epsilon_{agg} $, 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, $ \epsilon_{agg} $.

Note
compute_thickness_agg and compute_epsilon_agg are mutually exclusive and the selection between using one method or the other depends on the inpu parameter:
* set Constant agglomerate parameter [Thickness | Porosity] = Thickness
* set Agglomerate porosity = 0.25 #specify if Porosity is selected in variable above
* set Thickness of the agglomerate film [nm] = 80 #specify if Thickness is selected in property above
*

Reimplemented from FuelCellShop::MicroScale::WaterAgglomerate.

double FuelCellShop::MicroScale::HybridAgglomerate::compute_thickness_agg ( )
protected

Member function to compute the thickness of the agglomerate thin film based on the radius and structure.

For a given ionomer volume fraction, $ \epsilon_N $; size of the agglomerate, $ r_{agg} $; and, porosity inside the agglomerate, $ \epsilon_{agg} $, 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, $ \delta_{agg} $

Note
compute_thickness_agg and compute_epsilon_agg are mutually exclusive and the selection between using one method or the other depends on the inpu parameter:
* set Constant agglomerate parameter [Thickness | Porosity] = Thickness
* set Agglomerate porosity = 0.25 #specify if Porosity is selected in variable above
* set Thickness of the agglomerate film [nm] = 80 #specify if Thickness is selected in property above
*
virtual boost::shared_ptr<FuelCellShop::MicroScale::MicroScaleBase> FuelCellShop::MicroScale::HybridAgglomerate::create_replica ( )
inlineprotectedvirtual

This member function is used to create an object of type MicroScaleBase.

Reimplemented from FuelCellShop::MicroScale::WaterAgglomerate.

virtual void FuelCellShop::MicroScale::HybridAgglomerate::declare_parameters ( ParameterHandler &  param) const
inlineprotectedvirtual
void FuelCellShop::MicroScale::HybridAgglomerate::dfsub ( double &  ,
double  [],
double  [],
double  [] 
)
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.

static void FuelCellShop::MicroScale::HybridAgglomerate::dfsub_wrapper ( double &  ,
double  [],
double  [],
double  [] 
)
staticprotected
void FuelCellShop::MicroScale::HybridAgglomerate::fsub ( double &  ,
double  [],
double  [],
double  [] 
)
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.

static void FuelCellShop::MicroScale::HybridAgglomerate::fsub_wrapper ( double &  ,
double  [],
double  [],
double  [] 
)
staticprotected
virtual std::string FuelCellShop::MicroScale::HybridAgglomerate::get_name ( )
inlinevirtual

Return name of class instance, i.e.

concrete name.

Reimplemented from FuelCellShop::MicroScale::WaterAgglomerate.

References concrete_name.

virtual void FuelCellShop::MicroScale::HybridAgglomerate::initialize ( ParameterHandler &  param)
inlineprotectedvirtual
virtual void FuelCellShop::MicroScale::HybridAgglomerate::print_properties ( )
virtual

Print out key agglomerate information (name, radius, film thickness, porosity).

Reimplemented from FuelCellShop::MicroScale::AgglomerateBase.

void FuelCellShop::MicroScale::HybridAgglomerate::set_structure ( )
protectedvirtual

Functions directly inherited from parent.

-int cont_tolerance (double start_tol, double end_tol) -int cont_cd () -void setup_DAE_solver () -virtual double get_film_thickness() -virtual double get_radius() -void gsub ( int &, double [], double & ) -static void gsub_wrapper ( int &, double [], double & ) -void dgsub ( int &, double [], double [] ) -static void dgsub_wrapper ( int &, double [], double [] ) -void guess ( double &, double [], double [], double [] ) -static void guess_wrapper ( double &, double [], double [], double [] )Set the composition and structure of the agglomerate

Structure is different to the pure water filled case, hence it is reimplemented here.

Implements FuelCellShop::MicroScale::MicroScaleBase.

Member Data Documentation

const std::string FuelCellShop::MicroScale::HybridAgglomerate::concrete_name
static
double FuelCellShop::MicroScale::HybridAgglomerate::hybrid_core_volume_fraction
private

Referenced by aux_volume_fraction(), and initialize().

double FuelCellShop::MicroScale::HybridAgglomerate::hybrid_interface
private

Object inheritted from water filled agglomerate.

-FuelCellShop::Material::LiquidWater water

Transport Parameters Proton Diffusivity in Nafion and water -double D_H_NAF -double D_H_Water

Oxygen Diffusivity in Nafion and water

  • double D_O2_N -double DO2_Water

Henry's Constant for oxygen in nafion -double HO2N -double rel_permittivity_water -double rel_permittivity_Naf -std::vector<std::string> derivative_flags

absolute tolerance in proton concentration double H_tol

HybridAgglomerate const* FuelCellShop::MicroScale::HybridAgglomerate::PROTOTYPE
staticprotected

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