/[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 1903 - (show annotations) (download) (as text)
Thu Sep 25 08:47:22 2008 UTC (15 years, 8 months ago) by jpye
File MIME type: text/x-ascend
File size: 1226 byte(s)
Expanded the ASCEND interface for fprops to include p,u,s,h,a.
1 (* test of the fluid properties routines currently implemented in asc_mbwr.c *)
2
3 REQUIRE "atoms.a4l";
4 REQUIRE "johnpye/thermo_types.a4c";
5 IMPORT "johnpye/fprops/helmholtz";
6
7 MODEL mbwrconf;
8 component IS_A symbol_constant;
9 component :== 'ammonia';
10 END mbwrconf;
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 propsdata IS_A mbwrconf;
23
24 props1: helmholtz_p(
25 T, rho : INPUT;
26 p : OUTPUT;
27 propsdata : DATA
28 );
29
30 props2: helmholtz_h(
31 T, rho : INPUT;
32 h : OUTPUT;
33 propsdata : DATA
34 );
35
36 props3: helmholtz_s(
37 T, rho : INPUT;
38 s : OUTPUT;
39 propsdata : 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