/[ascend]/trunk/models/johnpye/fprops/helmholtz.h
ViewVC logotype

Contents of /trunk/models/johnpye/fprops/helmholtz.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1838 - (show annotations) (download) (as text)
Thu Aug 28 08:32:29 2008 UTC (15 years, 9 months ago) by jpye
File MIME type: text/x-chdr
File size: 2846 byte(s)
Added 'exponential' terms for nitrogen correlation (still testing).
1 #ifndef FPROPS_HELMHOLTZ_H
2 #define FPROPS_HELMHOLTZ_H
3
4 /*
5 Terms containing powers of 'tau'
6 */
7 typedef struct IdealPowTerm_struct{
8 double a0;
9 double t0;
10 } IdealPowTerm;
11
12 /*
13 See J R Cooper 'Representation of the Ideal-Gas Thermaldynamic
14 Properties of Water', Int J Thermophys v 3 no 1, 1982 and also
15 Span, Lemmon, Jacobsen & Wagner 'A Reference Quality Equation of State
16 for Nitrogen' 1998.
17
18 The form of exponential terms appearing in the reduced
19 Helmholtz function equation is
20
21 b ln [ 1 - exp( -B tau ) ]
22
23 where B is defined as beta / tau in the nomenclature of Cooper.
24 */
25 typedef struct IdealExpTerm_struct{
26 double b;
27 double B;
28 } IdealExpTerm;
29
30 typedef struct IdealData_struct{
31 double c; /* constant value in phi_0 expression */
32 double m; /* linear coefficient in phi_0 expression */
33 unsigned np; /* number of power terms */
34 const IdealPowTerm *pt; /* power term data, may be NULL if np == 0 */
35 unsigned ne; /* number of 'exponential' terms */
36 const IdealExpTerm *et; /* exponential term data, maybe NULL if ne == 0 */
37 } IdealData;
38
39 /**
40 Data structure for rows of the coefficient and exponent table (allows
41 the data to be represented more concisely when declaring a fluid from
42 C code.
43 */
44 typedef struct HelmholtzPowTerm_struct{
45 double a; /* coefficient */
46 double t; /* exponent of tau */
47 int d; /* exponent of delta */
48 unsigned l; /* exponent X in exp(-del^X) */
49 } HelmholtzPowTerm;
50
51 /**
52 Data structure for 'exponential terms' in the residual expression.
53 These terms are of the form used in Span et al, 1998, as cited in
54 the file 'nitrogen.c'.
55 */
56 typedef struct HelmholtzExpTerm_struct{
57 double a; /* coefficient */
58 double t; /* exponent of tau */
59 int d; /* exponent of delta */
60 int phi;
61 int beta;
62 double gamma;
63 } HelmholtzExpTerm;
64
65 /**
66 Data structure for fluid-specific data for the Helmholtz free energy EOS.
67 See Tillner-Roth 1993 for information about 'atd' and 'a0' data.
68 */
69 typedef struct HelmholtzData_struct{
70 double R; /**< specific gas constant */
71 double M; /**< molar mass, kg/kmol */
72 double rho_star; /**< normalisation density, kg/m�� */
73 double T_star; /* normalisation temperature, K */
74
75 const IdealData *ideal; /* data for ideal component of Helmholtz energy */
76
77 unsigned np; /* number of power terms in residual equation */
78 const HelmholtzPowTerm *pt; /* power term data for residual eqn, maybe NULL if np == 0 */
79 unsigned ne; /* number of exponential terms (a la Span et al 1998) for residual eqn */
80 const HelmholtzExpTerm *et; /* exponential term data, maybe NULL if ne == 0 */
81 } HelmholtzData;
82
83 double helmholtz_p(double T, double rho, const HelmholtzData *data);
84 double helmholtz_u(double T, double rho, const HelmholtzData *data);
85 double helmholtz_h(double T, double rho, const HelmholtzData *data);
86 double helmholtz_s(double T, double rho, const HelmholtzData *data);
87
88 #endif
89

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22