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

Annotation of /trunk/models/johnpye/airprops.a4c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2649 - (hide annotations) (download) (as text)
Wed Dec 12 12:39:25 2012 UTC (7 years, 9 months ago) by jpye
File MIME type: text/x-ascend
File size: 2680 byte(s)
Fixing GPL header, removing postal address (rpmlint incorrect-fsf-address)
1 jpye 1603 (* Air properties calculator for ASCEND modelling environment
2 jpye 1606 Copyright (C) John Pye 2007
3 jpye 1603
4     This program is free software; you can redistribute it
5     and/or modify it under the terms of the GNU General Public
6     License as published by the Free Software Foundation; either
7     version 2 of the License, or (at your option) any later
8     version.
9    
10     This program is distributed in the hope that it will be
11     useful, but WITHOUT ANY WARRANTY; without even the implied
12     warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13     PURPOSE. See the GNU General Public License for more
14     details.
15    
16 jpye 2649 You should have received a copy of the GNU General Public License
17     along with this program. If not, see <http://www.gnu.org/licenses/>.
18 jpye 1603 *)
19     REQUIRE "atoms.a4l";
20     REQUIRE "johnpye/thermo_types.a4c";
21    
22     (*
23     The air property correlations here are taken from the paper by
24     George A. Adebiyi, 'Formulations for the Thermodynamic Properties of
25 jpye 1610 Pure Substance', J Energy Res Tech., 2005. doi:10.1115/1.1794695
26 jpye 1603
27     Currently, this model just allows the enthalpy of air to be calculated
28     given the pressure and temperature. Other correlations are implemented
29     in the Adebiyi paper, but they haven't been coded here yet.
30     *)
31     MODEL airprops;
32     p IS_A pressure;
33     T IS_A temperature;
34 jpye 1619 v IS_A specific_volume;
35 jpye 1603
36     p_c IS_A pressure_constant;
37     p_c :== 37.7 {bar};
38    
39     T_c IS_A temperature_constant;
40     T_c :== 132.6 {K};
41    
42     p_r IS_A factor;
43     p_r = p / p_c;
44    
45     T_r IS_A factor;
46     T_r = T / T_c;
47    
48 jpye 1619 v_r IS_A factor;
49     v_r = (v * M) / (1{GAS_C} * T_c / p_c);
50    
51 jpye 1603 a[0..6] IS_A real_constant;
52     a[0] :== 1.685175;
53     a[1] :== 2.283617;
54     a[2] :== -0.49965;
55     a[3] :== 0.108826;
56     a[4] :== -0.012765;
57     a[5] :== 7.471154e-4;
58     a[6] :== -1.732085e-5;
59    
60 jpye 1619 b_0, b_1, b_2, b_3 IS_A real_constant;
61     b_0 :== -8.107e-4;
62 jpye 1603 b_1 :== 0.1629;
63     b_2 :== -0.338964;
64     b_3 :== -0.143369;
65    
66     h_r0 IS_A real_constant;
67     h_r0 :== -9.08244;
68    
69     M IS_A molar_weight_constant;
70     M :== 28.97 {kg/kmol};
71    
72     h IS_A specific_enthalpy;
73     h_r IS_A factor;
74     h_r = h * M / 1{GAS_C} / T_c;
75    
76     h_r = SUM[ a[k]/(k+0.5)*T_r^(k+0.5) | k IN [0..6]] + h_r0
77     + ( b_1 + 2.6*b_2 / T_r^1.6 + 1.6 * b_3 / T_r^0.6 ) * p_r;
78    
79 jpye 1619 Z IS_A factor;
80     Z * T_r = p_r * v_r;
81    
82     Z = 1 + (b_0 + b_1 / T_r + b_2 / T_r^2.6 + b_3 / T_r^1.6) * p_r;
83    
84 jpye 2095
85     s IS_A specific_entropy;
86     s_r IS_A factor;
87     s * M = s_r * 1{GAS_C};
88    
89     s_r = SUM[ a[k] / (k - 0.5) * T_r^(k - 0.5) | k IN [0..6]] - ln(p_r)
90     + (-b_0 + 1.6 * b_2 / T_r^2.6 + 0.6 * b_3 / T_r^1.6) * p_r
91     + 16.540034; (* s_r0 calculating using reference state *)
92    
93 jpye 1603 METHODS
94 jpye 2095 METHOD bound_self;
95     h.lower_bound := -1e5 {kJ/kg};
96     END bound_self;
97 jpye 1603 METHOD on_load;
98 jpye 2095 RUN ClearAll;
99     RUN bound_self;
100 jpye 1603 FIX p, T;
101     p := 1 {bar};
102     T := 300 {K};
103     END on_load;
104     END airprops;
105    

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