OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PureGas.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 //
3 // FCST: Fuel Cell Simulation Toolbox
4 //
5 // Copyright (C) 2006-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: PureGas.h
11 // - Description: This class describes properties of pure gases
12 // - Developers: Valentin N. Zingan, University of Alberta
13 // - Id: $Id: PureGas.h 2605 2014-08-15 03:36:44Z secanell $
14 //
15 // ----------------------------------------------------------------------------
16 
17 #ifndef _FCST_FUELCELLSHOP_MATERIAL_PUREGAS_H_
18 #define _FCST_FUELCELLSHOP_MATERIAL_PUREGAS_H_
19 
20 #define _DUMMY_ 1.e300
21 
22 #include "base_material.h"
23 #include "fcst_constants.h"
24 
32 
33 namespace FuelCellShop
34 {
35 namespace Material
36 {
37 
89 class PureGas : public BaseMaterial
90 {
91 public:
92 
94 
95 
99  virtual void declare_parameters(ParameterHandler& param) const;
100 
104  virtual void initialize(ParameterHandler& param);
105 
107 
109 
110 
115  const double& get_molar_mass() const
116  {
117  return molar_mass;
118  }
119 
124  const double& get_collision_diameter() const
125  {
126  return collision_diameter;
127  }
128 
133  const double& get_eps_BY_k() const
134  {
135  return eps_BY_k;
136  }
137 
142  const double& get_Prandtl() const
143  {
144  return Prandtl;
145  }
146 
161  virtual enMaterialID get_ID() const = 0;
162 
167  const std::string& get_chemical_formula() const
168  {
169  return chemical_formula;
170  }
171 
176  const std::string& get_dynamic_viscosity_mode() const
177  {
178  return dynamic_viscosity_mode;
179  }
180 
185  const std::string& get_bulk_viscosity_mode() const
186  {
187  return bulk_viscosity_mode;
188  }
189 
194  const std::string& get_thermal_conductivity_mode() const
195  {
197  }
198 
200 
202 
203 
211  const double get_pressure(const double& density,
212  const double& temperature) const;
213 
224  void get_pressure(const std::vector<double>& density,
225  const double& temperature,
226  std::vector<double>& pressure) const;
227 
238  void get_pressure(const std::vector<double>& density,
239  const std::vector<double>& temperature,
240  std::vector<double>& pressure) const;
241 
248  const double get_Dpressure_Ddensity(const double& temperature) const;
249 
258  void get_Dpressure_Ddensity(const std::vector<double>& temperature,
259  std::vector<double>& dst) const;
260 
267  const double get_Dpressure_Dtemperature(const double& density) const;
268 
277  void get_Dpressure_Dtemperature(const std::vector<double>& density,
278  std::vector<double>& dst) const;
279 
281 
283 
284 
292  const double get_Sutherland_dynamic_viscosity(const double& temperature) const;
293 
303  void get_Sutherland_dynamic_viscosity(const std::vector<double>& temperature,
304  std::vector<double>& dynamic_viscosity) const;
305 
313  const double get_DSutherland_dynamic_viscosity_Dtemperature(const double& temperature) const;
314 
324  void get_DSutherland_dynamic_viscosity_Dtemperature(const std::vector<double>& temperature,
325  std::vector<double>& dst) const;
326 
328 
330 
331 
339  const double get_ChapmanEnskog_dynamic_viscosity(const double& temperature) const;
340 
350  void get_ChapmanEnskog_dynamic_viscosity(const std::vector<double>& temperature,
351  std::vector<double>& dynamic_viscosity) const;
352 
360  const double get_DChapmanEnskog_dynamic_viscosity_Dtemperature(const double& temperature) const;
361 
371  void get_DChapmanEnskog_dynamic_viscosity_Dtemperature(const std::vector<double>& temperature,
372  std::vector<double>& dst) const;
373 
375 
377 
378 
386  const double get_dynamic_viscosity(const double& temperature) const;
387 
397  void get_dynamic_viscosity(const std::vector<double>& temperature,
398  std::vector<double>& dynamic_viscosity) const;
399 
407  const double get_Ddynamic_viscosity_Dtemperature(const double& temperature) const;
408 
418  void get_Ddynamic_viscosity_Dtemperature(const std::vector<double>& temperature,
419  std::vector<double>& dst) const;
420 
422 
424 
425 
433  const double get_bulk_viscosity(const double& dynamic_viscosity) const;
434 
444  void get_bulk_viscosity(const std::vector<double>& dynamic_viscosity,
445  std::vector<double>& bulk_viscosity) const;
446 
455  const double get_Dbulk_viscosity_Dtemperature(const double& src) const;
456 
468  void get_Dbulk_viscosity_Dtemperature(const std::vector<double>& src,
469  std::vector<double>& dst) const;
470 
472 
474 
475 
483  const double get_Sutherland_thermal_conductivity(const double& temperature) const;
484 
494  void get_Sutherland_thermal_conductivity(const std::vector<double>& temperature,
495  std::vector<double>& thermal_conductivity) const;
496 
504  const double get_DSutherland_thermal_conductivity_Dtemperature(const double& temperature) const;
505 
515  void get_DSutherland_thermal_conductivity_Dtemperature(const std::vector<double>& temperature,
516  std::vector<double>& dst) const;
517 
519 
521 
522 
530  const double get_ChapmanEnskog_thermal_conductivity(const double& temperature) const;
531 
541  void get_ChapmanEnskog_thermal_conductivity(const std::vector<double>& temperature,
542  std::vector<double>& thermal_conductivity) const;
543 
551  const double get_DChapmanEnskog_thermal_conductivity_Dtemperature(const double& temperature) const;
552 
562  void get_DChapmanEnskog_thermal_conductivity_Dtemperature(const std::vector<double>& temperature,
563  std::vector<double>& dst) const;
564 
566 
568 
569 
577  const double get_thermal_conductivity(const double& temperature) const;
578 
588  void get_thermal_conductivity(const std::vector<double>& temperature,
589  std::vector<double>& thermal_conductivity) const;
590 
598  const double get_Dthermal_conductivity_Dtemperature(const double& temperature) const;
599 
609  void get_Dthermal_conductivity_Dtemperature(const std::vector<double>& temperature,
610  std::vector<double>& dst) const;
611 
613 
615 
616 
624  const double get_molar_enthalpy(const double& temperature) const;
625 
635  void get_molar_enthalpy(const std::vector<double>& temperature,
636  std::vector<double>& molar_enthalpy) const;
637 
645  const double get_Dmolar_enthalpy_Dtemperature(const double& temperature) const;
646 
656  void get_Dmolar_enthalpy_Dtemperature(const std::vector<double>& temperature,
657  std::vector<double>& dst) const;
658 
666  const double get_D2molar_enthalpy_Dtemperature2(const double& temperature) const;
667 
677  void get_D2molar_enthalpy_Dtemperature2(const std::vector<double>& temperature,
678  std::vector<double>& dst) const;
679 
681 
683 
684 
692  const double get_water_vapor_saturation_pressure(const double& temperature) const;
693 
703  void get_water_vapor_saturation_pressure(const std::vector<double>& temperature,
704  std::vector<double>& water_vapor_saturation_pressure) const;
705 
713  const double get_Dwater_vapor_saturation_pressure_Dtemperature(const double& temperature) const;
714 
724  void get_Dwater_vapor_saturation_pressure_Dtemperature(const std::vector<double>& temperature,
725  std::vector<double>& dst) const;
726 
728 
730 
731 
739  const double get_collision_integral(const double& temperature) const;
740 
750  void get_collision_integral(const std::vector<double>& temperature,
751  std::vector<double>& collision_integral) const;
752 
760  const double get_Dcollision_integral_Dtemperature(const double& temperature) const;
761 
771  void get_Dcollision_integral_Dtemperature(const std::vector<double>& temperature,
772  std::vector<double>& dst) const;
773 
775 
777 
778 
786  const double get_specific_heat_capacity(const double& temperature) const;
787 
797  void get_specific_heat_capacity(const std::vector<double>& temperature,
798  std::vector<double>& specific_heat_capacity) const;
799 
807  const double get_Dspecific_heat_capacity_Dtemperature(const double& temperature) const;
808 
818  void get_Dspecific_heat_capacity_Dtemperature(const std::vector<double>& temperature,
819  std::vector<double>& dst) const;
820 
828  const double get_D2specific_heat_capacity_Dtemperature2(const double& temperature) const;
829 
839  void get_D2specific_heat_capacity_Dtemperature2(const std::vector<double>& temperature,
840  std::vector<double>& dst) const;
841 
843 
844 protected:
845 
847 
848 
852  PureGas(const std::string& name);
853 
857  virtual ~PureGas();
858 
860 
862  // DATA //
864 
866 
867 
871  double molar_mass;
872 
877 
881  double eps_BY_k;
882 
886  double Prandtl;
887 
889 
891 
892 
897  double A_Sutherland;
898 
903  double B_Sutherland;
904 
909  double c_0;
910 
915  double c_1;
916 
921  double c_2;
922 
927  double c_3;
928 
933  double H_ref;
934 
939  double T_ref;
940 
942 
944 
945 
949  std::string chemical_formula;
950 
956 
961  std::string bulk_viscosity_mode;
962 
968 
970 
971 };
972 
980 class Oxygen : public PureGas
981 {
982 public:
983 
985 
986 
991  :
992  PureGas("oxygen")
993  {
994  this->molar_mass = 31.999e-3;
995  this->collision_diameter = 3.4330000;
996  this->eps_BY_k = 113.00000;
997  this->Prandtl = 0.7130000;
998 
999  this->A_Sutherland = 1.693411300e-6;
1000  this->B_Sutherland = 127.0000000000;
1001 
1002  this->c_0 = 0.8800e3;
1003  this->c_1 = - 0.0001e3;
1004  this->c_2 = 0.5400e3;
1005  this->c_3 = - 0.3300e3;
1006 
1007  this->H_ref = 0.000;
1008  this->T_ref = 298.0;
1009 
1010  this->chemical_formula = "O2";
1011  }
1012 
1016  virtual ~Oxygen() { }
1017 
1019 
1021 
1022 
1023  virtual enMaterialID get_ID() const
1024  {
1025  return matOxygen;
1026  }
1027 
1029 
1030 };
1031 
1039 class Nitrogen : public PureGas
1040 {
1041 public:
1042 
1044 
1045 
1050  :
1051  PureGas("nitrogen")
1052  {
1053  this->molar_mass = 28.0134e-3;
1054  this->collision_diameter = 3.66700000;
1055  this->eps_BY_k = 99.8000000;
1056  this->Prandtl = 0.70700000;
1057 
1058  this->A_Sutherland = 1.406732195e-6;
1059  this->B_Sutherland = 111.0000000000;
1060 
1061  this->c_0 = 1.11e3;
1062  this->c_1 = - 0.48e3;
1063  this->c_2 = 0.96e3;
1064  this->c_3 = - 0.42e3;
1065 
1066  this->H_ref = 0.000;
1067  this->T_ref = 298.0;
1068 
1069  this->chemical_formula = "N2";
1070  }
1071 
1075  virtual ~Nitrogen() { }
1076 
1078 
1080 
1081 
1082  virtual enMaterialID get_ID() const
1083  {
1084  return matNitrogen;
1085  }
1086 
1088 
1089 };
1090 
1098 class Hydrogen : public PureGas
1099 {
1100 public:
1101 
1103 
1104 
1109  :
1110  PureGas("hydrogen")
1111  {
1112  this->molar_mass = 2.016e-3;
1113  this->collision_diameter = 2.915000;
1114  this->eps_BY_k = 38.00000;
1115  this->Prandtl = 0.685000;
1116 
1117  this->A_Sutherland = 6.362365620e-7;
1118  this->B_Sutherland = 72.00000000000;
1119 
1120  this->c_0 = 13.46e3;
1121  this->c_1 = 4.600e3;
1122  this->c_2 = - 6.850e3;
1123  this->c_3 = 3.790e3;
1124 
1125  this->H_ref = 0.000;
1126  this->T_ref = 298.0;
1127 
1128  this->chemical_formula = "H2";
1129  }
1130 
1134  virtual ~Hydrogen() { }
1135 
1137 
1139 
1140 
1141  virtual enMaterialID get_ID() const
1142  {
1143  return matHydrogen;
1144  }
1145 
1147 
1148 };
1149 
1157 class WaterVapor : public PureGas
1158 {
1159 public:
1160 
1162 
1163 
1168  :
1169  PureGas("water")
1170  {
1171  this->molar_mass = 18.015e-3;
1172  this->collision_diameter = 2.6410000;
1173  this->eps_BY_k = 809.10000;
1174  this->Prandtl = 0.9500000;
1175 
1176  this->A_Sutherland = _DUMMY_;
1177  this->B_Sutherland = _DUMMY_;
1178 
1179  this->c_0 = 1.790e3;
1180  this->c_1 = 0.107e3;
1181  this->c_2 = 0.586e3;
1182  this->c_3 = - 0.200e3;
1183 
1184  this->H_ref = - 2.41826e5;
1185  this->T_ref = 298.00000;
1186 
1187  this->chemical_formula = "H2O Vapor";
1188  }
1189 
1193  virtual ~WaterVapor() { }
1194 
1196 
1198 
1199 
1200  virtual enMaterialID get_ID() const
1201  {
1202  return matWaterVapor;
1203  }
1204 
1206 
1207 };
1208 
1216 class Air : public PureGas
1217 {
1218 public:
1219 
1221 
1222 
1227  :
1228  PureGas("air")
1229  {
1230  this->molar_mass = 28.964e-3;
1231  this->collision_diameter = 3.6170000;
1232  this->eps_BY_k = 97.000000;
1233  this->Prandtl = 0.7020000;
1234 
1235  this->A_Sutherland = 1.512041288e-6;
1236  this->B_Sutherland = 120.0000000000;
1237 
1238  this->c_0 = 1.050e3;
1239  this->c_1 = - 0.365e3;
1240  this->c_2 = 0.850e3;
1241  this->c_3 = - 0.390e3;
1242 
1243  this->H_ref = _DUMMY_;
1244  this->T_ref = _DUMMY_;
1245 
1246  this->chemical_formula = "78.1_N2__20.9_O2__0.9_Ar__0.03_CO2__0.002_Ne__0.0005_He__0.0002_CH4__0.0001_Kr__0.00005_H2__0.000009_He";
1247  }
1248 
1252  virtual ~Air() { }
1253 
1255 
1257 
1258 
1259  virtual enMaterialID get_ID() const
1260  {
1261  return matAir;
1262  }
1263 
1265 
1266 };
1267 
1275 class Helium : public PureGas
1276 {
1277 public:
1278 
1280 
1281 
1286  :
1287  PureGas("helium")
1288  {
1289  this->molar_mass = 4.002602e-3;
1290  this->collision_diameter = 2.576000000;
1291  this->eps_BY_k = 10.20000000;
1292  this->Prandtl = 0.710000000;
1293 
1294  this->A_Sutherland = 1.484381490e-6;
1295  this->B_Sutherland = 79.40000000000;
1296 
1297  this->c_0 = 5.193e3;
1298  this->c_1 = 0.00000;
1299  this->c_2 = 0.00000;
1300  this->c_3 = 0.00000;
1301 
1302  this->H_ref = _DUMMY_;
1303  this->T_ref = _DUMMY_;
1304 
1305  this->chemical_formula = "He";
1306  }
1307 
1311  virtual ~Helium() { }
1312 
1314 
1316 
1317 
1318  virtual enMaterialID get_ID() const
1319  {
1320  return matHelium;
1321  }
1322 
1324 
1325 };
1326 
1327 } // Material
1328 
1329 } // FuelCellShop
1330 
1331 #endif
std::string thermal_conductivity_mode
Definition: PureGas.h:967
Air()
Constructor.
Definition: PureGas.h:1226
const double get_DSutherland_dynamic_viscosity_Dtemperature(const double &temperature) const
This function returns the first derivative of the Sutherland dynamic viscosity of a pure gas...
std::string dynamic_viscosity_mode
Definition: PureGas.h:955
double collision_diameter
Collision diameter, .
Definition: PureGas.h:876
const double get_molar_enthalpy(const double &temperature) const
This function returns molar enthalpy of a pure gas.
const double get_ChapmanEnskog_dynamic_viscosity(const double &temperature) const
This function returns Chapman Enskog dynamic viscosity of a pure gas.
enMaterialID
Definition: PureGas.h:25
std::string bulk_viscosity_mode
Definition: PureGas.h:961
virtual enMaterialID get_ID() const
This function returns a number from enMaterialID enumeration.
Definition: PureGas.h:1141
virtual ~Hydrogen()
Destructor.
Definition: PureGas.h:1134
const double get_DChapmanEnskog_dynamic_viscosity_Dtemperature(const double &temperature) const
This function returns the first derivative of the Chapman Enskog dynamic viscosity of a pure gas...
const std::string & get_bulk_viscosity_mode() const
This function returns bulk_viscosity_mode.
Definition: PureGas.h:185
double eps_BY_k
The maximum energy of attraction divided by the Boltzmann constant, .
Definition: PureGas.h:881
const double & get_Prandtl() const
This function returns Prandtl.
Definition: PureGas.h:142
double c_3
Coefficient of the specific heat capacity at constant pressure formula, .
Definition: PureGas.h:927
const std::string name
Name of the layer.
Definition: base_material.h:155
const double get_collision_integral(const double &temperature) const
This function returns collision integral of a pure gas.
const double get_Dbulk_viscosity_Dtemperature(const double &src) const
This function returns the first derivative of the desired bulk viscosity of a pure gas...
virtual enMaterialID get_ID() const
This function returns a number from enMaterialID enumeration.
Definition: PureGas.h:1200
virtual ~WaterVapor()
Destructor.
Definition: PureGas.h:1193
const double get_Dcollision_integral_Dtemperature(const double &temperature) const
This function returns the first derivative of the collision integral of a pure gas.
const double get_Dthermal_conductivity_Dtemperature(const double &temperature) const
This function returns the first derivative of the desired thermal conductivity of a pure gas...
Hydrogen()
Constructor.
Definition: PureGas.h:1108
virtual ~PureGas()
Destructor.
const double get_ChapmanEnskog_thermal_conductivity(const double &temperature) const
This function returns Chapman Enskog thermal conductivity of a pure gas.
const double & get_eps_BY_k() const
This function returns eps_BY_k.
Definition: PureGas.h:133
std::string chemical_formula
Chemical formula of the pure gas.
Definition: PureGas.h:949
Definition: PureGas.h:27
Definition: PureGas.h:29
virtual enMaterialID get_ID() const
This function returns a number from enMaterialID enumeration.
Definition: PureGas.h:1082
double H_ref
Coefficient of the molar enthalpy formula .
Definition: PureGas.h:933
const std::string & get_chemical_formula() const
This function returns chemical_formula.
Definition: PureGas.h:167
const double get_specific_heat_capacity(const double &temperature) const
This function returns specific heat capacity at constant pressure of a pure gas.
Definition: PureGas.h:28
const double get_dynamic_viscosity(const double &temperature) const
This function returns desired dynamic viscosity of a pure gas.
const double & get_collision_diameter() const
This function returns collision_diameter.
Definition: PureGas.h:124
const double get_Sutherland_dynamic_viscosity(const double &temperature) const
This function returns Sutherland dynamic viscosity of a pure gas.
double Prandtl
Prandtl number, .
Definition: PureGas.h:886
double A_Sutherland
Coefficient of the Sutherland dynamic viscosity formula, .
Definition: PureGas.h:897
virtual ~Helium()
Destructor.
Definition: PureGas.h:1311
double T_ref
Coefficient of the molar enthalpy formula .
Definition: PureGas.h:939
This class describes properties of pure oxygen.
Definition: PureGas.h:980
const double get_Dwater_vapor_saturation_pressure_Dtemperature(const double &temperature) const
This function returns the first derivative of the saturation pressure of water vapor.
Definition: PureGas.h:31
This class describes properties of pure nitrogen.
Definition: PureGas.h:1039
double c_0
Coefficient of the specific heat capacity at constant pressure formula, .
Definition: PureGas.h:909
Helium()
Constructor.
Definition: PureGas.h:1285
This class describes properties of pure air.
Definition: PureGas.h:1216
WaterVapor()
Constructor.
Definition: PureGas.h:1167
const std::string & get_thermal_conductivity_mode() const
This function returns thermal_conductivity_mode.
Definition: PureGas.h:194
Definition: PureGas.h:25
double c_2
Coefficient of the specific heat capacity at constant pressure formula, .
Definition: PureGas.h:921
virtual ~Nitrogen()
Destructor.
Definition: PureGas.h:1075
virtual ~Oxygen()
Destructor.
Definition: PureGas.h:1016
const std::string & get_dynamic_viscosity_mode() const
This function returns dynamic_viscosity_mode.
Definition: PureGas.h:176
const double get_Sutherland_thermal_conductivity(const double &temperature) const
This function returns Sutherland thermal conductivity of a pure gas.
virtual void declare_parameters(ParameterHandler &param) const
Declare parameters.
const double get_thermal_conductivity(const double &temperature) const
This function returns desired thermal conductivity of a pure gas.
#define _DUMMY_
Definition: PureGas.h:20
virtual enMaterialID get_ID() const
This function returns a number from enMaterialID enumeration.
Definition: PureGas.h:1259
This class is a base class for all pure gases used in FCST.
Definition: PureGas.h:89
const double get_D2molar_enthalpy_Dtemperature2(const double &temperature) const
This function returns the second derivative of the molar enthalpy of a pure gas. ...
double B_Sutherland
Coefficient of the Sutherland dynamic viscosity formula, .
Definition: PureGas.h:903
const double get_water_vapor_saturation_pressure(const double &temperature) const
This function returns saturation pressure of water vapor.
virtual enMaterialID get_ID() const =0
This function returns a number from enMaterialID enumeration.
PureGas(const std::string &name)
Constructor.
Nitrogen()
Constructor.
Definition: PureGas.h:1049
Definition: PureGas.h:30
double molar_mass
Molar mass, .
Definition: PureGas.h:871
const double get_DSutherland_thermal_conductivity_Dtemperature(const double &temperature) const
This function returns the first derivative of the Sutherland thermal conductivity of a pure gas...
const double get_Dspecific_heat_capacity_Dtemperature(const double &temperature) const
This function returns the first derivative of the specific heat capacity at constant pressure of a p...
Oxygen()
Constructor.
Definition: PureGas.h:990
This class describes properties of pure helium.
Definition: PureGas.h:1275
const double get_Dpressure_Dtemperature(const double &density) const
This function returns of a pure ideal gas.
const double get_Dpressure_Ddensity(const double &temperature) const
This function returns of a pure ideal gas.
const double get_Dmolar_enthalpy_Dtemperature(const double &temperature) const
This function returns the first derivative of the molar enthalpy of a pure gas.
virtual ~Air()
Destructor.
Definition: PureGas.h:1252
const double get_pressure(const double &density, const double &temperature) const
This function returns pressure of a pure ideal gas.
virtual enMaterialID get_ID() const
This function returns a number from enMaterialID enumeration.
Definition: PureGas.h:1318
virtual enMaterialID get_ID() const
This function returns a number from enMaterialID enumeration.
Definition: PureGas.h:1023
virtual void initialize(ParameterHandler &param)
Initialize parameters.
const double get_bulk_viscosity(const double &dynamic_viscosity) const
This function returns desired bulk viscosity of a pure gas.
This class describes properties of pure hydrogen.
Definition: PureGas.h:1098
const double get_D2specific_heat_capacity_Dtemperature2(const double &temperature) const
This function returns the second derivative of the specific heat capacity at constant pressure of a ...
const double get_Ddynamic_viscosity_Dtemperature(const double &temperature) const
This function returns the first derivative of the desired dynamic viscosity of a pure gas...
Definition: PureGas.h:26
const double get_DChapmanEnskog_thermal_conductivity_Dtemperature(const double &temperature) const
This function returns the first derivative of the Chapman Enskog thermal conductivity of a pure gas...
Virtual class used to provide the interface for all material classes.
Definition: base_material.h:54
double c_1
Coefficient of the specific heat capacity at constant pressure formula, .
Definition: PureGas.h:915
This class describes properties of pure WaterVapor.
Definition: PureGas.h:1157
const double & get_molar_mass() const
This function returns molar_mass.
Definition: PureGas.h:115