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 | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
FuelCellShop::MicroScale::IonomerAgglomerate Class Reference

Class that solves an ionomer-filled agglomerate problem in 1D. More...

#include <agglomerate_ionomer_1D.h>

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

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 &param) const
 
virtual void initialize (ParameterHandler &param)
 
- 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...
 

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 &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
 
- 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...
 
- 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...
 

Detailed Description

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.

Input parameters

LIST OF INPUT PARAMETERS FOR THE CLASS.

* ...
* subsection MicroScale
* subsection IonomerAgglomerateNumerical
* set Proton Conductivity factor = 1.0 #Factor modifying ionomer proton conductivity within the agglomerate and film
* set Non Equilibrium BC Rate constant = 0.13 #Non equilibrium Reaction rate coefficient
* set Use non equilibrium BC = false #Use non-equilibrium BC as described by Suzukhi et al.
* end
* end
*

Constructor & Destructor Documentation

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

Constructors.

FuelCellShop::MicroScale::IonomerAgglomerate::IonomerAgglomerate ( std::string  name)
protected

Member Function Documentation

virtual double FuelCellShop::MicroScale::IonomerAgglomerate::aux_volume_fraction ( )
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 SolutionMap FuelCellShop::MicroScale::IonomerAgglomerate::compute_current ( )
virtual

Main function of the class used to compute the current over the whole agglomerate at the local operating conditions.

Implements FuelCellShop::MicroScale::MicroScaleBase.

int FuelCellShop::MicroScale::IonomerAgglomerate::cont_tolerance ( double  start_tol,
double  end_tol 
)
protected

Function which implements a continuation based on the tolerance.

virtual boost::shared_ptr<FuelCellShop::MicroScale::MicroScaleBase> FuelCellShop::MicroScale::IonomerAgglomerate::create_replica ( )
inlineprotectedvirtual

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

Implements FuelCellShop::MicroScale::MicroScaleBase.

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

static void FuelCellShop::MicroScale::IonomerAgglomerate::dfsub_wrapper ( double &  ,
double  [],
double  [],
double  [] 
)
staticprivate
void FuelCellShop::MicroScale::IonomerAgglomerate::dgsub ( int &  ,
double  [],
double  [] 
)
privatevirtual

The derivatives of the boundary conditions.

See COLDAE.f

Implements FuelCell::ApplicationCore::DAEWrapper.

static void FuelCellShop::MicroScale::IonomerAgglomerate::dgsub_wrapper ( int &  ,
double  [],
double  [] 
)
staticprivate
void FuelCellShop::MicroScale::IonomerAgglomerate::fsub ( double &  ,
double  [],
double  [],
double  [] 
)
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.

static void FuelCellShop::MicroScale::IonomerAgglomerate::fsub_wrapper ( double &  ,
double  [],
double  [],
double  [] 
)
staticprivate
virtual double FuelCellShop::MicroScale::IonomerAgglomerate::get_film_thickness ( )
inlineprotectedvirtual
virtual std::string FuelCellShop::MicroScale::IonomerAgglomerate::get_name ( )
inlinevirtual

Return name of class instance, i.e.

concrete name.

Implements FuelCellShop::MicroScale::MicroScaleBase.

References concrete_name.

virtual double FuelCellShop::MicroScale::IonomerAgglomerate::get_radius ( )
inlineprotectedvirtual
void FuelCellShop::MicroScale::IonomerAgglomerate::gsub ( int &  ,
double  [],
double &   
)
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.

static void FuelCellShop::MicroScale::IonomerAgglomerate::gsub_wrapper ( int &  ,
double  [],
double &   
)
staticprivate
void FuelCellShop::MicroScale::IonomerAgglomerate::guess ( double &  ,
double  [],
double  [],
double  [] 
)
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.

static void FuelCellShop::MicroScale::IonomerAgglomerate::guess_wrapper ( double &  ,
double  [],
double  [],
double  [] 
)
staticprivate
virtual void FuelCellShop::MicroScale::IonomerAgglomerate::initialize ( ParameterHandler &  param)
inlineprotectedvirtual
virtual void FuelCellShop::MicroScale::IonomerAgglomerate::set_structure ( )
protectedvirtual

Set the composition and structure of the agglomerate.

Implements FuelCellShop::MicroScale::MicroScaleBase.

void FuelCellShop::MicroScale::IonomerAgglomerate::setup_DAE_solver ( )
protectedvirtual

Setup the variables in the problem required by the DAE Solver.

Implements FuelCell::ApplicationCore::DAEWrapper.

Member Data Documentation

const std::string FuelCellShop::MicroScale::IonomerAgglomerate::concrete_name
static
double FuelCellShop::MicroScale::IonomerAgglomerate::cond_factor
private

Used to modify the proton conductivity in agglomerate.

Referenced by initialize().

double FuelCellShop::MicroScale::IonomerAgglomerate::endTol
private
double FuelCellShop::MicroScale::IonomerAgglomerate::k_O2
private

Rate constant for non-equilibrium boundary condition.

Referenced by initialize().

double FuelCellShop::MicroScale::IonomerAgglomerate::lambda
private
bool FuelCellShop::MicroScale::IonomerAgglomerate::non_equil_bc
private

Bool to determine if the non-equilibrium boundary condition is used.

Referenced by initialize().

double FuelCellShop::MicroScale::IonomerAgglomerate::prev_effectiveness
private
IonomerAgglomerate const* FuelCellShop::MicroScale::IonomerAgglomerate::PROTOTYPE
staticprotected
double FuelCellShop::MicroScale::IonomerAgglomerate::sigma_p
private

Proton conductivity.

bool FuelCellShop::MicroScale::IonomerAgglomerate::uFD
private

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