OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PSD_HI.h
Go to the documentation of this file.
1 //---------------------------------------------------------------------------
2 //
3 // FCST: Fuel Cell Simulation Toolbox
4 //
5 // Copyright (C) 2013 by Energy Systems Design Laboratory, University of Alberta
6 //
7 // This software is distributed under the MIT License.
8 // For more information, see the README file in /doc/LICENSE
9 //
10 // - Class: PSD_base.h
11 // - Description: Base class for pore size distribution model.
12 // - Developers: 2009-13 by Marc Secanell, University of Alberta
13 // 2013-14 by Jie Zhou, University of Alberta
14 // - $ $
15 //
16 //---------------------------------------------------------------------------
17 #ifndef _FUELCELLSHOP__HI__PSD_H
18 #define _FUELCELLSHOP__HI__PSD_H
19 
20 // Include OpenFCST routines:
21 #include <microscale/PSD_base.h>
22 
23 using namespace dealii;
24 
25 namespace FuelCellShop
26 {
27 
28 
29  namespace MicroScale
30  {
88  template <int dim>
89  class HIPSD
90  :
91  public BasePSD<dim>
92  {
93  public:
95 
96 
103  HIPSD();
104 
108  HIPSD (std::string name);
109 
113  virtual ~HIPSD() {}
114 
118  void declare_parameters (ParameterHandler &param) const;
119 
124  void initialize ( ParameterHandler &param);
125 
130  inline void set_temperature (const SolutionVariable& T_in)
131  {
132  Assert( T_in.get_variablename() == temperature_of_REV, ExcMessage("Wrong solution variable passed in PSD::set_temperature.") );
133  this->T_vector = T_in;
134  }
135 
140  inline void set_capillary_pressure (const SolutionVariable& C_in)
141  {
142  Assert( C_in.get_variablename() == capillary_pressure, ExcMessage("Wrong solution variable passed in PSD::capillary_pressure.") );
143  this->Capillary_pressure_vector = C_in;
144 
145  critical_radius_is_initialized = false;
146  saturation_is_initialized = false;
147  critical_radius_computed.clear();
148  saturation_computed.clear();
149 
150  }
151 
158  inline void set_critical_radius()
159  {
160  get_critical_radius(critical_radius_computed);
161 
162  critical_radius_is_initialized = true;
163  }
164 
171  inline void set_saturation()
172  {
173  this->get_saturation(saturation_computed);
174 
175  saturation_is_initialized = true;
176  }
190  static const std::string concrete_name;
191 
193 
195 
196 
209  const std::type_info& get_base_type() const
210  {
211  return typeid(HIPSD<dim>);
212  }
213 
223  virtual void get_saturation(std::vector<double>& S) const ;
224  virtual void get_derivative_saturation(std::vector<double>& S) const ;
231  virtual void get_global_saturated_permeability(double& saturated_permeability) const ;
232  virtual void get_global_saturated_permeability(const double,double& ) const ;
239  virtual void get_pore_HI_liquid_saturated_permeability(std::vector<double>& ) const ;
240 
241  virtual void get_derivative_pore_HI_liquid_saturated_permeability(std::vector<double>& ) const ;
242 
243  virtual void get_derivative_pore_HI_liquid_saturated_permeability(const double porosity, const std::vector<double> S,
244  const std::vector<double> ds_dp,
245  std::vector<double>& ) const ;
246 
247 
248  virtual void get_pore_HI_liquid_saturated_permeability(const double porosity, const std::vector<double> S,
249  std::vector<double>& saturated_HI_permeability) const ;
250 
255  virtual void get_relative_liquid_permeability(std::vector<double>& liquid_permeability) const ;
256  virtual void get_derivative_relative_liquid_permeability(std::vector<double>& ) const ;
263  virtual void get_pore_HI_gas_saturated_permeability(std::vector<double>& saturated_HI_permeability) const ;
264 
265  virtual void get_pore_HI_gas_saturated_permeability(const double porosity, const std::vector<double> S,
266  std::vector<double>& saturated_HI_permeability) const ;
267 
272  virtual void get_relative_gas_permeability(std::vector<double>& gas_permeability) const ;
273 
280  virtual void get_liquid_gas_interfacial_surface(std::vector<double>& HI_liquid_gas_interfacial_surface_a) const ;
281 
282  virtual void get_liquid_gas_interfacial_surface_withoutPb(std::vector<double>& HI_liquid_gas_interfacial_surface) const ;
283 
290  virtual void get_derivative_liquid_gas_interfacial_surface(std::vector<double>& ) const ;
291 
292  virtual void get_derivative_liquid_gas_interfacial_surface_increment(std::vector<double>& ) const ;
293 
299  virtual void get_pore_HI_wetted_wall_surface_area(std::vector<double>& HI_wetted_wall_surface_area) const ;
300 
305  virtual void get_wetted_wall_surface_area(std::vector<double>& wetted_wall_surface_area) const ;
306 
307 
314  virtual void get_pore_knudsen_radius_C1(std::vector<double>& knudsen_radius_C1) const ;
315 
322  virtual void get_pore_knudsen_radius_C3(std::vector<double>& knudsen_radius_C3) const ;
323 
328  virtual void get_knudsen_radius(std::vector<double>& knudsen_radius) const ;
329 
333  virtual void get_diffusivity() const ;
334 
335 
348  virtual void get_critical_radius(std::vector<double>& dst) const;
349  virtual void get_derivate_critical_radius(std::vector<double>& dst) const;
350  virtual void get_maximum_cross_sectional_areas(double&) const;
354  virtual void get_PSD_plot(const std::vector<double> ,std::vector<double>&) const;
355 
357 
358  protected:
359 
361 
362 
365  virtual boost::shared_ptr<FuelCellShop::MicroScale::BasePSD <dim>> create_replica (const std::string &psd_section_name)
366  {
367  return boost::shared_ptr<FuelCellShop::MicroScale::BasePSD <dim>> (new FuelCellShop::MicroScale::HIPSD<dim> (psd_section_name));
368  }
370 
372 
375  static HIPSD<dim> const* PROTOTYPE;
377 
379  // DATA //
381 
383 
384 
388  std::vector<double> fHI_k;
389 
393  std::vector<double> rHI_k;
394 
398  std::vector<double> sHI_k;
399 
401 
402 
406 
410 
412  double pressure_c;
413 
416  std::vector<double> critical_radius_computed;
417 
424 
426  std::vector<double> saturation_computed;
427 
434  };
435 
436  } // PSD
437 
438 } // FuelCellShop
439 
440 #endif
double contact_angle_HI
Definition: PSD_HI.h:400
Definition: system_management.h:78
virtual boost::shared_ptr< FuelCellShop::MicroScale::BasePSD< dim > > create_replica(const std::string &psd_section_name)
This member function is used to create an object of type psd.
Definition: PSD_HI.h:365
const std::type_info & get_base_type() const
This member function returns a type_info object with the name of the base layer type the inherited cl...
Definition: PSD_HI.h:209
void set_capillary_pressure(const SolutionVariable &C_in)
Member function used to set the capillary pressure [psi] at every quadrature point inside the cell...
Definition: PSD_HI.h:140
static HIPSD< dim > const * PROTOTYPE
PROTOTYPE is the pointer is the dynamic pointer pointing to the HIPSD class itself.
Definition: PSD_HI.h:375
VariableNames get_variablename() const
Function to get the VariableNames enumeration corresponding to this struct.
Definition: fcst_variables.h:170
static const std::string concrete_name
Concrete name used for objects of this class.
Definition: PSD_HI.h:190
This structure is used to encapsulate data from constant values and variable solution data that is us...
Definition: fcst_variables.h:86
std::vector< double > rHI_k
The r_k is the characteristic pore size of the distribution k.
Definition: PSD_HI.h:393
std::vector< double > saturation_computed
Saturation_computed by the get_critical_radius function.
Definition: PSD_HI.h:426
void set_saturation()
Member function used to set the saturation at every quadrature point inside the cell.
Definition: PSD_HI.h:171
Definition: system_management.h:76
std::vector< double > critical_radius_computed
Critical_radius_computed by the get_critical_radius function.
Definition: PSD_HI.h:416
bool critical_radius_is_initialized
Check if the critical radius has already been computed by set_critical_radius function.
Definition: PSD_HI.h:423
void set_temperature(const SolutionVariable &T_in)
Member function used to set the temperature [Kelvin] at every quadrature point inside the cell...
Definition: PSD_HI.h:130
bool saturation_is_initialized
Check if the saturation has already been computed by set_saturation function.
Definition: PSD_HI.h:432
std::vector< double > sHI_k
The s_k is the spread of the distribution k.
Definition: PSD_HI.h:398
virtual ~HIPSD()
Destructor.
Definition: PSD_HI.h:113
SolutionVariable T_vector
Temperature at every quadrature point inside the cell.
Definition: PSD_HI.h:405
Hydrophilic Pore Size Distribution.
Definition: PSD_HI.h:89
std::vector< double > fHI_k
The f_k is the contribution of the log-normal distribution k to the total PSD.
Definition: PSD_HI.h:388
SolutionVariable Capillary_pressure_vector
Capillary pressure at every quadrature point inside the cell.
Definition: PSD_HI.h:409
Pore Size Distribution.
Definition: PSD_base.h:129
double pressure_c
Constant capillary pressure only for unit_test use.
Definition: PSD_HI.h:412
void set_critical_radius()
Member function used to set the critical radius [nm] at every quadrature point inside the cell...
Definition: PSD_HI.h:158