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

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

Parent Directory Parent Directory | Revision Log Revision Log


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


1 jpye 2124 (* test via ASCEND of the fluid properties routines implemented in helmholtz.c *)
2 jpye 1810
3     REQUIRE "atoms.a4l";
4 jpye 1825 REQUIRE "johnpye/thermo_types.a4c";
5 jpye 1822 IMPORT "johnpye/fprops/helmholtz";
6 jpye 1810
7 jpye 1996 MODEL helmholtz_conf;
8 jpye 1810 component IS_A symbol_constant;
9 kchittur 2147 component :== 'methane';
10 jpye 1996 END helmholtz_conf;
11 jpye 1810
12     MODEL fprops_test;
13    
14     p IS_A pressure;
15     T IS_A temperature;
16 jpye 1823 rho IS_A mass_density;
17 jpye 1825 h IS_A specific_enthalpy;
18 jpye 1903 u IS_A specific_energy;
19     a IS_A specific_energy;
20     s IS_A specific_entropy;
21 jpye 1810
22 jpye 1996 conf IS_A helmholtz_conf;
23 jpye 1810
24 jpye 1825 props1: helmholtz_p(
25 jpye 1823 T, rho : INPUT;
26 jpye 1810 p : OUTPUT;
27 jpye 1996 conf : DATA
28 jpye 1810 );
29    
30 jpye 1920 props2: helmholtz_u(
31 jpye 1825 T, rho : INPUT;
32 jpye 1920 u : OUTPUT;
33 jpye 1996 conf : DATA
34 jpye 1825 );
35    
36 jpye 1903 props3: helmholtz_s(
37     T, rho : INPUT;
38     s : OUTPUT;
39 jpye 1996 conf : DATA
40 jpye 1903 );
41    
42     rho*(h - u) = p;
43     a = u + T*s;
44    
45 jpye 1811 METHODS
46     METHOD on_load;
47 jpye 1826 RUN ClearAll;
48 jpye 1823 FIX rho, T;
49 jpye 1826 rho := 39.278 {kg/m^3};
50     T := 300 {K} + 273.15 {K};
51 jpye 1811 END on_load;
52 jpye 1826 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 jpye 1810 END fprops_test;
67    

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