17 #ifndef _FUELCELLSHOP__POROUS__LAYER_H
18 #define _FUELCELLSHOP__POROUS__LAYER_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>
31 #include <boost/concept_check.hpp>
38 using namespace dealii;
40 namespace FuelCellShop
81 void set_gases_and_compute (std::vector<FuelCellShop::Material::PureGas*>& gases_in,
82 const double& pressure_in,
83 const double& temperature_in);
105 inline void set_gases (std::vector<FuelCellShop::Material::PureGas*>& gases_in,
106 const double& pressure_in)
108 Assert(gases_in.size() >= 2, ExcMessage(
"Number of gases should be more than or equal to two in PorousLayer::set_gases method."));
109 this->gases = gases_in;
110 this->pressure = pressure_in;
112 gas_mixture =
nullptr;
120 gas_mixture = &rgas_mixture;
132 const bool& rpermeability_is_constant,
133 const bool& rtortuosity_is_constant)
135 porosity_is_constant = rporosity_is_constant;
136 permeability_is_constant = rpermeability_is_constant;
137 tortuosity_is_constant = rtortuosity_is_constant;
147 this->T_vector = T_in;
157 this->s_vector = s_in;
171 Assert(index > 0 || index < gases.size(), ExcIndexRange(index,0,gases.size()));
179 std::vector<FuelCellShop::Material::PureGas*>
get_gases()
const
190 return this->gas_mixture;
204 T = this->temperature;
223 return porosity_is_constant;
232 return permeability_is_constant;
241 return tortuosity_is_constant;
250 AssertThrow( porosity_is_constant , ExcInternalError() );
260 AssertThrow( porosity_is_constant , ExcInternalError() );
262 for(
unsigned int q = 0; q < dst.size(); ++q)
263 dst[q] = this->get_porosity();
270 void get_porosity(std::vector<double>& dst,
271 const std::vector< Point<dim> >& points)
const;
277 void get_permeability(std::vector< SymmetricTensor<2,dim> >& dst)
const;
283 void get_permeability(std::vector< SymmetricTensor<2,dim> >& dst,
284 const std::vector< Point<dim> >& points)
const;
290 void get_SQRT_permeability(std::vector< SymmetricTensor<2,dim> >& dst)
const;
296 void get_SQRT_permeability(std::vector< SymmetricTensor<2,dim> >& dst,
297 const std::vector< Point<dim> >& points)
const;
303 void get_permeability_INV(std::vector< SymmetricTensor<2,dim> >& dst)
const;
309 void get_permeability_INV(std::vector< SymmetricTensor<2,dim> >& dst,
310 const std::vector< Point<dim> >& points)
const;
316 void get_SQRT_permeability_INV(std::vector< SymmetricTensor<2,dim> >& dst)
const;
322 void get_SQRT_permeability_INV(std::vector< SymmetricTensor<2,dim> >& dst,
323 const std::vector< Point<dim> >& points)
const;
329 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;
356 virtual void print_layer_properties()
const;
398 std::vector<double>& D_b)
const;
421 std::vector<double>& D_b,
422 std::vector<double>& dD_b_dT)
const;
433 std::vector<double>& D_m)
const;
445 std::vector<double>& D_m,
446 std::vector<double>& dD_m_dT)
const;
455 std::vector<double>& D_k)
const;
464 std::vector<double>& D_k,
465 std::vector<double>& dD_k_dT)
const;
472 const std::type_info& info =
typeid(*this);
490 porosity_is_constant =
true;
491 permeability_is_constant =
true;
492 tortuosity_is_constant =
true;
494 gas_mixture =
nullptr;
514 gas_mixture(&gas_mixture)
518 porosity_is_constant =
true;
519 permeability_is_constant =
true;
520 tortuosity_is_constant =
true;
533 virtual void declare_parameters (
const std::string &name, ParameterHandler ¶m)
const;
543 declare_parameters(this->name, param);
550 virtual void initialize (ParameterHandler ¶m);
562 void print_caller_name(
const std::string& caller_name)
const;
573 virtual void gas_diffusion_coefficients(Table< 2, double > &)
const;
585 virtual void derivative_gas_diffusion_coefficients(std::vector< Table< 2, double > >&)
const;
605 std::vector<FuelCellShop::Material::PureGas*>
gases;
SymmetricTensor< 2, dim > permeability_INV
Inverse of user defined constant permeability, 1/m^2.
Definition: porous_layer.h:648
const unsigned int dim
Definition: fcst_constants.h:24
SymmetricTensor< 2, dim > Forchheimer_permeability
User defined constant Forchheimer permeability, 1/m.
Definition: porous_layer.h:658
bool tortuosity_is_constant
Variable defining if the tortuosity is constant.
Definition: porous_layer.h:623
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:105
std::vector< FuelCellShop::Material::PureGas * > gases
Gases inside a porous layer.
Definition: porous_layer.h:605
SolutionVariable s_vector
Liquid water saturation at every quadrature point inside the cell.
Definition: porous_layer.h:687
VariableNames get_variablename() const
Function to get the VariableNames enumeration corresponding to this struct.
Definition: fcst_variables.h:163
SolutionVariable T_vector
Temperature at every quadrature point inside the cell.
Definition: porous_layer.h:684
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:707
SymmetricTensor< 2, dim > SQRT_permeability_INV
Inverse of square root of user defined constant permeability, 1/m.
Definition: porous_layer.h:653
const FuelCellShop::Material::GasMixture *const get_gas_mixture() const
This function returns gas_mixture.
Definition: porous_layer.h:188
void get_p(double &p) const
Return the constant pressure [atm] inside the layer.
Definition: porous_layer.h:211
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:154
This structure is used to encapsulate data from constant values and variable solution data that is us...
Definition: fcst_variables.h:86
SymmetricTensor< 2, dim > permeability
User defined constant permeability, m^2.
Definition: porous_layer.h:638
Table< 2, double > D_ECtheory
Tensor of diffusion coefficients – This are computed with setting up the gas so that they do not need...
Definition: porous_layer.h:691
PorousLayer(const std::string &name)
Constructor.
Definition: porous_layer.h:484
void get_porosity(std::vector< double > &dst) const
This function computes constant porosity in quadrature points of a mesh entity.
Definition: porous_layer.h:258
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:144
bool porosity_is_constant
Variable defining if the porosity is constant.
Definition: porous_layer.h:611
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:695
Definition: system_management.h:75
double get_porosity() const
This function computes constant porosity in quadrature points of a mesh entity.
Definition: porous_layer.h:248
virtual ~PorousLayer()
Destructor.
Definition: porous_layer.h:527
virtual void declare_parameters(ParameterHandler ¶m) const
Declare parameters for a parameter file.
Definition: porous_layer.h:541
PorousLayer()
Constructor.
Definition: porous_layer.h:502
std::vector< double > D_bulk
Vector of bulk diffusion coefficients at every quadrature point inside the cell.
Definition: porous_layer.h:701
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:131
void set_gas_mixture(FuelCellShop::Material::GasMixture &rgas_mixture)
Set gas_mixture.
Definition: porous_layer.h:118
double pressure
Total pressure [atm] used to compute gas diffusivity.
Definition: porous_layer.h:681
Definition: system_management.h:76
FCSTLogStream log
Object used to output data to file and, if file attached recorded to a file as well.
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:169
const bool & get_porosity_is_constant() const
This function returns porosity_is_constant.
Definition: porous_layer.h:221
const bool & get_permeability_is_constant() const
This function returns permeability_is_constant.
Definition: porous_layer.h:230
SymmetricTensor< 2, dim > SQRT_permeability
Square root of user defined constant permeability, m.
Definition: porous_layer.h:643
This class describes properties of gas mixtures.
Definition: GasMixture.h:115
This class is a base class for all pure gases used in FCST.
Definition: PureGas.h:89
Definition: system_management.h:91
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:202
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:669
const bool & get_tortuosity_is_constant() const
This function returns tortuosity_is_constant.
Definition: porous_layer.h:239
double Knudsen_radius
Parameter used to define Knudsen pore radius.
Definition: porous_layer.h:633
double porosity
User defined constant porosity.
Definition: porous_layer.h:628
SymmetricTensor< 2, dim > tortuosity
User defined constant tortuosity.
Definition: porous_layer.h:663
Virtual class used to implement properties that are characteristic of a porous layer.
Definition: porous_layer.h:65
double temperature
Temperature [K] used to compute gas diffusivity.
Definition: porous_layer.h:675
Virtual class used to characterize a generic layer interface.
Definition: base_layer.h:58
FuelCellShop::Material::GasMixture * gas_mixture
Gas mixture.
Definition: porous_layer.h:599
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:179
bool permeability_is_constant
Variable defining if the permeability is constant.
Definition: porous_layer.h:617
PorousLayer(const std::string &name, FuelCellShop::Material::GasMixture &gas_mixture)
Constructor.
Definition: porous_layer.h:510
virtual void pcapillary(std::vector< double > &) const
Compute , at all quadrature points in the cell.
Definition: porous_layer.h:470