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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2311 - (show annotations) (download) (as text)
Mon Nov 1 05:51:07 2010 UTC (13 years, 7 months ago) by jpye
File MIME type: text/x-ascend
File size: 11112 byte(s)
Fix outdated URL.
1 (*
2 ASCEND model library: tube-bank view factor model
3 Copyright (C) John Pye 2007-2008
4 http://jpye.dyndns.org/
5
6 This program is free software; you can redistribute it
7 and/or modify it under the terms of the GNU General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later
10 version.
11
12 This program is distributed in the hope that it will be
13 useful, but WITHOUT ANY WARRANTY; without even the implied
14 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the GNU General Public License for more
16 details.
17
18 You should have received a copy of the GNU General Public
19 License along with this program; if not, write to the Free
20 Software Foundation, Inc., 59 Temple Place, Suite 330,
21 Boston, MA 02111-1307 USA
22 -------------------------------------------------------------------
23
24 View factor calculation from a bank of tubes
25 to an opposing flat surface. This case is of
26 interest in solar collector design.
27
28 F
29 ___ _._ ___
30 .˙˙ ˙˙. .˙˙ : ˙˙.G .˙˙ ˙˙.
31 : E : : : C:. : D :
32 | ´ | | C ^ E| .| ´ |·········
33 '. .' B'. : .'; '.H .' ^
34 '-----' .'--:--'. . '-----' :
35 . : . ` I˙ . : h
36 . : . ˙ ˙ . :
37 .:. . ˙ . :
38 ------------------+------+----------+----+-+->
39 O A X J x
40 (x1) (x2)
41
42 (ASCII art above uses UTF-8 encoding)
43
44 The view factor from the entire surface of cylinder
45 'C' to the plane slice from A to J is calculated and
46 returned as 'F' by this model.
47
48 The distance OC is given by the variable 'h'.
49 The distance OA is given by the variable 'x1'.
50 The distance OJ is given by the variable 'x2'.
51 The radius of the cylinders is given by 'r'.
52 The spacing of the cylinders (centre-to-centre) is 2*s.
53
54 At the point X there is a region boundary. To the
55 right of X, some beams from the cylinder C are
56 occluded by the cylinder D. For this reason, the model
57 currently requires the conditional solver CMSlv.
58
59 The calculation method uses Hottel's crossed string rule
60 to determine the view factor.
61 *)
62
63 REQUIRE "atoms.a4l";
64
65 (*
66 Calculates the angle (relative to the top of the
67 circle) at which a tangent strikes a circle, given the position
68 of the point (x,-h) and the radius of the circle (r).
69 *)
70 MODEL wrapping_angle(
71 x WILL_BE delta_distance;
72 h WILL_BE distance;
73 r WILL_BE distance;
74 theta WILL_BE angle;
75 );
76 theta = arccos((x*sqrt(h^2 + x^2 - r^2) - h*r) / (x^2 + h^2));
77 END wrapping_angle;
78
79 (*
80 Calculate the length L of a piece of string from the top
81 of a circle, of radius r, stretched around the circle to a
82 point (x,-h) located below the circle and to one side.
83
84 This will be used in the Hottel 'crossed string' method to
85 calculate view factors from a tube bank to a plane wall.
86 *)
87 MODEL wrapping_length(
88 x WILL_BE delta_distance;
89 h WILL_BE distance;
90 r WILL_BE distance;
91 L WILL_BE distance; (* resulting length (output) *)
92 );
93 theta IS_A angle;
94 wrap_ang IS_A wrapping_angle(x,h,r,theta);
95
96 L_tan, L_arc IS_A distance;
97 L_tan = sqrt(h^2 + x^2 - r^2);
98 L_arc = r*theta;
99 L = L_tan + L_arc;
100 END wrapping_length;
101
102 (*
103 Calculate the length L of a piece of string from the
104 top of a circle (at 0,0, with radius r) stretched to a
105 remote point (x,-h) for the case where the string is
106 partly obstructed by another circle adjacent to the first
107 one. The obstructing circle is located at (2s,0) and has
108 the same radius r.
109 *)
110 MODEL wrapping_length_obstructed(
111 x WILL_BE delta_distance;
112 h WILL_BE distance;
113 r WILL_BE distance;
114 s WILL_BE distance;
115 L WILL_BE distance; (* resulting length (output) *)
116 );
117 phi IS_A angle;
118 phi = arcsin(r/s);
119
120 L_arc, L_span, L_tan IS_A distance;
121 L_arc = r*phi;
122 L_span = 2*sqrt(s^2-r^2);
123
124 x1 IS_A delta_distance;
125 -x1 = (x - 2*s);
126 psi IS_A angle;
127 wrap IS_A wrapping_angle(x1,h,r,psi);
128
129 L_hug IS_A delta_distance;
130 L_hug = r*(psi - (1{PI} - phi));
131
132 L_tan = sqrt(h^2 + x1^2 - r^2);
133
134 L = L_arc + L_span + L_hug + L_tan;
135
136 END wrapping_length_obstructed;
137
138 (*
139 Conditional model, to calculate the length of a string
140 as for wrapping_length_obstructed and wrapping_length
141 for remote points (x,-h) where it is not yet known
142 whether or not the string is obstructed by an adjacent
143 circle. The distance x_crit is calculated, then depending
144 on its value, the appropriate wrapping length formula
145 is used. The equations are condensed from the above
146 models into fewer (but more complex) equations, to help
147 with model convergence.
148 *)
149 MODEL wrapping_length_ambi(
150 x WILL_BE delta_distance;
151 h WILL_BE distance;
152 r WILL_BE distance;
153 s WILL_BE distance;
154 L WILL_BE distance; (* resulting length (output) *)
155 );
156 x_crit IS_A distance;
157 x_crit = s + h*sqrt(s^2-r^2)/r;
158
159 (* obstructed case *)
160 phi IS_A angle;
161 phi = arcsin(r/s);
162
163 x1 IS_A delta_distance;
164 -x1 = (x - 2*s);
165
166 psi IS_A angle;
167 wrap IS_A wrapping_angle(x1,h,r,psi);
168
169 L_span IS_A distance;
170 L_span = 2*sqrt(s^2-r^2);
171 L_hug IS_A delta_distance;
172 L_hug = r*(psi - (1{PI} - phi));
173
174 L_expr_obstructed: L = r*phi + L_span + L_hug + sqrt(h^2 + x1^2 - r^2);
175
176 (* unobstructed case *)
177 theta IS_A angle;
178 wrap_clear IS_A wrapping_angle(x,h,r,theta);
179
180 L_expr_clear: L = r*theta + sqrt(h^2 + x^2 - r^2);
181
182 CONDITIONAL
183 obstructed_expr: abs(x) > x_crit;
184 END CONDITIONAL;
185 is_obstructed IS_A boolean_var;
186 is_obstructed == SATISFIED(obstructed_expr, 1e-3{m});
187 WHEN(is_obstructed)
188 CASE TRUE:
189 USE L_expr_obstructed;
190 CASE FALSE:
191 USE L_expr_clear;
192 END WHEN;
193
194 END wrapping_length_ambi;
195
196 MODEL vfac_empty;
197 (* nothing here, just a placeholder for refinement *)
198 END vfac_empty;
199
200 (*
201 View factor from a circle C to a flat strip OA
202 placed below it (see diagram at top of file)
203 *)
204 MODEL vfac_circle_plane(
205 x WILL_BE delta_distance;
206 h WILL_BE distance;
207 r WILL_BE distance;
208 F WILL_BE fraction; (* output *)
209 ) REFINES vfac_empty;
210 xzero IS_A delta_distance;
211 xzero = 0;
212 OBF, OECF, ADBF, ACF IS_A distance;
213 OBF_wrap IS_A wrapping_length(xzero,h,r,OBF);
214 OECF,OBF ARE_THE_SAME;
215 xneg IS_A delta_distance;
216 xneg = -x;
217 ADBF_wrap IS_A wrapping_length(xneg,h,r,ADBF);
218 ACF_wrap IS_A wrapping_length(x,h,r,ACF);
219
220 F = ((ADBF + OECF) - (OBF + ACF)) / (4{PI}*r);
221 END vfac_circle_plane;
222
223 (*
224 View factor from a circle C to a flat strip OA
225 placed below it, for the case where the view is
226 obstructed by adjacent circle D (see diagram at top
227 of file).
228 *)
229 MODEL vfac_circle_plane_obstructed(
230 x WILL_BE delta_distance;
231 h WILL_BE distance;
232 r WILL_BE distance;
233 s WILL_BE distance;
234 F WILL_BE fraction; (* output *)
235 ) REFINES vfac_empty;
236 xzero IS_A delta_distance;
237 xzero = 0;
238 OBF, OEGF, JKBF, JIHGF IS_A distance;
239 OBF_wrap IS_A wrapping_length(xzero,h,r,OBF);
240 OEGF,OBF ARE_THE_SAME;
241 xneg IS_A delta_distance;
242 xneg = -x;
243 JKBF_wrap IS_A wrapping_length(xneg,h,r,JKBF);
244 JIHGF_wrap IS_A wrapping_length_obstructed(x,h,r,s,JIHGF);
245
246 F = ((JKBF + OEGF) - (OBF + JIHGF)) / (4{PI}*r);
247 END vfac_circle_plane_obstructed;
248
249 (*
250 Conditional model that calculates the view factor
251 from a circle C to a flat string OA placed below it,
252 for the case where it may or may not be obstructed by
253 a neighbouring circle D.
254 *)
255 MODEL vfac_circle_plane_ambi(
256 x WILL_BE delta_distance;
257 h WILL_BE distance;
258 r WILL_BE distance;
259 s WILL_BE distance;
260 F WILL_BE fraction; (* output *)
261 ) REFINES vfac_empty;
262 xzero IS_A delta_distance;
263 xzero = 0;
264 OBF, OEGF, JKBF, JIHGF IS_A distance;
265 OBF_wrap IS_A wrapping_length(xzero,h,r,OBF);
266 OEGF,OBF ARE_THE_SAME;
267 xneg IS_A delta_distance;
268 xneg = -x;
269 JKBF_wrap IS_A wrapping_length(xneg,h,r,JKBF);
270 JIHGF_wrap IS_A wrapping_length_ambi(x,h,r,s,JIHGF);
271
272 F = ((JKBF + OEGF) - (OBF + JIHGF)) / (4{PI}*r);
273 END vfac_circle_plane_ambi;
274
275 (*
276 Model for the view factor from a single tube to a surface beneath it.
277 *)
278 MODEL singletube;
279 x "x coordinate of tube centreline" IS_A delta_distance;
280 x1 "left end of flat surface" IS_A delta_distance;
281 x2 "right end of flat surface" IS_A delta_distance;
282 h "height from cylinder axis to surface" IS_A distance;
283 r "cylinder radius" IS_A distance;
284 s "cylinder half-spacing" IS_A distance;
285
286 F1, F2 IS_A fraction;
287 vfac1 IS_A vfac_circle_plane_ambi(x1a,h,r,s,F1);
288 vfac2 IS_A vfac_circle_plane_ambi(x2a,h,r,s,F2);
289
290 x1a, x2a IS_A delta_distance;
291 x1a = abs(x1 - x);
292 x2a = abs(x2 - x);
293
294 CONDITIONAL
295 c1: (x1 - x) * (x2 - x) >= 0;
296 c3: x1a > x2a;
297 END CONDITIONAL;
298
299 sameside IS_A boolean_var;
300 greater1 IS_A boolean_var;
301 sameside == SATISFIED(c1);
302 greater1 == SATISFIED(c3);
303
304 expr1: F = F1 - F2;
305 expr2: F = F2 - F1;
306 exprS: F = F1 + F2;
307
308 F "view factor from tube to surface x1--x2" IS_A fraction;
309 WHEN(sameside,greater1)
310 CASE TRUE,TRUE:
311 USE expr1;
312 CASE TRUE,FALSE:
313 USE expr2;
314 CASE FALSE,TRUE:
315 USE exprS;
316 CASE FALSE,FALSE:
317 USE exprS;
318 END WHEN;
319
320 twoF IS_A fraction;
321 twoF = 2 * F;
322 METHODS
323 METHOD on_load;
324 FIX x; x:= 610 {mm};
325 FIX x1; x1 := -607.5 {mm};
326 FIX x2; x2 := +607.5 {mm};
327 FIX h; h := 200 {mm} - 23 {mm};
328 FIX r; r:= 20 {mm};
329 FIX s; s:= 22.5 {mm};
330 sameside := FALSE;
331 greater1 := TRUE;
332 END on_load;
333 END singletube;
334
335 (*
336 Model of a tube bank (many tubes) facing opposite a
337 flat surface. Model serves only to calculate the view
338 factors, which will then be used elsewhere.
339 *)
340 MODEL tubebank;
341 W IS_A distance;
342 D IS_A distance;
343 theta IS_A angle;
344
345 B, N IS_A distance;
346 N*sin(theta)=D;
347 N*cos(theta)*2 = B - W;
348
349 h IS_A distance;
350 r IS_A distance;
351 L IS_A distance;
352 s IS_A distance;
353
354 h = D - s; (* assume that tubes are spaced down from the top wall slightly *)
355
356 n IS_A integer_constant;
357 n :== 2; (* in the half-cavity *)
358
359 2*s = (W/2) / n;
360
361 nb IS_A integer_constant;
362 nb :== 2; (* in the half-cavity *)
363
364 (*
365 Calculate view factors from every tube to every
366 slice of the plane opposite.
367
368 F_cum is from a tube to a plate from 0 to x[j].
369 F is from x[j-1] to x[j]
370 In both cases, j=[1..nb].
371 *)
372 F_cum[1..n][-nb..nb] IS_A fraction;
373 F[1..n][-nb..nb] IS_A fraction;
374
375 x_base[-nb..nb] IS_A delta_distance;
376 FOR j IN [-nb..nb] CREATE
377 x_base[j] = j/nb * (B/2);
378 END FOR;
379
380 x_tube[1..n] IS_A delta_distance;
381 FOR i IN [1..n] CREATE
382 x_tube[i] = (2*i-1)*s;
383 END FOR;
384
385 x[1..n][-nb..nb] IS_A delta_distance;
386
387 vfac[1..n][-nb..nb] IS_A vfac_empty;
388 FOR i IN [1..n] CREATE
389 x[i][0] = x_base[0] - x_tube[i];
390 vfac[i][0] IS_REFINED_TO vfac_circle_plane_ambi(x[i][0],h,r,s,F_cum[i][0]);
391 FOR j IN [1..nb] CREATE
392 x[i][j] = x_base[j] - x_tube[i];
393 x[i][-j] = x_base[j] + x_tube[i];
394 vfac[i][j] IS_REFINED_TO vfac_circle_plane_ambi(x[i][j],h,r,s,F_cum[i][j]);
395 vfac[i][-j] IS_REFINED_TO vfac_circle_plane_ambi(x[i][-j],h,r,s,F_cum[i][-j]);
396 END FOR;
397 END FOR;
398 FOR i IN [1..n] CREATE
399 FOR j IN [1..nb] CREATE
400 F[i][j] = F_cum[i][j] - F_cum[i][j-1];
401 F[i][-j] = F_cum[i][-j] - F_cum[i][-j+1];
402 END FOR;
403 END FOR;
404 METHODS
405 METHOD on_load;
406 FIX D,W,theta;
407 D := 200 {mm};
408 W := 575 {mm};
409 theta := 32 {deg};
410
411 FIX r;
412 r:= 42.164 {mm} / 2.;
413 END on_load;
414 END tubebank;

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