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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1273 - (show annotations) (download) (as text)
Sun Feb 4 04:54:20 2007 UTC (15 years, 5 months ago) by johnpye
File MIME type: text/x-ascend
File size: 2027 byte(s)
Identified a problem in moving from qdot_s = 700 to qdot_s = 1000 in QRSlv steady case. Maybe a problem with nominal values?
1 REQUIRE "steam/iapwssatprops.a4c";
2
3 MODEL iapwssat REFINES iapwssatprops;
4 x IS_A fraction; (* ensures we stay in the required region *)
5 h IS_A specific_enthalpy;
6 u IS_A specific_energy;
7 v IS_A specific_volume;
8
9 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 METHODS
13 METHOD default_self;
14 x := 0.5;
15 x.nominal := 0.5;
16 h := 2800 {kJ/kg};
17 h.nominal := 500 {kJ/kg};
18 u := 2300 {kJ/kg};
19 u.nominal := 400 {kJ/kg};
20 v := 0.001 {m^3/kg};
21 v.nominal := 0.07 {m^3/kg};
22 RUN iapwssatprops::default_self;
23 END default_self;
24 METHOD bound_self;
25 T.lower_bound := 273 {K};
26 END bound_self;
27 METHOD specify;
28 FIX x;
29 RUN iapwssatprops::specify;
30 END specify;
31 METHOD values;
32 x := 0.5;
33 RUN iapwssatprops::values;
34 END values;
35 METHOD on_load;
36 RUN default_self;
37 RUN reset; RUN values;
38 RUN bound_self;
39 END on_load;
40 END iapwssat;
41
42 (*
43 not sure what to do with this test case. We are trying to show that
44 illegal values of quality 'x' will fix themselves up somehow.
45 *)
46 MODEL testiapwssat1 REFINES iapwssat;
47 METHODS
48 METHOD values;
49 RUN iapwssatprops::values;
50 x := 1.01;
51 x.upper_bound := 1.0;
52 x.lower_bound := 0.0;
53 END values;
54 METHOD self_test;
55 ASSERT x <= x.upper_bound;
56 ASSERT x >= x.lower_bound;
57 END self_test;
58 END testiapwssat1;
59
60 (*
61 test our ability to converge steam properties using the above when
62 (u,v) are fixed.
63 *)
64 MODEL testiapwssatuv REFINES iapwssat;
65 METHODS
66 METHOD specify;
67 FIX u,v;
68 END specify;
69 METHOD values;
70 v := 1.0 / (500 {kg/m^3});
71 u := 780 {kJ/kg};
72 END values;
73 METHOD self_test;
74 ASSERT abs(p - 10.540441 {bar}) < 0.000002 {bar};
75 ASSERT abs(T - (273.15{K} + 182.177917{K})) < 0.000001 {K};
76 ASSERT abs(x - 0.004734) < 0.000001;
77 END self_test;
78 METHOD values2;
79 v := 1.0 / (450 {kg/m^3});
80 u := 780 {kJ/kg};
81 END values2;
82 METHOD self_test2;
83 ASSERT abs(p - 10.426431 {bar}) < 0.000002 {bar};
84 ASSERT abs(T - (273.15{K} + 181.700586{K})) < 0.000001 {K};
85 ASSERT abs(x - 0.005885) < 0.000001;
86 END self_test2;
87
88 END testiapwssatuv;

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