/[ascend]/trunk/models/johnpye/fprops/fprops_test.a4c
ViewVC logotype

Contents of /trunk/models/johnpye/fprops/fprops_test.a4c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2147 - (show annotations) (download) (as text)
Fri Jan 22 04:15:50 2010 UTC (10 years, 5 months ago) by kchittur
File MIME type: text/x-ascend
File size: 1226 byte(s)


1 (* test via ASCEND of the fluid properties routines implemented in helmholtz.c *)
2
3 REQUIRE "atoms.a4l";
4 REQUIRE "johnpye/thermo_types.a4c";
5 IMPORT "johnpye/fprops/helmholtz";
6
7 MODEL helmholtz_conf;
8 component IS_A symbol_constant;
9 component :== 'methane';
10 END helmholtz_conf;
11
12 MODEL fprops_test;
13
14 p IS_A pressure;
15 T IS_A temperature;
16 rho IS_A mass_density;
17 h IS_A specific_enthalpy;
18 u IS_A specific_energy;
19 a IS_A specific_energy;
20 s IS_A specific_entropy;
21
22 conf IS_A helmholtz_conf;
23
24 props1: helmholtz_p(
25 T, rho : INPUT;
26 p : OUTPUT;
27 conf : DATA
28 );
29
30 props2: helmholtz_u(
31 T, rho : INPUT;
32 u : OUTPUT;
33 conf : DATA
34 );
35
36 props3: helmholtz_s(
37 T, rho : INPUT;
38 s : OUTPUT;
39 conf : DATA
40 );
41
42 rho*(h - u) = p;
43 a = u + T*s;
44
45 METHODS
46 METHOD on_load;
47 RUN ClearAll;
48 FIX rho, T;
49 rho := 39.278 {kg/m^3};
50 T := 300 {K} + 273.15 {K};
51 END on_load;
52 METHOD self_test;
53 ASSERT abs(p - 10 {MPa}) < 0.001 {MPa};
54 ASSERT abs(h - 2238.2 {kJ/kg}) < 0.1 {kJ/kg};
55 END self_test;
56
57 METHOD values_2;
58 RUN on_load;
59 rho := 74.732 {kg/m^3};
60 T := 150 {K} + 273.15 {K};
61 END values_2;
62 METHOD self_test_2;
63 ASSERT abs(p - 10 {MPa}) < 0.001 {MPa};
64 ASSERT abs(h - 1688.5 {kJ/kg}) < 0.1 {kJ/kg};
65 END self_test_2;
66 END fprops_test;

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