OpenFCST: The open-source Fuel Cell Simulation Toolbox
|
Virtual class used to implement properties that are characteristic of a void layer or a porous layer. More...
#include <porous_layer.h>
Public Member Functions | |
Initalization | |
void | set_gases_and_compute (std::vector< FuelCellShop::Material::PureGas * > &gases_in, const double &pressure_in, const double &temperature_in) |
Member function used to store all the gases that are in the pore space in the gas diffusion layer as well as their temperature [Kelvin ] and total pressure [atm ]. | |
void | compute_gas_diffusion (FuelCellShop::Material::PureGas *solute_gas, FuelCellShop::Material::PureGas *solvent_gas) |
Member function used to compute bulk diffusion coefficients and derivatives w.r.t temperature for non-isothermal case and store inside the layer. | |
void | set_gases (std::vector< FuelCellShop::Material::PureGas * > &gases_in, const double &pressure_in) |
Member function used to store all the gases that are in the pore space in the porous layer. | |
void | set_temperature (const SolutionVariable &T_in) |
Member function used to set the temperature ]Kelvin ] at every quadrature point inside the cell. | |
Accessors and info | |
FuelCellShop::Material::PureGas * | get_gas_pointer (int index) const |
Return the FuelCellShop::Material::PureGas pointer that is stored inside the class in the ith position. | |
std::vector < FuelCellShop::Material::PureGas * > | get_gases () const |
Returns the vector of FuelCellShop::Material::PureGas pointers stored in the porous layer. | |
void | get_gas_index (FuelCellShop::Material::PureGas *gas_type, int &index) const |
Return the gas index in the GDL class. | |
void | get_T_and_p (double &T, double &p) const |
Return the constant temperature [Kelvin ] and constant pressure [atm ] inside the layer. | |
void | get_p (double &p) const |
Return the constant pressure [atm ] inside the layer. | |
virtual void | print_layer_properties () const |
This member function is a virtual class that can be used to output to screen information from the layer. | |
virtual bool | test_layer () const |
This virtual class should be used for any derived class to be able to test the functionality of the class. | |
Public Member Functions inherited from FuelCellShop::Layer::BaseLayer< dim > | |
virtual void | set_derivative_flags (const std::vector< VariableNames > &flags) |
Set the variables for which you would like to compute the derivatives. | |
void | set_position (std::vector< Point< dim > > &p) |
Member function used by some applications such as dummyGDL in order to know which value to return. | |
virtual void | set_constant_solution (const double &value, const VariableNames &name) |
Set those solution variables which are constant in the particular application. | |
virtual void | set_solution (const std::vector< SolutionVariable > &) |
If the effective properties in the layer depend on the solution, the solution for a given cell should be passed to the class using this member function. | |
bool | belongs_to_material (const char material_id) |
Check if a given cell belongs to the catalyst layer. | |
const std::string & | name_material () |
Return the name of the layer. | |
virtual const std::type_info & | get_base_type () const |
This member function return the name of the type of layer, i.e. | |
virtual bool | test_layer () |
This virtual class should be used for any derived class to be able to test the functionality of the class. | |
unsigned int | get_material_id () |
Return the material id of the layer. | |
Protected Member Functions | |
Constructors, destructor, and initalization | |
PorousLayer (const std::string &name) | |
Constructor. | |
PorousLayer () | |
Constructor. | |
virtual | ~PorousLayer () |
Destructor. | |
virtual void | declare_parameters (const std::string &name, ParameterHandler ¶m) const |
Declare parameters for a parameter file. | |
virtual void | declare_parameters (ParameterHandler ¶m) const |
Declare parameters for a parameter file. | |
virtual void | initialize (ParameterHandler ¶m) |
Member function used to read in data and initialize the necessary data to compute the coefficients. | |
void | set_parameters (const std::string &object_name, const std::vector< std::string > &name_dvar, const std::vector< double > &value_dvar, ParameterHandler ¶m) |
Member function used to change the values in the parameter file for a given list of parameters. | |
virtual void | set_parameters (const std::vector< std::string > &name_dvar, const std::vector< double > &value_dvar, ParameterHandler ¶m) |
Member function used to change the values in the parameter file for a given list of parameters. | |
Internal accessors and info | |
virtual void | gas_diffusion_coefficients (Table< 2, double > &) const |
Return the molecular diffusivty all the gases assigned to the layer using set_gases_and_compute. | |
virtual void | derivative_gas_diffusion_coefficients (std::vector< Table< 2, double > > &) const |
Return the derivative of the molecular diffusion coefficient with respect to the derivative flags for all the gases assigned to the layer using set_gases_and_compute. | |
Protected Member Functions inherited from FuelCellShop::Layer::BaseLayer< dim > | |
BaseLayer () | |
Constructor. | |
BaseLayer (const std::string &name) | |
Constructor. | |
virtual | ~BaseLayer () |
Destructor. | |
Protected Attributes | |
Internal variables | |
std::string | diffusion_species_name |
If GDL properties are stored inside the class (e.g DummyGDL) then, return the property stored under coefficient_name name. | |
std::vector < FuelCellShop::Material::PureGas * > | gases |
Gases inside the layer. | |
double | temperature |
Temperature [Kelvin ] used to compute gas diffusivity. | |
double | pressure |
Total pressure [atm ] used to compute gas diffusivity. | |
SolutionVariable | T_vector |
Temperature at every quadrature point inside the cell. | |
Table< 2, double > | D_ECtheory |
Tensor of diffusion coefficients – This are computed with setting up the gas so that they do not need to be recomputed all the time. | |
std::vector< Table< 2, double > > | dD_ECtheory_dx |
Vector of tensors for the derivative of the diffusion coefficients – This are computed with setting up the gas so that they do not need to be recomputed all the time. | |
std::vector< double > | D_bulk |
Vector of bulk diffusion coefficients at every quadrature point inside the cell. | |
std::vector< double > | dD_bulk_dT |
Vector of derivative of bulk diffusion coefficients w.r.t temperature, at every quadrature point inside the cell. | |
Protected Attributes inherited from FuelCellShop::Layer::BaseLayer< dim > | |
const std::string | name |
Name of the layer. | |
unsigned int | material_id |
Identification number. | |
std::vector< Point< dim > > | point |
Coordinates of the point where we would like to compute the effective properties. | |
std::vector< VariableNames > | derivative_flags |
Flags for derivatives: These flags are used to request derivatives. | |
std::map< VariableNames, double > | constant_solutions |
Map storing values of solution variables constant in a particular application. | |
Virtual class used to implement properties that are characteristic of a void layer or a porous layer.
This layer is used to setup information needed to compute molecular diffusivities and Knudsen diffusivities (pending implementation) for any gases. Therefore, it provides member functions to specify the gases that exist within the layer as well as their temperature and pressure.
It also inherits all properties of BaseLayer.
Note you cannot make an object of this class since it still lacks many member functions that are necessary for a full layer implementation.
|
inlineprotected |
Constructor.
References temperature_of_REV, and total_pressure.
|
inlineprotected |
Constructor.
|
inlineprotectedvirtual |
Destructor.
void FuelCellShop::Layer::PorousLayer< dim >::compute_gas_diffusion | ( | FuelCellShop::Material::PureGas * | solute_gas, |
FuelCellShop::Material::PureGas * | solvent_gas | ||
) |
Member function used to compute bulk diffusion coefficients and derivatives w.r.t temperature for non-isothermal case and store inside the layer.
This function takes solute and solvent gas as an input argument (Fick's diffusion model). Before calling this function, pressure [atm
] must be set inside the layer, and temperature [Kelvin
] must be set using set_temperature method.
|
inlineprotectedvirtual |
Declare parameters for a parameter file.
Reimplemented from FuelCellShop::Layer::BaseLayer< dim >.
Reimplemented in FuelCellShop::Layer::CatalystLayer< dim >, FuelCellShop::Layer::GasDiffusionLayer< dim >, FuelCellShop::Layer::MicroPorousLayer< dim >, FuelCellShop::Layer::DesignMPL< dim >, FuelCellShop::Layer::AgglomerateCL< dim >, FuelCellShop::Layer::ConventionalCL< dim >, FuelCellShop::Layer::DesignFibrousGDL< dim >, FuelCellShop::Layer::DummyCL< dim >, FuelCellShop::Layer::DummyGDL< dim >, FuelCellShop::Layer::SGL24BA< dim >, and FuelCellShop::Layer::HomogeneousCL< dim >.
References FuelCellShop::Layer::BaseLayer< dim >::declare_parameters().
|
inlineprotectedvirtual |
Declare parameters for a parameter file.
Reimplemented from FuelCellShop::Layer::BaseLayer< dim >.
Reimplemented in FuelCellShop::Layer::GasDiffusionLayer< dim >, FuelCellShop::Layer::MicroPorousLayer< dim >, FuelCellShop::Layer::DesignMPL< dim >, FuelCellShop::Layer::AgglomerateCL< dim >, FuelCellShop::Layer::SGL24BA< dim >, FuelCellShop::Layer::DesignFibrousGDL< dim >, FuelCellShop::Layer::SGL24BC< dim >, FuelCellShop::Layer::DummyGDL< dim >, and FuelCellShop::Layer::DummyCL< dim >.
|
protectedvirtual |
Return the derivative of the molecular diffusion coefficient with respect to the derivative flags for all the gases assigned to the layer using set_gases_and_compute.
This routine uses FuelCellShop::Mixture::ChapmanEnskog to compute the binary diffusivity for each gas with respect to each other. If the layer contains three gases the vector returns D12, D13, D23. For 4 gases, it returns D12, D13, D14, D23, D24, D34 . Derivatives are provided in the vector w.r.t following parameters in the same order as below:
|
protectedvirtual |
Return the molecular diffusivty all the gases assigned to the layer using set_gases_and_compute.
This routine uses FuelCellShop::Mixture::ChapmanEnskog to compute the binary diffusivity for each gas with respect to each other. If the layer contains three gases the vector returns D12, D13, D23. For 4 gases, it returns D12, D13, D14, D23, D24, D34.
void FuelCellShop::Layer::PorousLayer< dim >::get_gas_index | ( | FuelCellShop::Material::PureGas * | gas_type, |
int & | index | ||
) | const |
Return the gas index in the GDL class.
If the gas does not exist in the GDL it will return -1 as the index.
|
inline |
Return the FuelCellShop::Material::PureGas pointer that is stored inside the class in the ith position.
The diffusion coefficient D[i][j] would be the diffusion coefficient of gas type i with j.
|
inline |
Returns the vector of FuelCellShop::Material::PureGas pointers stored in the porous layer.
This method is useful to access all gases which are being transported inside a particular porous layer object.
|
inline |
Return the constant pressure [atm
] inside the layer.
|
inline |
Return the constant temperature [Kelvin
] and constant pressure [atm
] inside the layer.
|
protectedvirtual |
Member function used to read in data and initialize the necessary data to compute the coefficients.
Reimplemented from FuelCellShop::Layer::BaseLayer< dim >.
Reimplemented in FuelCellShop::Layer::CatalystLayer< dim >, FuelCellShop::Layer::GasDiffusionLayer< dim >, FuelCellShop::Layer::MicroPorousLayer< dim >, FuelCellShop::Layer::ConventionalCL< dim >, FuelCellShop::Layer::DesignMPL< dim >, FuelCellShop::Layer::HomogeneousCL< dim >, FuelCellShop::Layer::AgglomerateCL< dim >, FuelCellShop::Layer::DesignFibrousGDL< dim >, FuelCellShop::Layer::DummyGDL< dim >, and FuelCellShop::Layer::DummyCL< dim >.
|
inlinevirtual |
This member function is a virtual class that can be used to output to screen information from the layer.
This function should be re-implemented in each layer with data that is relevant in each case.
Reimplemented from FuelCellShop::Layer::BaseLayer< dim >.
Reimplemented in FuelCellShop::Layer::AgglomerateCL< dim >, and FuelCellShop::Layer::ConventionalCL< dim >.
|
inline |
Member function used to store all the gases that are in the pore space in the porous layer.
Besides this, it takes total pressure [atm
] as input. This method can be particulary used for non-isothermal applications when temperature changes in every cell, hence this method doesn't compute the diffusion coefficients but store the relevant constant data.
solvent
gas
should be the last object inside the input vector. On not ensuring this may not give any errors, as this function may also be used for multi-component gas transport but for fickian diffusion, it may give wrong results. void FuelCellShop::Layer::PorousLayer< dim >::set_gases_and_compute | ( | std::vector< FuelCellShop::Material::PureGas * > & | gases_in, |
const double & | pressure_in, | ||
const double & | temperature_in | ||
) |
Member function used to store all the gases that are in the pore space in the gas diffusion layer as well as their temperature [Kelvin
] and total pressure [atm
].
Then, when computing diffusion, the class will return each one of the diffusion coefficients for the gases. For example, if we pass a vector with for gases, say oxygen and nitrogen, effective_gas_diffusivity will return \( D_{N_2,O_2} \)
|
inlineprotectedvirtual |
Member function used to change the values in the parameter file for a given list of parameters.
Note that this is a static function, therefore it requires as the first argument the string with the name of the section you would like to create for the object of this class.
Reimplemented from FuelCellShop::Layer::BaseLayer< dim >.
References FuelCellShop::Layer::BaseLayer< dim >::set_parameters().
|
inlineprotectedvirtual |
Member function used to change the values in the parameter file for a given list of parameters.
Reimplemented from FuelCellShop::Layer::BaseLayer< dim >.
Reimplemented in FuelCellShop::Layer::DesignMPL< dim >, and FuelCellShop::Layer::DummyGDL< dim >.
|
inline |
Member function used to set the temperature ]Kelvin
] at every quadrature point inside the cell.
This function should particulary be used in the case of non-isothermal application.
References FuelCellShop::SolutionVariable::get_variablename(), and temperature_of_REV.
|
virtual |
This virtual class should be used for any derived class to be able to test the functionality of the class.
|
protected |
Vector of bulk diffusion coefficients at every quadrature point inside the cell.
This particulary stores non-isothermal diffusion coefficients computed using compute_gas_diffusion method.
|
protected |
Tensor of diffusion coefficients – This are computed with setting up the gas so that they do not need to be recomputed all the time.
|
protected |
Vector of derivative of bulk diffusion coefficients w.r.t temperature, at every quadrature point inside the cell.
These are computed using compute_gas_diffusion method.
|
protected |
Vector of tensors for the derivative of the diffusion coefficients – This are computed with setting up the gas so that they do not need to be recomputed all the time.
|
protected |
If GDL properties are stored inside the class (e.g DummyGDL) then, return the property stored under coefficient_name name.
|
protected |
Gases inside the layer.
|
protected |
Total pressure [atm
] used to compute gas diffusivity.
|
protected |
Temperature at every quadrature point inside the cell.
|
protected |
Temperature [Kelvin
] used to compute gas diffusivity.