OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ICCP.h
Go to the documentation of this file.
1 //---------------------------------------------------------------------------
2 // C++ Interface: agglomerate_ionomer_1D.h
3 //
4 // Description: Class that solves solid carbon particle, with Pt surface loading,
5 // surrounded by ionomer thin film
6 //
7 // Authors: Philip Wardlaw,
8 // University of Alberta.
9 //
10 // Copyright: See COPYING file that comes with this distribution
11 //
12 //---------------------------------------------------------------------------
13 
14 #include<micro_scale_base.h>
15 
16 //FCST materials and kinetics classes
17 #include <catalyst_base.h>
19 #include <base_kinetics.h>
20 #include <double_trap_kinetics.h>
21 #include <tafel_kinetics.h>
22 #include <dual_path_kinetics.h>
23 
24 
25 
26 #ifndef ICCO_H_
27 #define ICCO_H_
28 
29 
30 namespace FuelCellShop
31 {
32  namespace MicroScale
33  {
34 
57  class ICCP: public MicroScaleBase {
58 
59  public:
60 
61  static const std::string concrete_name;
62 
63 
74  virtual void set_solution(const std::map<VariableNames,SolutionVariable>& sols,const VariableNames& react, const int& index);
75 
82  virtual SolutionMap compute_current ( );
83 
89  virtual bool has_derivatives(){
90  //numerical for the moment
91  return false;
92  }
93 
97  virtual std::string get_name(){
98  return concrete_name;
99  }
100 
105  virtual double aux_volume_fraction(){
106  return 0;
107  }
108 
109 
113  virtual void print_properties();
114 
115  virtual void make_thread_safe(ParameterHandler &param, unsigned int thread_index);
116 
117 
118  protected:
119 
122 
124  ICCP():
125  F(Constants::F()),
126  pi(Constants::Pi()){
127  non_eq_BC = false;
128  }
129 
131  ICCP(std::string name);
132 
133 
134  virtual void set_structure ();
135  /*
136  * Protected pure virtual member function for declaring parameters, must be implemented
137  * by all children. Parameter structure is hierarchical, therefore children
138  * should call their parent's declare parameter function from their own declare
139  * parameter function.
140  */
141  virtual void declare_parameters (ParameterHandler &param) const;
142 
143  /*
144  * Protected pure virtual member function for initializing parameters, must be implemented
145  * by all children. Parameter structure is hierarchical, therefore children
146  * should call their parent's initialize function from their own initialize function.
147  */
148  virtual void initialize (ParameterHandler &param);
149 
153  virtual boost::shared_ptr<MicroScaleBase> create_replica (){
154  return boost::shared_ptr<MicroScaleBase>( new ICCP());
155  }
156  static ICCP const* PROTOTYPE;
157 
158  private:
159 
160 
161  double residual(const double & c_inner, const double & c_outer);
162 
163 
164  //Stored solutions
165  std::vector<SolutionVariable> reactants;
167 
168  //Transport factors
169  double ActiveArea; //Scaled to agglomerate surface
170  bool non_eq_BC; //If true then use. See residual()
172  double P; //Pressure
173  double HO2N; //Henry's number for O2 in Nafion
174  double DO2N; // diffusion of oxygen in bulk nafion
175 
176  //Pointers to assests obtained from the CL
177  boost::shared_ptr<FuelCellShop::Kinetics::BaseKinetics> kinetics;
178  boost::shared_ptr<FuelCellShop::Material::PolymerElectrolyteBase> electrolyte;
179  boost::shared_ptr<FuelCellShop::Material::CatalystBase> catalyst;
180 
181  //Physical dimensions. Read in as [nm], coverted to [cm]
183 
184  //Some constants
185  const double F, pi;
186  };
187  }
188 
189 }
190 
191 
192 
193 #endif /* ICCO_H_ */
virtual void make_thread_safe(ParameterHandler &param, unsigned int thread_index)
double residual(const double &c_inner, const double &c_outer)
boost::shared_ptr< FuelCellShop::Material::CatalystBase > catalyst
Definition: ICCP.h:179
virtual void declare_parameters(ParameterHandler &param) const
Class that solves solid carbon particle, with Pt surface loading, surrounded by ionomer thin film...
Definition: ICCP.h:57
virtual bool has_derivatives()
Returns true if the class instance can calculate current density derivatives.
Definition: ICCP.h:89
SolutionVariable proton_pot
Definition: ICCP.h:166
VariableNames
The enumeration containing the names of some of the available FCST solution variables and their deriv...
Definition: system_management.h:62
Convenient storage object for SolutionVariables.
Definition: fcst_variables.h:447
const double F
Definition: ICCP.h:185
This structure is used to encapsulate data from constant values and variable solution data that is us...
Definition: fcst_variables.h:86
boost::shared_ptr< FuelCellShop::Material::PolymerElectrolyteBase > electrolyte
Definition: ICCP.h:178
virtual void print_properties()
Print out key micro-structural dimensions, defined by child.
const double pi
Definition: ICCP.h:185
FuelCellShop::Layer::MultiScaleCL< deal_II_dimension > CLPropNames
Convenient typdef for getting properties.
Definition: ICCP.h:121
SolutionVariable electron_pot
Definition: ICCP.h:166
ICCP()
Default Constructor.
Definition: ICCP.h:124
virtual std::string get_name()
Return name of class instance, i.e.
Definition: ICCP.h:97
double non_eq_BC_coeff
Definition: ICCP.h:171
double P
Definition: ICCP.h:172
boost::shared_ptr< FuelCellShop::Kinetics::BaseKinetics > kinetics
Definition: ICCP.h:177
double core_radius
Definition: ICCP.h:182
double DO2N
Definition: ICCP.h:174
bool non_eq_BC
Definition: ICCP.h:170
std::vector< SolutionVariable > reactants
Definition: ICCP.h:165
The base class for micro scale objects in OpenFCST.
Definition: micro_scale_base.h:134
double HO2N
Definition: ICCP.h:173
static ICCP const * PROTOTYPE
Definition: ICCP.h:156
virtual void initialize(ParameterHandler &param)
double film_thickness
Definition: ICCP.h:182
virtual SolutionMap compute_current()
Function used to compute the current density produced by the micro structure.
virtual double aux_volume_fraction()
MicroScale object may have extra contribution to volume of layer, e.g.
Definition: ICCP.h:105
virtual boost::shared_ptr< MicroScaleBase > create_replica()
This member function is used to create an object of type MicroScaleBase.
Definition: ICCP.h:153
static const std::string concrete_name
Definition: ICCP.h:61
double ActiveArea
Definition: ICCP.h:169
double Pi()
.
Definition: fcst_constants.h:43
virtual void set_solution(const std::map< VariableNames, SolutionVariable > &sols, const VariableNames &react, const int &index)
Function for setting the solution map(reactant concentration, phi_s, phi_m, etc.).