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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1395 - (hide annotations) (download) (as text)
Sat Apr 21 15:11:45 2007 UTC (17 years, 1 month ago) by jpye
File MIME type: text/x-ascend
File size: 2030 byte(s)
Added full jacobian preconditioner (ongoing).
Some tweaks to dsgsat & related models.
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 jpye 1395 rho IS_A mass_density;
8 johnpye 1042
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 jpye 1395 rho_expr: ( rho_f * rho_g )/ (rho_g + (rho_f - rho_g)*x ) = rho ;
12 johnpye 1042 METHODS
13 johnpye 1106 METHOD default_self;
14     x := 0.5;
15 johnpye 1276 x.nominal := 0.5;
16     h := 2800 {kJ/kg};
17     h.nominal := 500 {kJ/kg};
18 johnpye 1106 u := 2300 {kJ/kg};
19 johnpye 1276 u.nominal := 400 {kJ/kg};
20 jpye 1395 rho := 1000 {kg/m^3};
21     rho.nominal := 1. / (0.07 {m^3/kg});
22 johnpye 1106 RUN iapwssatprops::default_self;
23     END default_self;
24 johnpye 1268 METHOD bound_self;
25     T.lower_bound := 273 {K};
26     END bound_self;
27 johnpye 1042 METHOD specify;
28 johnpye 1276 FIX x;
29 johnpye 1275 RUN iapwssatprops::specify;
30 johnpye 1042 END specify;
31     METHOD values;
32 johnpye 1276 x := 0.5;
33 johnpye 1275 RUN iapwssatprops::values;
34 johnpye 1042 END values;
35     METHOD on_load;
36 johnpye 1106 RUN default_self;
37 johnpye 1042 RUN reset; RUN values;
38     RUN bound_self;
39     END on_load;
40     END iapwssat;
41 johnpye 1043
42 johnpye 1161 (*
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 johnpye 1043 MODEL testiapwssat1 REFINES iapwssat;
47     METHODS
48     METHOD values;
49     RUN iapwssatprops::values;
50     x := 1.01;
51 johnpye 1052 x.upper_bound := 1.0;
52     x.lower_bound := 0.0;
53 johnpye 1043 END values;
54 johnpye 1051 METHOD self_test;
55 johnpye 1052 ASSERT x <= x.upper_bound;
56     ASSERT x >= x.lower_bound;
57 johnpye 1051 END self_test;
58 johnpye 1043 END testiapwssat1;
59 johnpye 1161
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 jpye 1395 FIX u,rho;
68 johnpye 1161 END specify;
69     METHOD values;
70 jpye 1395 rho := 500 {kg/m^3};
71 johnpye 1161 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 jpye 1395 rho := 450 {kg/m^3};
80 johnpye 1161 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