16 #ifndef _FUELCELLSHOP__POROUS__LAYER_H 
   17 #define _FUELCELLSHOP__POROUS__LAYER_H 
   21 #include <boost/concept_check.hpp> 
   39 using namespace dealii;
 
   41 namespace FuelCellShop
 
   91         void set_gases_and_compute (std::vector<FuelCellShop::Material::PureGas*>& gases_in,
 
   92                                     const double& pressure_in,
 
   93                                     const double& temperature_in);
 
  116         inline void set_gases (std::vector<FuelCellShop::Material::PureGas*>& gases_in,
 
  117                                const double& pressure_in)
 
  119             Assert(gases_in.size() >= 2, ExcMessage(
"Number of gases should be more than or equal to two in PorousLayer::set_gases method."));
 
  120             this->gases = gases_in;
 
  121             this->pressure = pressure_in;
 
  123             gas_mixture = 
nullptr;
 
  131             gas_mixture = &rgas_mixture;
 
  142                                                                   const bool& rpermeability_is_constant,
 
  143                                                                   const bool& rtortuosity_is_constant)
 
  145             porosity_is_constant     = rporosity_is_constant;
 
  146             permeability_is_constant = rpermeability_is_constant;
 
  147             tortuosity_is_constant   = rtortuosity_is_constant;
 
  157             this->p_vector = p_in;
 
  167             this->T_vector = T_in;
 
  177             this->s_vector = s_in;
 
  187             this->capillary_pressure_vector = p_in;
 
  199             Assert(index > 0 || index < gases.size(), ExcIndexRange(index,0,gases.size()));
 
  207         std::vector<FuelCellShop::Material::PureGas*> 
get_gases()
 const {
 
  208             return this->gases; }
 
  214             return this->gas_mixture; }
 
  227             T = this->temperature;
 
  237             p = this->pressure; }
 
  244             return porosity_is_constant; 
 
  251             return permeability_is_constant; }
 
  257             return tortuosity_is_constant; }
 
  263             AssertThrow( porosity_is_constant , ExcInternalError() );
 
  271             AssertThrow( porosity_is_constant , ExcInternalError() );
 
  273             for(
unsigned int q = 0; q < dst.size(); ++q)
 
  274                 dst[q] = this->get_porosity();
 
  280         void get_porosity(std::vector<double>&             dst,
 
  281                           const std::vector< Point<dim> >& points) 
const;
 
  286         void get_permeability(std::vector< SymmetricTensor<2,dim> >& dst) 
const;
 
  291         void get_permeability(std::vector< SymmetricTensor<2,dim> >& dst, 
 
  292                               const std::vector< Point<dim> >&       points) 
const;
 
  297         void get_SQRT_permeability(std::vector< SymmetricTensor<2,dim> >& dst) 
const;
 
  302         void get_SQRT_permeability(std::vector< SymmetricTensor<2,dim> >& dst, 
 
  303                                    const std::vector< Point<dim> >&       points) 
const;
 
  308         void get_permeability_INV(std::vector< SymmetricTensor<2,dim> >& dst) 
const;
 
  313         void get_permeability_INV(std::vector< SymmetricTensor<2,dim> >& dst, 
 
  314                                   const std::vector< Point<dim> >&       points) 
const;
 
  319         void get_SQRT_permeability_INV(std::vector< SymmetricTensor<2,dim> >& dst) 
const;
 
  324         void get_SQRT_permeability_INV(std::vector< SymmetricTensor<2,dim> >& dst, 
 
  325                                        const std::vector< Point<dim> >&       points) 
const;
 
  330         void get_Forchheimer_permeability(std::vector< SymmetricTensor<2,dim> >& dst) 
const;
 
  335         void get_Forchheimer_permeability(std::vector< SymmetricTensor<2,dim> >& dst, 
 
  336                                           const std::vector< Point<dim> >&       points) 
