/[ascend]/trunk/models/johnpye/loop.a4c
ViewVC logotype

Contents of /trunk/models/johnpye/loop.a4c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 186 - (show annotations) (download) (as text)
Fri Jan 13 03:36:44 2006 UTC (14 years, 7 months ago) by johnpye
File MIME type: text/x-ascend
File size: 1636 byte(s)
Modularising the 'loop' components in my steam system test case.
Changing some models to use the new 'FIX varlist' syntax (bug 204)
1 REQUIRE "johnpye/ideal_steam.a4c";
2 REQUIRE "johnpye/absorber.a4c";
3 REQUIRE "johnpye/surgetank.a4c";
4 REQUIRE "johnpye/condenser.a4c";
5
6 MODEL absorber_and_condenser;
7 A IS_A absorber;
8 C IS_A condenser;
9
10 A.mdot_gas_out, C.mdot_gas_in ARE_THE_SAME;
11 A.S_out, C.S_in ARE_THE_SAME;
12
13 Q_A ALIASES A.Q;
14 Q_C ALIASES C.Q;
15
16 METHODS
17 METHOD default_self;
18 RUN reset; RUN values;
19 END default_self;
20
21 METHOD specify;
22 RUN A.specify;
23 C.h_out.fixed := TRUE;
24 END specify;
25
26 METHOD values;
27 RUN A.values;
28 C.h_out := 400 {kJ/kg};
29 END values;
30
31 END absorber_and_condenser;
32
33
34 MODEL loop;
35 A IS_A absorber;
36 C IS_A condenser;
37 S IS_A vessel_with_water;
38
39 m_water_total IS_A mass;
40
41 A.S_out, C.S_in ARE_THE_SAME; (* absorber outlet steam goes to the condenser *)
42 A.p, S.p ARE_THE_SAME; (* absorber pressure equals surge tank pressure *)
43
44 A.Q, C.Q ARE_THE_SAME; (* heat out of condenser must balance that absorbed *)
45
46 p ALIASES A.p;
47 Q ALIASES A.Q;
48 T_abs_out ALIASES A.T;
49 m_abs_water ALIASES A.m_water;
50 m_surge_water ALIASES S.m_water;
51 m_gas ALIASES S.m_gas;
52 V_surge ALIASES S.V_vessel;
53 V_absorber ALIASES A.V_total;
54 absorber_void_fraction ALIASES A.alpha;
55
56 m_surge_water + m_abs_water = m_water_total;
57
58 METHODS
59 METHOD default_self;
60 RUN reset;
61 RUN values;
62 END default_self;
63
64 METHOD specify;
65 A.Q.fixed := TRUE;
66 A.V_total.fixed := TRUE;
67 S.V_vessel.fixed := TRUE;
68 S.m_gas.fixed := TRUE;
69 m_water_total.fixed := TRUE;
70 END specify;
71
72 METHOD values;
73 A.Q := 400 {W/m^2} * 20 * 40{mm} * 300{m};
74 A.V_total := 300{m} * 16 * 1{PI}*( 40{mm} )^2;
75 S.V_vessel := 10 {m^3};
76 S.m_gas := 7.27101 {kg};
77 m_water_total := 3000 {kg};
78 END values;
79
80 END loop;

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