/[ascend]/trunk/models/solar/frops_test.a4c
ViewVC logotype

Annotation of /trunk/models/solar/frops_test.a4c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2573 - (hide annotations) (download) (as text)
Mon Feb 20 23:03:16 2012 UTC (10 years, 5 months ago) by jpye
File MIME type: text/x-ascend
File size: 1226 byte(s)
Merging models from Vikram Kadam. Awaiting checking.
1 jpye 2573 (* 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;
67    

Properties

Name Value
svn:executable *

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