-
Notifications
You must be signed in to change notification settings - Fork 0
/
solar_field_model_using_sunpos.a4l
353 lines (269 loc) · 8.48 KB
/
solar_field_model_using_sunpos.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
(* This model simulates the Solar field according to the approach of the patnode. *)
REQUIRE "atoms.a4l";
REQUIRE "vikram/mytypes.a4l";
REQUIRE "johnpye/thermo_types.a4c";
REQUIRE "johnpye/sunpos.a4c";
MODEL sunpos_wrapper REFINES sunpos;
beta = 1.0 * theta_z;
METHODS
METHOD specify;
FIX L_st, L_loc, phi; (* time and location *)
FIX gamma; (* surface orientation *)
FIX t;
END specify;
METHOD values;
END values;
METHOD self_test;
ASSERT abs(theta-35.0{deg}) < 0.15{deg};
ASSERT abs(delta-(-13.80{deg})) < 0.02{deg};
END self_test;
END sunpos_wrapper;
(* To calculate heat absorbed by the solar receiver of cylindrical shape *)
MODEL Qabsorbed;
(* Variables *)
value IS_A intensity; (* Solar radiation absorbed by the receiver tubesin W/m2 *)
DNI IS_A intensity; (* Direct normal insolation in W/m2 *)
GAMMA IS_A angle; (* surface azimuth angle, south=0, west positive *)
Standard_Time IS_A time; (* in hr *)
DST IS_A time; (* Daylight savings time adjustment, 1 hr during daylight savings time, o during standard time *)
Lst IS_A angle; (* Standard meridian for the local time zone, deg *)
Lloc IS_A angle; (* Local merididan of the collector site, deg *)
PHI IS_A angle; (* lattitude location of the plant in deg *)
Iam IS_A factor; (* Incidence angle modifier *)
Rs IS_A factor; (* Row shadow factor *)
Weff IS_A distance; (* Effective unshaded width of mirror aperture, m *)
W IS_A distance; (* Collector aperture width, m *)
Lspacing IS_A distance; (* Length of spacing between troughs, m *)
ENDLOSS IS_A factor; (* End loss for the heat collecting elements- HCE *)
F IS_A distance; (* Focal length of the collectors, m *)
Lsca IS_A distance; (* Length of single solar collector assembly, m *)
Nfield IS_A fraction; (* Field efficiency *)
Nhce IS_A fraction; (* Number of HCE types in the field *)
SFAavail IS_A fraction; (* Fraction of solar field which is operable and tracking the sun *)
(* parts *)
Sunpos IS_A sunpos_wrapper;
(* interconnections *)
PHI, Sunpos.phi ARE_THE_SAME;
Lst, Sunpos.L_st ARE_THE_SAME;
Lloc, Sunpos.L_loc ARE_THE_SAME;
Standard_Time, Sunpos.t ARE_THE_SAME;
GAMMA, Sunpos.gamma ARE_THE_SAME;
(* Equations *)
value = DNI * cos(Sunpos.theta) * Iam * Rs * ENDLOSS * Nfield * Nhce * SFAavail;
Iam = 1 + 8.84e-4 * (Sunpos.theta/cos(Sunpos.theta)) - 5.369e-5 * (Sunpos.theta^2)/cos(Sunpos.theta);
Rs = Weff / W;
Rs = (Lspacing/W) * (cos(Sunpos.theta_z)/cos(Sunpos.theta));
ENDLOSS = 1 - F * tan(Sunpos.theta) / Lsca;
METHODS
METHOD specify;
FIX DNI;
FIX Lst;
FIX Lloc;
FIX DST;
FIX Standard_Time;
FIX Lspacing;
FIX W;
FIX F;
FIX Lsca;
FIX Nfield;
FIX Nhce;
FIX SFAavail;
FIX PHI;
RUN Sunpos.specify;
END specify;
METHOD values;
IF (Standard_Time > 12{hour}) THEN
GAMMA := 90{deg};
END IF;
IF (Standard_Time <= 12{hour}) THEN
GAMMA := -90{deg};
END IF;
(* guesses *)
value := 100 {watt/m^2};
END values;
END Qabsorbed;
MODEL test_Qabsorbed;
Qabs IS_A Qabsorbed;
METHODS
METHOD specify;
RUN Qabs.specify;
END specify;
METHOD values;
Qabs.DNI := 60 {watt/m^2};
Qabs.Lst := -105 {deg};
Qabs.Lloc := -110 {deg};
Qabs.DST := 0 {hour};
Qabs.PHI := 37.21 {deg};
Qabs.Standard_Time := 15 {hour};
Qabs.Lspacing := 15 {m};
Qabs.W := 5 {m};
Qabs.F := 5 {m};
Qabs.Lsca := 50 {m};
Qabs.Nfield := 0.857;
Qabs.Nhce := 0.832;
Qabs.SFAavail := 1;
RUN Qabs.values;
END values;
METHOD on_load;
RUN specify;
RUN values;
END on_load;
END test_Qabsorbed;
(* To calculate heat loss per metre for the field *)
MODEL HeatLossField;
(* Variables *)
DNI IS_A intensity; (* Direct normal insolation in W/m2 *)
Ti IS_A temperature; (* Input temperature to the field, deg cel *)
To IS_A temperature; (* Output temperature from the field, deg cel *)
type IS_A variable;
HCEfra IS_A fraction; (* The fraction of HCE type in the field *)
a0 IS_A solver_var;
a1 IS_A solver_var;
a2 IS_A solver_var;
a3 IS_A solver_var;
b0 IS_A solver_var;
b1 IS_A solver_var;
HLfield IS_A heatloss_per_unit_lenght;
(* Equation *)
HLfield * (To-Ti) = HCEfra * (a0*(To-Ti) + (a1/2)*(To^2 - Ti^2) + (a2/3)*(To^3 - Ti^3) + (a3/4)*(To^4 - Ti^4) * DNI*(b0*(To-Ti) + (b1/3)*(To^3 - Ti^3)));
METHODS
METHOD specify;
FIX a0;
FIX a1;
FIX a2;
FIX a3;
FIX b0;
FIX b1;
FIX DNI;
FIX Ti;
END specify;
METHOD values;
DNI := 60 {watt/m^2};
Ti := 30 {K};
IF (type = 1) THEN
(* air *)
a0 := -2.247372E+01 {watt/m^2};
a1 := 8.374490E-01 {watt/m^2/K};
a2 := 0.00 {watt/m^2/K^2};
a3 := 4.620143E-06 {watt/m^2/K^3};
b0 := 6.983190E-02 {m};
b1 := 9.312703E-08 {m/K^2};
END IF;
IF (type = 2) THEN
(* vaccum *)
a0 := -2.247372E+01 {watt/m^2};
a1 := 8.374490E-01 {watt/m^2/K};
a2 := 0.00 {watt/m^2/K^2};
a3 := 4.620143E-06 {watt/m^2/K^3};
b0 := 6.983190E-02 {m};
b1 := 9.312703E-08 {m/K^2};
END IF;
IF (type = 3) THEN
(* hydrogen *)
a0 := -2.247372E+01 {watt/m^2};
a1 := 8.374490E-01 {watt/m^2/K};
a2 := 0.00 {watt/m^2/K^2};
a3 := 4.620143E-06 {watt/m^2/K^3};
b0 := 6.983190E-02 {m};
b1 := 9.312703E-08 {m/K^2};
END IF;
END values;
END HeatLossField;
(* To calculate Q collected by the solar field in W/m2 *)
MODEL Qcollected;
(* variables *)
field_types IS_A set OF symbol_constant;
field_types :== ['air','vaccum','hydrogen'];
DNI IS_A intensity;
Ti IS_A temperature; (* Input temperature to the field, deg cel *)
To IS_A temperature; (* Output temperature from the field, deg cel *)
Tambient IS_A temperature; (* Ambient temperature, deg cel *)
width IS_A distance; (* Width of mirror aperure, m *)
RecHL IS_A intensity; (* Receiver heat loss, W/m2 *)
SfHL IS_A intensity; (* Soalr field piping heat loss, W/m2 *)
value IS_A intensity;
delT IS_A delta_temperature;
rho_i IS_A mass_density;
hi IS_A specific_enthalpy;
ho IS_A specific_enthalpy;
delHfield IS_A specific_enthalpy;
Lsca IS_A distance; (* Length of single solar collector assembly, m *)
Nsca IS_A factor; (* Number of solar collector assemblies in the field *)
Vhtf IS_A volumetric_flowrate; (* m3/hr *)
(* parts *)
Qabs IS_A Qabsorbed;
hlfield[field_types] IS_A HeatLossField;
(* interconnecting *) (* Annulus types- air, vaccum, hydrogen *)
To,
hlfield['air'].To,
hlfield['vaccum'].To,
hlfield['hydrogen'].To ARE_THE_SAME;
DNI, Qabs.DNI ARE_THE_SAME;
Lsca, Qabs.Lsca ARE_THE_SAME;
(* equations *)
RecHL * width = SUM[hlfield[field_types].HLfield];
delT * 2 = (To + Ti) - Tambient * 2;
SfHL = 0.01693{watt/m^2/K}*delT - 0.0001683{watt/m^2/K^2}*(delT^2) + 0.78e-7{watt/m^2/K^3}*(delT^3);
value = Qabs.value - (RecHL + SfHL);
rho_i = 1074.0{kg/m^3} - 0.6367{kg/m^3/K}*Ti - 0.0007762{kg/m^3/K^2}*Ti^2;
delHfield * (Vhtf * rho_i) = value * width * Lsca * Nsca;
hi = 1000{m^2/s^2} * (-18.34 + 1.498{1/K}*Ti + 0.001377{1/K^2}*Ti^2);
ho = 1000{m^2/s^2} * (-18.34 + 1.498{1/K}*To + 0.001377{1/K^2}*To^2);
delHfield = abs(hi - ho);
METHODS
METHOD specify;
FIX DNI;
FIX Ti;
FIX Tambient;
FIX width;
FIX Lsca;
FIX Nsca;
FIX Vhtf;
FIX hlfield[field_types].HCEfra;
FIX hlfield[field_types].type;
RUN hlfield[field_types].specify;
RUN Qabs.specify;
END specify;
METHOD values;
DNI := 60 {watt/m^2};
Ti := 60{K};
Tambient := 30{K};
width := 5{m};
Lsca := 50 {m};
Nsca := 256;
Vhtf := 400{m^3/hour};
hlfield['air'].type := 1;
hlfield['vaccum'].type := 2;
hlfield['hydrogen'].type := 3;
hlfield['air'].HCEfra := 1.0;
hlfield['vaccum'].HCEfra := 0.0;
hlfield['hydrogen'].HCEfra := 0.0;
Qabs.Lst := -105 {deg};
Qabs.Lloc := -110 {deg};
Qabs.DST := 0 {hour};
Qabs.PHI := 37.21 {deg};
Qabs.Standard_Time := 15 {hour};
Qabs.Lspacing := 15 {m};
Qabs.W := 5 {m};
Qabs.F := 5 {m};
Qabs.Nfield := 0.857;
Qabs.Nhce := 0.832;
Qabs.SFAavail := 1;
RUN hlfield[field_types].values;
RUN Qabs.values;
(* guesses *)
To := 100{K};
END values;
METHOD on_load;
RUN specify;
RUN values;
END on_load;
END Qcollected;
MODEL test_Qcollected;
Qcoll IS_A Qcollected;
METHODS
METHOD on_load;
RUN Qcoll.specify;
RUN Qcoll.values;
END on_load;
END test_Qcollected;