OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PSD_dual.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__DUAL__PSD_H
18 #define _FUELCELLSHOP__DUAL__PSD_H
19 
20 // Include deal.II classes
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>
26 
27 //Include STL
28 #include <cmath>
29 #include <iostream>
30 
31 // Include OpenFCST routines:
34 #include "utils/fcst_utilities.h"
35 #include "utils/fcst_constants.h"
36 #include "PSD_base.h"
37 #include "PSD_HI.h"
38 #include "PSD_HO.h"
39 
40 
41 
42 using namespace dealii;
43 
44 namespace FuelCellShop
45 {
46 
47 
48  namespace MicroScale
49  {
113  template <int dim>
114  class DualPSD : public BasePSD<dim>
115  {
116  public:
117 
119 
120 
123  DualPSD();
124 
128  DualPSD (std::string name);
129 
133  virtual ~DualPSD();
134 
138  void declare_parameters (ParameterHandler &param) const;
143  void initialize (ParameterHandler &param );
144 
149  inline void set_temperature (const SolutionVariable& T_in)
150  {
151  Assert( T_in.get_variablename() == temperature_of_REV, ExcMessage("Wrong solution variable passed in PSD::set_temperature.") );
152  this->T_vector = T_in;
153  }
154 
159  inline void set_capillary_pressure (const SolutionVariable& C_in)
160  {
161  Assert( C_in.get_variablename() == capillary_pressure, ExcMessage("Wrong solution variable passed in PSD::capillary_pressure.") );
162  this->Capillary_pressure_vector = C_in;
163 
164  psd_hi->set_capillary_pressure(C_in);
165  psd_ho->set_capillary_pressure(C_in);
166  }
167 
174  inline void set_critical_radius()
175  {
176  psd_hi->set_critical_radius();
177  psd_ho->set_critical_radius();
178 
179  }
180 
187  inline void set_saturation()
188  {
189  psd_hi->set_saturation();
190  psd_ho->set_saturation();
191  }
192 
194 
196 
197 
211  static const std::string concrete_name;
212 
214 
216 
217 
226  virtual void get_saturation(std::vector<double>& S) const ;
227 
234  virtual void get_global_saturated_permeability(double& saturated_permeability) const ;
235 
242  virtual void get_relative_liquid_permeability(std::vector<double>& liquid_permeability) const ;
243 
250  virtual void get_relative_gas_permeability(std::vector<double>& gas_permeability) const ;
251 
258  virtual void get_liquid_gas_interfacial_surface(std::vector<double>& liquid_gas_interfacial_surface) const ;
259 
266  virtual void get_wetted_wall_surface_area(std::vector<double>& wetted_wall_surface_area) const ;
267 
274  virtual void get_knudsen_radius(std::vector<double>& knudsen_radius) const ;
275 
279  virtual void get_diffusivity() const ;
280 
289  virtual const double get_critical_radius(double& p_c) const;
290 
299  virtual void get_critical_radius(std::vector<double>& dst) const;
300 
301 
303 
304  protected:
306 
307 
312  virtual boost::shared_ptr<FuelCellShop::MicroScale::BasePSD<dim> > create_replica (const std::string &psd_section_name)
313  {
314  return boost::shared_ptr<FuelCellShop::MicroScale::BasePSD<dim> > (new FuelCellShop::MicroScale::DualPSD<dim> (psd_section_name));
315  }
317 
319 
320 
323  static DualPSD<dim> const* PROTOTYPE;
325 
327  // DATA //
329 
331 
332 
336 
340 
343 
346 
348  };
349 
350  } // PSD
351 
352 } // FuelCellShop
353 
354 #endif
Definition: system_management.h:77
Hydrophobic Pore Size Distribution.
Definition: PSD_HO.h:106
VariableNames get_variablename() const
Function to get the VariableNames enumeration corresponding to this struct.
Definition: fcst_variables.h:163
SolutionVariable Capillary_pressure_vector
Capillary pressure at every quadrature point inside the cell.
Definition: PSD_dual.h:345
static const std::string concrete_name
Concrete name used for objects of this class.
Definition: PSD_dual.h:211
This structure is used to encapsulate data from constant values and variable solution data that is us...
Definition: fcst_variables.h:86
HOPSD< dim > * psd_ho
Creating a pointer of PSD hydrophobic class.
Definition: PSD_dual.h:339
Definition: system_management.h:75
SolutionVariable T_vector
Temperature at every quadrature point inside the cell.
Definition: PSD_dual.h:342
void set_critical_radius()
Member function used to set the critical radius [nm] at every quadrature point inside the cell...
Definition: PSD_dual.h:174
Hydrophilic Pore Size Distribution.
Definition: PSD_HI.h:105
HIPSD< dim > * psd_hi
Creating a pointer of PSD hydrophilic class.
Definition: PSD_dual.h:335
void set_temperature(const SolutionVariable &T_in)
Member function used to set the temperature [Kelvin] at every quadrature point inside the cell...
Definition: PSD_dual.h:149
Dual Pore Size Distribution.
Definition: PSD_dual.h:114
Pore Size Distribution.
Definition: PSD_base.h:130
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_dual.h:312
static DualPSD< dim > const * PROTOTYPE
PROTOTYPE is the pointer is the dynamic pointer pointing to the DualPSD class itself.
Definition: PSD_dual.h:323
void set_saturation()
Member function used to set the saturation at every quadrature point inside the cell.
Definition: PSD_dual.h:187
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_dual.h:159