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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1850 - (hide annotations) (download) (as text)
Tue Sep 2 06:56:47 2008 UTC (11 years, 3 months ago) by jpye
File MIME type: text/x-chdr
File size: 1925 byte(s)
Added ideal cp0 values to test data and added
calculation function for this. Works for nitrogen 
but not for ammonia.
1 jpye 1832 #ifndef FPROPS_HELMHOLTZ_H
2     #define FPROPS_HELMHOLTZ_H
3 jpye 1822
4 jpye 1847 #include "ideal.h"
5 jpye 1835
6 jpye 1822 /**
7     Data structure for rows of the coefficient and exponent table (allows
8     the data to be represented more concisely when declaring a fluid from
9     C code.
10     */
11 jpye 1838 typedef struct HelmholtzPowTerm_struct{
12 jpye 1822 double a; /* coefficient */
13     double t; /* exponent of tau */
14 jpye 1826 int d; /* exponent of delta */
15 jpye 1832 unsigned l; /* exponent X in exp(-del^X) */
16 jpye 1838 } HelmholtzPowTerm;
17 jpye 1822
18     /**
19 jpye 1838 Data structure for 'exponential terms' in the residual expression.
20     These terms are of the form used in Span et al, 1998, as cited in
21     the file 'nitrogen.c'.
22     */
23     typedef struct HelmholtzExpTerm_struct{
24     double a; /* coefficient */
25     double t; /* exponent of tau */
26     int d; /* exponent of delta */
27     int phi;
28     int beta;
29     double gamma;
30     } HelmholtzExpTerm;
31    
32     /**
33 jpye 1822 Data structure for fluid-specific data for the Helmholtz free energy EOS.
34 jpye 1832 See Tillner-Roth 1993 for information about 'atd' and 'a0' data.
35 jpye 1822 */
36     typedef struct HelmholtzData_struct{
37 jpye 1832 double R; /**< specific gas constant */
38     double M; /**< molar mass, kg/kmol */
39     double rho_star; /**< normalisation density, kg/m�� */
40     double T_star; /* normalisation temperature, K */
41 jpye 1822
42 jpye 1835 const IdealData *ideal; /* data for ideal component of Helmholtz energy */
43 jpye 1822
44 jpye 1838 unsigned np; /* number of power terms in residual equation */
45     const HelmholtzPowTerm *pt; /* power term data for residual eqn, maybe NULL if np == 0 */
46     unsigned ne; /* number of exponential terms (a la Span et al 1998) for residual eqn */
47     const HelmholtzExpTerm *et; /* exponential term data, maybe NULL if ne == 0 */
48 jpye 1822 } HelmholtzData;
49    
50 jpye 1826 double helmholtz_p(double T, double rho, const HelmholtzData *data);
51     double helmholtz_u(double T, double rho, const HelmholtzData *data);
52     double helmholtz_h(double T, double rho, const HelmholtzData *data);
53 jpye 1829 double helmholtz_s(double T, double rho, const HelmholtzData *data);
54 jpye 1850 double helmholtz_cp0(double T, const HelmholtzData *data);
55 jpye 1825
56 jpye 1832 #endif
57    

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