(* Air properties calculator for ASCEND modelling environment
Copyright (C) John Pye 2007
This program is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the GNU General Public License for more
details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
*)
REQUIRE "atoms.a4l";
REQUIRE "johnpye/thermo_types.a4c";
(*
The air property correlations here are taken from the paper by
George A. Adebiyi, 'Formulations for the Thermodynamic Properties of
Pure Substance', J Energy Res Tech., 2005. doi:10.1115/1.1794695
Currently, this model just allows the enthalpy of air to be calculated
given the pressure and temperature. Other correlations are implemented
in the Adebiyi paper, but they haven't been coded here yet.
*)
MODEL airprops;
p IS_A pressure;
T IS_A temperature;
v IS_A specific_volume;
p_c IS_A pressure_constant;
p_c :== 37.7 {bar};
T_c IS_A temperature_constant;
T_c :== 132.6 {K};
p_r IS_A factor;
p_r = p / p_c;
T_r IS_A factor;
T_r = T / T_c;
v_r IS_A factor;
v_r = (v * M) / (1{GAS_C} * T_c / p_c);
a[0..6] IS_A real_constant;
a[0] :== 1.685175;
a[1] :== 2.283617;
a[2] :== -0.49965;
a[3] :== 0.108826;
a[4] :== -0.012765;
a[5] :== 7.471154e-4;
a[6] :== -1.732085e-5;
b_0, b_1, b_2, b_3 IS_A real_constant;
b_0 :== -8.107e-4;
b_1 :== 0.1629;
b_2 :== -0.338964;
b_3 :== -0.143369;
h_r0 IS_A real_constant;
h_r0 :== -9.08244;
M IS_A molar_weight_constant;
M :== 28.97 {kg/kmol};
h IS_A specific_enthalpy;
h_r IS_A factor;
h_r = h * M / 1{GAS_C} / T_c;
h_r = SUM[ a[k]/(k+0.5)*T_r^(k+0.5) | k IN [0..6]] + h_r0
+ ( b_1 + 2.6*b_2 / T_r^1.6 + 1.6 * b_3 / T_r^0.6 ) * p_r;
Z IS_A factor;
Z * T_r = p_r * v_r;
Z = 1 + (b_0 + b_1 / T_r + b_2 / T_r^2.6 + b_3 / T_r^1.6) * p_r;
s IS_A specific_entropy;
s_r IS_A factor;
s * M = s_r * 1{GAS_C};
s_r = SUM[ a[k] / (k - 0.5) * T_r^(k - 0.5) | k IN [0..6]] - ln(p_r)
+ (-b_0 + 1.6 * b_2 / T_r^2.6 + 0.6 * b_3 / T_r^1.6) * p_r
+ 16.540034; (* s_r0 calculating using reference state *)
METHODS
METHOD bound_self;
h.lower_bound := -1e5 {kJ/kg};
END bound_self;
METHOD on_load;
RUN ClearAll;
RUN bound_self;
FIX p, T;
p := 1 {bar};
T := 300 {K};
END on_load;
END airprops;