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

The base class for micro scale objects in OpenFCST. More...

#include <micro_scale_base.h>

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

Public Member Functions

virtual ~MicroScaleBase ()
 Destructor. More...
 
virtual SolutionMap compute_current ()=0
 Function used to compute the current density produced by the micro structure. 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 ()=0
 Returns true if the class instance can calculate current density derivatives. More...
 
virtual std::string get_name ()=0
 Return name of class instance, i.e. More...
 
virtual void print_properties ()=0
 Print out key micro-structural dimensions, defined by child. More...
 
virtual double aux_volume_fraction ()=0
 MicroScale object may have extra contribution to volume of layer, e.g. More...
 
virtual void make_thread_safe (ParameterHandler &param, unsigned int thread_index)=0
 
Initalization
virtual void set_solution (const std::map< VariableNames, SolutionVariable > &, const VariableNames &, const int &)=0
 Function for setting the solution map(reactant concentration, phi_s, phi_m, etc.). More...
 

Static Public Member Functions

Instance Delivery (Functions)
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

Instance Delivery (Types)
typedef std::map< std::string,
MicroScaleBase * > 
_mapFactory
 This object is used to store all objects of type MicroScaleBase. More...
 

Protected Member Functions

void set_layer (FuelCellShop::Layer::MultiScaleCL< deal_II_dimension > *_layer)
 
virtual void declare_parameters (ParameterHandler &param) const =0
 
virtual void initialize (ParameterHandler &param)=0
 
 MicroScaleBase ()
 
virtual void set_structure ()=0
 
Instance Delivery (Private functions)
virtual boost::shared_ptr
< MicroScaleBase
create_replica ()=0
 This member function is used to create an object of MicroScaleBase. More...
 

Static Protected Member Functions

Instance Delivery (Protected functions)
static _mapFactoryget_mapFactory ()
 This member function is used to create an object of type MicroScaleBase. More...
 

Protected Attributes

FuelCellShop::Layer::MultiScaleCL
< deal_II_dimension > * 
layer
 

Detailed Description

The base class for micro scale objects in OpenFCST.

This polymorphic class specifies all the necessary interfaces that must be implemented by a micro scale object in order for it to work with OpenFCST's MultiScaleCl class.

Theory

Micro scale objects primary purpose are to determine reaction rates within the Cl whilst accounting for micro scale mass transport and other losses.

Used to calculate reaction rate of CL micro structure [A/cm^3] and micro scale effectiveness (a ratio of CL micro structure reaction rate normalized by reaction rate calculated using a macro scale homogeneous CL expression).

Input parameters

LIST OF INPUT PARAMETERS FOR THE CLASS.

* ...
* subsection MicroScale
* set Microscale type = IonomerAgglomerateAnalytical # Chose micro scale type,
* #Options as of October 2014 are [ICCP|HybridAgglomerateNumerical|IonomerAgglomerateAnalytical|
* #IonomerAgglomerateNumerical|IonomerAgglomerateSun|PolyAgglomerate|WaterAgglomerateNumerical]
* #Further subsections for micro scale child classes
* end
* ...
*

Usage details

The base class should be used to create an instance of itself, using a deal.ii parameter interface. First declare_MicroScale_parameters must be called. This function will declare all parameters for all children of the microscale base class (Ionomer filled analytical agglomerate, etc.). N.b The parameters will be entered within the current subsection of the parameter object. Once you have read/initialized your param object use the create_MicroStructure function to create your micro scale object. The object will be automatically initialized. Use the compute_current function to obtain values for current density and micro scale effectiveness. Function set_solution should be called before calling compute_current or compute_derivative_current, in order for the results to be valid for your present solution.

*
* //Set up micro scale parameters within catalyst layer context
* param.enter_subsection(multi_scale_catalyst_layer);
*
* //Create an object of MicroScaleBase. In this context <b>this</b> is a pointer to type MultiScaleCL
* boost::shared_ptr<FuelCellShop::MicroScale::MicroScaleBase> micro = FuelCellShop::MicroScale::MicroScaleBase::create_MicroStructure(param,this);
* param.leave_subsection();
*
* //Set solution to micro scale
* micro->set_solution(solution_map, reactant_name, solution_index);
*
* //Solve
* double effectiveness;
* double current_density = micro->compute_current(effectiveness);
*
*
Author
Philip Wardlaw
Date
2014

Member Typedef Documentation

typedef std::map< std::string, MicroScaleBase* > FuelCellShop::MicroScale::MicroScaleBase::_mapFactory
protected

This object is used to store all objects of type MicroScaleBase.

Constructor & Destructor Documentation

virtual FuelCellShop::MicroScale::MicroScaleBase::~MicroScaleBase ( )
inlinevirtual

Destructor.

FuelCellShop::MicroScale::MicroScaleBase::MicroScaleBase ( )
inlineprotected

Member Function Documentation

virtual double FuelCellShop::MicroScale::MicroScaleBase::aux_volume_fraction ( )
pure virtual
virtual SolutionMap FuelCellShop::MicroScale::MicroScaleBase::compute_current ( )
pure virtual

Function used to compute the current density produced by the micro structure.

Several other functionals may be returned (effectiveness, coverages) Returns current density in [A/cm^3 of sold volume]

Solves for solution variables set by the last call to set_solution.

Implemented in FuelCellShop::MicroScale::PolyAgglomerate, FuelCellShop::MicroScale::IonomerAgglomerateSun, FuelCellShop::MicroScale::IonomerAgglomerateAnalytical, FuelCellShop::MicroScale::ICCP, FuelCellShop::MicroScale::WaterAgglomerate, FuelCellShop::MicroScale::IonomerAgglomerate, and FuelCellShop::MicroScale::WaterConicalPoreAgglomerate.

