OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PSD_HO.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__HO__PSD_H
18 #define _FUELCELLSHOP__HO__PSD_H
19 
20 // Include OpenFCST routines:
21 #include <microscale/PSD_base.h>
22 
23 using namespace dealii;
24 
25 
26 namespace FuelCellShop
27 {
28 
29 
30  namespace MicroScale
31  {
90  template <int dim>
91  class HOPSD : public BasePSD<dim>
92  {
93  public:
95 
97 
106  HOPSD();
107 
111  HOPSD (std::string name);
112 
116  virtual ~HOPSD();
117 
122  void initialize ( ParameterHandler &param );
123 
128  void declare_parameters (ParameterHandler &param) const;
129 
134  inline void set_temperature (const SolutionVariable& T_in)
135  {
136  Assert( T_in.get_variablename() == temperature_of_REV, ExcMessage("Wrong solution variable passed in PSD::set_temperature.") );
137  this->T_vector = T_in;
138  }
139 
144  inline void set_capillary_pressure (const SolutionVariable& C_in)
145  {
146  Assert( C_in.get_variablename() == capillary_pressure, ExcMessage("Wrong solution variable passed in PSD::capillary_pressure.") );
147  this->Capillary_pressure_vector = C_in;
148 
149  critical_radius_is_initialized = false;
150  saturation_is_initialized = false;
151  critical_radius_computed.clear();
152  saturation_computed.clear();
153  }
154 
161  inline void set_critical_radius()
162  {
163  get_critical_radius(critical_radius_computed);
164 
165  critical_radius_is_initialized = true;
166  }
167 
174  inline void set_saturation()
175  {
176  get_saturation(saturation_computed);
177 
178  saturation_is_initialized = true;
179  }
194  static const std::string concrete_name;
196 
198 
211  const std::type_info& get_base_type() const
212  {
213  return typeid(HOPSD<dim>);
214  }
215 
225  virtual void get_saturation(std::vector<double>& S) const ;
226  virtual void get_derivative_saturation(std::vector<double>& ) const ;
227 
234  virtual void get_global_saturated_permeability(double& saturated_permeability) const ;
235  virtual void get_global_saturated_permeability(const double,double& ) const ;
243  virtual void get_pore_HO_liquid_saturated_permeability(std::vector<double>& saturated_HO_permeability) const ;
244 
245  virtual void get_derivative_pore_HO_liquid_saturated_permeability(std::vector<double>& ) const ;
246 
247  virtual void get_derivative_pore_HO_liquid_saturated_permeability(const double porosity, const std::vector<double> S,
248  const std::vector<double> ds_dp,
249  std::vector<double>& ) const ;
250 
251  virtual void get_pore_HO_liquid_saturated_permeability(const double porosity, const std::vector<double> S,
252  std::vector<double>& saturated_HO_permeability) const ;
253 
258  virtual void get_relative_liquid_permeability(std::vector<double>& liquid_permeability) const ;
259 
260  virtual void get_derivative_relative_liquid_permeability(std::vector<double>& ) const ;
261 
268  virtual void get_pore_HO_gas_saturated_permeability(std::vector<double>& saturated_HO_permeability) const ;
269 
270  virtual void get_pore_HO_gas_saturated_permeability(const double porosity, const std::vector<double> S,
271  std::vector<double>& saturated_HO_permeability) const ;
272 
277  virtual void get_relative_gas_permeability(std::vector<double>& gas_permeability) const ;
278 
285  virtual void get_liquid_gas_interfacial_surface(std::vector<double>& HO_liquid_gas_interfacial_surface_a) const ;
286 
287  virtual void get_liquid_gas_interfacial_surface_withoutPb(std::vector<double>& HO_liquid_gas_interfacial_surface) const ;
288 
295  virtual void get_derivative_liquid_gas_interfacial_surface_increment(std::vector<double>& ) const ;
296  virtual void get_derivative_liquid_gas_interfacial_surface(std::vector<double>& ) const ;
297 
304  virtual void get_pore_HO_wetted_wall_surface_area(std::vector<double>& HO_wetted_wall_surface_area) const ;
305 
310  virtual void get_wetted_wall_surface_area(std::vector<double>& wetted_wall_surface_area) const ;
311 
318  virtual void get_pore_knudsen_radius_C2(std::vector<double>& knudsen_radius_C2) const ;
319 
326  virtual void get_pore_knudsen_radius_C4(std::vector<double>& knudsen_radius_C4) const ;
327 
332  virtual void get_knudsen_radius(std::vector<double>& knudsen_radius) const ;
333 
337  virtual void get_diffusivity() const ;
338 
339 
352  virtual void get_critical_radius(std::vector<double>& dst) const;
353  virtual void get_derivate_critical_radius(std::vector<double>& dst) const;
354  virtual void get_maximum_cross_sectional_areas(double&) const;
355 
359  virtual void get_PSD_plot(const std::vector<double> ,std::vector<double>&) const;
360 
362 
363  protected:
364 
366 
367 
372  virtual boost::shared_ptr<FuelCellShop::MicroScale::BasePSD <dim>> create_replica (const std::string &psd_section_name)
373  {
374  return boost::shared_ptr<FuelCellShop::MicroScale::BasePSD <dim>> (new FuelCellShop::MicroScale::HOPSD<dim> (psd_section_name));
375  }
377 
379 
380 
383  static HOPSD<dim> const* PROTOTYPE;
385 
387  // DATA //
389 
391 
392 
396  std::vector<double> fHO_k;
397 
401  std::vector<double> rHO_k;
402 
406  std::vector<double> sHO_k;
407 
409 
413 
417 
420  double pressure_c;
421 
424  std::vector<double> critical_radius_computed;
425 
432 
434  std::vector<double> saturation_computed;
435 
441 
443  };
444 
445  } // PSD
446 
447 } // FuelCellShop
448 
449 #endif
static const std::string concrete_name
Concrete name used for objects of this class.
Definition: PSD_HO.h:194
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_HO.h:372
std::vector< double > rHO_k
The r_k is the characteristic pore size of the distribution k.
Definition: PSD_HO.h:401
Definition: system_management.h:78
Hydrophobic Pore Size Distribution.
Definition: PSD_HO.h:91
std::vector< double > critical_radius_computed
Critical_radius_computed by the get_critical_radius function.
Definition: PSD_HO.h:424
std::vector< double > sHO_k
The s_k is the spread of the distribution k.
Definition: PSD_HO.h:406
VariableNames get_variablename() const
Function to get the VariableNames enumeration corresponding to this struct.
Definition: fcst_variables.h:170
void set_saturation()
Member function used to set the saturation at every quadrature point inside the cell.
Definition: PSD_HO.h:174
This structure is used to encapsulate data from constant values and variable solution data that is us...
Definition: fcst_variables.h:86
bool critical_radius_is_initialized
Check if the critical radius has already been computed by set_critical_radius function.
Definition: PSD_HO.h:431
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_HO.h:144
static HOPSD< dim > const * PROTOTYPE
PROTOTYPE is the pointer is the dynamic pointer pointing to the HOPSD class itself.
Definition: PSD_HO.h:383
double contact_angle_HO
Definition: PSD_HO.h:408
void set_temperature(const SolutionVariable &T_in)
Member function used to set the temperature [Kelvin] at every quadrature point inside the cell...
Definition: PSD_HO.h:134
SolutionVariable Capillary_pressure_vector
Capillary pressure at every quadrature point inside the cell.
Definition: PSD_HO.h:416
Definition: system_management.h:76
SolutionVariable T_vector
Temperature at every quadrature point inside the cell.
Definition: PSD_HO.h:412
std::vector< double > saturation_computed
Saturation_computed by the get_critical_radius function.
Definition: PSD_HO.h:434
void set_critical_radius()
Member function used to set the critical radius [nm] at every quadrature point inside the cell...
Definition: PSD_HO.h:161
bool saturation_is_initialized
Check if the saturation has already been computed by set_saturation function.
Definition: PSD_HO.h:440
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_HO.h:211
Pore Size Distribution.
Definition: PSD_base.h:129
std::vector< double > fHO_k
The f_k is the contribution of the log-normal distribution k to the total PSD.
Definition: PSD_HO.h:396
double pressure_c
Constant capillary pressure only for unit_test use.
Definition: PSD_HO.h:420