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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2300 - (show annotations) (download) (as text)
Fri Aug 20 13:50:05 2010 UTC (13 years, 9 months ago) by jpye
File MIME type: text/x-csrc
File size: 9244 byte(s)
Fixing test routine.
1 /* 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 #include "../helmholtz.h"
12
13 #define DECANE_M 142.28168 /* kg/kmol */
14 #define DECANE_R (8314.472/DECANE_M) /* J/kg/K */
15 #define DECANE_TSTAR 617.7 /* K */
16
17 const IdealData ideal_data_decane = {
18 13.9361966549 /* constant, a_1, adjust to solver s */
19 , -10.5265128286 /* linear, a_2, adjust to solver h */
20 , DECANE_TSTAR /* Tstar */
21 , DECANE_R /* cp0star */
22 , 1 /* power terms */
23 , (const IdealPowTerm[]){
24 {19.109, 0.0}
25 }
26 , 4 /* exponential terms */
27 , (const IdealExpTerm[]){
28 {25.685, 1193.0}
29 ,{28.233, 2140.0}
30 ,{12.417, 4763.0}
31 ,{10.035, 10862.0}
32 }
33 };
34
35 const HelmholtzData helmholtz_data_decane = {
36 "decane"
37 , /* R */ DECANE_R /* J/kg/K */
38 , /* M */ DECANE_M /* kg/kmol */
39 , /* rho_star */ 1.64*DECANE_M /* kg/m3(= rho_c for this model) */
40 , /* T_star */ DECANE_TSTAR /* K (= T_c for this model) */
41
42 , /* T_c */ DECANE_TSTAR
43 , /* rho_c */ 1.64*DECANE_M /* kg/m3 */
44 , /* T_t */ 0
45
46 , 0.4884 /* acentric factor */
47 , &ideal_data_decane
48 , 12 /* power terms */
49 , (const HelmholtzPowTerm[]){
50 /* a_i, t_i, d_i, l_i */
51 {1.0461, 0.25, 1.0, 0.0}
52 , {-2.4807, 1.125, 1.0, 0.0}
53 , {0.74372, 1.5, 1.0, 0.0}
54 , {-0.52579, 1.375, 2.0, 0.0}
55 , {0.15315, 0.25, 3.0, 0.0}
56 , {0.00032865, 0.875, 7.0, 0.0}
57 , {0.84178, 0.625, 2.0, 1.0}
58 , {0.055424, 1.75, 5.0, 1.0}
59 , {-0.73555, 3.625, 1.0, 2.0}
60 , {-0.18507, 3.625, 4.0, 2.0}
61 , {-0.020775, 14.5, 3.0, 3.0}
62 , {0.012335, 12.0, 4.0, 3.0}
63 }
64 , 0 /* gaussian terms */
65 , 0
66 , 0 /* critical terms */
67 , 0
68 };
69
70 /*
71 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:
72
73 ./test.py decane
74 */
75
76 #ifdef TEST
77
78 #include "../test.h"
79 #include <math.h>
80 #include <assert.h>
81 #include <stdio.h>
82
83 const TestData td[]; const unsigned ntd;
84
85 int main(void){
86 //return helm_check_u(&helmholtz_data_decane, ntd, td);
87 //return helm_check_dpdT_rho(&helmholtz_data_decane, ntd, td);
88 //return helm_check_dpdrho_T(&helmholtz_data_decane, ntd, td);
89 //return helm_check_dhdT_rho(&helmholtz_data_decane, ntd, td);
90 //return helm_check_dhdrho_T(&helmholtz_data_decane, ntd, td);
91 //return helm_check_dudT_rho(&helmholtz_data_decane, ntd, td);
92 //return helm_check_dudrho_T(&helmholtz_data_decane, ntd, td);
93 return helm_run_test_cases(&helmholtz_data_decane, ntd, td, 'C');
94 }
95
96 /*
97 A small set of data points calculated using REFPROP 8.0, for validation.
98 */
99
100 const TestData td[] = {
101 /* Temperature, Pressure, Density, Int. Energy, Enthalpy, Entropy, Cv, Cp, Cp0, Helmholtz */
102 /* (C), (MPa), (kg/m3), (kJ/kg), (kJ/kg), (kJ/kg-K), (kJ/kg-K), (kJ/kg-K), (kJ/kg-K), (kJ/kg) */
103 {0.E+0, 9.99999999996E-2, 7.45973454683E+2, -4.2578052228E+2, -4.25646469253E+2, -1.19114858816E+0, 1.6781645376E+0, 2.10398398924E+0, 1.52928460778E+0, -1.00418285425E+2}
104 , {5.0E+1, 1.E-1, 7.07075966274E+2, -3.16101971851E+2, -3.15960544332E+2, -8.22828515891E-1, 1.87244727016E+0, 2.28826672252E+0, 1.749585249E+0, -5.02049369411E+1}
105 , {1.00E+2, 1.E-1, 6.67470731788E+2, -1.96639123206E+2, -1.96489303903E+2, -4.79429319518E-1, 2.07595788789E+0, 2.49271179669E+0, 1.97525435348E+0, -1.77400726281E+1}
106 , {1.50E+2, 1.E-1, 6.25576369103E+2, -6.67046238023E+1, -6.65447712168E+1, -1.52909776185E-1, 2.27751269616E+0, 2.706187541E+0, 2.19452836322E+0, -2.00085200947E+0}
107 , {2.00E+2, 1.E-1, 3.80581810268E+0, 3.12090270786E+2, 3.38365830285E+2, 7.53354706856E-1, 2.35984030703E+0, 2.43758250007E+0, 2.40083306022E+0, -4.43595087634E+1}
108 , {2.50E+2, 1.E-1, 3.38292653385E+0, 4.35129016109E+2, 4.64689220565E+2, 1.00700445985E+0, 2.5435240352E+0, 2.61405351773E+0, 2.59119605105E+0, -9.16853670591E+1}
109 , {3.00E+2, 1.E-1, 3.05604662626E+0, 5.66872752114E+2, 5.99594765954E+2, 1.25317061242E+0, 2.71352031532E+0, 2.78012371941E+0, 2.76495915801E+0, -1.51381984395E+2}
110 , {3.50E+2, 1.E-1, 2.79236125818E+0, 7.06674205462E+2, 7.42486190643E+2, 1.49210947867E+0, 2.86908183269E+0, 2.93333982231E+0, 2.92278037035E+0, -2.23133816171E+2}
111 , {4.00E+2, 1.E-1, 2.57354383597E+0, 8.53855250253E+2, 8.92712175323E+2, 1.72393147126E+0, 3.01082705105E+0, 3.07358893911E+0, 3.06594598377E+0, -3.06609219627E+2}
112 , {0.E+0, 1.E+0, 7.46602478581E+2, -4.26123531054E+2, -4.24784130197E+2, -1.19240661155E+0, 1.67864225003E+0, 2.10340051682E+0, 1.52928460778E+0, -1.00417665108E+2}
113 , {5.0E+1, 1.E+0, 7.07922639616E+2, -3.16552893502E+2, -3.15140309776E+2, -8.24226783339E-1, 1.87287619389E+0, 2.28712304419E+0, 1.749585249E+0, -5.02040084657E+1}
114 , {1.00E+2, 1.E+0, 6.68643892983E+2, -1.97243330453E+2, -1.95747766057E+2, -4.81052390109E-1, 2.07631911299E+0, 2.4906124901E+0, 1.97525435348E+0, -1.77386310843E+1}
115 , {1.50E+2, 1.E+0, 6.2728773681E+2, -6.75439071407E+1, -6.59497423877E+1, -1.54898836583E-1, 2.27773880828E+0, 2.7021822495E+0, 2.19452836322E+0, -1.99846444069E+0}
116 , {2.00E+2, 1.E+0, 5.81677953262E+2, 7.2855155135E+1, 7.45743194843E+1, 1.58765205441E-1, 2.47107027632E+0, 2.92053240064E+0, 2.40083306022E+0, -2.26460181931E+0}
117 , {2.50E+2, 1.E+0, 5.27207054953E+2, 2.24611008852E+2, 2.26507796823E+2, 4.63812526584E-1, 2.65526803901E+0, 3.16545981843E+0, 2.59119605105E+0, -1.80325144298E+1}
118 , {3.00E+2, 1.E+0, 4.25502476076E+1, 5.38550601011E+2, 5.62052226882E+2, 1.06667124303E+0, 2.80573664144E+0, 3.15205610336E+0, 2.76495915801E+0, -7.28120219328E+1}
119 , {3.50E+2, 1.E+0, 3.38118289748E+1, 6.87438353206E+2, 7.17013801513E+2, 1.32591612902E+0, 2.92166263403E+0, 3.09630914993E+0, 2.92278037035E+0, -1.38806282591E+2}
120 , {4.00E+2, 1.E+0, 2.91999068007E+1, 8.39287158786E+2, 8.73533843435E+2, 1.5674856347E+0, 3.04505815586E+0, 3.17134686699E+0, 3.06594598377E+0, -2.15865796212E+2}
121 , {0.E+0, 1.0E+1, 7.52618344716E+2, -4.293892362E+2, -4.16102289276E+2, -1.20457509072E+0, 1.68337399291E+0, 2.09850106465E+0, 1.52928460778E+0, -1.00359550169E+2}
122 , {5.0E+1, 1.0E+1, 7.15879690825E+2, -3.20779225856E+2, -3.06810398233E+2, -8.37567729606E-1, 1.87715848658E+0, 2.27765296332E+0, 1.749585249E+0, -5.01192140337E+1}
123 , {1.00E+2, 1.E+1, 6.79374556262E+2, -2.02773862429E+2, -1.88054441591E+2, -4.96212826573E-1, 2.08004859742E+0, 2.47403949527E+0, 1.97525435348E+0, -1.76120461931E+1}
124 , {1.50E+2, 1.0E+1, 6.42244165163E+2, -7.49325278306E+1, -5.93621255718E+1, -1.7282398781E-1, 2.28051532856E+0, 2.67328849669E+0, 2.19452836322E+0, -1.80205738871E+0}
125 , {2.00E+2, 1.0E+1, 6.03687157514E+2, 6.26176251741E+1, 7.91824963587E+1, 1.36443595504E-1, 2.47182059277E+0, 2.8671576013E+0, 2.40083306022E+0, -1.94066203845E+0}
126 , {2.50E+2, 1.0E+1, 5.62863023249E+2, 2.09426123966E+2, 2.27192435817E+2, 4.33657650726E-1, 2.6508610651E+0, 3.05141034721E+0, 2.59119605105E+0, -1.74418760108E+1}
127 , {3.00E+2, 1.0E+1, 5.18920448496E+2, 3.64848633148E+2, 3.84119409678E+2, 7.20021677415E-1, 2.81692486607E+0, 3.22336289062E+0, 2.76495915801E+0, -4.78317912626E+1}
128 , {3.50E+2, 1.0E+1, 4.71362243852E+2, 5.28042794079E+2, 5.49257900148E+2, 9.96173871154E-1, 2.9703774624E+0, 3.37899315719E+0, 2.92278037035E+0, -9.27229537306E+1}
129 , {4.00E+2, 1.E+1, 4.20901626277E+2, 6.97908893377E+2, 7.21667414075E+2, 1.26224144264E+0, 3.11116653439E+0, 3.51390000636E+0, 3.06594598377E+0, -1.51768933734E+2}
130 , {5.0E+1, 1.E+2, 7.69124060494E+2, -3.47861990994E+2, -2.17843954715E+2, -9.36104418657E-1, 1.9160808825E+0, 2.25563104975E+0, 1.749585249E+0, -4.53598481048E+1}
131 , {1.00E+2, 1.00E+2, 7.4379410551E+2, -2.35017519157E+2, -1.00571710486E+2, -5.98991846303E-1, 2.11601855501E+0, 2.43650053268E+0, 1.97525435348E+0, -1.15037117092E+1}
132 , {1.50E+2, 1.E+2, 7.20018289364E+2, -1.1306205919E+2, 2.5823301748E+1, -2.813579992E-1, 2.31364865707E+0, 2.61860950226E+0, 2.19452836322E+0, 5.99457817189E+0}
133 , {2.00E+2, 1.00E+2, 6.97554608485E+2, 1.78021344305E+1, 1.61160086315E+2, 2.07643007388E-2, 2.50173915385E+0, 2.79311342762E+0, 2.40083306022E+0, 7.97750553589E+0}
134 , {2.50E+2, 1.E+2, 6.76259991581E+2, 1.57059587206E+2, 3.04931709237E+2, 3.09481450381E-1, 2.6766932023E+0, 2.95553425241E+0, 2.59119605105E+0, -4.84563356116E+0}
135 , {3.00E+2, 1.00E+2, 6.56048338801E+2, 3.04056039497E+2, 4.56483831911E+2, 5.86049424008E-1, 2.83733093812E+0, 3.10422844825E+0, 2.76495915801E+0, -3.18381878727E+1}
136 , {3.50E+2, 1.00E+2, 6.368650397E+2, 4.58106597572E+2, 6.15125736269E+2, 8.5134625997E-1, 2.98389032448E+0, 3.23922114254E+0, 2.92278037035E+0, -7.24098243282E+1}
137 , {4.00E+2, 1.00E+2, 6.18670919551E+2, 6.18555389255E+2, 7.80192209154E+2, 1.1060852784E+0, 3.11732261704E+0, 3.36140073752E+0, 3.06594598377E+0, -1.26005915903E+2}
138 };
139
140 const unsigned ntd = sizeof(td)/sizeof(TestData);
141
142 #endif

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