/[ascend]/trunk/models/johnpye/fprops/fluids/r218.c
ViewVC logotype

Annotation of /trunk/models/johnpye/fprops/fluids/r218.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2301 - (hide annotations) (download) (as text)
Sat Aug 21 13:28:35 2010 UTC (13 years, 10 months ago) by jpye
File MIME type: text/x-csrc
File size: 6267 byte(s)
Regen toluene model working, next water.
1 hongke 2280 /* This file is created by Hongke Zhu, 7-26-2010.
2     Chemical & Materials Engineering Department,
3     University of Alabama in Huntsville, United States.
4    
5     LITERATURE REFERENCE
6     Lemmon, E.W. and Span, R.,
7     "Short Fundamental Equations of State for 20 Industrial Fluids,"
8     J. Chem. Eng. Data, 51:785-850, 2006.
9     */
10    
11 jpye 2301 #include "../helmholtz.h"
12    
13 hongke 2280 #define R218_M 188.01933 /* kg/kmol */
14     #define R218_R (8314.472/R218_M) /* J/kg/K */
15     #define R218_TSTAR 345.02 /* K */
16    
17     const IdealData ideal_data_r218 = {
18     -15.6587335175 /* constant */
19     , 11.4531412796 /* linear */
20     , R218_TSTAR /* Tstar */
21     , R218_R /* cp0star */
22     , 1 /* power terms */
23     , (const IdealPowTerm[]){
24     {4.0, 0.0}
25     }
26     , 3 /* exponential terms */
27     , (const IdealExpTerm[]){
28     {7.2198, 326.0}
29     ,{7.2692, 595.0}
30     ,{11.599, 1489.0}
31     }
32     };
33    
34     const HelmholtzData helmholtz_data_r218 = {
35     "r218"
36     , /* R */ R218_R /* J/kg/K */
37     , /* M */ R218_M /* kg/kmol */
38     , /* rho_star */ 3.34*R218_M /* kg/m3(= rho_c for this model) */
39     , /* T_star */ R218_TSTAR /* K (= T_c for this model) */
40    
41     , /* T_c */ R218_TSTAR
42     , /* rho_c */ 3.34*R218_M /* kg/m3 */
43 jpye 2301 , /* T_t */ 125.45
44 hongke 2280
45     , 0.3172 /* acentric factor */
46     , &ideal_data_r218
47     , 12 /* power terms */
48     , (const HelmholtzPowTerm[]){
49     /* a_i, t_i, d_i, l_i */
50     {1.3270, 0.25, 1.0, 0}
51     , {-3.8433, 1.25, 1.0, 0}
52     , {0.92200, 1.5, 1.0, 0}
53     , {0.11360, 0.25, 3.0, 0}
54     , {0.00036195, 0.875, 7.0, 0}
55     , {1.1001, 2.375, 1.0, 1}
56     , {1.1896, 2.0, 2.0, 1}
57     , {-0.025147, 2.125, 5.0, 1}
58     , {-0.65923, 3.5, 1.0, 2}
59     , {-0.027969, 6.5, 1.0, 2}
60     , {-0.18330, 4.75, 4.0, 2}
61     , {-0.021630, 12.5, 2.0, 3}
62     }
63     , 0 /* gaussian terms */
64     , 0
65     , 0 /* critical terms */
66     , 0
67     };
68    
69     /*
70     Test suite. These tests attempt to validate the current code using a few sample figures output by REFPROP 8.0. To compile and run the test:
71    
72     ./test.py r218
73     */
74    
75     #ifdef TEST
76    
77 jpye 2300 #include "../test.h"
78 hongke 2280 #include <math.h>
79     #include <assert.h>
80     #include <stdio.h>
81    
82     const TestData td[]; const unsigned ntd;
83    
84     int main(void){
85     //return helm_check_u(&helmholtz_data_r218, ntd, td);
86     //return helm_check_dpdT_rho(&helmholtz_data_r218, ntd, td);
87     //return helm_check_dpdrho_T(&helmholtz_data_r218, ntd, td);
88     //return helm_check_dhdT_rho(&helmholtz_data_r218, ntd, td);
89     //return helm_check_dhdrho_T(&helmholtz_data_r218, ntd, td);
90     //return helm_check_dudT_rho(&helmholtz_data_r218, ntd, td);
91     //return helm_check_dudrho_T(&helmholtz_data_r218, ntd, td);
92     return helm_run_test_cases(&helmholtz_data_r218, ntd, td, 'C');
93     }
94    
95     /*
96     A small set of data points calculated using REFPROP 8.0, for validation.
97     */
98    
99     const TestData td[] = {
100     /* Temperature, Pressure, Density, Int. Energy, Enthalpy, Entropy, Cv, Cp, Cp0, Helmholtz */
101     /* (C), (MPa), (kg/m3), (kJ/kg), (kJ/kg), (kJ/kg-K), (kJ/kg-K), (kJ/kg-K), (kJ/kg-K), (kJ/kg) */
102     {-1.00E+2, 1.E-1, 1.84091047427E+3, 1.04721330925E+2, 1.04775651872E+2, 5.70398798424E-1, 5.68203557539E-1, 8.54126698839E-1, 5.53878209743E-1, 5.95677897758E+0}
103     , {-5.0E+1, 1.E-1, 1.6623114573E+3, 1.49641465669E+2, 1.49701622868E+2, 7.97847861264E-1, 6.62742604818E-1, 9.46425360174E-1, 6.57377860316E-1, -2.83982845717E+1}
104     , {0.E+0, 1.E-1, 8.52734888498E+0, 2.83042011708E+2, 2.94768985865E+2, 1.40550465537E+0, 7.10051805828E-1, 7.61763424972E-1, 7.46421688908E-1, -1.00871584905E+2}
105     , {5.0E+1, 1.E-1, 7.10981071873E+0, 3.2053760084E+2, 3.34602672887E+2, 1.53925646462E+0, 7.83923354584E-1, 8.31788175666E-1, 8.25402804462E-1, -1.76873125702E+2}
106     , {1.00E+2, 1.E-1, 6.11775882212E+0, 3.6153041725E+2, 3.77876272474E+2, 1.66365235906E+0, 8.51544796293E-1, 8.97969981282E-1, 8.94585287726E-1, -2.59261460534E+2}
107     , {1.50E+2, 1.E-1, 5.37577897398E+0, 4.05662381868E+2, 4.24264337135E+2, 1.78023818889E+0, 9.10403575559E-1, 9.56129624135E-1, 9.54041414983E-1, -3.47645407761E+2}
108     , {-1.00E+2, 1.E+0, 1.84284039278E+3, 1.04562556643E+2, 1.05105197234E+2, 5.69480019445E-1, 5.68452059225E-1, 8.53503213703E-1, 5.53878209743E-1, 5.95709127613E+0}
109     , {-5.0E+1, 1.E+0, 1.66588529311E+3, 1.49371495272E+2, 1.49971776698E+2, 7.96634876785E-1, 6.62730756137E-1, 9.4441885525E-1, 6.57377860316E-1, -2.83975774825E+1}
110     , {0.E+0, 1.E+0, 1.46007167296E+3, 1.99355885632E+2, 2.00040783517E+2, 9.98678486701E-1, 7.5012517614E-1, 1.06727072786E+0, 7.46421688908E-1, -7.34331430104E+1}
111     , {5.0E+1, 1.E+0, 8.6162306303E+1, 3.14097632723E+2, 3.25703635892E+2, 1.41670188912E+0, 8.20057354091E-1, 9.40626237344E-1, 8.25402804462E-1, -1.43709582746E+2}
112     , {1.00E+2, 1.E+0, 6.74422387677E+1, 3.57484668883E+2, 3.72312171918E+2, 1.55080361141E+0, 8.64133883876E-1, 9.39597944035E-1, 8.94585287726E-1, -2.21197698716E+2}
113     , {1.50E+2, 1.E+0, 5.68953484132E+1, 4.02656313081E+2, 4.20232442377E+2, 1.67126737603E+0, 9.16201158362E-1, 9.78801500495E-1, 9.54041414983E-1, -3.04540477085E+2}
114     , {-1.00E+2, 1.E+1, 1.8610238582E+3, 1.03067737633E+2, 1.08441123878E+2, 5.60681392081E-1, 5.71263547284E-1, 8.48365630237E-1, 5.53878209743E-1, 5.98575459454E+0}
115     , {-5.0E+1, 1.E+1, 1.69773562046E+3, 1.46946796321E+2, 1.52836994936E+2, 7.85500518915E-1, 6.63636782959E-1, 9.29205409183E-1, 6.57377860316E-1, -2.8337644475E+1}
116     , {0.E+0, 1.E+1, 1.52425675332E+3, 1.94959547116E+2, 2.01520121625E+2, 9.82044753551E-1, 7.46239699493E-1, 1.01972545894E+0, 7.46421688908E-1, -7.3285977316E+1}
117     , {5.0E+1, 1.E+1, 1.3247230493E+3, 2.47435936471E+2, 2.54984684117E+2, 1.16155021166E+0, 8.230527383E-1, 1.1207629242E+0, 8.25402804462E-1, -1.27919014428E+2}
118     , {1.00E+2, 1.0E+1, 1.08076691964E+3, 3.04477989215E+2, 3.13730678041E+2, 1.33039214742E+0, 8.93324112019E-1, 1.22799640654E+0, 8.94585287726E-1, -1.91957840594E+2}
119     , {1.50E+2, 1.0E+1, 8.08686137126E+2, 3.64409426697E+2, 3.7677516359E+2, 1.48888349374E+0, 9.48407636582E-1, 1.2714976472E+0, 9.54041414983E-1, -2.65611623678E+2}
120     };
121    
122     const unsigned ntd = sizeof(td)/sizeof(TestData);
123    
124     #endif

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