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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2284 - (show annotations) (download) (as text)
Sat Aug 14 10:52:06 2010 UTC (9 years, 2 months ago) by jpye
File MIME type: text/x-csrc
File size: 9707 byte(s)
Working on combined cycle simulation using toluene in the bottoming cycle.
Seem to be getting negative values of h and s for toluene in some cases.
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: aAnother 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 "toluene.h"
21
22 #define TOLUENE_M 92.13842 /* kg/kmol */
23 #define TOLUENE_R (8314.472/TOLUENE_M) /* J/kg/K */
24 #define TOLUENE_TSTAR 591.75 /* K */
25
26
27 const IdealData ideal_data_toluene = {
28 3.5241174832 /* constant */
29 , 1.1360823464 /* linear */
30 , TOLUENE_TSTAR /* Tstar */
31 , TOLUENE_R /* cp0star */
32 , 1 /* power terms */
33 , (const IdealPowTerm[]){
34 {4.0, 0.0}
35 }
36 , 5 /* exponential terms */
37 , (const IdealExpTerm[]){
38 {1.6994, 190.0}
39 ,{8.0577, 797.0}
40 ,{17.059, 1619.0}
41 ,{8.4567, 3072.0}
42 ,{8.6423, 7915.0}
43 }
44 };
45
46 const HelmholtzData helmholtz_data_toluene = {
47 "toluene"
48 , /* R */ TOLUENE_R /* J/kg/K */
49 , /* M */ TOLUENE_M /* kg/kmol */
50 , /* rho_star */ 3.169*TOLUENE_M /* kg/m3(= rho_c for this model) */
51 , /* T_star */ TOLUENE_TSTAR /* K (= T_c for this model) */
52
53 , /* T_c */ TOLUENE_TSTAR
54 , /* rho_c */ 3.169*TOLUENE_M /* kg/m3 */
55 , /* T_t */ 178.15
56
57 , 0.2657 /* acentric factor */
58 , &ideal_data_toluene
59 , 12 /* power terms */
60 , (const HelmholtzPowTerm[]){
61 /* a_i, t_i, d_i, l_i */
62 {0.96464, 0.25, 1.0, 0.0}
63 , {-2.7855, 1.125, 1.0, 0.0}
64 , {0.86712, 1.5, 1.0, 0.0}
65 , {-0.18860, 1.375, 2.0, 0.0}
66 , {0.11804, 0.25, 3.0, 0.0}
67 , {0.00025181, 0.875, 7.0, 0.0}
68 , {0.57196, 0.625, 2.0, 1.0}
69 , {-0.029287, 1.75, 5.0, 1.0}
70 , {-0.43351, 3.625, 1.0, 2.0}
71 , {-0.12540, 3.625, 4.0, 2.0}
72 , {-0.028207, 14.5, 3.0, 3.0}
73 , {0.014076, 12.0, 4.0, 3.0}
74 }
75 , 0 /* gaussian terms */
76 , 0
77 , 0 /* critical terms */
78 , 0
79 };
80
81 /*
82 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:
83
84 ./test.py toluene
85 */
86
87 #ifdef TEST
88
89 #include "test.h"
90 #include <math.h>
91 #include <assert.h>
92 #include <stdio.h>
93
94 const TestData td[]; const unsigned ntd;
95
96 int main(void){
97 return helm_run_test_cases(&helmholtz_data_toluene, ntd, td, 'C');
98 }
99
100 /*
101 A small set of data points calculated using REFPROP 8.0, for validation.
102 */
103
104 const TestData td[] = {
105 /* Temperature, Pressure, Density, Int. Energy, Enthalpy, Entropy, Cv, Cp, Cp0, Helmholtz */
106 /* (C), (MPa), (kg/m3), (kJ/kg), (kJ/kg), (kJ/kg-K), (kJ/kg-K), (kJ/kg-K), (kJ/kg-K), (kJ/kg) */
107 {-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}
108 , {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}
109 , {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}
110 , {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}
111 , {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}
112 , {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}
113 , {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}
114 , {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}
115 , {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}
116 , {-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}
117 , {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}
118 , {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}
119 , {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}
120 , {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}
121 , {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}
122 , {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}
123 , {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}
124 , {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}
125 , {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}
126 , {-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}
127 , {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}
128 , {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}
129 , {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}
130 , {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}
131 , {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}
132 , {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}
133 , {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}
134 , {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}
135 , {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}
136 , {-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}
137 , {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}
138 , {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}
139 , {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}
140 , {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}
141 , {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}
142 , {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}
143 , {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}
144 , {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}
145 , {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}
146 };
147
148 const unsigned ntd = sizeof(td)/sizeof(TestData);
149
150 #endif

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