17 #ifndef _FUELCELLSHOP_POLYMER_ELECTROLYTE_MATERIAL_BASE__H
18 #define _FUELCELLSHOP_POLYMER_ELECTROLYTE_MATERIAL_BASE__H
21 #include <base/parameter_handler.h>
22 #include <base/point.h>
23 #include <base/function.h>
24 #include <lac/vector.h>
25 #include <fe/fe_values.h>
37 namespace FuelCellShop
81 iterator->second->declare_parameters(param);
104 std::string polymer_electrolyte_name)
106 boost::shared_ptr<FuelCellShop::Material::PolymerElectrolyteBase > pointer;
112 if (iterator->second)
114 pointer = iterator->second->create_replica();
124 FcstUtilities::log<<
"Concrete name in FuelCellShop::Material::PolymerElectrolyteBase::create_PolymerElectrolyte does not exist"<<std::endl;
128 pointer->initialize(param);
144 const std::type_info& info =
typeid(*this);
146 <<
" called in Class "
147 << info.name() << std::endl;
158 const std::type_info& info =
typeid(*this);
160 <<
" called in Class "
161 << info.name() << std::endl;
171 const std::type_info& info =
typeid(*this);
173 <<
" called in Class "
174 << info.name() << std::endl;
183 const std::type_info& info =
typeid(*this);
185 <<
" called in Class "
186 << info.name() << std::endl;
196 const std::type_info& info =
typeid(*this);
198 <<
" called in Class "
199 << info.name() << std::endl;
209 const std::type_info& info =
typeid(*this);
211 <<
" called in Class "
212 << info.name() << std::endl;
221 const std::type_info& info =
typeid(*this);
223 <<
" called in Class "
224 << info.name() << std::endl;
234 const std::type_info& info =
typeid(*this);
236 <<
" called in Class "
237 << info.name() << std::endl;
247 const std::type_info& info =
typeid(*this);
249 <<
" called in Class "
250 << info.name() << std::endl;
260 const std::type_info& info =
typeid(*this);
262 <<
" called in Class "
263 << info.name() << std::endl;
273 const std::type_info& info =
typeid(*this);
275 <<
" called in Class "
276 << info.name() << std::endl;
286 const std::type_info& info =
typeid(*this);
288 <<
" called in Class "
289 << info.name() << std::endl;
299 const std::type_info& info =
typeid(*this);
301 <<
" called in Class "
302 << info.name() << std::endl;
311 const std::type_info& info =
typeid(*this);
313 <<
" called in Class "
314 << info.name() << std::endl;
323 const std::type_info& info =
typeid(*this);
325 <<
" called in Class "
326 << info.name() << std::endl;
336 const std::type_info& info =
typeid(*this);
338 <<
" called in Class "
339 << info.name() << std::endl;
349 const std::type_info& info =
typeid(*this);
351 <<
" called in Class "
352 << info.name() << std::endl;
362 const std::type_info& info =
typeid(*this);
364 <<
" called in Class "
365 << info.name() << std::endl;
375 const std::type_info& info =
typeid(*this);
377 <<
" called in Class "
378 << info.name() << std::endl;
393 const std::type_info& info =
typeid(*this);
395 <<
" called in Class "
396 << info.name() << std::endl;
406 const std::type_info& info =
typeid(*this);
408 <<
" called in Class "
409 << info.name() << std::endl;
419 const std::type_info& info =
typeid(*this);
421 <<
" called in Class "
422 << info.name() << std::endl;
475 inline void set_T (
const double& Temp)
496 ExcMessage(
"Input solution variable not initialized properly in PolymerElectrolyteBase::set_membrane_water_content method.") );
512 ExcMessage(
"Input solution variable not initialized properly in PolymerElectrolyteBase::set_temperature method.") );
529 ExcMessage(
"Input solution variable not initialized properly in PolymerElectrolyteBase::set_water_molar_fraction method.") );
581 const std::type_info& info =
typeid(*this);
583 <<
" called in Class "
584 << info.name() << std::endl;
592 const std::type_info& info =
typeid(*this);
594 <<
" called in Class "
595 << info.name() << std::endl;
604 typedef std::map< std::string, FuelCellShop::Material::PolymerElectrolyteBase* >
_mapFactory;
625 virtual boost::shared_ptr<FuelCellShop::Material::PolymerElectrolyteBase >
create_replica ()
627 const std::type_info& info =
typeid(*this);
629 <<
" called in Class "
630 << info.name() << std::endl;
double permittivity
Permittivity of the material.
Definition: polymer_electrolyte_material_base.h:653
double H_H2
Henry's Constant [Pa-cm^3/mol] for dissolution of hydroge.
Definition: polymer_electrolyte_material_base.h:649
double given_thermoosmotic_coeff
Given thermo-osmotic diffusion coefficient [gm/(cm-s-K )] in the parameter file.
Definition: polymer_electrolyte_material_base.h:688
double T
Temperature [Kelvins] for isothermal case.
Definition: polymer_electrolyte_material_base.h:657
double D_H2
Effective diffusion coefficient of hydrogen [cm^2/s], given in the parameter file.
Definition: polymer_electrolyte_material_base.h:704
double diffusion_w
Diffusion of water in polymer electrolyte (if constant option is used), [cm2/s].
Definition: polymer_electrolyte_material_base.h:676
double H_O2
Henry's Constant [Pa-cm^3/mol] for dissolution of oxygen.
Definition: polymer_electrolyte_material_base.h:645
double get_H_O2() const
Get Henry's constant [Pa-cm^3/mol] for oxygen dissolution in the polymer electrolyte.
Definition: polymer_electrolyte_material_base.h:436
virtual void hydrogen_diffusivity(double &) const
Compute the oxygen diffusivity, [cm^2/s], inside the polymer electrolyte for constant case...
Definition: polymer_electrolyte_material_base.h:309
virtual void thermoosmotic_coeff(std::vector< double > &) const
Compute the thermo-osmotic diffusion coefficient, [gm/ (cm-s-K )], inside the polymer electrolyte at ...
Definition: polymer_electrolyte_material_base.h:271
std::string method_enthalpy_sorption
Method/semi-empirical relation to compute enthalpy of sorption of water.
Definition: polymer_electrolyte_material_base.h:743
double p_total
Total pressure (in Pascals).
Definition: polymer_electrolyte_material_base.h:665
VariableNames get_variablename() const
Function to get the VariableNames enumeration corresponding to this struct.
Definition: fcst_variables.h:163
const std::string name
Name of the layer.
Definition: base_material.h:155
double get_EW() const
Get Equivalent Weight (grams of dry polymer electrolyte per moles of ) of the polymer electrolyte mat...
Definition: polymer_electrolyte_material_base.h:448
virtual double get_dHlambda_dT(const double &) const
Compute of sorbed water in the polymer electrolyte as a function of .
Definition: polymer_electrolyte_material_base.h:404
FuelCellShop::Material::WaterVapor * water_mat
Pointer to FuelCellShop::Material::WaterVapor object, dynamically allocated when the class is constru...
Definition: polymer_electrolyte_material_base.h:769
FuelCellShop::SolutionVariable lambda_var
Solution variable, membrane water content .
Definition: polymer_electrolyte_material_base.h:752
virtual void declare_parameters(ParameterHandler ¶m) const
Declare parameters for a parameter file.
Definition: polymer_electrolyte_material_base.h:579
FuelCellShop::SolutionVariable xwater_var
Solution variable, water vapor molar fraction .
Definition: polymer_electrolyte_material_base.h:762
VariableNames
The enumeration containing the names of some of the available FCST solution variables and their deriv...
Definition: system_management.h:62
double D_Protons
Diffusion coefficient of protons [cm^2/s], given in the parameter file.
Definition: polymer_electrolyte_material_base.h:709
This structure is used to encapsulate data from constant values and variable solution data that is us...
Definition: fcst_variables.h:86
virtual void proton_conductivity_derivative(std::map< VariableNames, std::vector< double > > &) const
Compute the derivatives of proton conductivity at every quadrature point in the cell.
Definition: polymer_electrolyte_material_base.h:194
void set_water_molar_fraction(const FuelCellShop::SolutionVariable &x_in)
Set the solution variable, water vapor molar fraction .
Definition: polymer_electrolyte_material_base.h:526
virtual void oxygen_diffusivity(std::vector< double > &) const
Compute the oxygen diffusivity, [cm^2/s], inside the polymer electrolyte at every quadrature point in...
Definition: polymer_electrolyte_material_base.h:321
std::string method_electroosmotic_drag
Method/semi-empirical relation to compute Electro-osmotic drag.
Definition: polymer_electrolyte_material_base.h:733
virtual double get_d2Hlambda_dT2(const double &) const
Compute of sorbed water in the polymer electrolyte as a function of .
Definition: polymer_electrolyte_material_base.h:417
virtual void sorption_isotherm(std::vector< double > &) const
Compute the equilibrium water content, , inside the polymer electrolyte for vapor-equilibriated case...
Definition: polymer_electrolyte_material_base.h:142
double D_O2
Diffusion coefficient of oxygen [cm^2/s], given in the parameter file.
Definition: polymer_electrolyte_material_base.h:699
std::string method_diffusivity
Method/semi-empirical relation to compute water diffusivity.
Definition: polymer_electrolyte_material_base.h:728
virtual void water_diffusivity(std::vector< double > &) const
Compute the water diffusivity, [cm^2/s], inside the polymer electrolyte at every quadrature point in...
Definition: polymer_electrolyte_material_base.h:219
Definition: system_management.h:75
double get_density() const
Get the density [gm/cm^3] of the dry polymer electrolyte material.
Definition: polymer_electrolyte_material_base.h:430
Definition: system_management.h:72
virtual void oxygen_diffusivity(double &) const
Compute the oxygen diffusivity, [cm^2/s], inside the polymer electrolyte for constant case...
Definition: polymer_electrolyte_material_base.h:297
double get_H_H2() const
Get Henry's constant [Pa-cm^3/mol] for hydrogen dissolution in the polymer electrolyte.
Definition: polymer_electrolyte_material_base.h:442
virtual void initialize(ParameterHandler ¶m)
Initialize parameters.
Definition: polymer_electrolyte_material_base.h:590
void set_T(const double &Temp)
Specify the temperature [Kelvin] in the polymer electrolyte for isothermal case.
Definition: polymer_electrolyte_material_base.h:475
virtual void sorption_isotherm_derivative(std::map< VariableNames, std::vector< double > > &) const
Compute the derivatives for water sorption source terms, , at every quadrature point in the cell...
Definition: polymer_electrolyte_material_base.h:156
virtual void sorption_enthalpy(std::vector< double > &) const
Compute the enthalpy of sorption [J/mol] of water, at all quadrature points in the cell...
Definition: polymer_electrolyte_material_base.h:360
std::map< std::string, FuelCellShop::Material::PolymerElectrolyteBase * > _mapFactory
This object is used to store all objects of type PolymerElectrolyteBase.
Definition: polymer_electrolyte_material_base.h:604
FCSTLogStream log
Object used to output data to file and, if file attached recorded to a file as well.
virtual void water_diffusivity_derivative(std::map< VariableNames, std::vector< double > > &) const
Compute the derivatives of water diffusivity at every quadrature point in the cell.
Definition: polymer_electrolyte_material_base.h:232
double lambda
Membrane water content, for constant lambda case.
Definition: polymer_electrolyte_material_base.h:662
static _mapFactory * get_mapFactory()
Definition: polymer_electrolyte_material_base.h:612
std::string method_sorption
Method to compute equilibrium water content value from sorption isotherm.
Definition: polymer_electrolyte_material_base.h:723
This class implements the interface to compute the properties of a "standard" polymer electrolyte mem...
Definition: polymer_electrolyte_material_base.h:62
Definition: system_management.h:67
virtual void sorption_enthalpy_derivative(std::map< VariableNames, std::vector< double > > &) const
Compute the derivatives of enthalpy of sorption of water, at every quadrature point in the cell...
Definition: polymer_electrolyte_material_base.h:373
PolymerElectrolyteBase(std::string name)
Constructor.
Definition: polymer_electrolyte_material_base.h:544
double sigma_p
Proton conductivity value [S/cm], given in the parameter file; used with "Constant" method...
Definition: polymer_electrolyte_material_base.h:671
virtual void electroosmotic_drag_derivative(std::map< VariableNames, std::vector< double > > &) const
Compute the derivatives of electro-osmotic drag coefficient, at every quadrature point in the cell...
Definition: polymer_electrolyte_material_base.h:258
double EW
Equivalent weight.
Definition: polymer_electrolyte_material_base.h:637
virtual void oxygen_diffusivity_derivative(std::map< VariableNames, std::vector< double > > &) const
Compute the derivatives of oxygen diffusivity, at every quadrature point in the cell.
Definition: polymer_electrolyte_material_base.h:334
virtual ~PolymerElectrolyteBase()
Destructor.
Definition: polymer_electrolyte_material_base.h:570
void set_membrane_water_content(const FuelCellShop::SolutionVariable &l_in)
Set the solution variable, membrane water content .
Definition: polymer_electrolyte_material_base.h:493
virtual boost::shared_ptr< FuelCellShop::Material::PolymerElectrolyteBase > create_replica()
This member function is used to create an object of type PolymerElectrolyteBase.
Definition: polymer_electrolyte_material_base.h:625
PolymerElectrolyteBase()
Constructor.
Definition: polymer_electrolyte_material_base.h:557
void set_lambda(const double &L)
Specify the water content in the polymer electrolyte for constant lambda case.
Definition: polymer_electrolyte_material_base.h:483
void set_temperature(const FuelCellShop::SolutionVariable &T_in)
Set the solution variable, temperature [Kelvin].
Definition: polymer_electrolyte_material_base.h:509
std::string method_conductivity
Method/Semi-empirical relation to compute protonic conductivity.
Definition: polymer_electrolyte_material_base.h:718
std::string method_thermoosmosis
Method/semi-empirical relation to compute thermo-osmotic diffusion coefficient.
Definition: polymer_electrolyte_material_base.h:738
static boost::shared_ptr< FuelCellShop::Material::PolymerElectrolyteBase > create_PolymerElectrolyte(ParameterHandler ¶m, std::string polymer_electrolyte_name)
Function called in create_CatalystLayer and used to select the appropriate PolymerElectrolyteBase chi...
Definition: polymer_electrolyte_material_base.h:103
double given_n_drag
Given electroosmotic drag value in the parameter file.
Definition: polymer_electrolyte_material_base.h:682
virtual void electroosmotic_drag(std::vector< double > &) const
Compute the electro-osmotic drag coefficient inside the polymer electrolyte at every quadrature point...
Definition: polymer_electrolyte_material_base.h:245
virtual void thermoosmotic_coeff_derivative(std::map< VariableNames, std::vector< double > > &) const
Compute the derivatives of thermo-osmotic diffusion coefficient, at every quadrature point in the cel...
Definition: polymer_electrolyte_material_base.h:284
static void declare_PolymerElectrolyte_parameters(ParameterHandler ¶m)
Function used to declare all the data necessary in the parameter files for all PolymerElectrolyteBase...
Definition: polymer_electrolyte_material_base.h:74
virtual double get_Hlambda(const double &) const
Compute the molar enthalpy, [J/mol] of sorbed water in the polymer electrolyte as a function of ...
Definition: polymer_electrolyte_material_base.h:391
virtual void proton_conductivity(double &) const
Compute the proton conductivity, [S/cm], inside the polymer electrolyte for constant case...
Definition: polymer_electrolyte_material_base.h:169
double rho_M
Dry polymer electrolyte density [gm/cm^3].
Definition: polymer_electrolyte_material_base.h:640
void set_p_t(const double &p_t)
Specify the total pressure in Pascals.
Definition: polymer_electrolyte_material_base.h:467
double given_enthalpy_sorption
Given enthalpy of sorption of water [J/mol] in the parameter file.
Definition: polymer_electrolyte_material_base.h:694
virtual void proton_diffusivity(double &) const
Compute the proton diffusivity, [cm^2/s], inside the polymer electrolyte for constant case...
Definition: polymer_electrolyte_material_base.h:347
double get_permittivity() const
Get permittivity of the polymer electrolyte material.
Definition: polymer_electrolyte_material_base.h:454
virtual void water_diffusivity(double &) const
Compute the water diffusivity, [cm^2/s], inside the polymer electrolyte for constant case...
Definition: polymer_electrolyte_material_base.h:207
Virtual class used to provide the interface for all material classes.
Definition: base_material.h:54
FuelCellShop::SolutionVariable T_var
Solution variable, temperature .
Definition: polymer_electrolyte_material_base.h:757
const bool is_initialized() const
Function to determine whether the structure is initialized or not.
Definition: fcst_variables.h:172
virtual void proton_conductivity(std::vector< double > &) const
Compute the proton conductivity, [S/cm], inside the polymer electrolyte, at every quadrature point i...
Definition: polymer_electrolyte_material_base.h:181
This class describes properties of pure WaterVapor.
Definition: PureGas.h:1157