OpenFCST: The open-source Fuel Cell Simulation Toolbox
|
Class used to store data and provide information regarding the electrolyte. More...
#include <nafion.h>
Public Member Functions | |
Constructors, destructor, and parameter initalization | |
Nafion (const bool) | |
PROTOTYE Constructor. More... | |
Nafion (std::string name="Nafion") | |
Constructor The constructor initialize parameters using the default values. More... | |
~Nafion () | |
Destructor. More... | |
virtual void | declare_parameters (ParameterHandler ¶m) const |
Declare parameters. More... | |
virtual void | initialize (ParameterHandler ¶m) |
Member function used to read in data and initialize the necessary data from the parameter file to compute the coefficients. More... | |
Transport properties and derivatives accessor methods | |
virtual void | sorption_isotherm (std::vector< double > &) const |
Compute the equilibrium water content, , inside the Nafion for vapor-equilibriated case, at every quadrature point in the cell. More... | |
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. More... | |
virtual void | proton_conductivity (double &, const double, const double) const |
Compute the proton conductivity, [S/cm ], inside the nafion, at every quadrature point in the cell. More... | |
virtual void | proton_conductivity (double &) const |
Compute the proton conductivity, [S/cm ], inside the nafion for a case of constant and . More... | |
virtual void | proton_conductivity (std::vector< double > &) const |
Compute the proton conductivity, [S/cm ], inside the nafion, at every quadrature point in the cell. More... | |
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. More... | |
virtual void | water_diffusivity (double &, const double, const double) const |
Compute the water diffusivity, [cm^2/s ], inside the nafion at every quadrature point in the cell. More... | |
virtual void | water_diffusivity (double &) const |
Compute the water diffusivity, [cm^2/s ], inside the nafion for a case of constant and . More... | |
virtual void | water_diffusivity (std::vector< double > &) const |
Compute the water diffusivity, [cm^2/s ], inside the nafion at every quadrature point in the cell. More... | |
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. More... | |
virtual void | electroosmotic_drag (std::vector< double > &) const |
Compute the electro-osmotic drag coefficient inside the nafion at every quadrature point in the cell. More... | |
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. More... | |
virtual void | thermoosmotic_coeff (std::vector< double > &) const |
Compute the thermo-osmotic diffusion coefficient, [gm/ (cm-s-K )], inside the nafion at every quadrature point in the cell. More... | |
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 cell. More... | |
virtual void | oxygen_diffusivity (double &, const double) const |
Compute the oxygen diffusivity, [cm^2/s ], inside the nafion for a given . More... | |
virtual void | oxygen_diffusivity (double &) const |
Compute the oxygen diffusivity, [cm^2/s ], inside the nafion for a constant . More... | |
virtual void | hydrogen_diffusivity (double &) const |
Compute the hydrogen diffusivity, [cm^2/s ], inside the nafion for a constant . More... | |
virtual void | oxygen_diffusivity (std::vector< double > &) const |
Compute the oxygen diffusivity, [cm^2/s ], inside the nafion at every quadrature point in the cell. More... | |
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. More... | |
virtual void | proton_diffusivity (double &) const |
Compute the proton diffusivity, [cm^2/s ], inside the nafion for constant case. More... | |
virtual void | sorption_enthalpy (std::vector< double > &) const |
Compute the enthalpy of sorption [J/mol ] of water in Nafion, at all quadrature points in the cell. More... | |
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. More... | |
Accessor methods for molar enthalpy of sorbed water and its derivatives | |
virtual double | get_Hlambda (const double &) const |
Compute the molar enthalpy, [J/mol ] of sorbed water in the Nafion as a function of . More... | |
virtual double | get_dHlambda_dT (const double &) const |
Compute of sorbed water in the Nafion as a function of . More... | |
virtual double | get_d2Hlambda_dT2 (const double &) const |
Compute of sorbed water in the Nafion as a function of . More... | |
Public Member Functions inherited from FuelCellShop::Material::PolymerElectrolyteBase | |
double | get_density () const |
Get the density [gm/cm^3 ] of the dry polymer electrolyte material. More... | |
double | get_H_O2 () const |
Get Henry's constant [Pa-cm^3/mol ] for oxygen dissolution in the polymer electrolyte. More... | |
double | get_H_H2 () const |
Get Henry's constant [Pa-cm^3/mol ] for hydrogen dissolution in the polymer electrolyte. More... | |
double | get_EW () const |
Get Equivalent Weight (grams of dry polymer electrolyte per moles of ) of the polymer electrolyte material. More... | |
double | get_permittivity () const |
Get permittivity of the polymer electrolyte material. More... | |
void | set_p_t (const double &p_t) |
Specify the total pressure in Pascals. More... | |
void | set_T (const double &Temp) |
Specify the temperature [Kelvin ] in the polymer electrolyte for isothermal case. More... | |
void | set_lambda (const double &L) |
Specify the water content in the polymer electrolyte for constant lambda case. More... | |
void | set_membrane_water_content (const FuelCellShop::SolutionVariable &l_in) |
Set the solution variable, membrane water content . More... | |
void | set_temperature (const FuelCellShop::SolutionVariable &T_in) |
Set the solution variable, temperature [Kelvin ]. More... | |
void | set_water_molar_fraction (const FuelCellShop::SolutionVariable &x_in) |
Set the solution variable, water vapor molar fraction . More... | |
Public Member Functions inherited from FuelCellShop::Material::BaseMaterial | |
void | set_derivative_flags (const std::vector< VariableNames > &flags) |
Set the names of FCST solution variables with respect to which you would like to compute the derivatives of material properties. More... | |
const std::string & | name_material () const |
Return the name of the layer. More... | |
virtual void | print_material_properties () const |
This function prints out the material properties. More... | |
Static Public Attributes | |
static const std::string | concrete_name |
Name of the class. More... | |
Private Member Functions | |
void | modify_parameters (const unsigned int &index, const std::string &method) |
Method to modify parameters, without declaring and initializing the parameter file. More... | |
Private Attributes | |
std::map< std::string, double > | springer_coeffs |
Map for proton conductivity's coefficients; used with "Springer" method. More... | |
Friends | |
Friend class for Unit Testing | |
class | ::NafionTest |
Friend class for testing purposes. More... | |
Instance Delivery | |
static Nafion const * | PROTOTYPE |
Create prototype for the layer. More... | |
virtual boost::shared_ptr < FuelCellShop::Material::PolymerElectrolyteBase > | create_replica () |
This member function is used to create an object of type Nafion material. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from FuelCellShop::Material::PolymerElectrolyteBase | |
static void | declare_PolymerElectrolyte_parameters (ParameterHandler ¶m) |
Function used to declare all the data necessary in the parameter files for all PolymerElectrolyteBase children. More... | |
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 children that will be used in the layer. More... | |
Protected Types inherited from FuelCellShop::Material::PolymerElectrolyteBase | |
typedef std::map< std::string, FuelCellShop::Material::PolymerElectrolyteBase * > | _mapFactory |
This object is used to store all objects of type PolymerElectrolyteBase. More... | |
Protected Member Functions inherited from FuelCellShop::Material::PolymerElectrolyteBase | |
PolymerElectrolyteBase (std::string name) | |
Constructor. More... | |
PolymerElectrolyteBase () | |
Constructor. More... | |
virtual | ~PolymerElectrolyteBase () |
Destructor. More... | |
Protected Member Functions inherited from FuelCellShop::Material::BaseMaterial | |
BaseMaterial () | |
Constructor. More... | |
BaseMaterial (const std::string &name) | |
Constructor. More... | |
virtual | ~BaseMaterial () |
Destructor. More... | |
Static Protected Member Functions inherited from FuelCellShop::Material::PolymerElectrolyteBase | |
static _mapFactory * | get_mapFactory () |
Protected Attributes inherited from FuelCellShop::Material::PolymerElectrolyteBase | |
FuelCellShop::Material::WaterVapor * | water_mat |
Pointer to FuelCellShop::Material::WaterVapor object, dynamically allocated when the class is constructed. More... | |
double | EW |
Equivalent weight. More... | |
double | rho_M |
Dry polymer electrolyte density [gm/cm^3 ]. More... | |
double | H_O2 |
Henry's Constant [Pa-cm^3/mol ] for dissolution of oxygen. More... | |
double | H_H2 |
Henry's Constant [Pa-cm^3/mol ] for dissolution of hydroge. More... | |
double | permittivity |
Permittivity of the material. More... | |
double | T |
Temperature [Kelvins ] for isothermal case. More... | |
double | lambda |
Membrane water content, for constant lambda case. More... | |
double | p_total |
Total pressure (in Pascals). More... | |
double | sigma_p |
Proton conductivity value [S/cm ], given in the parameter file; used with "Constant" method. More... | |
double | diffusion_w |
Diffusion of water in polymer electrolyte (if constant option is used), [cm2/s ]. More... | |
double | given_n_drag |
Given electroosmotic drag value in the parameter file. More... | |
double | given_thermoosmotic_coeff |
Given thermo-osmotic diffusion coefficient [gm/ )] in the parameter file. More... | |
double | given_enthalpy_sorption |
Given enthalpy of sorption of water [J/mol ] in the parameter file. More... | |
double | D_O2 |
Diffusion coefficient of oxygen [cm^2/s ], given in the parameter file. More... | |
double | D_H2 |
Effective diffusion coefficient of hydrogen [cm^2/s ], given in the parameter file. More... | |
double | D_Protons |
Diffusion coefficient of protons [cm^2/s ], given in the parameter file. More... | |
std::string | method_conductivity |
Method/Semi-empirical relation to compute protonic conductivity. More... | |
std::string | method_sorption |
Method to compute equilibrium water content value from sorption isotherm. More... | |
std::string | method_diffusivity |
Method/semi-empirical relation to compute water diffusivity. More... | |
std::string | method_electroosmotic_drag |
Method/semi-empirical relation to compute Electro-osmotic drag. More... | |
std::string | method_thermoosmosis |
Method/semi-empirical relation to compute thermo-osmotic diffusion coefficient. More... | |
std::string | method_enthalpy_sorption |
Method/semi-empirical relation to compute enthalpy of sorption of water. More... | |
FuelCellShop::SolutionVariable | lambda_var |
Solution variable, membrane water content . More... | |
FuelCellShop::SolutionVariable | T_var |
Solution variable, temperature . More... | |
FuelCellShop::SolutionVariable | xwater_var |
Solution variable, water vapor molar fraction . More... | |
Protected Attributes inherited from FuelCellShop::Material::BaseMaterial | |
const std::string | name |
Name of the layer. More... | |
std::vector< VariableNames > | derivative_flags |
Flags for derivatives: These flags are used to request derivatives of material properties. More... | |
Class used to store data and provide information regarding the electrolyte.
In this case the electrolyte that is setup is Nafion. In particular the data coded in this class is obtained from the literature from Nafion 1100, usually from NRE 211 properties.
In the parameter file the following parameters can be specified within the subsections specified below:
As with most routines you need to first declare_parameters, and then initialize. After this the class is ready for use.
See for example FuelCell::OperatingConditions class for more details.
FuelCellShop::Material::Nafion::Nafion | ( | const bool | ) |
PROTOTYE Constructor.
FuelCellShop::Material::Nafion::Nafion | ( | std::string | name = "Nafion" | ) |
Constructor The constructor initialize parameters using the default values.
This is so that if I do not want to call declare_parameters and initialize, I can still use the routine with the hard coded values.
FuelCellShop::Material::Nafion::~Nafion | ( | ) |
Destructor.
|
inlineprivatevirtual |
This member function is used to create an object of type Nafion material.
Reimplemented from FuelCellShop::Material::PolymerElectrolyteBase.
|
virtual |
Declare parameters.
In the parameter file the following parameters can be specified within the subsections specified below:
Reimplemented from FuelCellShop::Material::PolymerElectrolyteBase.
|
virtual |
Compute the electro-osmotic drag coefficient inside the nafion at every quadrature point in the cell.
It takes vector as an input argument and values are passed by reference. Note that the double return method is not implemented for electro-osmotic drag coefficients because it is required only when is one of the solution variables in the application. set_membrane_water_content should be called before using this method.
Reimplemented from FuelCellShop::Material::PolymerElectrolyteBase.
|
virtual |
Compute the derivatives of electro-osmotic drag coefficient, at every quadrature point in the cell.
The derivatives are computed based on the flags set by the set_derivative_flags method. It takes map as an input argument by reference, in which Key
corresponds to the variable about which derivative is being computed, i.e., VariableNames and Value
corresponds to the vector storing the derivative values. set_membrane_water_content should be called before using this method. Also, this method should only be called when atleast there is one derivative flag.
Reimplemented from FuelCellShop::Material::PolymerElectrolyteBase.
|
virtual |
Compute of sorbed water in the Nafion as a function of .
It takes Temperature, [Kelvin
] as input by reference and returns the double value corresponding to the second derivative.
Reimplemented from FuelCellShop::Material::PolymerElectrolyteBase.
|
virtual |
Compute of sorbed water in the Nafion as a function of .
It takes Temperature, [Kelvin
] as input by reference and returns the double value corresponding to the derivative.
Reimplemented from FuelCellShop::Material::PolymerElectrolyteBase.
|
virtual |
Compute the molar enthalpy, [J/mol
] of sorbed water in the Nafion as a function of .
It takes Temperature, [Kelvin
] as input by reference and returns the double value corresponding to molar enthalpy.
Reimplemented from FuelCellShop::Material::PolymerElectrolyteBase.
|
virtual |
Compute the hydrogen diffusivity, [cm^2/s
], inside the nafion for a constant .
Before calling this method, set_T method should be used for setting the constant temperature value. It takes a double as an input argument and value is passed by reference.
Reimplemented from FuelCellShop::Material::PolymerElectrolyteBase.
|
virtual |
Member function used to read in data and initialize the necessary data from the parameter file to compute the coefficients.
Reimplemented from FuelCellShop::Material::PolymerElectrolyteBase.
|
inlineprivate |
Method to modify parameters, without declaring and initializing the parameter file.
It takes two arguments, first one (unsigned int) corresponds to a particular type of method and second one (std::string) corresponds to various implementations for that method type. index corresponds to following methods:
References FuelCellShop::Material::PolymerElectrolyteBase::method_conductivity, FuelCellShop::Material::PolymerElectrolyteBase::method_diffusivity, FuelCellShop::Material::PolymerElectrolyteBase::method_electroosmotic_drag, FuelCellShop::Material::PolymerElectrolyteBase::method_enthalpy_sorption, FuelCellShop::Material::PolymerElectrolyteBase::method_sorption, and FuelCellShop::Material::PolymerElectrolyteBase::method_thermoosmosis.
|
virtual |
Compute the oxygen diffusivity, [cm^2/s
], inside the nafion for a given .
It can be called by either constant or variable solution setting methods to avoid duplicate equations. The first parameter is the output oxygen diffusivity and the second one is temperature, [K
], used as input parameter.
|
virtual |
Compute the oxygen diffusivity, [cm^2/s
], inside the nafion for a constant .
Before calling this method, set_T method should be used for setting the constant temperature value. It takes a double as an input argument and value is passed by reference.
Reimplemented from FuelCellShop::Material::PolymerElectrolyteBase.
|
virtual |
Compute the oxygen diffusivity, [cm^2/s
], inside the nafion at every quadrature point in the cell.
It takes vector as an input argument and values are passed by reference. set_temperature should be called before using this method.
Reimplemented from FuelCellShop::Material::PolymerElectrolyteBase.
|
virtual |
Compute the derivatives of oxygen diffusivity, at every quadrature point in the cell.
The derivatives are computed based on the flags set by the set_derivative_flags method. It takes map as an input argument by reference, in which Key
corresponds to the variable about which derivative is being computed, i.e., VariableNames and Value
corresponds to the vector storing the derivative values. set_temperature should be called before using this method. Also, this method should only be called when atleast there is one derivative flag.
Reimplemented from FuelCellShop::Material::PolymerElectrolyteBase.
|
virtual |
Compute the proton conductivity, [S/cm
], inside the nafion, at every quadrature point in the cell.
It is computed \ as a function of and . It can be called by either constant or variable solution setting methods to avoid duplicate equations. The first parameter is the output bulk proton conductivity and the two following are input parameters such as temperature, [K
], and water content, [-
].
|
virtual |
Compute the proton conductivity, [S/cm
], inside the nafion for a case of constant and .
Before calling this method, set_T method should be used for setting the constant temperature value. If the constant value is required to be different from the default value 12.0, then set_lambda method should be used. It takes a double as an input argument and value is passed by reference.
Reimplemented from FuelCellShop::Material::PolymerElectrolyteBase.
|
virtual |
Compute the proton conductivity, [S/cm
], inside the nafion, at every quadrature point in the cell.
It is computed as a function of and , hence solution setting methods should be called accordingly for them, whether constant or variable. It is recommended to set the constant ones in the initialization of the application, unless you are solving for multi-scale model. It takes vector as an input argument and values are passed by reference.
Reimplemented from FuelCellShop::Material::PolymerElectrolyteBase.
|
virtual |
Compute the derivatives of proton conductivity at every quadrature point in the cell.
The derivatives are computed based on the flags set by the set_derivative_flags method. It takes map as an input argument by reference, in which Key
corresponds to the variable about which derivative is being computed, i.e., VariableNames and Value
corresponds to the vector storing the derivative values. Note that this method should not be used when both and are constant. Hence, atleast set_membrane_water_content or set_temperature should be called before using this method. Also, this method should only be called when atleast there is one derivative flag.
Reimplemented from FuelCellShop::Material::PolymerElectrolyteBase.
|
virtual |
Compute the proton diffusivity, [cm^2/s
], inside the nafion for constant case.
It takes a double as an input argument and value is passed by reference. It basically returns a constant value specified using the parameter file.
Reimplemented from FuelCellShop::Material::PolymerElectrolyteBase.
|
virtual |
Compute the enthalpy of sorption [J/mol
] of water in Nafion, at all quadrature points in the cell.
It takes vector as an input argument and values are passed by reference. Note that the double return method is not implemented for thermo-osmotic diffusion coefficients because it is required only when is one of the solution variables in the application. set_temperature should be called before using this method.
Reimplemented from FuelCellShop::Material::PolymerElectrolyteBase.
|
virtual |
Compute the derivatives of enthalpy of sorption of water, at every quadrature point in the cell.
The derivatives are computed based on the flags set by the set_derivative_flags method. It takes map as an input argument by reference, in which Key
corresponds to the variable about which derivative is being computed, i.e., VariableNames and Value
corresponds to the vector storing the derivative values. set_temperature should be called before using this method. Also, this method should only be called when atleast there is one derivative flag.
Reimplemented from FuelCellShop::Material::PolymerElectrolyteBase.
|
virtual |
Compute the equilibrium water content, , inside the Nafion for vapor-equilibriated case, at every quadrature point in the cell.
It takes a vector as an input argument and values are passed by reference. It is required to call set_water_molar_fraction method atleast before computing sorption isotherm values.
Reimplemented from FuelCellShop::Material::PolymerElectrolyteBase.
|
virtual |
Compute the derivatives for water sorption source terms, , at every quadrature point in the cell.
The derivatives are computed based on the flags set by the set_derivative_flags method. It takes map as an input argument by reference, in which Key
corresponds to the variable about which derivative is being computed, i.e., VariableNames and Value
corresponds to the vector storing the derivative values. It is required to call set_water_molar_fraction method atleast before computing sorption isotherm values. Also, this method should only be called when atleast there is one derivative flag.
Reimplemented from FuelCellShop::Material::PolymerElectrolyteBase.
|
virtual |
Compute the thermo-osmotic diffusion coefficient, [gm/
(cm-s-K
)], inside the nafion at every quadrature point in the cell.
It takes vector as an input argument and values are passed by reference. Note that the double return method is not implemented for thermo-osmotic diffusion coefficients because it is required only when is one of the solution variables in the application. set_temperature should be called before using this method.
Reimplemented from FuelCellShop::Material::PolymerElectrolyteBase.
|
virtual |
Compute the derivatives of thermo-osmotic diffusion coefficient, at every quadrature point in the cell.
The derivatives are computed based on the flags set by the set_derivative_flags method. It takes map as an input argument by reference, in which Key
corresponds to the variable about which derivative is being computed, i.e., VariableNames and Value
corresponds to the vector storing the derivative values. set_temperature should be called before using this method. Also, this method should only be called when atleast there is one derivative flag.
Reimplemented from FuelCellShop::Material::PolymerElectrolyteBase.
|
virtual |
Compute the water diffusivity, [cm^2/s
], inside the nafion at every quadrature point in the cell.
It is computed as a function of and . It can be called by either constant or variable solution setting methods to avoid duplicate equations. The first parameter is the output water diffusivity and the two following are input parameters such as temperature, [K
], and water content, [-
].
|
virtual |
Compute the water diffusivity, [cm^2/s
], inside the nafion for a case of constant and .
Before calling this method, set_T method should be used for setting the constant temperature value. If the constant value is required to be different from the default value 12.0, then set_lambda method should be used. It takes a double as an input argument and value is passed by reference.
Reimplemented from FuelCellShop::Material::PolymerElectrolyteBase.
|
virtual |
Compute the water diffusivity, [cm^2/s
], inside the nafion at every quadrature point in the cell.
It is computed as a function of and , hence solution setting methods should be called accordingly for them, whether constant or variable. It is recommended to set the constant ones in the initialization of the application. Note that this method should not be used when both and are constant. Hence, atleast set_membrane_water_content or set_temperature should be called before using this method. It takes vector as an input argument and values are passed by reference.
Reimplemented from FuelCellShop::Material::PolymerElectrolyteBase.
|
virtual |
Compute the derivatives of water diffusivity at every quadrature point in the cell.
The derivatives are computed based on the flags set by the set_derivative_flags method. It takes map as an input argument by reference, in which Key
corresponds to the variable about which derivative is being computed, i.e., VariableNames and Value
corresponds to the vector storing the derivative values. Note that this method should not be used when both and are constant. Hence, atleast set_membrane_water_content or set_temperature should be called before using this method. Also, this method should only be called when atleast there is one derivative flag.
Reimplemented from FuelCellShop::Material::PolymerElectrolyteBase.
|
friend |
Friend class for testing purposes.
|
static |
Name of the class.
This name is used to select the layer.
|
staticprivate |
Create prototype for the layer.
|
private |
Map for proton conductivity's coefficients; used with "Springer" method.
Conductivity is given by
[S/cm
]