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

Annotation of /trunk/models/johnpye/fprops/fluids/acetone.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: 8017 byte(s)
Regen toluene model working, next water.
1 hongke 2280 /* This file is created by Hongke Zhu, 02-03-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 ACETONE_M 58.07914 /* kg/kmol */
14     #define ACETONE_R (8314.472/ACETONE_M) /* J/kg/K */
15     #define ACETONE_TSTAR 508.1 /* K */
16    
17     const IdealData ideal_data_acetone = {
18     -9.4883659997 /* constant, a_1, adjust to solver s */
19     , 7.1422719708 /* linear, a_2, adjust to solver h */
20     , ACETONE_TSTAR /* Tstar */
21     , ACETONE_R /* cp0star */
22     , 1 /* power terms */
23     , (const IdealPowTerm[]){
24     {4.0, 0.0}
25     }
26     , 3 /* exponential terms */
27     , (const IdealExpTerm[]){
28     {3.7072, 310.0}
29     ,{7.0675, 3480.0}
30     ,{11.012, 1576.0}
31     }
32     };
33    
34     const HelmholtzData helmholtz_data_acetone = {
35     "acetone"
36     , /* R */ ACETONE_R /* J/kg/K */
37     , /* M */ ACETONE_M /* kg/kmol */
38     , /* rho_star */ 4.7*ACETONE_M /* kg/m3(= rho_c for this model) */
39     , /* T_star */ ACETONE_TSTAR /* K (= T_c for this model) */
40    
41     , /* T_c */ ACETONE_TSTAR
42     , /* rho_c */ 4.7*ACETONE_M /* kg/m3 */
43 jpye 2301 , /* T_t */ 178.5
44 hongke 2280
45     , 0.3071 /* acentric factor */
46     , &ideal_data_acetone
47     , 12 /* power terms */
48     , (const HelmholtzPowTerm[]){
49     /* a_i, t_i, d_i, l_i */
50     {0.90041, 0.25, 1.0, 0.0}
51     , {-2.1267, 1.25, 1.0, 0.0}
52     , {-0.083409, 1.5, 1.0, 0.0}
53     , {0.065683, 0.25, 3.0, 0.0}
54     , {0.00016527, 0.875, 7.0, 0.0}
55     , {-0.039663, 2.375, 1.0, 1.0}
56     , {0.72085, 2.0, 2.0, 1.0}
57     , {0.0092318, 2.125, 5.0, 1.0}
58     , {-0.17217, 3.5, 1.0, 2.0}
59     , {-0.14961, 6.5, 1.0, 2.0}
60     , {-0.076124, 4.75, 4.0, 2.0}
61     , {-0.018166, 12.5, 2.0, 3.0}
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 acetone
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_acetone, ntd, td);
86     //return helm_check_dpdT_rho(&helmholtz_data_acetone, ntd, td);
87     //return helm_check_dpdrho_T(&helmholtz_data_acetone, ntd, td);
88     //return helm_check_dhdT_rho(&helmholtz_data_acetone, ntd, td);
89     //return helm_check_dhdrho_T(&helmholtz_data_acetone, ntd, td);
90     //return helm_check_dudT_rho(&helmholtz_data_acetone, ntd, td);
91     //return helm_check_dudrho_T(&helmholtz_data_acetone, ntd, td);
92     return helm_run_test_cases(&helmholtz_data_acetone, 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     {-5.0E+1, 1.E-1, 8.65466736579E+2, 9.75139609024E+1, 9.76295054933E+1, 5.85862036597E-1, 1.45785160795E+0, 2.01807638339E+0, 1.09315360536E+0, -3.32211525641E+1}
103     , {0.E+0, 1.E-1, 8.12177984673E+2, 1.99947867834E+2, 2.00070993555E+2, 9.99851042349E-1, 1.51175310222E+0, 2.08819813581E+0, 1.2151468332E+0, -7.31614443837E+1}
104     , {5.0E+1, 9.99999999999E-2, 7.56116674299E+2, 3.07195700348E+2, 3.07327955069E+2, 1.36015145196E+0, 1.59386998954E+0, 2.21082571152E+0, 1.35704025081E+0, -1.32337241352E+2}
105     , {1.00E+2, 1.E-1, 1.9261104892E+0, 8.39109640048E+2, 8.91027741612E+2, 3.12246134155E+0, 1.40982565768E+0, 1.58182537425E+0, 1.50591359722E+0, -3.26036809551E+2}
106     , {1.50E+2, 1.E-1, 1.67874818829E+0, 9.12994840411E+2, 9.72563035747E+2, 3.32737802746E+0, 1.52868094578E+0, 1.68609165718E+0, 1.65259065671E+0, -4.94985171907E+2}
107     , {2.00E+2, 1.E-1, 1.49264578043E+0, 9.92945939492E+2, 1.05994107076E+3, 3.52242658031E+0, 1.65845168615E+0, 1.8100233366E+0, 1.7925450811E+0, -6.73690196981E+2}
108     , {2.50E+2, 1.E-1, 1.34549130473E+0, 1.07924559777E+3, 1.15356789153E+3, 3.71042894914E+0, 1.78573128009E+0, 1.93446788483E+0, 1.9241082419E+0, -8.61865306977E+2}
109     , {-5.0E+1, 1.E+0, 8.66001213343E+2, 9.7231202983E+1, 9.83859357762E+1, 5.8459316038E-1, 1.45803935586E+0, 2.01741680308E+0, 1.09315360536E+0, -3.32207607559E+1}
110     , {0.E+0, 1.E+0, 8.12932634043E+2, 1.99546312691E+2, 2.0077642692E+2, 9.98378654208E-1, 1.51186067759E+0, 2.08673582107E+0, 1.2151468332E+0, -7.31608167061E+1}
111     , {5.0E+1, 1.E+0, 7.57240751007E+2, 3.06603984983E+2, 3.07924568957E+2, 1.35831703293E+0, 1.59377009414E+0, 2.20771267767E+0, 1.35704025081E+0, -1.32336164208E+2}
112     , {1.00E+2, 1.E+0, 6.95128144811E+2, 4.21016218751E+2, 4.22454802425E+2, 1.68754939463E+0, 1.69644176326E+0, 2.38429942127E+0, 1.50591359722E+0, -2.08692837856E+2}
113     , {1.50E+2, 1.E+0, 2.04768926798E+1, 8.80704820961E+2, 9.29540355514E+2, 2.9190798905E+0, 1.76044984742E+0, 2.20173172301E+0, 1.65259065671E+0, -3.54503834705E+2}
114     , {2.00E+2, 1.E+0, 1.67167215179E+1, 9.7344396221E+2, 1.03326430431E+3, 3.1509487605E+0, 1.75284402493E+0, 2.01753219884E+0, 1.7925450811E+0, -5.17427443823E+2}
115     , {2.50E+2, 1.E+0, 1.44915694064E+1, 1.06546415063E+3, 1.13446978915E+3, 3.35425782813E+0, 1.83247044453E+0, 2.04497940878E+0, 1.9241082419E+0, -6.89315832151E+2}
116     , {-5.0E+1, 1.0E+1, 8.71169502691E+2, 9.45046152087E+1, 1.05983437607E+2, 5.72207340857E-1, 1.46022746496E+0, 2.01151069252E+0, 1.09315360536E+0, -3.31834529035E+1}
117     , {0.E+0, 1.E+1, 8.20119776501E+2, 1.95727023027E+2, 2.07920363911E+2, 9.84182294287E-1, 1.51343124327E+0, 2.07385655492E+0, 1.2151468332E+0, -7.31023706571E+1}
118     , {5.0E+1, 1.E+1, 7.67663104878E+2, 3.01106302374E+2, 3.14132850005E+2, 1.34100576876E+0, 1.59380942171E+0, 2.18159093858E+0, 1.35704025081E+0, -1.322397118E+2}
119     , {1.00E+2, 1.E+1, 7.11404611819E+2, 4.12656041694E+2, 4.26712739997E+2, 1.66467781438E+0, 1.69269713142E+0, 2.32766594585E+0, 1.50591359722E+0, -2.08518484744E+2}
120     , {1.50E+2, 1.0E+1, 6.48078931062E+2, 5.32131593218E+2, 5.47561812471E+2, 1.96835911103E+0, 1.8020451462E+0, 2.51431046831E+0, 1.65259065671E+0, -3.00779564616E+2}
121     , {2.00E+2, 1.0E+1, 5.71773909423E+2, 6.61810705711E+2, 6.79300136122E+2, 2.26235835372E+0, 1.91995651624E+0, 2.77307283281E+0, 1.7925450811E+0, -4.0862414935E+2}
122     , {2.50E+2, 1.0E+1, 4.67882263136E+2, 8.06950299149E+2, 8.28323197393E+2, 2.56136683461E+0, 2.05473841555E+0, 3.25624323228E+0, 1.9241082419E+0, -5.33028760377E+2}
123     , {-5.0E+1, 1.E+2, 9.11414392479E+2, 7.41365182423E+1, 1.83856093471E+2, 4.69290017563E-1, 1.49585619568E+0, 1.98965918304E+0, 1.09315360536E+0, -3.05855491769E+1}
124     , {0.E+0, 1.00E+2, 8.71670285716E+2, 1.69287633604E+2, 2.84009910637E+2, 8.74152489994E-1, 1.54731436858E+0, 2.02320977842E+0, 1.2151468332E+0, -6.94871190383E+1}
125     , {5.0E+1, 1.E+2, 8.34034370754E+2, 2.66880309269E+2, 3.86779444732E+2, 1.21949137069E+0, 1.62498954651E+0, 2.09238451251E+0, 1.35704025081E+0, -1.2719832717E+2}
126     , {1.00E+2, 1.00E+2, 7.97806143356E+2, 3.68251635715E+2, 4.93595368441E+2, 1.52667477593E+0, 1.71936723283E+0, 2.18250287773E+0, 1.50591359722E+0, -2.01427056924E+2}
127     , {1.50E+2, 1.00E+2, 7.62655963525E+2, 4.7403891091E+2, 6.05159632156E+2, 1.80712114232E+0, 1.82049411814E+0, 2.28059563615E+0, 1.65259065671E+0, -2.90644400463E+2}
128     , {2.00E+2, 1.00E+2, 7.28481656862E+2, 5.84381772661E+2, 7.21653588715E+2, 2.06723334266E+0, 1.92235642884E+0, 2.37872932038E+0, 1.7925450811E+0, -3.93729683418E+2}
129     , {2.50E+2, 1.00E+2, 6.9532778944E+2, 6.99144201019E+2, 8.42961263301E+2, 2.31087543559E+0, 2.02189036779E+0, 2.47265535866E+0, 1.9241082419E+0, -5.09790283112E+2}
130     };
131    
132     const unsigned ntd = sizeof(td)/sizeof(TestData);
133    
134     #endif

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