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

Annotation of /trunk/models/johnpye/fprops/fluids/carbonylsulfide.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: 8607 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 CARBONYLSULFIDE_M 60.0751 /* kg/kmol */
14     #define CARBONYLSULFIDE_R (8314.472/CARBONYLSULFIDE_M) /* J/kg/K */
15     #define CARBONYLSULFIDE_TSTAR 378.77 /* K */
16    
17     const IdealData ideal_data_carbonylsulfide = {
18     -3.6587449805 /* constant, a_1, adjust to solver s */
19     , 3.7349245016 /* linear, a_2, adjust to solver h */
20     , CARBONYLSULFIDE_TSTAR /* Tstar */
21     , CARBONYLSULFIDE_R /* cp0star */
22     , 1 /* power terms */
23     , (const IdealPowTerm[]){
24     {3.5, 0.0}
25     }
26     , 4 /* exponential terms */
27     , (const IdealExpTerm[]){
28     {2.1651, 768.0}
29     ,{0.93456, 1363.0}
30     ,{1.0623, 3175.0}
31     ,{0.34269, 12829.0}
32     }
33     };
34    
35     const HelmholtzData helmholtz_data_carbonylsulfide = {
36     "carbonylsulfide"
37     , /* R */ CARBONYLSULFIDE_R /* J/kg/K */
38     , /* M */ CARBONYLSULFIDE_M /* kg/kmol */
39     , /* rho_star */ 7.41*CARBONYLSULFIDE_M /* kg/m3(= rho_c for this model) */
40     , /* T_star */ CARBONYLSULFIDE_TSTAR /* K (= T_c for this model) */
41    
42     , /* T_c */ CARBONYLSULFIDE_TSTAR
43     , /* rho_c */ 7.41*CARBONYLSULFIDE_M /* kg/m3 */
44 jpye 2301 , /* T_t */ 134.3
45 hongke 2280
46     , 0.0978 /* acentric factor */
47     , &ideal_data_carbonylsulfide
48     , 12 /* power terms */
49     , (const HelmholtzPowTerm[]){
50     /* a_i, t_i, d_i, l_i */
51     {0.94374, 0.25, 1.0, 0.0}
52     , {-2.5348, 1.125, 1.0, 0.0}
53     , {0.59058, 1.5, 1.0, 0.0}
54     , {-0.021488, 1.375, 2.0, 0.0}
55     , {0.082083, 0.25, 3.0, 0.0}
56     , {0.00024689, 0.875, 7.0, 0.0}
57     , {0.21226, 0.625, 2.0, 1.0}
58     , {-0.041251, 1.75, 5.0, 1.0}
59     , {-0.22333, 3.625, 1.0, 2.0}
60     , {-0.050828, 3.625, 4.0, 2.0}
61     , {-0.028333, 14.5, 3.0, 3.0}
62     , {0.016983, 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 carbonylsulfide
74     */
75    
76     #ifdef TEST
77    
78 jpye 2300 #include "../test.h"
79 hongke 2280 #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_carbonylsulfide, ntd, td);
87     //return helm_check_dpdT_rho(&helmholtz_data_carbonylsulfide, ntd, td);
88     //return helm_check_dpdrho_T(&helmholtz_data_carbonylsulfide, ntd, td);
89     //return helm_check_dhdT_rho(&helmholtz_data_carbonylsulfide, ntd, td);
90     //return helm_check_dhdrho_T(&helmholtz_data_carbonylsulfide, ntd, td);
91     //return helm_check_dudT_rho(&helmholtz_data_carbonylsulfide, ntd, td);
92     //return helm_check_dudrho_T(&helmholtz_data_carbonylsulfide, ntd, td);
93     return helm_run_test_cases(&helmholtz_data_carbonylsulfide, 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     {-1.00E+2, 9.99999999999E-2, 1.27622789263E+3, -5.8290521228E+1, -5.82121653163E+1, -2.95390152407E-1, 7.43168548616E-1, 1.16891418867E+0, 5.59004634633E-1, -7.14371633876E+0}
104     , {-5.0E+1, 1.E-1, 3.33111970832E+0, 2.79043203476E+2, 3.09063139341E+2, 1.38777409653E+0, 4.93605311433E-1, 6.51087576931E-1, 6.16471293519E-1, -3.06385861654E+1}
105     , {0.E+0, 1.E-1, 2.68405891929E+0, 3.05078652556E+2, 3.42335658832E+2, 1.5222036634E+0, 5.35384421038E-1, 6.82531319795E-1, 6.67979502845E-1, -1.10711278102E+2}
106     , {5.0E+1, 1.E-1, 2.2552758466E+0, 3.33036004879E+2, 3.77376478862E+2, 1.63992225947E+0, 5.75375918047E-1, 7.18750689013E-1, 7.11092311406E-1, -1.96904873268E+2}
107     , {1.00E+2, 1.E-1, 1.9470522898E+0, 3.62787144534E+2, 4.14146833498E+2, 1.74566458331E+0, 6.09711517468E-1, 7.51312975876E-1, 7.46701780621E-1, -2.88607594729E+2}
108     , {1.50E+2, 1.E-1, 1.71390439336E+0, 3.94087786721E+2, 4.52434098445E+2, 1.84191705432E+0, 6.3885370514E-1, 7.79488807867E-1, 7.76437557365E-1, -3.85319414815E+2}
109     , {2.00E+2, 1.E-1, 1.53106015998E+0, 4.26719269767E+2, 4.92033489688E+2, 1.93034539625E+0, 6.63880207642E-1, 8.03931688635E-1, 8.01769074057E-1, -4.86623654467E+2}
110     , {2.50E+2, 1.E-1, 1.38369261799E+0, 4.60507436131E+2, 5.32777822415E+2, 2.01218740894E+0, 6.85730083236E-1, 8.25401561775E-1, 8.23788301947E-1, -5.92168406857E+2}
111     , {3.00E+2, 1.E-1, 1.26232845843E+0, 4.95315424076E+2, 5.74534108669E+2, 2.08840379066E+0, 7.0508361563E-1, 8.44493235684E-1, 8.43242045267E-1, -7.01653208539E+2}
112     , {3.50E+2, 1.E-1, 1.16061199463E+0, 5.31033146616E+2, 6.17194585979E+2, 2.15975607707E+0, 7.22406006146E-1, 8.61627099103E-1, 8.60627009051E-1, -8.14818852808E+2}
113     , {-1.00E+2, 1.E+0, 1.27710568297E+3, -5.84791305388E+1, -5.76961099843E+1, -2.96481144052E-1, 7.43556319505E-1, 1.16820150212E+0, 5.59004634633E-1, -7.14342044613E+0}
114     , {-5.0E+1, 1.E+0, 1.17532453844E+3, -2.0613296741E-1, 6.44695860968E-1, -5.39141073123E-4, 7.06202958333E-1, 1.1798816406E+0, 6.16471293519E-1, -8.58236369422E-2}
115     , {0.E+0, 1.E+0, 1.05919821388E+3, 6.0660832483E+1, 6.16049428364E+1, 2.4564140941E-1, 7.0261919678E-1, 1.27405373611E+0, 6.67979502845E-1, -6.43611849726E+0}
116     , {5.0E+1, 1.E+0, 2.46422188373E+1, 3.25204007874E+2, 3.65784769152E+2, 1.29646292776E+0, 6.03238099812E-1, 8.08729453907E-1, 7.11092311406E-1, -9.3747987232E+1}
117     , {1.00E+2, 1.E+0, 2.05425338763E+1, 3.57164920157E+2, 4.05844406633E+2, 1.41173994026E+0, 6.23264983556E-1, 7.99638037339E-1, 7.46701780621E-1, -1.69625838549E+2}
118     , {1.50E+2, 1.E+0, 1.77509017636E+1, 3.89710759378E+2, 4.46045925519E+2, 1.51283010563E+0, 6.46510648878E-1, 8.09835957217E-1, 7.76437557365E-1, -2.5044329982E+2}
119     , {2.00E+2, 1.E+0, 1.56827474219E+1, 4.23138648115E+2, 4.86902985645E+2, 1.60407753322E+0, 6.68620131596E-1, 8.2478951574E-1, 8.01769074057E-1, -3.3583063673E+2}
120     , {2.50E+2, 1.E+0, 1.40726368917E+1, 4.57478946775E+2, 5.28538834677E+2, 1.68771540358E+0, 6.88879496722E-1, 8.40651636666E-1, 8.23788301947E-1, -4.25449366607E+2}
121     , {3.00E+2, 1.E+0, 1.27764030308E+1, 4.92692528412E+2, 5.70961818883E+2, 1.76515138191E+0, 7.07301949577E-1, 8.56157450975E-1, 8.43242045267E-1, -5.1900398613E+2}
122     , {3.50E+2, 1.E+0, 1.17069202891E+1, 5.28721450286E+2, 6.1414101199E+2, 1.83737278972E+0, 7.24047061073E-1, 8.7085787159E-1, 8.60627009051E-1, -6.16237403631E+2}
123     , {-1.00E+2, 1.0E+1, 1.28558796704E+3, -6.02885053369E+1, -5.2509963334E+1, -3.07093331955E-1, 7.47416081172E-1, 1.16178083003E+0, 5.59004634633E-1, -7.11529490882E+0}
124     , {-5.0E+1, 1.E+1, 1.18857276837E+3, -3.12487279197E+0, 5.28857926254E+0, -1.38485986721E-2, 7.09702250085E-1, 1.16312526954E+0, 6.16471293519E-1, -3.4557998296E-2}
125     , {0.E+0, 1.E+1, 1.08229738606E+3, 5.55728670062E+1, 6.48124716923E+1, 2.26622096008E-1, 7.05042991442E-1, 1.22724930851E+0, 6.67979502845E-1, -6.32895851846E+0}
126     , {5.0E+1, 1.E+1, 9.54389538397E+2, 1.18754310982E+2, 1.29232212927E+2, 4.42870150165E-1, 7.13462076273E-1, 1.36818649071E+0, 7.11092311406E-1, -2.43591780434E+1}
127     , {1.00E+2, 1.0E+1, 7.6801911315E+2, 1.92835698935E+2, 2.05856208228E+2, 6.62635807547E-1, 7.38216406591E-1, 1.80473715004E+0, 7.46701780621E-1, -5.44268526516E+1}
128     , {1.50E+2, 1.0E+1, 3.42073193892E+2, 3.10965381486E+2, 3.40198891093E+2, 9.98498153736E-1, 7.72810027815E-1, 2.46165756423E+0, 7.76437557365E-1, -1.11549112268E+2}
129     , {2.00E+2, 1.0E+1, 2.12804982382E+2, 3.76000992944E+2, 4.22992373916E+2, 1.18453786861E+0, 7.26384907923E-1, 1.28117637193E+0, 8.01769074057E-1, -1.8446309959E+2}
130     , {2.50E+2, 1.0E+1, 1.6886724235E+2, 4.21920769685E+2, 4.81138886005E+2, 1.30152242664E+0, 7.24050597292E-1, 1.08356791595E+0, 8.23788301947E-1, -2.5897068781E+2}
131 jpye 2301
132 hongke 2280 , {3.00E+2, 1.0E+1, 1.43715050788E+2, 4.63735014093E+2, 5.33317148637E+2, 1.39682608573E+0, 7.3114236723E-1, 1.01377562168E+0, 8.43242045267E-1, -3.36855856944E+2}
133     , {3.50E+2, 1.0E+1, 1.26589854641E+2, 5.04156960606E+2, 5.83152232608E+2, 1.48020744501E+0, 7.41309099387E-1, 9.83608558638E-1, 8.60627009051E-1, -4.18234308752E+2}
134     };
135    
136     const unsigned ntd = sizeof(td)/sizeof(TestData);
137    
138     #endif

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