const;
 
  342         void get_tortuosity(std::vector< SymmetricTensor<2,dim> >& dst) 
const;
 
  348         void get_tortuosity(std::vector< SymmetricTensor<2,dim> >& dst, 
 
  349                             const std::vector< Point<dim> >&       points) 
const;
 
  376             const std::type_info& info = 
typeid(*this);
 
  378             << 
" called in Class " 
  379             << info.name() << std::endl;
 
  393             const std::type_info& info = 
typeid(*this);
 
  395             << 
" called in Class " 
  396             << info.name() << std::endl;
 
  478                                                 std::vector<double>& dD_b_dT)
 const 
  481              dD_b_dT = this->dD_bulk_dT;
 
  496             D_m = this->D_molecular;
 
  510                                                   std::vector<double>& dD_m_dT)
 const 
  512              D_m = this->D_molecular;
 
  513              dD_m_dT = this->dD_molecular_dT;
 
  534                                std::vector<double>& dD_dT)
 const 
  537              dD_dT = this->dD_k_dT;
 
  544             const std::type_info& info = 
typeid(*this);
 
  550             const std::type_info& info = 
typeid(*this);
 
  556             const std::type_info& info = 
typeid(*this);
 
  562             const std::type_info& info = 
typeid(*this);
 
  568             const std::type_info& info = 
typeid(*this);
 
  574             const std::type_info& info = 
typeid(*this);
 
  580             const std::type_info& info = 
typeid(*this);
 
  586             const std::type_info& info = 
typeid(*this);
 
  602                                        std::vector<double>& D_k) 
const;
 
  621                                        std::vector<double>& D_k,
 
  622                                        std::vector<double>& dD_k_dT) 
const;
 
  631         virtual void print_layer_properties() 
const;
 
  648             porosity_is_constant     = 
true;
 
  649             permeability_is_constant = 
true;
 
  650             tortuosity_is_constant   = 
true;
 
  652             gas_mixture = 
nullptr;
 
  654             psd_pointer = 
nullptr;
 
  674         gas_mixture(&gas_mixture)
 
  678             porosity_is_constant     = 
true;
 
  679             permeability_is_constant = 
true;
 
  680             tortuosity_is_constant   = 
true;
 
  683             psd_pointer = 
nullptr;
 
  695         virtual void declare_parameters (
const std::string &name, ParameterHandler ¶m) 
const;
 
  705             declare_parameters(this->name, param);
 
  712         virtual void initialize (ParameterHandler ¶m);
 
  724         void print_caller_name(
const std::string& caller_name) 
const;
 
  737         virtual void gas_diffusion_coefficients(Table< 2, double > &) 
const;
 
  751         virtual void derivative_gas_diffusion_coefficients(std::vector< Table< 2, double > >&) 
const;
 
  769         std::vector<FuelCellShop::Material::PureGas*> 
gases;
 
  904         boost::shared_ptr< FuelCellShop::MicroScale::BasePSD<dim> > 
PSD; 
 
void Knudsen_diffusion(std::vector< double > &D) const 
Member function used to get the Knudsen diffusivity in the layer after calling compute_gas_diffusion...
Definition: porous_layer.h:522
 
SymmetricTensor< 2, dim > permeability_INV
Inverse of user defined constant permeability, 1/m^2. 
Definition: porous_layer.h:806
 
void Knudsen_diffusion(std::vector< double > &D, std::vector< double > &dD_dT) const 
Member function used to compute the Knudsen diffusivity in the layer.after calling compute_gas_diffus...
Definition: porous_layer.h:533
 
virtual void effective_gas_diffusivity(Table< 2, double > &D_eff) const 
Return the effective diffusivty in the GDL for all the gases assigned to the layer using set_gases_an...
Definition: porous_layer.h:374
 
virtual void gas_diffusion_coefficient(std::vector< double > &D_b) const 
Member function used to compute diffusion for a solute_gas, solvent_gas combination at a given temper...
Definition: porous_layer.h:451
 
