OpenFCST: The open-source Fuel Cell Simulation Toolbox
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
fcst
include
materials
PureGas.h
Go to the documentation of this file.
1
//---------------------------------------------------------------------------
2
//
3
// FCST: Fuel Cell Simulation Toolbox
4
//
5
// Copyright (C) 2006-13 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: Class storing pure gas properties.
12
// - Developers: Ali MalekpourKoupaei (2009-10) and Madhur Bhaiya (2013)
13
// - Id: $Id: PureGas.h 1354 2013-08-17 00:01:22Z secanell $
14
//
15
//---------------------------------------------------------------------------
16
17
#ifndef _FUELCELLSHOP__PUREGAS__H
18
#define _FUELCELLSHOP__PUREGAS__H
19
20
#define __Del(p) {if(p) delete p; p=__null;}
21
#define __printf __builtin_printf
22
#define __scanf __builtin_scanf
23
#define __exp __builtin_exp
24
#define __pow __builtin_pow
25
#define __DUMMY -9999
26
27
//Include STL
28
#include<cmath>
29
#include<iostream>
30
#include <vector>
31
#include <fstream>
32
#include <deal.II/base/subscriptor.h>
33
34
#include "
base_material.h
"
35
36
//enumerations
37
enum
enMaterialID
{
matOxygen
=1,
matNitrogen
,
matWater
,
matHydrogen
,
matNone
};
38
39
namespace
FuelCellShop
40
41
{
42
namespace
Material
43
{
44
49
class
PureGas
:
public
dealii::Subscriptor,
BaseMaterial
50
{
51
public
:
52
54
double
Tc
;
56
double
Pc
;
58
double
Vc
;
62
double
Zc
;
64
double
w
;
66
double
M
;
68
double
Tnb
;
70
double
Vl
;
72
double
Mu_0
;
74
double
hard_sphere_diameter
;
76
double
e_k
;
77
78
PureGas
();
79
virtual
~PureGas
();
80
82
virtual
double
getCollisionDiameter
();
83
virtual
double
getDimensionlessTemperature
(
const
double
& T);
84
85
virtual
enMaterialID
get_ID
()=0;
86
virtual
char
*
get_name
() =0;
87
virtual
char
*
get_formula
() =0;
88
89
virtual
void
get_viscosity
(
double
& mu,
const
double
& T) =0;
90
virtual
void
get_viscosity_Chapman_Enskog
(
double
& mu,
const
double
& T,
const
double
& MW,
const
double
&
hard_sphere_diameter
);
91
virtual
void
get_viscosity_Chapman_Enskog
(
double
& mu,
const
double
& T);
92
virtual
void
get_dMu_d_T_Chapman_Enskog
(
double
& dmu,
const
double
& T,
93
const
double
& MW,
const
double
&
hard_sphere_diameter
);
94
virtual
void
get_dMu_d_T_Chapman_Enskog
(
double
& dmu,
const
double
& T);
95
101
virtual
double
get_molar_enthalpy
(
const
double
& T)
const
= 0;
102
107
virtual
double
get_dmolar_enthalpy_dT
(
const
double
& T)
const
= 0;
108
113
virtual
double
get_d2molar_enthalpy_dT2
(
const
double
& T)
const
= 0;
114
115
116
};
117
//---------------------------------------------------------------------------
118
122
class
Oxygen
:
public
PureGas
123
{
124
public
:
125
126
Oxygen
();
127
virtual
~Oxygen
();
128
129
virtual
enMaterialID
get_ID
();
130
virtual
char
*
get_name
() ;
131
virtual
char
*
get_formula
() ;
132
133
virtual
void
get_viscosity
(
double
& mu,
const
double
& T) ;
134
140
virtual
double
get_molar_enthalpy
(
const
double
&)
const
;
141
147
virtual
double
get_dmolar_enthalpy_dT
(
const
double
& T)
const
;
148
154
virtual
double
get_d2molar_enthalpy_dT2
(
const
double
& T)
const
;
155
};
156
//---------------------------------------------------------------------------
157
161
class
Nitrogen
:
public
PureGas
162
{
163
public
:
164
165
Nitrogen
();
166
virtual
~Nitrogen
();
167
168
virtual
enMaterialID
get_ID
();
169
virtual
char
*
get_name
() ;
170
virtual
char
*
get_formula
() ;
171
172
virtual
void
get_viscosity
(
double
& mu,
const
double
& T) ;
173
179
virtual
double
get_molar_enthalpy
(
const
double
&)
const
;
180
186
virtual
double
get_dmolar_enthalpy_dT
(
const
double
& T)
const
;
187
193
virtual
double
get_d2molar_enthalpy_dT2
(
const
double
& T)
const
;
194
};
195
196
//---------------------------------------------------------------------------
197
201
class
Water
:
public
PureGas
202
{
203
public
:
204
205
Water
();
206
virtual
~Water
();
207
208
virtual
enMaterialID
get_ID
();
209
virtual
char
*
get_name
() ;
210
virtual
char
*
get_formula
() ;
211
212
virtual
void
get_viscosity
(
double
& mu,
const
double
& T) ;
213
219
virtual
double
get_molar_enthalpy
(
const
double
&)
const
;
220
226
virtual
double
get_dmolar_enthalpy_dT
(
const
double
& T)
const
;
227
233
virtual
double
get_d2molar_enthalpy_dT2
(
const
double
& T)
const
;
234
236
static
double
satPressure
(
const
double
&);
237
239
static
double
derivSatPressure
(
const
double
&);
240
244
static
double
molarWeight
()
245
{
246
return
18.015;
247
}
248
};
249
250
//---------------------------------------------------------------------------
251
255
class
Hydrogen
:
public
PureGas
256
{
257
public
:
258
259
Hydrogen
();
260
virtual
~Hydrogen
();
261
262
virtual
enMaterialID
get_ID
();
263
virtual
char
*
get_name
() ;
264
virtual
char
*
get_formula
() ;
265
266
virtual
void
get_viscosity
(
double
& mu,
const
double
& T) ;
267
273
virtual
double
get_molar_enthalpy
(
const
double
&)
const
;
274
280
virtual
double
get_dmolar_enthalpy_dT
(
const
double
& T)
const
;
281
287
virtual
double
get_d2molar_enthalpy_dT2
(
const
double
& T)
const
;
288
};
289
290
//---------------------------------------------------------------------------
291
}
292
}
293
294
#endif
Generated on Fri Aug 30 2013 17:15:54 for OpenFCST: The open-source Fuel Cell Simulation Toolbox by
1.8.2