1 | model Reconciled_NewDataReconciliationSimpleTests_TSP_FourFlows5
|
---|
2 | /* This is not Complete ThermoSysPro variables and functions needs to be corrected manually */
|
---|
3 | //Variables of Interest
|
---|
4 | parameter Real singularPressureLoss1_Q = 2.10;
|
---|
5 | parameter Real singularPressureLoss1_T = 470;
|
---|
6 | parameter Real singularPressureLoss1_Pm = 1550000;
|
---|
7 | parameter Real singularPressureLoss2_Q = 1.91;
|
---|
8 | parameter Real singularPressureLoss2_T = 465;
|
---|
9 | parameter Real singularPressureLoss2_Pm = 1500000;
|
---|
10 | parameter Real singularPressureLoss3_Q = 0.95;
|
---|
11 | parameter Real singularPressureLoss3_T = 473;
|
---|
12 | parameter Real singularPressureLoss3_Pm = 1490000;
|
---|
13 | parameter Real singularPressureLoss4_Q = 2.00;
|
---|
14 | parameter Real singularPressureLoss4_T = 462;
|
---|
15 | parameter Real singularPressureLoss4_Pm = 1400000;
|
---|
16 | parameter Real staticDrum1_T = 470;
|
---|
17 | parameter Real staticDrum1_P = 1450000;
|
---|
18 | parameter Real mixer21_P = 1450000;
|
---|
19 | parameter Real mixer21_T = 475;
|
---|
20 | //parameters in SET-S
|
---|
21 | parameter Real singularPressureLoss1_K = 0.0001;
|
---|
22 | parameter Integer singularPressureLoss1_mode = 0;
|
---|
23 | parameter Real singularPressureLoss2_K = 0.0001;
|
---|
24 | parameter Integer singularPressureLoss2_mode = 0;
|
---|
25 | parameter Real singularPressureLoss3_K = 0.0001;
|
---|
26 | parameter Integer singularPressureLoss3_mode = 0;
|
---|
27 | parameter Real singularPressureLoss4_K = 0.0001;
|
---|
28 | parameter Integer singularPressureLoss4_mode = 0;
|
---|
29 | parameter Real staticDrum1_x = 1.0;
|
---|
30 | parameter Integer mixer21_mode = 0;
|
---|
31 | //residualVars
|
---|
32 | Real res_F_1;
|
---|
33 | Real res_F_2;
|
---|
34 | Real res_F_3;
|
---|
35 | Real res_F_4;
|
---|
36 | Real res_F_5;
|
---|
37 | Real res_F_6;
|
---|
38 | Real res_F_7;
|
---|
39 | Real res_F_8;
|
---|
40 | Real res_F_9;
|
---|
41 | Real res_F_10;
|
---|
42 | Real res_F_11;
|
---|
43 | Real res_F_12;
|
---|
44 | Real res_F_13;
|
---|
45 | Real res_F_14;
|
---|
46 | //remaining variables in setS
|
---|
47 | Real staticDrum1_Cs_eva_P;
|
---|
48 | Real staticDrum1_Cs_sur_P;
|
---|
49 | Real staticDrum1_Ce_sup_P;
|
---|
50 | Real staticDrum1_Ce_steam_h_vol;
|
---|
51 | Real staticDrum1_lsat_P = staticDrum1_lsat.P;
|
---|
52 | Real staticDrum1_lsat_T = staticDrum1_lsat.T;
|
---|
53 | Real staticDrum1_lsat_rho = staticDrum1_lsat.rho;
|
---|
54 | Real staticDrum1_vsat_P = staticDrum1_vsat.P;
|
---|
55 | Real staticDrum1_vsat_T = staticDrum1_vsat.T;
|
---|
56 | Real staticDrum1_vsat_rho = staticDrum1_vsat.rho;
|
---|
57 | Real staticDrum1_vsat_h = staticDrum1_vsat.h;
|
---|
58 | Real singularPressureLoss1_C2_h_vol;
|
---|
59 | Real staticDrum1_Ce_sup_h_vol;
|
---|
60 | Real staticDrum1_Ce_eva_h_vol;
|
---|
61 | Real staticDrum1_Ce_eco_h_vol;
|
---|
62 | Real staticDrum1_Cs_purg_h_vol;
|
---|
63 | Real staticDrum1_Cs_sup_h_vol;
|
---|
64 | Real staticDrum1_Cs_eva_h_vol;
|
---|
65 | Real staticDrum1_lsat_h = staticDrum1_lsat.h;
|
---|
66 | Real staticDrum1_hl;
|
---|
67 | Real staticDrum1_hv;
|
---|
68 | Real staticDrum1_Cs_sur_h_vol;
|
---|
69 | Real sink1_Q;
|
---|
70 | Real sink1_C_Q;
|
---|
71 | Real singularPressureLoss4_C2_Q;
|
---|
72 | Real singularPressureLoss4_C1_Q;
|
---|
73 | Real mixer21_pro_pT_d = mixer21_pro_pT.d;
|
---|
74 | Real singularPressureLoss3_C2_h_vol;
|
---|
75 | Real singularPressureLoss2_C2_h_vol;
|
---|
76 | Real mixer21_Ce1_h_vol;
|
---|
77 | Real mixer21_Ce2_h_vol;
|
---|
78 | Real mixer21_pro_pT_h = mixer21_pro_pT.h;
|
---|
79 | Real mixer21_h;
|
---|
80 | Real mixer21_Cs_h_vol;
|
---|
81 | Real mixer21_Ce2_P;
|
---|
82 | Real mixer21_Cs_P;
|
---|
83 | Real sink1_P;
|
---|
84 | Real sink1_C_P;
|
---|
85 | Real sink1_C_h;
|
---|
86 | Real singularPressureLoss4_C2_h;
|
---|
87 | Real singularPressureLoss4_C1_h_vol;
|
---|
88 | Real singularPressureLoss4_C1_h;
|
---|
89 | Real singularPressureLoss4_h;
|
---|
90 | Real singularPressureLoss4_pro_pT_h = singularPressureLoss4_pro_pT.h;
|
---|
91 | Real singularPressureLoss4_pro_pT_d = singularPressureLoss4_pro_pT.d;
|
---|
92 | Real singularPressureLoss4_rho;
|
---|
93 | Real singularPressureLoss4_deltaP;
|
---|
94 | Real singularPressureLoss4_C1_P;
|
---|
95 | Real singularPressureLoss4_C2_P;
|
---|
96 | Real mixer21_Ce1_P;
|
---|
97 | Real sourceQ1_P;
|
---|
98 | Real sourceQ1_C_P;
|
---|
99 | Real singularPressureLoss1_C1_P;
|
---|
100 | Real singularPressureLoss1_C2_P;
|
---|
101 | Real singularPressureLoss1_deltaP;
|
---|
102 | Real singularPressureLoss1_rho;
|
---|
103 | Real singularPressureLoss1_pro_pT_d = singularPressureLoss1_pro_pT.d;
|
---|
104 | Real singularPressureLoss1_pro_pT_h = singularPressureLoss1_pro_pT.h;
|
---|
105 | Real singularPressureLoss1_h;
|
---|
106 | Real singularPressureLoss1_C1_h_vol;
|
---|
107 | Real sourceQ1_C_h;
|
---|
108 | Real singularPressureLoss1_C1_h;
|
---|
109 | Real singularPressureLoss1_C2_h;
|
---|
110 | Real singularPressureLoss2_C2_h;
|
---|
111 | Real singularPressureLoss2_C1_P;
|
---|
112 | Real singularPressureLoss2_C2_P;
|
---|
113 | Real singularPressureLoss2_deltaP;
|
---|
114 | Real singularPressureLoss2_rho;
|
---|
115 | Real singularPressureLoss2_pro_pT_d = singularPressureLoss2_pro_pT.d;
|
---|
116 | Real singularPressureLoss2_pro_pT_h = singularPressureLoss2_pro_pT.h;
|
---|
117 | Real singularPressureLoss2_h;
|
---|
118 | Real singularPressureLoss2_C1_h_vol;
|
---|
119 | Real singularPressureLoss2_C1_h;
|
---|
120 | Real singularPressureLoss1_C1_Q;
|
---|
121 | Real singularPressureLoss1_C2_Q;
|
---|
122 | Real staticDrum1_Ce_eva_Q;
|
---|
123 | Real staticDrum1_Ce_eva_h;
|
---|
124 | Real staticDrum1_Ce_eco_Q;
|
---|
125 | Real staticDrum1_Ce_eco_h;
|
---|
126 | Real staticDrum1_Cs_sup_Q;
|
---|
127 | Real staticDrum1_Cs_sup_h;
|
---|
128 | Real staticDrum1_Cs_eva_Q;
|
---|
129 | Real staticDrum1_Cs_eva_h;
|
---|
130 | Real staticDrum1_Cs_sur_h;
|
---|
131 | Real staticDrum1_Cs_purg_Q;
|
---|
132 | Real staticDrum1_Cs_purg_h;
|
---|
133 | Real staticDrum1_Ce_steam_Q;
|
---|
134 | Real staticDrum1_Ce_steam_h;
|
---|
135 | Real staticDrum1_Ce_sup_Q;
|
---|
136 | Real staticDrum1_Ce_sup_h;
|
---|
137 | Real staticDrum1_Cth_W;
|
---|
138 | Real staticDrum1_Cs_sur_Q;
|
---|
139 | Real singularPressureLoss2_C1_Q;
|
---|
140 | Real singularPressureLoss2_C2_Q;
|
---|
141 | Real mixer21_Oalpha1_signal;
|
---|
142 | Real mixer21_alpha1;
|
---|
143 | Real singularPressureLoss3_C1_Q;
|
---|
144 | Real singularPressureLoss3_C2_Q;
|
---|
145 | Real mixer21_Ce2_Q;
|
---|
146 | Real mixer21_Cs_Q;
|
---|
147 | Real mixer21_Cs_h;
|
---|
148 | Real mixer21_Ce1_Q;
|
---|
149 | Real mixer21_Ce1_h;
|
---|
150 | Real mixer21_Ce2_h;
|
---|
151 | Real singularPressureLoss3_C2_h;
|
---|
152 | Real singularPressureLoss3_C1_P;
|
---|
153 | Real singularPressureLoss3_C2_P;
|
---|
154 | Real singularPressureLoss3_deltaP;
|
---|
155 | Real singularPressureLoss3_rho;
|
---|
156 | Real singularPressureLoss3_pro_pT_d = singularPressureLoss3_pro_pT.d;
|
---|
157 | Real singularPressureLoss3_pro_pT_h = singularPressureLoss3_pro_pT.h;
|
---|
158 | Real singularPressureLoss3_h;
|
---|
159 | Real singularPressureLoss3_C1_h_vol;
|
---|
160 | Real singularPressureLoss3_C1_h;
|
---|
161 | ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT singularPressureLoss1_pro_pT, singularPressureLoss2_pro_pT, singularPressureLoss3_pro_pT, singularPressureLoss4_pro_pT, mixer21_pro_pT;
|
---|
162 | ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat staticDrum1_lsat, staticDrum1_vsat;
|
---|
163 | equation
|
---|
164 | //set-C Canonical form
|
---|
165 | res_F_1 = staticDrum1_Cs_eva_h - singularPressureLoss3_C1_h;
|
---|
166 | res_F_2 = staticDrum1_Cs_eva_Q - singularPressureLoss3_C1_Q;
|
---|
167 | res_F_3 = singularPressureLoss2_C2_P - mixer21_Ce1_P;
|
---|
168 | res_F_4 = singularPressureLoss4_C1_P - mixer21_Cs_P;
|
---|
169 | res_F_5 = singularPressureLoss3_C2_P - mixer21_Ce2_P;
|
---|
170 | res_F_6 = singularPressureLoss4_C1_h_vol - mixer21_Cs_h_vol;
|
---|
171 | res_F_7 = singularPressureLoss4_C1_Q - mixer21_Cs_Q;
|
---|
172 | res_F_8 = singularPressureLoss4_C1_h - mixer21_Cs_h;
|
---|
173 | res_F_9 = staticDrum1_Cs_sur_h_vol - singularPressureLoss2_C1_h_vol;
|
---|
174 | res_F_10 = staticDrum1_Cs_eva_h_vol - singularPressureLoss3_C1_h_vol;
|
---|
175 | res_F_11 = staticDrum1_lsat_T - staticDrum1_T;
|
---|
176 | res_F_12 = staticDrum1_Ce_sup_P - singularPressureLoss1_C2_P;
|
---|
177 | res_F_13 = staticDrum1_Cs_sur_P - singularPressureLoss2_C1_P;
|
---|
178 | res_F_14 = staticDrum1_Cs_eva_P - singularPressureLoss3_C1_P;
|
---|
179 | //remaining equations in Set-S
|
---|
180 | staticDrum1_P = staticDrum1_Cs_eva_P;
|
---|
181 | staticDrum1_P = staticDrum1_Cs_sur_P;
|
---|
182 | staticDrum1_P = staticDrum1_Ce_sup_P;
|
---|
183 | staticDrum1_Ce_steam_h_vol = staticDrum1_hv;
|
---|
184 | staticDrum1_hv = staticDrum1_vsat_h;
|
---|
185 | (staticDrum1_lsat, staticDrum1_vsat) = ThermoSysPro.Properties.WaterSteam.IF97.Water_sat_P(staticDrum1_P);
|
---|
186 | singularPressureLoss1_C2_h_vol = staticDrum1_Ce_sup_h_vol;
|
---|
187 | staticDrum1_Ce_sup_h_vol = staticDrum1_hl;
|
---|
188 | staticDrum1_Ce_eva_h_vol = staticDrum1_hl;
|
---|
189 | staticDrum1_Ce_eco_h_vol = staticDrum1_hl;
|
---|
190 | staticDrum1_Cs_purg_h_vol = staticDrum1_hl;
|
---|
191 | staticDrum1_Cs_sup_h_vol = staticDrum1_hl;
|
---|
192 | staticDrum1_Cs_eva_h_vol = staticDrum1_hl;
|
---|
193 | staticDrum1_hl = staticDrum1_lsat_h;
|
---|
194 | staticDrum1_Cs_sur_h_vol = (1.0 - staticDrum1_x) * staticDrum1_hl + staticDrum1_x * staticDrum1_hv;
|
---|
195 | sink1_C_Q = sink1_Q;
|
---|
196 | singularPressureLoss4_C2_Q = sink1_C_Q;
|
---|
197 | singularPressureLoss4_C2_Q = singularPressureLoss4_C1_Q;
|
---|
198 | singularPressureLoss4_Q = singularPressureLoss4_C1_Q;
|
---|
199 | mixer21_pro_pT = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(mixer21_P, mixer21_T, mixer21_mode);
|
---|
200 | mixer21_Ce2_h_vol = singularPressureLoss3_C2_h_vol;
|
---|
201 | mixer21_Ce1_h_vol = singularPressureLoss2_C2_h_vol;
|
---|
202 | mixer21_Ce1_h_vol = mixer21_h;
|
---|
203 | mixer21_Ce2_h_vol = mixer21_h;
|
---|
204 | mixer21_h = mixer21_pro_pT_h;
|
---|
205 | mixer21_Cs_h_vol = mixer21_h;
|
---|
206 | mixer21_P = mixer21_Ce2_P;
|
---|
207 | mixer21_P = mixer21_Cs_P;
|
---|
208 | sink1_C_P = sink1_P;
|
---|
209 | singularPressureLoss4_C2_P = sink1_C_P;
|
---|
210 | singularPressureLoss4_C2_h = sink1_C_h;
|
---|
211 | singularPressureLoss4_C2_h = singularPressureLoss4_C1_h;
|
---|
212 | 0.0 = singularPressureLoss4_C1_h - singularPressureLoss4_C1_h_vol;
|
---|
213 | singularPressureLoss4_h = singularPressureLoss4_C1_h;
|
---|
214 | singularPressureLoss4_h = singularPressureLoss4_pro_pT_h;
|
---|
215 | singularPressureLoss4_pro_pT = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(singularPressureLoss4_Pm, singularPressureLoss4_T, singularPressureLoss4_mode);
|
---|
216 | singularPressureLoss4_rho = singularPressureLoss4_pro_pT_d;
|
---|
217 | singularPressureLoss4_deltaP = singularPressureLoss4_K * (singularPressureLoss4_Q * abs(singularPressureLoss4_Q) / singularPressureLoss4_rho);
|
---|
218 | singularPressureLoss4_C1_P - singularPressureLoss4_C2_P = singularPressureLoss4_deltaP;
|
---|
219 | singularPressureLoss4_Pm = 0.5 * (singularPressureLoss4_C1_P + singularPressureLoss4_C2_P);
|
---|
220 | mixer21_P = mixer21_Ce1_P;
|
---|
221 | staticDrum1_Cth_W = 0.0;
|
---|
222 | singularPressureLoss1_pro_pT = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(singularPressureLoss1_Pm, singularPressureLoss1_T, singularPressureLoss1_mode);
|
---|
223 | sourceQ1_C_P = sourceQ1_P;
|
---|
224 | singularPressureLoss1_Pm = 0.5 * (singularPressureLoss1_C1_P + singularPressureLoss1_C2_P);
|
---|
225 | singularPressureLoss1_C1_P = sourceQ1_C_P;
|
---|
226 | singularPressureLoss1_C1_P - singularPressureLoss1_C2_P = singularPressureLoss1_deltaP;
|
---|
227 | singularPressureLoss1_deltaP = singularPressureLoss1_K * (singularPressureLoss1_Q * abs(singularPressureLoss1_Q) / singularPressureLoss1_rho);
|
---|
228 | singularPressureLoss1_rho = singularPressureLoss1_pro_pT_d;
|
---|
229 | singularPressureLoss1_h = singularPressureLoss1_pro_pT_h;
|
---|
230 | singularPressureLoss1_h = singularPressureLoss1_C1_h;
|
---|
231 | 0.0 = singularPressureLoss1_C1_h - singularPressureLoss1_C1_h_vol;
|
---|
232 | singularPressureLoss1_C1_h = sourceQ1_C_h;
|
---|
233 | singularPressureLoss1_C2_h = singularPressureLoss1_C1_h;
|
---|
234 | singularPressureLoss1_C2_h = staticDrum1_Ce_sup_h;
|
---|
235 | staticDrum1_Ce_steam_h = 100000.0;
|
---|
236 | staticDrum1_Cs_purg_h = 100000.0;
|
---|
237 | mixer21_Ce1_h = singularPressureLoss2_C2_h;
|
---|
238 | singularPressureLoss2_C2_h = singularPressureLoss2_C1_h;
|
---|
239 | singularPressureLoss2_pro_pT = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(singularPressureLoss2_Pm, singularPressureLoss2_T, singularPressureLoss2_mode);
|
---|
240 | singularPressureLoss2_Pm = 0.5 * (singularPressureLoss2_C1_P + singularPressureLoss2_C2_P);
|
---|
241 | singularPressureLoss2_C1_P - singularPressureLoss2_C2_P = singularPressureLoss2_deltaP;
|
---|
242 | singularPressureLoss2_deltaP = singularPressureLoss2_K * (singularPressureLoss2_Q * abs(singularPressureLoss2_Q) / singularPressureLoss2_rho);
|
---|
243 | singularPressureLoss2_rho = singularPressureLoss2_pro_pT_d;
|
---|
244 | singularPressureLoss2_h = singularPressureLoss2_pro_pT_h;
|
---|
245 | singularPressureLoss2_h = singularPressureLoss2_C1_h;
|
---|
246 | 0.0 = singularPressureLoss2_C1_h - singularPressureLoss2_C1_h_vol;
|
---|
247 | singularPressureLoss2_C1_h = staticDrum1_Cs_sur_h;
|
---|
248 | staticDrum1_Cs_sup_h = 100000.0;
|
---|
249 | staticDrum1_Ce_eco_h = 100000.0;
|
---|
250 | staticDrum1_Ce_eva_h = 100000.0;
|
---|
251 | singularPressureLoss1_Q = singularPressureLoss1_C1_Q;
|
---|
252 | singularPressureLoss1_C2_Q = singularPressureLoss1_C1_Q;
|
---|
253 | singularPressureLoss1_C2_Q = staticDrum1_Ce_sup_Q;
|
---|
254 | staticDrum1_Ce_steam_Q = 0.0;
|
---|
255 | staticDrum1_Cs_purg_Q = 0.0;
|
---|
256 | staticDrum1_Cs_sup_Q = 0.0;
|
---|
257 | staticDrum1_Ce_eco_Q = 0.0;
|
---|
258 | staticDrum1_Ce_eva_Q = 0.0;
|
---|
259 | staticDrum1_Ce_eco_Q + staticDrum1_Ce_steam_Q + staticDrum1_Ce_sup_Q + staticDrum1_Ce_eva_Q + (-staticDrum1_Cs_sup_Q) - staticDrum1_Cs_eva_Q - staticDrum1_Cs_sur_Q - staticDrum1_Cs_purg_Q = 0.0;
|
---|
260 | staticDrum1_Ce_eco_Q * staticDrum1_Ce_eco_h + staticDrum1_Ce_steam_Q * staticDrum1_Ce_steam_h + staticDrum1_Ce_sup_Q * staticDrum1_Ce_sup_h + staticDrum1_Ce_eva_Q * staticDrum1_Ce_eva_h + staticDrum1_Cth_W + (-staticDrum1_Cs_purg_Q) * staticDrum1_Cs_purg_h - staticDrum1_Cs_sur_Q * staticDrum1_Cs_sur_h - staticDrum1_Cs_eva_Q * staticDrum1_Cs_eva_h - staticDrum1_Cs_sup_Q * staticDrum1_Cs_sup_h = 0.0;
|
---|
261 | singularPressureLoss2_Q = singularPressureLoss2_C1_Q;
|
---|
262 | singularPressureLoss2_C1_Q = staticDrum1_Cs_sur_Q;
|
---|
263 | singularPressureLoss2_C2_Q = singularPressureLoss2_C1_Q;
|
---|
264 | mixer21_Ce1_Q = singularPressureLoss2_C2_Q;
|
---|
265 | mixer21_Oalpha1_signal = mixer21_alpha1;
|
---|
266 | mixer21_alpha1 = mixer21_Ce1_Q / mixer21_Cs_Q;
|
---|
267 | 0.0 = mixer21_Ce1_Q + mixer21_Ce2_Q - mixer21_Cs_Q;
|
---|
268 | singularPressureLoss3_Q = singularPressureLoss3_C1_Q;
|
---|
269 | singularPressureLoss3_C2_Q = singularPressureLoss3_C1_Q;
|
---|
270 | mixer21_Ce2_Q = singularPressureLoss3_C2_Q;
|
---|
271 | 0.0 = mixer21_Ce1_Q * mixer21_Ce1_h + mixer21_Ce2_Q * mixer21_Ce2_h - mixer21_Cs_Q * mixer21_Cs_h;
|
---|
272 | mixer21_Ce2_h = singularPressureLoss3_C2_h;
|
---|
273 | singularPressureLoss3_C2_h = singularPressureLoss3_C1_h;
|
---|
274 | singularPressureLoss3_pro_pT = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(singularPressureLoss3_Pm, singularPressureLoss3_T, singularPressureLoss3_mode);
|
---|
275 | singularPressureLoss3_Pm = 0.5 * (singularPressureLoss3_C1_P + singularPressureLoss3_C2_P);
|
---|
276 | singularPressureLoss3_C1_P - singularPressureLoss3_C2_P = singularPressureLoss3_deltaP;
|
---|
277 | singularPressureLoss3_deltaP = singularPressureLoss3_K * (singularPressureLoss3_Q * abs(singularPressureLoss3_Q) / singularPressureLoss3_rho);
|
---|
278 | singularPressureLoss3_rho = singularPressureLoss3_pro_pT_d;
|
---|
279 | singularPressureLoss3_h = singularPressureLoss3_pro_pT_h;
|
---|
280 | singularPressureLoss3_h = singularPressureLoss3_C1_h;
|
---|
281 | 0.0 = singularPressureLoss3_C1_h - singularPressureLoss3_C1_h_vol;
|
---|
282 | annotation(
|
---|
283 | experiment(StartTime = 0, StopTime = 1, Tolerance = 1e-6, Interval = 0.002),
|
---|
284 | __OpenModelica_simulationFlags(lv = "LOG_STATS", s = "dassl"));
|
---|
285 | end Reconciled_NewDataReconciliationSimpleTests_TSP_FourFlows5;
|
---|