Definition: system_management.h:78
 
const unsigned int dim
Definition: fcst_constants.h:23
 
virtual void derivative_relative_liquid_permeablity_PSD(std::vector< double > &) const 
Definition: porous_layer.h:578
 
FuelCellShop::Material::PureGas * solvent_gas
Pointer used to store the solute gas for computing binary diffusion coefficients. ...
Definition: porous_layer.h:917
 
SymmetricTensor< 2, dim > Forchheimer_permeability
User defined constant Forchheimer permeability, 1/m. 
Definition: porous_layer.h:816
 
bool tortuosity_is_constant
Variable defining if the tortuosity is constant. 
Definition: porous_layer.h:778
 
virtual void relative_liquid_permeability_PSD(std::vector< Tensor< 2, dim > > &) const 
Definition: porous_layer.h:572
 
std::vector< double > D_k
Vector of Knudsen diffusion coefficients at every quadrature point inside the cell in m^2/s...
Definition: porous_layer.h:875
 
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...
Definition: porous_layer.h:116
 
std::vector< FuelCellShop::Material::PureGas * > gases
Gases inside a porous layer. 
Definition: porous_layer.h:769
 
virtual void derivative_effective_gas_diffusivity(std::map< VariableNames, std::vector< Tensor< 2, dim > > > &) const 
Return the derivative of effective diffusivity w.r.t solution variables/design parameters in the GDL...
Definition: porous_layer.h:410
 
SolutionVariable s_vector
Liquid water saturation at every quadrature point inside the cell [-]. 
Definition: porous_layer.h:848
 
VariableNames get_variablename() const 
Function to get the VariableNames enumeration corresponding to this struct. 
Definition: fcst_variables.h:170
 
bool PSD_is_used
Boolean flag to specify if a PSD is to be used to estimate saturation, permeability, etc. 
Definition: porous_layer.h:898
 
SolutionVariable T_vector
Temperature at every quadrature point inside the cell in [K]. 
Definition: porous_layer.h:845
 
std::vector< double > dD_bulk_dT
Vector of derivative of bulk diffusion coefficients w.r.t temperature, at every quadrature point insi...
Definition: porous_layer.h:895
 
std::string PSD_type
PSD class type from input file. 
Definition: porous_layer.h:901
 
SymmetricTensor< 2, dim > SQRT_permeability_INV
Inverse of square root of user defined constant permeability, 1/m. 
Definition: porous_layer.h:811
 
virtual void effective_gas_diffusivity(Table< 2, Tensor< 2, dim > > &D_eff) const 
Return a tensor with the effective diffusivty in the GDL for all the gases assigned to the layer usin...
Definition: porous_layer.h:391
 
const FuelCellShop::Material::GasMixture *const get_gas_mixture() const 
This function returns gas_mixture. 
Definition: porous_layer.h:213
 
void molecular_gas_diffusion_coefficient(std::vector< double > &D_m, std::vector< double > &dD_m_dT) const 
Member function used to compute molecular diffusion for a solute_gas, solvent_gas combination at a gi...
Definition: porous_layer.h:509
 
void get_p(double &p) const 
Return the constant pressure [atm] inside the layer. 
Definition: porous_layer.h:236
 
VariableNames
The enumeration containing the names of some of the available FCST solution variables and their deriv...
Definition: system_management.h:63
 
void set_saturation(const SolutionVariable &s_in)
Member function used to set the liquid water saturation at every quadrature point inside the cell...
Definition: porous_layer.h:174
 
This structure is used to encapsulate data from constant values and variable solution data that is us...
Definition: fcst_variables.h:86
 
virtual void derivative_saturation_from_capillary_equation_PSD(std::vector< double > &) const 
Definition: porous_layer.h:554
 
virtual void interfacial_surface_area_PSD(std::vector< double > &) const 
Definition: porous_layer.h:566
 
