/[ascend]/trunk/models/steam/iapwssat.a4c
ViewVC logotype

Annotation of /trunk/models/steam/iapwssat.a4c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1270 - (hide annotations) (download) (as text)
Sun Feb 4 01:01:18 2007 UTC (15 years, 6 months ago) by johnpye
File MIME type: text/x-ascend
File size: 1952 byte(s)
Reduced some debug output.
Added ATOM for specific_energy_rate.
Fixed default_self routines for DSG models.
Added testdsgsatrepeat test to check above.
1 johnpye 1051 REQUIRE "steam/iapwssatprops.a4c";
2 johnpye 1042
3     MODEL iapwssat REFINES iapwssatprops;
4 johnpye 1043 x IS_A fraction; (* ensures we stay in the required region *)
5 johnpye 1042 h IS_A specific_enthalpy;
6     u IS_A specific_energy;
7     v IS_A specific_volume;
8    
9 johnpye 1132 h_expr: h = (h_g - h_f) * x + h_f;
10     u_expr: u = (u_g - u_f) * x + u_f;
11     v_expr: v * ( rho_f * rho_g ) = (rho_g + (rho_f - rho_g)*x );
12 johnpye 1042 METHODS
13 johnpye 1106 METHOD default_self;
14     x := 0.5;
15 johnpye 1270 h := 2800 {kJ/kg};
16 johnpye 1106 u := 2300 {kJ/kg};
17     v := 100 {m^3/kg};
18 johnpye 1146 v.nominal := 0.01 {m^3/kg};
19 johnpye 1106 RUN iapwssatprops::default_self;
20     END default_self;
21 johnpye 1268 METHOD bound_self;
22     T.lower_bound := 273 {K};
23     END bound_self;
24 johnpye 1042 METHOD specify;
25 johnpye 1270 FIX x;
26 johnpye 1042 RUN iapwssatprops::specify;
27     END specify;
28     METHOD values;
29 johnpye 1270 x := 0.5;
30 johnpye 1042 RUN iapwssatprops::values;
31     END values;
32     METHOD on_load;
33 johnpye 1106 RUN default_self;
34 johnpye 1042 RUN reset; RUN values;
35     RUN bound_self;
36     END on_load;
37     END iapwssat;
38 johnpye 1043
39 johnpye 1161 (*
40     not sure what to do with this test case. We are trying to show that
41     illegal values of quality 'x' will fix themselves up somehow.
42     *)
43 johnpye 1043 MODEL testiapwssat1 REFINES iapwssat;
44     METHODS
45     METHOD values;
46     RUN iapwssatprops::values;
47     x := 1.01;
48 johnpye 1052 x.upper_bound := 1.0;
49     x.lower_bound := 0.0;
50 johnpye 1043 END values;
51 johnpye 1051 METHOD self_test;
52 johnpye 1052 ASSERT x <= x.upper_bound;
53     ASSERT x >= x.lower_bound;
54 johnpye 1051 END self_test;
55 johnpye 1043 END testiapwssat1;
56 johnpye 1161
57     (*
58     test our ability to converge steam properties using the above when
59     (u,v) are fixed.
60     *)
61     MODEL testiapwssatuv REFINES iapwssat;
62     METHODS
63     METHOD specify;
64     FIX u,v;
65     END specify;
66     METHOD values;
67     v := 1.0 / (500 {kg/m^3});
68     u := 780 {kJ/kg};
69     END values;
70     METHOD self_test;
71     ASSERT abs(p - 10.540441 {bar}) < 0.000002 {bar};
72     ASSERT abs(T - (273.15{K} + 182.177917{K})) < 0.000001 {K};
73     ASSERT abs(x - 0.004734) < 0.000001;
74     END self_test;
75     METHOD values2;
76     v := 1.0 / (450 {kg/m^3});
77     u := 780 {kJ/kg};
78     END values2;
79     METHOD self_test2;
80     ASSERT abs(p - 10.426431 {bar}) < 0.000002 {bar};
81     ASSERT abs(T - (273.15{K} + 181.700586{K})) < 0.000001 {K};
82     ASSERT abs(x - 0.005885) < 0.000001;
83     END self_test2;
84    
85     END testiapwssatuv;

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