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

Contents of /trunk/models/johnpye/fprops/fluids/r245fa.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: 7001 byte(s)
Regen toluene model working, next water.
1 /* This file is created by Hongke Zhu, 7-21-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 R245FA_M 134.04794 /* kg/kmol */
14 #define R245FA_R (8314.472/R245FA_M) /* J/kg/K */
15 #define R245FA_TSTAR 427.16 /* K */
16
17 const IdealData ideal_data_r245fa = {
18 -13.4283638514 /* constant */
19 , 9.8723653800 /* linear */
20 , R245FA_TSTAR /* Tstar */
21 , R245FA_R /* cp0star */
22 , 1 /* power terms */
23 , (const IdealPowTerm[]){
24 {4.0, 0.0}
25 }
26 , 3 /* exponential terms */
27 , (const IdealExpTerm[]){
28 {5.5728, 222.0}
29 ,{10.385, 1010.0}
30 ,{12.554, 2450.0}
31 }
32 };
33
34 const HelmholtzData helmholtz_data_r245fa = {
35 "r245a"
36 , /* R */ R245FA_R /* J/kg/K */
37 , /* M */ R245FA_M /* kg/kmol */
38 , /* rho_star */ 3.85*R245FA_M /* kg/m3(= rho_c for this model) */
39 , /* T_star */ R245FA_TSTAR /* K (= T_c for this model) */
40
41 , /* T_c */ R245FA_TSTAR
42 , /* rho_c */ 3.85*R245FA_M /* kg/m3 */
43 , /* T_t */ 171.05
44
45 , 0.3776 /* acentric factor */
46 , &ideal_data_r245fa
47 , 12 /* power terms */
48 , (const HelmholtzPowTerm[]){
49 /* a_i, t_i, d_i, l_i */
50 {1.2904, 0.25, 1.0, 0}
51 , {-3.2154, 1.25, 1.0, 0}
52 , {0.50693, 1.5, 1.0, 0}
53 , {0.093148, 0.25, 3.0, 0}
54 , {0.00027638, 0.875, 7.0, 0}
55 , {0.71458, 2.375, 1.0, 1}
56 , {0.87252, 2.0, 2.0, 1}
57 , {-0.015077, 2.125, 5.0, 1}
58 , {-0.40645, 3.5, 1.0, 2}
59 , {-0.11701, 6.5, 1.0, 2}
60 , {-0.13062, 4.75, 4.0, 2}
61 , {-0.022952, 12.5, 2.0, 3}
62 }
63 , 0 /* gaussian terms */
64 , 0
65 , 0 /* critical terms */
66 , 0
67 };
68
69 /*
70 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:
71
72 ./test.py r245fa
73 */
74
75 #ifdef TEST
76
77 #include "../test.h"
78 #include <math.h>
79 #include <assert.h>
80 #include <stdio.h>
81
82 const TestData td[]; const unsigned ntd;
83
84 int main(void){
85 //return helm_check_u(&helmholtz_data_r245fa, ntd, td);
86 //return helm_check_dpdT_rho(&helmholtz_data_r245fa, ntd, td);
87 //return helm_check_dpdrho_T(&helmholtz_data_r245fa, ntd, td);
88 //return helm_check_dhdT_rho(&helmholtz_data_r245fa, ntd, td);
89 //return helm_check_dhdrho_T(&helmholtz_data_r245fa, ntd, td);
90 //return helm_check_dudT_rho(&helmholtz_data_r245fa, ntd, td);
91 //return helm_check_dudrho_T(&helmholtz_data_r245fa, ntd, td);
92 return helm_run_test_cases(&helmholtz_data_r245fa, ntd, td, 'C');
93 }
94
95 /*
96 A small set of data points calculated using REFPROP 8.0, for validation.
97 */
98
99 const TestData td[] = {
100 /* Temperature, Pressure, Density, Int. Energy, Enthalpy, Entropy, Cv, Cp, Cp0, Helmholtz */
101 /* (C), (MPa), (kg/m3), (kJ/kg), (kJ/kg), (kJ/kg-K), (kJ/kg-K), (kJ/kg-K), (kJ/kg-K), (kJ/kg) */
102 {-1.00E+2, 1.E-1, 1.642867743E+3, 7.82286778951E+1, 7.82895470675E+1, 4.46318816458E-1, 8.14432395963E-1, 1.20057626482E+0, 6.1474853183E-1, 9.4857482538E-1}
103 , {-5.0E+1, 9.99999999999E-2, 1.52537816847E+3, 1.38093415198E+2, 1.38158972711E+2, 7.50037746064E-1, 8.41891755765E-1, 1.20785282284E+0, 7.14168043895E-1, -2.92775078364E+1}
104 , {0.E+0, 1.E-1, 1.40408353439E+3, 1.99945758307E+2, 2.00016979141E+2, 9.99939405626E-1, 8.97712994508E-1, 1.27360230486E+0, 8.12815453326E-1, -7.31876903396E+1}
105 , {5.0E+1, 1.E-1, 5.13338319501E+0, 4.28364645618E+2, 4.4784497588E+2, 1.85591228634E+0, 8.63814438318E-1, 9.38608379377E-1, 9.05625679822E-1, -1.71373409712E+2}
106 , {1.00E+2, 1.E-1, 4.3877271779E+0, 4.73589079721E+2, 4.96379922438E+2, 1.99544397972E+0, 9.38049567956E-1, 1.00589330707E+0, 9.92853271929E-1, -2.7101084131E+2}
107 , {1.50E+2, 1.E-1, 3.84610250217E+0, 5.22562612527E+2, 5.48562959617E+2, 2.12658034879E+0, 1.01636708975E+0, 1.0817262375E+0, 1.07532276937E+0, -3.77299862062E+2}
108 , {-1.00E+2, 1.E+0, 1.6437135539E+3, 7.8091617587E+1, 7.86999960953E+1, 4.45526252634E-1, 8.14811840314E-1, 1.20034322665E+0, 6.1474853183E-1, 9.4874694342E-1}
109 , {-5.0E+1, 1.E+0, 1.52667876104E+3, 1.37891263598E+2, 1.38546280242E+2, 7.49130471454E-1, 8.42184747031E-1, 1.20710675805E+0, 7.14168043895E-1, -2.92772011075E+1}
110 , {0.E+0, 1.E+0, 1.40620148636E+3, 1.99631933624E+2, 2.00343069268E+2, 9.98788341515E-1, 8.97861197451E-1, 1.27172724587E+0, 8.12815453326E-1, -7.31871018608E+1}
111 , {5.0E+1, 1.E+0, 1.27030991426E+3, 2.6562203073E+2, 2.66409240204E+2, 1.22064551507E+0, 9.64664381648E-1, 1.37946314218E+0, 9.05625679822E-1, -1.28829567464E+2}
112 , {1.00E+2, 1.E+0, 5.28447659371E+1, 4.61825188519E+2, 4.8074853849E+2, 1.82000199515E+0, 1.0280482894E+0, 1.21341189976E+0, 9.92853271929E-1, -2.17308555971E+2}
113 , {1.50E+2, 1.E+0, 4.24043400708E+1, 5.15639339306E+2, 5.39221831059E+2, 1.96712268519E+0, 1.04854296127E+0, 1.15823059894E+0, 1.07532276937E+0, -3.16748624933E+2}
114 , {-5.0E+1, 1.E+1, 1.53909893934E+3, 1.35965120951E+2, 1.42462429048E+2, 7.40370333092E-1, 8.45295712974E-1, 1.20060749443E+0, 7.14168043895E-1, -2.92485188785E+1}
115 , {0.E+0, 1.0E+1, 1.42577312311E+3, 1.96726200858E+2, 2.03739939466E+2, 9.87958382633E-1, 8.99845417243E-1, 1.2562637945E+0, 8.12815453326E-1, -7.31346313587E+1}
116 , {5.0E+1, 1.0E+1, 1.30431007975E+3, 2.60883869692E+2, 2.68550758229E+2, 1.20564894046E+0, 9.63967581713E-1, 1.34037461809E+0, 9.05625679822E-1, -1.28721585417E+2}
117 , {1.00E+2, 1.0E+1, 1.16493380479E+3, 3.29662022989E+2, 3.38246201729E+2, 1.40598832396E+0, 1.03349855565E+0, 1.4532414212E+0, 9.92853271929E-1, -1.94982520098E+2}
118 , {1.50E+2, 1.0E+1, 9.89840041485E+2, 4.04598131977E+2, 4.14700774405E+2, 1.59805183876E+0, 1.1091794695E+0, 1.61693870657E+0, 1.07532276937E+0, -2.71617503597E+2}
119 , {-5.0E+1, 1.00E+2, 1.62946095529E+3, 1.22534242857E+2, 1.83904231304E+2, 6.72053318805E-1, 8.81343455499E-1, 1.17893050588E+0, 7.14168043895E-1, -2.74344552341E+1}
120 , {0.E+0, 1.E+2, 1.54883372479E+3, 1.78935282891E+2, 2.43499992711E+2, 9.12926576577E-1, 9.31772224761E-1, 1.20934592821E+0, 8.12815453326E-1, -7.04306115009E+1}
121 , {5.0E+1, 1.00E+2, 1.47308743411E+3, 2.37229107494E+2, 3.05113740601E+2, 1.11995444578E+0, 9.9155520492E-1, 1.25684074092E+0, 9.05625679822E-1, -1.2468417166E+2}
122 , {1.00E+2, 1.E+2, 1.40099029554E+3, 2.97907382979E+2, 3.69285464839E+2, 1.30450153519E+0, 1.05465891422E+0, 1.31058719969E+0, 9.92853271929E-1, -1.88867364877E+2}
123 , {1.50E+2, 1.E+2, 1.33216116604E+3, 3.61130787193E+2, 4.36196779619E+2, 1.47270560797E+0, 1.11876041481E+0, 1.36584629601E+0, 1.07532276937E+0, -2.62044590818E+2}
124 };
125
126 const unsigned ntd = sizeof(td)/sizeof(TestData);
127
128 #endif

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