virtual std::vector<double> FuelCellShop::MicroScale::MicroScaleBase::compute_derivative_current ( )
inlinevirtual

Function to compute the derivative of the current density at the local operating conditions.

Returns current density derivatives in [A/cm^3 of solid/liquid phase micro structure]

Solves for solution variables set by the last call to set_solution.

Usage details

Call has_derivatives to check if it is OK to call this function.

Reimplemented in FuelCellShop::MicroScale::AgglomerateBase, FuelCellShop::MicroScale::PolyAgglomerate, FuelCellShop::MicroScale::IonomerAgglomerateSun, and FuelCellShop::MicroScale::IonomerAgglomerateAnalytical.

static boost::shared_ptr<FuelCellShop::MicroScale::MicroScaleBase > FuelCellShop::MicroScale::MicroScaleBase::create_MicroStructure ( ParameterHandler &  param,
FuelCellShop::Layer::MultiScaleCL< deal_II_dimension > *  layer 
)
inlinestatic

Function used to select the appropriate MicroScale type as specified in the ParameterHandler under line.

* set Microscale type = IonomerAgglomerateAnalytical
*

current options are [ IonomerAgglomerateAnalytical | IonomerAgglomerateNumerical | IonomerAgglomerateSun | WaterAgglomerateNumerical | WaterConicalPoreAgglomerate]

The parameter object must already be set to the appropriate subsection.

The MultiScaleCL that calls this function must pass a pointer of itself so that the micro structure class can call MultiScaleCl->get_resources() and ->get_properties().

References get_mapFactory(), and FcstUtilities::log.

Here is the call graph for this function:

virtual boost::shared_ptr<MicroScaleBase> FuelCellShop::MicroScale::MicroScaleBase::create_replica ( )
protectedpure virtual
static void FuelCellShop::MicroScale::MicroScaleBase::declare_MicroScale_parameters ( ParameterHandler &  param)
inlinestatic

Function used to declare all the data necessary in the parameter files for all MicroScale children.

This member function should be used instead of declare_parameters().

Parameters
paramParameterHandler object used to store all information about the simulation. Used to read the parameter file. The parameter object should already be set to the desired subsection.

The parameter subsection would look as follows:

* subsection MicroScale
* set Microscale type = IonomerAgglomerateAnalytical
* subsection AgglomerateBase
* set Radius of the agglomerate [nm] = 200
* set Constant agglomerate parameter [Thickness | Porosity] = Porosity #Variable used to select if thickness or porosity should be constant
* set Thickness of the agglomerate film [nm] = 15
* set Agglomerate porosity = 0.25
* end
*
* subsection NumericalAgglomerateBase
* set Initial condition tolerance factor = 0.05 #Factor determining how often initial solutions are store/updated
* set Database name = main_db #Database existing in FCST/Databases. Setting an unused name will create a new database.
* set Agglomerate Loading Profile = 1 #A list of doubles of the form "1,2.2,3...", used to weight the Pt. loading profile
* end
*
* subsection IonomerAgglomerateNumerical
* set Proton Conductivity factor = 1.0
* set Use non equilibrium BC = false
* set Non Equilibrium BC Rate constant = 1.0
* end
*
* #No parameters so far for other microscale types
*
* end
*
*

References get_mapFactory().

Here is the call graph for this function:

virtual void FuelCellShop::MicroScale::MicroScaleBase::declare_parameters ( ParameterHandler &  param) const
protectedpure virtual
static _mapFactory* FuelCellShop::MicroScale::MicroScaleBase::get_mapFactory ( )
inlinestaticprotected

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

Warning
This class MUST be redeclared in every child.

Referenced by create_MicroStructure(), and declare_MicroScale_parameters().

Here is the caller graph for this function:

virtual std::string FuelCellShop::MicroScale::MicroScaleBase::get_name ( )
pure virtual
virtual bool FuelCellShop::MicroScale::MicroScaleBase::has_derivatives ( )
pure virtual

Returns true if the class instance can calculate current density derivatives.

Usage details

Call this function if unsure whether or not to call compute_derivative_current.

Implemented in FuelCellShop::MicroScale::AgglomerateBase, FuelCellShop::MicroScale::PolyAgglomerate, and FuelCellShop::MicroScale::ICCP.

virtual void FuelCellShop::MicroScale::MicroScaleBase::initialize ( ParameterHandler &  param)
protectedpure virtual
virtual void FuelCellShop::MicroScale::MicroScaleBase::make_thread_safe ( ParameterHandler &  param,
unsigned int  thread_index 
)
pure virtual
virtual void FuelCellShop::MicroScale::MicroScaleBase::print_properties ( )
pure virtual
void FuelCellShop::MicroScale::MicroScaleBase::set_layer ( FuelCellShop::Layer::MultiScaleCL< deal_II_dimension > *  _layer)
inlineprotected

References layer.

virtual void FuelCellShop::MicroScale::MicroScaleBase::set_solution ( const std::map< VariableNames, SolutionVariable > &  ,
const VariableNames ,
const int &   
)
pure virtual

Function for setting the solution map(reactant concentration, phi_s, phi_m, etc.).

First argument provide the map of SolutionVariable. The second argument provide the name of the primary reactant. The final argument is the index of the solution map that the micro scale object should solve for.

This function should be called immediatly before compute_current or compute_derivative_current.

Implemented in FuelCellShop::MicroScale::AgglomerateBase, FuelCellShop::MicroScale::PolyAgglomerate, and FuelCellShop::MicroScale::ICCP.

virtual void FuelCellShop::MicroScale::MicroScaleBase::set_structure ( )
protectedpure virtual

Member Data Documentation

FuelCellShop::Layer::MultiScaleCL<deal_II_dimension>* FuelCellShop::MicroScale::MicroScaleBase::layer
protected

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