void set_capillary_pressure(const SolutionVariable &p_in)
Member function used to set the liquid water saturation at every quadrature point inside the cell...
Definition: porous_layer.h:184
 
SymmetricTensor< 2, dim > permeability
User defined constant permeability, m^2. 
Definition: porous_layer.h:796
 
Table< 2, double > D_ECtheory
Tensor of diffusion coefficients This are computed with setting up the gas so that they do not need t...
Definition: porous_layer.h:856
 
PorousLayer(const std::string &name)
Constructor. 
Definition: porous_layer.h:642
 
void get_porosity(std::vector< double > &dst) const 
This function computes constant porosity in quadrature points of a mesh entity. 
Definition: porous_layer.h:270
 
void set_temperature(const SolutionVariable &T_in)
Member function used to set the temperature [Kelvin] at every quadrature point inside the cell...
Definition: porous_layer.h:164
 
std::vector< double > dD_k_dT
Vector of derivatives for Knudsen diffusion coefficients w.r.t temperature, at every quadrature in m^...
Definition: porous_layer.h:880
 
bool porosity_is_constant
Variable defining if the porosity is constant. 
Definition: porous_layer.h:772
 
std::vector< Table< 2, double > > dD_ECtheory_dx
Vector of tensors for the derivative of the diffusion coefficients – This are computed with setting u...
Definition: porous_layer.h:860
 
Definition: system_management.h:76
 
double get_porosity() const 
This function computes constant porosity in quadrature points of a mesh entity. 
Definition: porous_layer.h:262
 
virtual ~PorousLayer()
Destructor. 
Definition: porous_layer.h:689
 
virtual void declare_parameters(ParameterHandler ¶m) const 
Declare parameters for a parameter file. 
Definition: porous_layer.h:703
 
PorousLayer()
Constructor. 
Definition: porous_layer.h:662
 
void set_pressure(const SolutionVariable &p_in)
Member function used to set the temperature [Kelvin] at every quadrature point inside the cell...
Definition: porous_layer.h:154
 
std::vector< double > D_bulk
Vector of bulk diffusion coefficients at every quadrature point inside the cell. 
Definition: porous_layer.h:887
 
void set_porosity_permeability_tortuosity_booleans(const bool &rporosity_is_constant, const bool &rpermeability_is_constant, const bool &rtortuosity_is_constant)
Set. 
Definition: porous_layer.h:141
 
void set_gas_mixture(FuelCellShop::Material::GasMixture &rgas_mixture)
Set gas_mixture. 
Definition: porous_layer.h:129
 
double pressure
Total pressure [atm] used to compute gas diffusivity. 
Definition: porous_layer.h:839
 
Definition: system_management.h:77
 
virtual void effective_gas_diffusivity(std::vector< Tensor< 2, dim > > &) const 
Return the effective diffusivity [m^2/s] in the GDL. 
Definition: porous_layer.h:363
 
virtual void saturated_liquid_permeablity_PSD(double &) const 
Definition: porous_layer.h:560
 
FCSTLogStream log
Object used to output data to file and, if file attached recorded to a file as well. 
 
std::vector< double > dD_molecular_dT
Vector of derivatives for molecular diffusion coefficients w.r.t temperature, at every quadrature in ...
Definition: porous_layer.h:870
 
FuelCellShop::Material::PureGas * get_gas_pointer(int index) const 
Return the FuelCellShop::Material::PureGas pointer that is stored inside the class in the ith positio...
Definition: porous_layer.h:197
 
const bool & get_porosity_is_constant() const 
This function returns porosity_is_constant. 
Definition: porous_layer.h:242
 
const bool & get_permeability_is_constant() const 
This function returns permeability_is_constant. 
Definition: porous_layer.h:250
 
boost::shared_ptr< FuelCellShop::MicroScale::BasePSD< dim > > PSD
Pointer to the PSD object. 
Definition: porous_layer.h:904
 
