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

Contents of /trunk/models/johnpye/fprops/fluids/toluene.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2664 - (show annotations) (download) (as text)
Fri Jan 18 06:02:15 2013 UTC (10 years, 8 months ago) by jpye
File MIME type: text/x-csrc
File size: 9907 byte(s)
Trying to debug fprops_triple_point for Toluene with pengrob correlation. Something strange is happening with fratio.
1 /* This file is created by Hongke Zhu, 05-30-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 http://dx.doi.org/10.1021/je050186n
10 */
11
12 /*
13 NOTE: Another EOS for toluene is
14 J. Phys. Chem. Ref. Data 18, 1565 (1989)
15 http://dx.doi.org/10.1063/1.555837
16 The triple-point temperature entered below has been taken from the abstract of
17 that article. -- jpye
18 */
19
20 #include "../helmholtz.h"
21
22 #define TOLUENE_M 92.13842 /* kg/kmol */
23 #define TOLUENE_R (8314.472/TOLUENE_M) /* J/kg/K */
24 #define TOLUENE_TC 591.75 /* K */
25
26 static const IdealData ideal_data_toluene = {
27 IDEAL_CP0
28 ,.data={.cp0={
29 TOLUENE_R /* cp0star */
30 , 1. /* Tstar */
31 , 1 /* power terms */
32 , (const Cp0PowTerm[]){
33 {4.0, 0.0}
34 }
35 , 5 /* exponential terms */
36 , (const Cp0ExpTerm[]){
37 {1.6994, 190.0}
38 ,{8.0577, 797.0}
39 ,{17.059, 1619.0}
40 ,{8.4567, 3072.0}
41 ,{8.6423, 7915.0}
42 }
43 }}
44 };
45
46 static HelmholtzData helmholtz_data_toluene = {
47 /* R */ TOLUENE_R /* J/kg/K */
48 , /* M */ TOLUENE_M /* kg/kmol */
49 , /* rho_star */ 3.169*TOLUENE_M /* kg/m3(= rho_c for this model) */
50 , /* T_star */ TOLUENE_TC /* K (= T_c for this model) */
51
52 , /* T_c */ TOLUENE_TC
53 , /* rho_c */ 3.169*TOLUENE_M /* kg/m3 */
54 , /* T_t */ 178.15
55
56 ,{FPROPS_REF_TPF}
57
58 , 0.2657 /* acentric factor */
59 , &ideal_data_toluene
60 , 12 /* power terms */
61 , (const HelmholtzPowTerm[]){
62 /* a_i, t_i, d_i, l_i */
63 {0.96464, 0.25, 1.0, 0.0}
64 , {-2.7855, 1.125, 1.0, 0.0}
65 , {0.86712, 1.5, 1.0, 0.0}
66 , {-0.18860, 1.375, 2.0, 0.0}
67 , {0.11804, 0.25, 3.0, 0.0}
68 , {0.00025181, 0.875, 7.0, 0.0}
69 , {0.57196, 0.625, 2.0, 1.0}
70 , {-0.029287, 1.75, 5.0, 1.0}
71 , {-0.43351, 3.625, 1.0, 2.0}
72 , {-0.12540, 3.625, 4.0, 2.0}
73 , {-0.028207, 14.5, 3.0, 3.0}
74 , {0.014076, 12.0, 4.0, 3.0}
75 }
76 , 0 /* gaussian terms */
77 , 0
78 , 0 /* critical terms */
79 , 0
80 };
81
82 EosData eos_toluene = {
83 "toluene"
84 ,"Lemmon, E.W. and Span, R., Short Fundamental Equations of State for "
85 "20 Industrial Fluids, J. Chem. Eng. Data, 51:785-850, 2006."
86 ,NULL
87 ,100
88 ,FPROPS_HELMHOLTZ
89 ,.data = {.helm = &helmholtz_data_toluene}
90 };
91
92 /*
93 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:
94
95 ./test.py toluene
96 */
97
98 #ifdef TEST
99
100 #include "../test.h"
101 #include "../refstate.h"
102 #include <math.h>
103 #include <assert.h>
104 #include <stdio.h>
105
106 const TestData td[]; const unsigned ntd;
107
108 int main(void){
109 PureFluid *P = helmholtz_prepare(&eos_toluene, NULL);
110 // refprop test test is evaluated with NBP refstate.
111 ReferenceState R = {FPROPS_REF_NBP};
112 fprops_set_reference_state(P, &R);
113 return helm_run_test_cases(P, ntd, td, 'C');
114 }
115
116 /*
117 A small set of data points calculated using REFPROP 8.0, for validation.
118 */
119
120 const TestData td[] = {
121 /* Temperature, Pressure, Density, Int. Energy, Enthalpy, Entropy, Cv, Cp, Cp0, Helmholtz */
122 /* (C), (MPa), (kg/m3), (kJ/kg), (kJ/kg), (kJ/kg-K), (kJ/kg-K), (kJ/kg-K), (kJ/kg-K), (kJ/kg) */
123 {-5.0E+1, 1.E-1, 9.31743793959E+2, -2.7796368849E+2, -2.77856362849E+2, -9.25814804729E-1, 1.07384880219E+0, 1.50887939453E+0, 8.38890037116E-1, -7.13681148149E+1}
124 , {0.E+0, 9.99999999996E-2, 8.85419387005E+2, -1.99843470166E+2, -1.99730529336E+2, -6.10308234395E-1, 1.19089523756E+0, 1.62560892646E+0, 1.02841980232E+0, -3.31377759406E+1}
125 , {5.0E+1, 1.E-1, 8.38754983998E+2, -1.14735284355E+2, -1.14616060026E+2, -3.24533529551E-1, 1.33853508371E+0, 1.78371445343E+0, 1.22469884825E+0, -9.86227428075E+0}
126 , {1.50E+2, 1.E-1, 2.69429585055E+0, 3.85101004755E+2, 4.22216453669E+2, 1.09358991193E+0, 1.52002251543E+0, 1.62359031397E+0, 1.59888115103E+0, -7.76515664768E+1}
127 , {2.00E+2, 1.E-1, 2.38736332985E+0, 4.65512094897E+2, 5.07399309444E+2, 1.28369895035E+0, 1.6836656191E+0, 1.78238579208E+0, 1.76720735298E+0, -1.41870063464E+2}
128 , {2.50E+2, 1.E-1, 2.14721426926E+0, 5.53713851288E+2, 6.00285821971E+2, 1.47019351709E+0, 1.83511624268E+0, 1.93116525555E+0, 1.92117094296E+0, -2.15417887177E+2}
129 , {3.00E+2, 1.E-1, 1.95289285094E+0, 6.49109840771E+2, 7.00315927143E+2, 1.65271191868E+0, 1.97356072949E+0, 2.06800343182E+0, 2.06105997822E+0, -2.9814199542E+2}
130 , {3.50E+2, 1.E-1, 1.79184023263E+0, 7.51075700012E+2, 8.06884247102E+2, 1.83090624556E+0, 2.09933747328E+0, 2.1927494985E+0, 2.18771144326E+0, -3.89853526911E+2}
131 , {4.00E+2, 1.E-1, 1.65590084724E+0, 8.59009047394E+2, 9.19399136672E+2, 2.00453009567E+0, 2.21328523848E+0, 2.30600117377E+0, 2.30221176489E+0, -4.90340386509E+2}
132 , {-5.0E+1, 1.E+0, 9.32207565139E+2, -2.78179292315E+2, -2.77106569847E+2, -9.26782303099E-1, 1.07427629453E+0, 1.50858834154E+0, 8.38890037116E-1, -7.13678213784E+1}
133 , {0.E+0, 1.E+0, 8.86033380271E+2, -2.00132072626E+2, -1.99003446976E+2, -6.11366379883E-1, 1.19128753461E+0, 1.62496714699E+0, 1.02841980232E+0, -3.31373459609E+1}
134 , {5.0E+1, 1.E+0, 8.3958584182E+2, -1.15125134625E+2, -1.13934071186E+2, -3.25741940993E-1, 1.33889140649E+0, 1.7824997272E+0, 1.22469884825E+0, -9.86162639319E+0}
135 , {1.00E+2, 1.E+0, 7.91130896553E+2, -2.16789998444E+1, -2.04149865131E+1, -5.6969054417E-2, 1.49674976629E+0, 1.96080050415E+0, 1.41703917458E+0, -4.20997188675E-1}
136 , {1.50E+2, 1.E+0, 7.38395261674E+2, 8.10317064931E+1, 8.23859947069E+1, 2.01313426949E-1, 1.65400288421E+0, 2.15406959251E+0, 1.59888115103E+0, -4.15407012041E+0}
137 , {2.00E+2, 1.E+0, 6.77129835671E+2, 1.93978591969E+2, 1.95455413617E+2, 4.53648001343E-1, 1.80655663525E+0, 2.37690961138E+0, 1.76720735298E+0, -2.06649598667E+1}
138 , {2.50E+2, 1.E+0, 2.49627622843E+1, 5.38081210417E+2, 5.7814087964E+2, 1.23164608461E+0, 1.88118032657E+0, 2.0693380049E+0, 1.92117094296E+0, -1.06254438746E+2}
139 , {3.00E+2, 1.E+0, 2.16350515476E+1, 6.37281069395E+2, 6.83502359776E+2, 1.42393539817E+0, 2.0014232814E+0, 2.15062073477E+0, 2.06105997822E+0, -1.78847504064E+2}
140 , {3.50E+2, 1.E+0, 1.92924863667E+1, 7.41616700051E+2, 7.93450350779E+2, 1.60779903495E+0, 2.11760752094E+0, 2.24805995325E+0, 2.18771144326E+0, -2.60283268576E+2}
141 , {4.00E+2, 1.E+0, 1.75004322593E+1, 8.51163018135E+2, 9.08304463854E+2, 1.78504154113E+0, 2.22586838681E+0, 2.34555674226E+0, 2.30221176489E+0, -3.5043769528E+2}
142 , {-5.0E+1, 1.E+1, 9.36727788816E+2, -2.80267410541E+2, -2.69591950584E+2, -9.36266381005E-1, 1.07851455093E+0, 1.50600823748E+0, 8.38890037116E-1, -7.13395676195E+1}
143 , {0.E+0, 1.E+1, 8.91959337438E+2, -2.02902532625E+2, -1.91691259218E+2, -6.21658410429E-1, 1.1951828844E+0, 1.61925493694E+0, 1.02841980232E+0, -3.30965378162E+1}
144 , {5.0E+1, 1.E+1, 8.47486829864E+2, -1.18818497603E+2, -1.07018904208E+2, -3.37357392234E-1, 1.34246036063E+0, 1.771932411E+0, 1.22469884825E+0, -9.8014563027E+0}
145 , {1.00E+2, 1.0E+1, 8.0199652593E+2, -2.66874266563E+1, -1.4218544714E+1, -7.06380222827E-2, 1.49983247469E+0, 1.94175266803E+0, 1.41703917458E+0, -3.28848641518E-1}
146 , {1.50E+2, 1.E+1, 7.5413911195E+2, 7.39982234251E+1, 8.72583764148E+1, 1.84336650958E-1, 1.65607520889E+0, 2.11796397795E+0, 1.59888115103E+0, -4.00383042763E+0}
147 , {2.00E+2, 1.0E+1, 7.02159553333E+2, 1.83398991354E+2, 1.97640768671E+2, 4.30712229641E-1, 1.80596612667E+0, 2.29819286688E+0, 1.76720735298E+0, -2.03925001012E+1}
148 , {2.50E+2, 1.E+1, 6.43324013205E+2, 3.01683224538E+2, 3.17227491183E+2, 6.70816628508E-1, 1.94803306926E+0, 2.48773450236E+0, 1.92117094296E+0, -4.92544946658E+1}
149 , {3.00E+2, 1.0E+1, 5.72859618395E+2, 4.29360247452E+2, 4.46816531119E+2, 9.07244126514E-1, 2.08348637479E+0, 2.70190132108E+0, 2.06105997822E+0, -9.06267236595E+1}
150 , {3.50E+2, 1.E+1, 4.82619870864E+2, 5.67597152334E+2, 5.8831739326E+2, 1.14379007454E+0, 2.21523200371E+0, 2.97081799384E+0, 2.18771144326E+0, -1.45155632618E+2}
151 , {4.00E+2, 1.0E+1, 3.65230216705E+2, 7.17850609477E+2, 7.4523060035E+2, 1.38583603049E+0, 2.33671225313E+0, 3.2982167038E+0, 2.30221176489E+0, -2.15024914449E+2}
152 , {-5.0E+1, 1.E+2, 9.73566463577E+2, -2.96216684786E+2, -1.93501560815E+2, -1.01712496304E+0, 1.11729804312E+0, 1.49926828361E+0, 8.38890037116E-1, -6.92452492835E+1}
153 , {0.E+0, 1.E+2, 9.37443850448E+2, -2.22970896912E+2, -1.16297841292E+2, -7.05285374483E-1, 1.23072858986E+0, 1.59783063726E+0, 1.02841980232E+0, -3.03221968722E+1}
154 , {5.0E+1, 1.E+2, 9.03531938134E+2, -1.43790236941E+2, -3.31134630721E+1, -4.25946342246E-1, 1.37563800318E+0, 1.73326853589E+0, 1.22469884825E+0, -6.145676444E+0}
155 , {1.00E+2, 1.00E+2, 8.71213552893E+2, -5.75473793707E+1, 5.72350407006E+1, -1.66244396499E-1, 1.53086320484E+0, 1.88141745562E+0, 1.41703917458E+0, 4.48671718295E+0}
156 , {1.50E+2, 1.00E+2, 8.40154382932E+2, 3.59871832857E+1, 1.55012926687E+2, 7.94652387002E-2, 1.68461309027E+0, 2.02885809284E+0, 1.59888115103E+0, 2.36146752972E+0}
157 , {2.00E+2, 1.E+2, 8.10185114722E+2, 1.36563902604E+2, 2.59992484767E+2, 3.13814186704E-1, 1.83095981571E+0, 2.16871650277E+0, 1.76720735298E+0, -1.19172798353E+1}
158 , {2.50E+2, 1.E+2, 7.81239534376E+2, 2.43703017915E+2, 3.71704732626E+2, 5.38148355014E-1, 1.96729881569E+0, 2.29784940076E+0, 1.92117094296E+0, -3.78292940101E+1}
159 , {3.00E+2, 1.00E+2, 7.53316072149E+2, 3.5683335895E+2, 4.8957976341E+2, 7.53257738589E-1, 2.09278400386E+0, 2.41515873717E+0, 2.06105997822E+0, -7.48963139225E+1}
160 , {3.50E+2, 1.00E+2, 7.26449934804E+2, 4.75368020599E+2, 6.1302375599E+2, 9.5969283105E-1, 2.20747956844E+0, 2.52067761592E+0, 2.18771144326E+0, -1.2266456707E+2}
161 , {4.00E+2, 1.00E+2, 7.00691111197E+2, 5.98745791333E+2, 7.41462030203E+2, 1.15790567127E+0, 2.31192175921E+0, 2.61507812375E+0, 2.30221176489E+0, -1.80698411281E+2}
162 };
163
164 const unsigned ntd = sizeof(td)/sizeof(TestData);
165
166 #endif

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