1 |
REQUIRE "johnpye/absorber.a4c"; |
2 |
REQUIRE "johnpye/surgetank.a4c"; |
3 |
REQUIRE "johnpye/condenser.a4c"; |
4 |
REQUIRE "johnpye/separator.a4c"; |
5 |
REQUIRE "johnpye/mixer.a4c"; |
6 |
|
7 |
(* |
8 |
Open-loop model. given the absorber conditions, what pressure is required |
9 |
in the surge tank in order for the mass to be contained ? |
10 |
*) |
11 |
MODEL loop; |
12 |
|
13 |
A IS_A absorber; |
14 |
|
15 |
S IS_A separator; |
16 |
A.S_out, S.S_in ARE_THE_SAME; |
17 |
A.mdot_out, S.mdot_in ARE_THE_SAME; |
18 |
|
19 |
C IS_A condenser_lmtd_sat(S.S_v, S_cond_out); (* in, out *) |
20 |
S.S_v, C.S_in ARE_THE_SAME; |
21 |
S_cond_out IS_A iapws95_2phase; |
22 |
|
23 |
|
24 |
M IS_A mixer; |
25 |
M.S_in_1, S.S_l ARE_THE_SAME; (* connect separated liquid to mixer *) |
26 |
M.S_in_2, C.S_out ARE_THE_SAME; (* connect condenser outlet to mixer *) |
27 |
M.mdot_in_1, S.mdot_l ARE_THE_SAME; |
28 |
M.mdot_in_2, C.mdot_out ARE_THE_SAME; |
29 |
|
30 |
(* T IS_A surgetank; |
31 |
C.mdot_out, T.mdot_water_in ARE_THE_SAME; |
32 |
S_tank_in IS_A thermo_state; *) |
33 |
(* M.S_out, S_tank_in ARE_THE_SAME; *)(* connect mixed outlet to surge tank *) |
34 |
(* m_T ALIASES T.m_water; *) |
35 |
(* p_T ALIASES T.p; *) |
36 |
(* V_water_T ALIASES T.V_water; *) |
37 |
|
38 |
m_water IS_A mass; |
39 |
m_A (* + m_T *) = m_water; |
40 |
|
41 |
(* some aliases, for usability *) |
42 |
|
43 |
Q_A ALIASES A.Q; |
44 |
Q_C ALIASES C.q; |
45 |
mdot_A_in ALIASES A.mdot_water_in; |
46 |
mdot_C_out ALIASES C.mdot_out; |
47 |
|
48 |
m_A ALIASES A.m_water; |
49 |
|
50 |
p_A ALIASES A.p; |
51 |
|
52 |
x_exit_A ALIASES A.x_exit; |
53 |
|
54 |
(*A.p = T.p;*) |
55 |
(* A.p = 40 {bar};*) |
56 |
|
57 |
METHODS |
58 |
METHOD default_self; |
59 |
RUN reset; RUN values; RUN bound_self; |
60 |
END default_self; |
61 |
|
62 |
METHOD specify; |
63 |
FIX A.V_total (*, A.mdot_water_in*); |
64 |
FIX A.Q; |
65 |
FIX A.T; |
66 |
|
67 |
FIX C.T_ci; |
68 |
FIX C.T_co; |
69 |
FIX C.cp_c; |
70 |
|
71 |
(* FIX T.rho_water; |
72 |
FIX T.V_vessel, T.m_gas; *) |
73 |
|
74 |
(* without surgetank, can't... FIX m_water; *) |
75 |
END specify; |
76 |
|
77 |
METHOD values; |
78 |
(* fixed *) |
79 |
m_water := 8000 {kg}; |
80 |
|
81 |
A.V_total := 300{m} * 16 * 1{PI}/4*( 40{mm} )^2; |
82 |
A.mdot_water_in := 0.4 {kg/s}; |
83 |
A.Q := 1000 {W/m^2} * 27(*concentration*) * 500{mm} * 60{m}; |
84 |
A.T := 500 {K}; |
85 |
|
86 |
C.cp_c := 4.2 {kJ/kg/K}; |
87 |
C.T_ci := 473.15 {K}; |
88 |
C.T_co := 490.15 {K}; |
89 |
|
90 |
(* T.T := C.T_co; |
91 |
T.rho_water := 997 {kg/m^3}; |
92 |
T.V_vessel := 10000 {L}; |
93 |
T.m_gas := 40 {kg}; *) |
94 |
|
95 |
(* free *) |
96 |
m_A := 1000 {kg}; |
97 |
(* m_T := 7000 {kg}; *) |
98 |
C.mdot_c := 10 {kg/s}; |
99 |
END values; |
100 |
|
101 |
METHOD bound_self; |
102 |
RUN C.bound_self; |
103 |
S_cond_out.h.lower_bound := -500 {kJ/kg}; (* aids convergence *) |
104 |
END bound_self; |
105 |
|
106 |
END loop; |