SymmetricTensor< 2, dim > SQRT_permeability
Square root of user defined constant permeability, m. 
Definition: porous_layer.h:801
 
This class describes properties of gas mixtures. 
Definition: GasMixture.h:102
 
This class is a base class for all pure gases used in OpenFCST. 
Definition: PureGas.h:88
 
Definition: system_management.h:92
 
SolutionVariable capillary_pressure_vector
Liquid water capillary pressure at every quadrature point inside the cell in [Pa]. 
Definition: porous_layer.h:851
 
void get_T_and_p(double &T, double &p) const 
Return the constant temperature [Kelvin] and constant pressure [atm] inside the layer. 
Definition: porous_layer.h:226
 
std::string diffusion_species_name
If GDL properties are stored inside the class (e.g DummyGDL) then, return the property stored under c...
Definition: porous_layer.h:827
 
bool use_Bosanquet
Boolean flag that specifies if Knudsen effects should be accounted for. 
Definition: porous_layer.h:786
 
const bool & get_tortuosity_is_constant() const 
This function returns tortuosity_is_constant. 
Definition: porous_layer.h:256
 
double Knudsen_radius
Parameter used to define Knudsen pore radius. 
Definition: porous_layer.h:791
 
double porosity
User defined constant porosity. 
Definition: porous_layer.h:781
 
FuelCellShop::Material::PureGas * solute_gas
Pointer used to store the solute gas for computing binary diffusion coefficients. ...
Definition: porous_layer.h:912
 
virtual void saturation_from_capillary_equation(std::vector< double > &) const 
Definition: porous_layer.h:548
 
void molecular_gas_diffusion_coefficient(std::vector< double > &D_m) const 
Member function used to compute molecular diffusion for a solute_gas, solvent_gas combination at a gi...
Definition: porous_layer.h:494
 
SymmetricTensor< 2, dim > tortuosity
User defined constant tortuosity. 
Definition: porous_layer.h:821
 
virtual void derivative_interfacial_surface_area_PSD(std::vector< double > &) const 
Definition: porous_layer.h:584
 
Pore Size Distribution. 
Definition: PSD_base.h:129
 
Virtual class used to implement properties that are characteristic of a porous layer. 
Definition: porous_layer.h:75
 
std::vector< double > D_molecular
Vector of molecular diffusion coefficients at every quadrature point inside the cell in m^2/s...
Definition: porous_layer.h:865
 
double temperature
Temperature [K] used to compute gas diffusivity. 
Definition: porous_layer.h:833
 
Virtual class used to characterize a generic layer interface. 
Definition: base_layer.h:58
 
virtual void gas_diffusion_coefficient(std::vector< double > &D_b, std::vector< double > &dD_b_dT) const 
Member function used to compute diffusion for a solute_gas, solvent_gas combination at a given temper...
Definition: porous_layer.h:477
 
SolutionVariable p_vector
Pressure at every quadrature point inside the cell in [Pa]. 
Definition: porous_layer.h:842
 
FuelCellShop::MicroScale::BasePSD< dim > * psd_pointer
Pointer to the PSD object. 
Definition: porous_layer.h:907
 
FuelCellShop::Material::GasMixture * gas_mixture
Gas mixture. 
Definition: porous_layer.h:763
 
std::vector< FuelCellShop::Material::PureGas * > get_gases() const 
Returns the vector of FuelCellShop::Material::PureGas pointers stored in the porous layer...
Definition: porous_layer.h:207
 
bool permeability_is_constant
Variable defining if the permeability is constant. 
Definition: porous_layer.h:775
 
PorousLayer(const std::string &name, FuelCellShop::Material::GasMixture &gas_mixture)
Constructor. 
Definition: porous_layer.h:670
 
virtual void pcapillary(std::vector< double > &) const 
Compute , at all quadrature points in the cell. 
Definition: porous_layer.h:542