-
Notifications
You must be signed in to change notification settings - Fork 0
/
flat_plate_collector.a4l
455 lines (358 loc) · 8.13 KB
/
flat_plate_collector.a4l
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
REQUIRE "atoms.a4l";
REQUIRE "vikram/mytypes.a4l";
REQUIRE "johnpye/thermo_types.a4c";
MODEL heat_transfer_coefficient_radiation(
T1 WILL_BE temperature;
T2 WILL_BE temperature;
E1 WILL_BE fraction;
E2 WILL_BE fraction;
);
value IS_A heat_transfer_coefficient;
(* equations *)
value * (1/E1 + 1/E2 - 1) = 5.67e-8{W/m^2/K^4} * (T1 + T2) * (T1^2 + T2^2);
METHODS
METHOD specify;
END specify;
METHOD values;
END values;
END heat_transfer_coefficient_radiation;
MODEL test_radiation;
T1 IS_A temperature;
T2 IS_A temperature;
E1 IS_A fraction;
E2 IS_A fraction;
h_r IS_A heat_transfer_coefficient_radiation(T1, T2, E1, E2);
METHODS
METHOD specify;
FIX T1;
FIX T2;
FIX E1;
FIX E2;
END specify;
METHOD values;
T1 := 60 {K} + 273.15 {K};
T2 := 30 {K} + 273.15 {K};
E1 := 0.6;
E2 := 0.7;
END values;
METHOD on_load;
RUN specify;
RUN values;
END on_load;
END test_radiation;
MODEL Nusselt_number(
T1 WILL_BE temperature;
T2 WILL_BE temperature;
B WILL_BE angle;
L WILL_BE distance;
);
(* variables *)
value IS_A factor;
g IS_A acceleration;
dT IS_A delta_temperature;
Ra IS_A rayleigh_number;
t1 IS_A factor;
t2 IS_A factor;
tt1 IS_A factor;
tt2 IS_A factor;
g = 9.8 {m/s^2};
dT = abs(T1-T2);
(* equations *)
Ra = g * B * dT * L^3;
tt1 = (1 - 1708{rad*K*m^4/s^2}/(Ra*cos(B) ) );
t1 = (abs(tt1) + tt1 )/ 2;
tt2 = (abs(Ra * cos(B)/5830{rad*K*m^4/s^2}))^(0.3) - 1;
t2 = (abs(tt2) + tt2 )/ 2;
value = 1 + 1.44*(1- 1708{rad*K*m^4/s^2}*((sin(1.8 * B)) ^ 1.6) / (Ra * cos(B)))*t1 + t2;
METHODS
METHOD specify;
END specify;
METHOD values;
END values;
END Nusselt_number;
MODEL test_Nusselt_number;
(* variables *)
T1 IS_A temperature;
T2 IS_A temperature;
B IS_A angle;
L IS_A distance;
(* equations *)
Nu IS_A Nusselt_number(T1, T2, B, L);
METHODS
METHOD specify;
FIX T1;
FIX T2;
FIX B;
FIX L;
END specify;
METHOD values;
T1 := 60 {K} + 273.15 {K};
T2 := 30 {K} + 273.15 {K};
B := 0.85 {rad};
L := 1.8 {cm};
END values;
METHOD on_load;
RUN specify;
RUN values;
END on_load;
END test_Nusselt_number;
MODEL heat_transfer_coefficient_convection(
T1 WILL_BE temperature;
T2 WILL_BE temperature;
spacing WILL_BE distance;
B WILL_BE angle;
);
(* variables *)
value IS_A heat_transfer_coefficient;
K IS_A thermal_conductivity;
(* thermal_conductivity of air *)
(* parts *)
Nu IS_A Nusselt_number(T1, T2, B, spacing);
(* equations *)
value = Nu.value * K / spacing;
METHODS
METHOD specify;
FIX K;
RUN Nu.specify;
END specify;
METHOD values;
K := 0.0253 {W/m/K};
RUN Nu.values;
END values;
END heat_transfer_coefficient_convection;
MODEL cover(
T WILL_BE temperature;
T_ WILL_BE temperature;
E WILL_BE fraction;
E_ WILL_BE fraction;
spacing WILL_BE distance;
tilt WILL_BE angle;
);
(* variables *)
Thermal_resistance IS_A inv_heat_transfer_coefficient;
(* parts *)
h_r IS_A heat_transfer_coefficient_radiation(T, T_, E, E_ );
h_c IS_A heat_transfer_coefficient_convection(T, T_, spacing, tilt );
(* equations *)
Thermal_resistance = 1/(h_c.value + h_r.value );
METHODS
METHOD specify;
FIX E;
FIX spacing;
FIX tilt;
RUN h_r.specify;
RUN h_c.specify;
END specify;
METHOD values;
RUN h_r.values;
RUN h_c.values;
END values;
END cover;
MODEL test_cover;
T IS_A temperature;
T_ IS_A temperature;
E IS_A fraction;
E_ IS_A fraction;
spacing IS_A distance;
tilt IS_A angle;
Cover IS_A cover(T, T_, E, E_, spacing, tilt);
METHODS
METHOD values;
T := 60 {K} + 273.15 {K};
T_ := 90 {K} + 273.15 {K};
E := 0.8;
E_ := 0.95;
spacing := 2 {cm};
tilt := 0.785 {rad};
END values;
METHOD specify;
FIX T;
FIX T_;
FIX E;
FIX E_;
FIX spacing;
FIX tilt;
END specify;
METHOD on_load;
RUN specify;
RUN values;
END on_load;
END test_cover;
MODEL topcover_to_atmosphere(
Ta WILL_BE temperature;
Ttop WILL_BE temperature;
Etop WILL_BE fraction;
);
(* variables *)
Ts IS_A temperature;
Thermal_resistance IS_A inv_heat_transfer_coefficient;
h_r IS_A heat_transfer_coefficient;
h_c IS_A heat_transfer_coefficient;
(* equations *)
Ts = 0.0552*(Ta^1.5);
h_r * (Ttop - Ta) = Etop * 5.67e-8{W/m^2/K^4} * (Ttop^4 - Ts^4);
Thermal_resistance = 1/(h_r + h_c);
METHODS
METHOD specify;
FIX h_c;
FIX Ta;
FIX Etop;
END specify;
METHOD values;
h_c := 10{W/m^2/K};
END values;
END topcover_to_atmosphere;
MODEL test_topcover_to_atmosphere;
Ta IS_A temperature;
Ttop IS_A temperature;
Etop IS_A fraction;
Rtop IS_A topcover_to_atmosphere (Ta, Ttop, Etop);
METHODS
METHOD values;
Ta := 30 {K} + 273.15 {K};
Ttop := 60 {K} + 273.15 {K};
Etop := 0.8;
END values;
METHOD specify;
FIX Ta;
FIX Ttop;
FIX Etop;
END specify;
METHOD on_load;
RUN specify;
RUN values;
END on_load;
END test_topcover_to_atmosphere;
MODEL absorbed_radiations;
value IS_A intensity;
METHODS
METHOD specify;
FIX value;
END specify;
METHOD values;
value := 10000000 {W/m^2};
END values;
END absorbed_radiations;
MODEL heat_loss(
Tp WILL_BE temperature;
Ta WILL_BE temperature;
Cover WILL_BE cover;
Rtop WILL_BE topcover_to_atmosphere;
);
(* variables *)
value IS_A intensity;
Ut IS_A heat_transfer_coefficient;
(* equations *)
Ut * ( Cover.Thermal_resistance + Rtop.Thermal_resistance ) = 1;
value = Ut*(Tp-Ta);
METHODS
METHOD specify;
END specify;
METHOD values;
END values;
END heat_loss;
MODEL test_heat_loss;
Ta IS_A temperature;
Ttop IS_A temperature;
Etop IS_A fraction;
Rtop IS_A topcover_to_atmosphere (Ta, Ttop, Etop);
T IS_A temperature;
T_ IS_A temperature;
E IS_A fraction;
E_ IS_A fraction;
spacing IS_A distance;
tilt IS_A angle;
Cover IS_A cover(T, T_, E, E_, spacing, tilt);
Tp IS_A temperature;
Heat_Loss IS_A heat_loss (Tp, Ta, Cover, Rtop);
METHODS
METHOD values;
Ta := 30 {K} + 273.15 {K};
Ttop := 60 {K} + 273.15 {K};
Etop := 0.8;
T := 60 {K} + 273.15 {K};
T_ := 90 {K} + 273.15 {K};
E := 0.8;
E_ := 0.95;
spacing := 2 {cm};
tilt := 0.785 {rad};
Tp := 90 {K} + 273.15 {K};
END values;
METHOD specify;
FIX Ta;
FIX Ttop;
FIX Etop;
FIX T;
FIX T_;
FIX E;
FIX E_;
FIX spacing;
FIX tilt;
FIX Tp;
END specify;
METHOD on_load;
RUN specify;
RUN values;
END on_load;
END test_heat_loss;
MODEL flat_plate_collector;
(* variables *)
A IS_A area;
tilt IS_A angle;
Ta IS_A temperature;
Tp IS_A temperature;
Ep IS_A fraction;
Ec IS_A fraction;
cover_spacing IS_A distance;
Tc IS_A temperature;
Qu IS_A energy_rate;
(* parts *)
Heat_Absorbed IS_A absorbed_radiations;
Heat_Loss IS_A heat_loss (Tp, Ta, Cover, Rtop);
Cover IS_A cover (Tc, Tp, Ec, Ep, cover_spacing, tilt);
Rtop IS_A topcover_to_atmosphere (Ta, Tc, Ec);
(* equations *)
Cover.T = Tp - Cover.Thermal_resistance * Heat_Loss.Ut * (Tp-Ta);
Qu = A * (Heat_Absorbed.value - Heat_Loss.value);
METHODS
METHOD specify;
FIX A;
FIX tilt;
FIX Ta;
FIX Tp;
FIX Ep;
FIX Ec;
FIX cover_spacing;
RUN Cover.specify;
RUN Heat_Absorbed.specify;
RUN Heat_Loss.specify;
RUN Rtop.specify;
END specify;
METHOD values;
RUN Cover.values;
RUN Heat_Absorbed.values;
RUN Heat_Loss.values;
RUN Rtop.values;
END values;
END flat_plate_collector;
MODEL test_flat_plate_collector;
fpcollector IS_A flat_plate_collector;
METHODS
METHOD specify;
RUN fpcollector.specify;
END specify;
METHOD values;
fpcollector.Ta := 30 {K} + 273.15 {K};
fpcollector.Tp := 90 {K} + 273.15 {K};
fpcollector.Ep := 0.95;
fpcollector.A := 1 {m^2};
fpcollector.tilt := 0.785 {rad};
fpcollector.Ec := 0.8;
fpcollector.cover_spacing := 2 {cm};
RUN fpcollector.values;
END values;
METHOD on_load;
RUN specify;
RUN values;
END on_load;
END test_flat_plate_collector;