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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2301 - (show annotations) (download) (as text)
Sat Aug 21 13:28:35 2010 UTC (13 years, 9 months ago) by jpye
File MIME type: text/x-csrc
File size: 6674 byte(s)
Regen toluene model working, next water.
1 /* This file is created by Hongke Zhu, 01-27-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 CARBONMONOXIDE_M 28.0101 /* kg/kmol */
14 #define CARBONMONOXIDE_R (8314.472/CARBONMONOXIDE_M) /* J/kg/K */
15 #define CARBONMONOXIDE_TSTAR 132.86 /* K */
16
17 const IdealData ideal_data_carbonmonoxide = {
18 -3.3728318564 /* constant, a_1, adjust to solver s */
19 , 3.3683460039 /* linear, a_2, adjust to solver h */
20 , CARBONMONOXIDE_TSTAR /* Tstar */
21 , CARBONMONOXIDE_R /* cp0star */
22 , 2 /* power terms */
23 , (const IdealPowTerm[]){
24 {3.5, 0.0}
25 ,{0.22311e-6, 1.5}
26 }
27 , 1 /* exponential terms */
28 , (const IdealExpTerm[]){
29 {1.0128,3089.0}
30 }
31 };
32
33 const HelmholtzData helmholtz_data_carbonmonoxide = {
34 "carbonmonoxide"
35 , /* R */ CARBONMONOXIDE_R /* J/kg/K */
36 , /* M */ CARBONMONOXIDE_M /* kg/kmol */
37 , /* rho_star */ 10.85*CARBONMONOXIDE_M /* kg/m3(= rho_c for this model) */
38 , /* T_star */ CARBONMONOXIDE_TSTAR /* K (= T_c for this model) */
39
40 , /* T_c */ CARBONMONOXIDE_TSTAR
41 , /* rho_c */ 10.85*CARBONMONOXIDE_M /* kg/m3 */
42 , /* T_t */ 68.16
43
44 , 0.0497 /* acentric factor */
45 , &ideal_data_carbonmonoxide
46 , 12 /* power terms */
47 , (const HelmholtzPowTerm[]){
48 /* a_i, t_i, d_i, l_i */
49 {0.90554, 0.25, 1.0, 0.0}
50 , {-2.4515, 1.125, 1.0, 0.0}
51 , {0.53149, 1.5, 1.0, 0.0}
52 , {0.024173, 1.375, 2.0, 0.0}
53 , {0.072156, 0.25, 3.0, 0.0}
54 , {0.00018818, 0.875, 7.0, 0.0}
55 , {0.19405, 0.625, 2.0, 1.0}
56 , {-0.043268, 1.75, 5.0, 1.0}
57 , {-0.12778, 3.625, 1.0, 2.0}
58 , {-0.027896, 3.625, 4.0, 2.0}
59 , {-0.034154, 14.5, 3.0, 3.0}
60 , {0.016329, 12.0, 4.0, 3.0}
61 }
62 , 0 /* gaussian terms */
63 , 0
64 , 0 /* critical terms */
65 , 0
66 };
67
68 /*
69 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:
70
71 ./test.py carbonmonoxide
72 */
73
74 #ifdef TEST
75
76 #include "../test.h"
77 #include <math.h>
78 #include <assert.h>
79 #include <stdio.h>
80
81 const TestData td[]; const unsigned ntd;
82
83 int main(void){
84 //return helm_check_u(&helmholtz_data_carbonmonoxide, ntd, td);
85 //return helm_check_dpdT_rho(&helmholtz_data_carbonmonoxide, ntd, td);
86 //return helm_check_dpdrho_T(&helmholtz_data_carbonmonoxide, ntd, td);
87 //return helm_check_dhdT_rho(&helmholtz_data_carbonmonoxide, ntd, td);
88 //return helm_check_dhdrho_T(&helmholtz_data_carbonmonoxide, ntd, td);
89 //return helm_check_dudT_rho(&helmholtz_data_carbonmonoxide, ntd, td);
90 //return helm_check_dudrho_T(&helmholtz_data_carbonmonoxide, ntd, td);
91 return helm_run_test_cases(&helmholtz_data_carbonmonoxide, ntd, td, 'C');
92 }
93
94 /*
95 A small set of data points calculated using REFPROP 8.0, for validation.
96 */
97
98 const TestData td[] = {
99 /* Temperature, Pressure, Density, Int. Energy, Enthalpy, Entropy, Cv, Cp, Cp0, Helmholtz */
100 /* (C), (MPa), (kg/m3), (kJ/kg), (kJ/kg), (kJ/kg-K), (kJ/kg-K), (kJ/kg-K), (kJ/kg-K), (kJ/kg) */
101 {-2.00E+2, 1.E-1, 8.29328555035E+2, -1.8290292793E+1, -1.81697133202E+1, -2.34979295116E-1, 1.2119454996E+0, 2.14153917477E+0, 1.03897567593E+0, -1.10155735531E+0}
102 , {-1.50E+2, 1.E-1, 2.76874115186E+0, 2.23405562257E+2, 2.59523059168E+2, 3.07850383224E+0, 7.46796245568E-1, 1.0574377805E+0, 1.03902475277E+0, -1.55712184683E+2}
103 , {-1.00E+2, 1.E-1, 1.95392948958E+0, 2.60857241171E+2, 3.12036160643E+2, 3.43649346164E+0, 7.43417572052E-1, 1.04593884434E+0, 1.03908684592E+0, -3.34171601711E+2}
104 , {-5.0E+1, 1.E-1, 1.51228016621E+0, 2.98115816861E+2, 3.64241130302E+2, 3.70138331192E+0, 7.42880987463E-1, 1.04281410032E+0, 1.03921107158E+0, -5.27847869194E+2}
105 , {0.E+0, 1.E-1, 1.23413765995E+0, 3.35324780203E+2, 4.16353018174E+2, 3.91210272705E+0, 7.43166674335E-1, 1.04193604776E+0, 1.03970477998E+0, -7.33266079692E+2}
106 , {-2.00E+2, 1.E+0, 8.31072255319E+2, -1.86815349254E+1, -1.74782701147E+1, -2.4034674961E-1, 1.21384211601E+0, 2.13541693713E+0, 1.03897567593E+0, -1.10017019146E+0}
107 , {-1.50E+2, 1.E+0, 3.15192242831E+1, 2.14821500604E+2, 2.46548169732E+2, 2.32317826027E+0, 8.00653211592E-1, 1.30866162554E+0, 1.03902475277E+0, -7.12779021481E+1}
108 , {-1.00E+2, 1.E+0, 2.03266855152E+1, 2.56298155595E+2, 3.05494567831E+2, 2.7266210416E+0, 7.54415960617E-1, 1.11497470398E+0, 1.03908684592E+0, -2.15816277759E+2}
109 , {-5.0E+1, 1.E+0, 1.53550056449E+1, 2.94981658346E+2, 3.60107000734E+2, 3.00391080856E+0, 7.47544177798E-1, 1.07661342833E+0, 1.03921107158E+0, -3.75341038583E+2}
110 , {0.E+0, 1.E+0, 1.24102874687E+1, 3.3295016662E+2, 4.13528477357E+2, 3.21997101165E+0, 7.45894434653E-1, 1.06227419038E+0, 1.03970477998E+0, -5.46584915212E+2}
111 , {-2.00E+2, 1.E+1, 8.46976747929E+2, -2.21914952161E+1, -1.03847956527E+1, -2.89982477768E-1, 1.23205777921E+0, 2.08723578937E+0, 1.03897567593E+0, -9.7927696739E-1}
112 , {-1.50E+2, 1.E+1, 6.33015776744E+2, 7.93839124778E+1, 9.51813070569E+1, 8.06052933334E-1, 9.68366965064E-1, 2.27403584685E+0, 1.03902475277E+0, -1.98815062623E+1}
113 , {-1.00E+2, 1.0E+1, 2.97599842806E+2, 1.94798945671E+2, 2.28401113957E+2, 1.70870238067E+0, 8.62292602302E-1, 2.48221917192E+0, 1.03908684592E+0, -1.01062871542E+2}
114 , {-5.0E+1, 1.E+1, 1.70258877184E+2, 2.61830688998E+2, 3.20564777731E+2, 2.18144240967E+0, 7.94196100349E-1, 1.48721097248E+0, 1.03921107158E+0, -2.24958184719E+2}
115 , {0.E+0, 1.0E+1, 1.26883698829E+2, 3.09631442692E+2, 3.88443773136E+2, 2.45664303017E+0, 7.73136316622E-1, 1.26831468771E+0, 1.03970477998E+0, -3.61400601E+2}
116 , {-1.50E+2, 1.00E+2, 8.33990263416E+2, 3.76942335904E+1, 1.57599710173E+2, 3.47546148332E-1, 1.08979809065E+0, 1.72135078323E+0, 1.03902475277E+0, -5.10607457667E+0}
117 , {-1.00E+2, 1.00E+2, 7.41259758873E+2, 1.0559194585E+2, 2.40497421027E+2, 9.13653621509E-1, 9.79801320404E-1, 1.60143520423E+0, 1.03908684592E+0, -5.2607178714E+1}
118 , {-5.0E+1, 1.00E+2, 6.6220769714E+2, 1.67080780623E+2, 3.18090804263E+2, 1.30785975111E+0, 9.20056641118E-1, 1.50461036402E+0, 1.03921107158E+0, -1.24768122837E+2}
119 , {0.E+0, 1.00E+2, 5.96334255498E+2, 2.23508819016E+2, 3.91200007436E+2, 1.60375988438E+0, 8.8347021931E-1, 1.42242457881E+0, 1.03970477998E+0, -2.14558193401E+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