1 |
|
/* ASCEND modelling environment |
2 |
|
Copyright (C) 2008 Carnegie Mellon University |
3 |
|
|
4 |
|
This program is free software; you can redistribute it and/or modify |
5 |
|
it under the terms of the GNU General Public License as published by |
6 |
|
the Free Software Foundation; either version 2, or (at your option) |
7 |
|
any later version. |
8 |
|
|
9 |
|
This program is distributed in the hope that it will be useful, |
10 |
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 |
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 |
|
GNU General Public License for more details. |
13 |
|
|
14 |
|
You should have received a copy of the GNU General Public License |
15 |
|
along with this program; if not, write to the Free Software |
16 |
|
Foundation, Inc., 59 Temple Place - Suite 330, |
17 |
|
Boston, MA 02111-1307, USA. |
18 |
|
*/ |
19 |
#ifndef FPROPS_IDEAL_H |
#ifndef FPROPS_IDEAL_H |
20 |
#define FPROPS_IDEAL_H |
#define FPROPS_IDEAL_H |
21 |
|
|
38 |
} IdealPowTerm; |
} IdealPowTerm; |
39 |
|
|
40 |
/* |
/* |
41 |
|
Terms containing exponential expressions with tau, like |
42 |
|
|
43 |
|
b x^2 exp(-x) / [1-exp(-x)]^2 |
44 |
|
|
45 |
|
where x = beta / T. Instead of representing in terms of beta, we ask the |
46 |
|
user to provide (b,beta) in the form of |
47 |
|
|
48 |
|
b,B |
49 |
|
|
50 |
|
where B = beta / T*, with T* being the normalisation temperature used |
51 |
|
to calculate tau in the main 'residual' correlation. |
52 |
|
|
53 |
See J R Cooper 'Representation of the Ideal-Gas Thermaldynamic |
See J R Cooper 'Representation of the Ideal-Gas Thermaldynamic |
54 |
Properties of Water', Int J Thermophys v 3 no 1, 1982 and also |
Properties of Water', Int J Thermophys v 3 no 1, 1982 and also |
55 |
Span, Lemmon, Jacobsen & Wagner 'A Reference Quality Equation of State |
Span, Lemmon, Jacobsen & Wagner 'A Reference Quality Equation of State |
56 |
for Nitrogen' 1998. |
for Nitrogen' 1998. |
57 |
|
|
58 |
The form of exponential terms appearing in the reduced |
From the above expression, the term appearing in the reduced |
59 |
Helmholtz function equation is |
Helmholtz function equation becomes |
60 |
|
|
61 |
|
b_i ln [ 1 - exp( -B_i tau ) ] |
62 |
|
|
63 |
|
This is the component in tau, there is also a constant term added, |
64 |
|
|
65 |
b ln [ 1 - exp( -B tau ) ] |
- b_i ln [ 1 - exp( -B_i tau0 ) ] |
66 |
|
|
|
where B is defined as beta / tau in the nomenclature of Cooper. |
|
67 |
*/ |
*/ |
68 |
typedef struct IdealExpTerm_struct{ |
typedef struct IdealExpTerm_struct{ |
69 |
double b; |
double b; |
71 |
} IdealExpTerm; |
} IdealExpTerm; |
72 |
|
|
73 |
typedef struct IdealData_struct{ |
typedef struct IdealData_struct{ |
74 |
double c; /* constant value in phi_0 expression */ |
double c; |
75 |
double m; /* linear coefficient in phi_0 expression */ |
double m; |
76 |
unsigned np; /* number of power terms */ |
unsigned np; /* number of power terms */ |
77 |
const IdealPowTerm *pt; /* power term data, may be NULL if np == 0 */ |
const IdealPowTerm *pt; /* power term data, may be NULL if np == 0 */ |
78 |
unsigned ne; /* number of 'exponential' terms */ |
unsigned ne; /* number of 'exponential' terms */ |