/[ascend]/trunk/models/johnpye/ideal_steam.a4c
ViewVC logotype

Contents of /trunk/models/johnpye/ideal_steam.a4c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 115 - (show annotations) (download) (as text)
Sun Dec 18 01:38:49 2005 UTC (16 years, 9 months ago) by johnpye
File MIME type: text/x-ascend
File size: 2791 byte(s)
Added 'ideal_steam' model. This doesn't represent *real* steam properties,
it's the IDEAL component of IAPWS-95's correlation *only*.
1 REQUIRE "system.a4l";
2 REQUIRE "atoms.a4l";
3 REQUIRE "johnpye/thermo_types.a4c";
4
5 MODEL ideal_steam REFINES thermo_state;
6
7 delta IS_A positive_variable;
8 tau IS_A positive_variable;
9
10 (*-------------- CONSTANTS ---------------*)
11 rhoc IS_A mass_density_constant;
12 Tc IS_A temperature_constant;
13
14 rhoc "density of water at the critical point"
15 :== 322 {kg/m^3};
16
17 Tc "temperature of water at the critical point"
18 :== 647.096 {K};
19
20 R IS_A specific_gas_constant;
21 R "specific gas constant for water"
22 :== 0.46151805 {kJ/kg/K};
23
24 tau = Tc / T;
25 delta = rho / rhoc;
26
27
28 range_0 IS_A set OF integer_constant;
29 range_0 :== [1..8];
30
31 range_01 IS_A set OF integer_constant;
32 range_01 :== [4..8];
33
34 range_r1 IS_A set OF integer_constant;
35 range_r1 :== [1..7];
36
37 range_r2 IS_A set OF integer_constant;
38 range_r2 :== [8..51];
39
40 range_r3 IS_A set OF integer_constant;
41 range_r3 :== [52..54];
42
43 range_r4 IS_A set OF integer_constant;
44 range_r4 :== [55..56];
45
46 n0[range_0] IS_A real_constant;
47 n0[1] :== -8.32044648201;
48
49 n0[2] :== 6.6832105268;
50 n0[3] :== 3.00632;
51 n0[4] :== 0.012436;
52
53 n0[5] :== 0.97315;
54 n0[6] :== 1.27950;
55 n0[7] :== 0.96956;
56 n0[8] :== 0.24873;
57
58 gamma0[range_01] IS_A real_constant;
59 gamma0[4] :== 1.28728967;
60 gamma0[5] :== 3.53734222;
61 gamma0[6] :== 7.74073708;
62 gamma0[7] :== 9.24437796;
63 gamma0[8] :== 27.5075105;
64
65 (*------------ IDEAL PARTS ------------*)
66
67 phi0 IS_A factor;
68 phi0_expr: phi0 =
69 SUM[ n0[i]*ln(1-exp(-tau*gamma0[i])) | i IN [range_01] ]
70 + ln(delta) + n0[1] + n0[2]*tau + n0[3]*ln(tau);
71
72 phi0delta IS_A factor;
73 phi0delta_expr: phi0delta = 1.0/delta;
74
75 phi0deltadelta IS_A factor;
76 phi0deltadelta_expr: phi0deltadelta =
77 -1.0/(delta*delta);
78
79
80 phi0tau IS_A factor;
81 phi0tau_expr: phi0tau =
82 n0[2] + n0[3]/tau
83 + SUM[ n0[i]*gamma0[i]*(1/(1-exp(-tau*gamma0[i])) - 1) | i IN [range_01] ];
84
85 phi0deltatau IS_A real_constant;
86 phi0deltatau :== 0.0;
87
88 phi0tautau IS_A factor;
89 phi0tautau_expr: phi0tautau
90 = -n0[3] / tau^2
91 - SUM [ n0[i] * gamma0[i]^2 * exp(-gamma0[i] * tau) / ( 1 - exp(-gamma0[i] * tau) )^2 | i IN range_01 ];
92
93
94 (*--------- THERMO PROPERTY RELATIONS ----------- *)
95
96 pressure: p = rho * R * T;
97
98 internal_energy: u = R * T * tau * (phi0tau);
99
100 enthalpy: h = R * T * (1 + tau*(phi0tau));
101
102 entropy: s = R * (tau*(phi0tau) - phi0);
103
104 c_isochoric: cv = - R * tau^2 * (phi0tautau);
105
106 c_isobaric: cp = - R * tau^2 * (phi0tautau);
107
108 spd_sound: w^2
109 = R * T * (1 - 1/(tau^2 * phi0tautau));
110
111 METHODS
112 METHOD default_self;
113 RUN ClearAll;
114 RUN specify;
115 RUN values;
116 END default_self;
117
118 METHOD specify;
119 T.fixed := TRUE;
120 rho.fixed := TRUE;
121 END specify;
122
123 METHOD values;
124 (* these are the test values from page 14 of the IAPWS-95 release *)
125 T := 500 {K};
126 rho := 838.025 {kg/m^3};
127 END values;
128
129 END ideal_steam;

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