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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1694 by jpye, Wed Dec 26 04:50:12 2007 UTC revision 1695 by jpye, Wed Dec 26 08:23:08 2007 UTC
# Line 1  Line 1 
1  (*  (*
2        ASCEND model library: tube-bank view factor model
3        Copyright (C) John Pye 2007
4        http://pye.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      View factor calculation from a bank of tubes
25      to an opposing flat surface. This case is of      to an opposing flat surface. This case is of
26      interest in solar collector design.      interest in solar collector design.
# Line 171  MODEL wrapping_length_ambi( Line 193  MODEL wrapping_length_ambi(
193    
194  END wrapping_length_ambi;    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      View factor from a circle C to a flat strip OA
202      placed below it (see diagram at top of file)      placed below it (see diagram at top of file)
# Line 180  MODEL vfac_circle_plane( Line 206  MODEL vfac_circle_plane(
206      h WILL_BE distance;      h WILL_BE distance;
207      r WILL_BE distance;      r WILL_BE distance;
208      F WILL_BE fraction; (* output *)      F WILL_BE fraction; (* output *)
209  );  ) REFINES vfac_empty;
210      xzero IS_A delta_distance;      xzero IS_A delta_distance;
211      xzero = 0;      xzero = 0;
212      OBF, OECF, ADBF, ACF IS_A distance;      OBF, OECF, ADBF, ACF IS_A distance;
# Line 206  MODEL vfac_circle_plane_obstructed( Line 232  MODEL vfac_circle_plane_obstructed(
232      r WILL_BE distance;      r WILL_BE distance;
233      s WILL_BE distance;      s WILL_BE distance;
234      F WILL_BE fraction; (* output *)      F WILL_BE fraction; (* output *)
235  );  ) REFINES vfac_empty;
236      xzero IS_A delta_distance;      xzero IS_A delta_distance;
237      xzero = 0;      xzero = 0;
238      OBF, OEGF, JKBF, JIHGF IS_A distance;      OBF, OEGF, JKBF, JIHGF IS_A distance;
# Line 232  MODEL vfac_circle_plane_ambi( Line 258  MODEL vfac_circle_plane_ambi(
258      r WILL_BE distance;      r WILL_BE distance;
259      s WILL_BE distance;      s WILL_BE distance;
260      F WILL_BE fraction; (* output *)      F WILL_BE fraction; (* output *)
261  );  ) REFINES vfac_empty;
262      xzero IS_A delta_distance;      xzero IS_A delta_distance;
263      xzero = 0;      xzero = 0;
264      OBF, OEGF, JKBF, JIHGF IS_A distance;      OBF, OEGF, JKBF, JIHGF IS_A distance;
# Line 252  END vfac_circle_plane_ambi; Line 278  END vfac_circle_plane_ambi;
278      factors, which will then be used elsewhere.      factors, which will then be used elsewhere.
279  *)  *)
280  MODEL tubebank;  MODEL tubebank;
281      x1, x2 IS_A delta_distance;      W IS_A distance;
282        D IS_A distance;
283        theta IS_A angle;
284    
285        B, N IS_A distance;
286        N*sin(theta)=D;
287        N*cos(theta)*2 = B - W;
288    
289      h IS_A distance;      h IS_A distance;
290      r IS_A distance;      r IS_A distance;
291      L IS_A distance;      L IS_A distance;
292      s IS_A distance;      s IS_A distance;
293        
294        h = D - s; (* assume that tubes are spaced down from the top wall slightly *)
295    
296        n IS_A integer_constant;
297        n :== 2; (* in the half-cavity *)
298    
299      F1, F2, F IS_A fraction;      2*s = (W/2) / n;
300      F1_wrap IS_A vfac_circle_plane_ambi(x1,h,r,s,F1);  
301      F2_wrap IS_A vfac_circle_plane_ambi(x2,h,r,s,F2);      nb IS_A integer_constant;
302      F = F2 - F1;      nb :== 2; (* in the half-cavity *)
303    
304        (*
305            Calculate view factors:
306    
307            F_cum is from a tube to a plate from 0 to x[j].
308            F is from x[j-1] to x[j]
309            In both cases, j=[1..nb].
310        *)
311        F_cum[1..n][-nb..nb] IS_A fraction;
312        F[1..n][-nb..-1,1..nb] IS_A fraction;
313    
314        x_base[-nb..nb] IS_A delta_distance;
315        FOR j IN [-nb..nb] CREATE
316            x_base[j] = j/nb * (B/2);
317        END FOR;
318    
319        x_tube[1..n] IS_A delta_distance;
320        FOR i IN [1..n] CREATE
321            x_tube[i] = (2*i-1)*s;
322        END FOR;
323    
324        x[1..n][-nb..nb] IS_A delta_distance;
325    
326        vfac[1..n][-nb..nb] IS_A vfac_empty;
327        FOR i IN [1..n] CREATE
328            x[i][0] = x_base[j] - x_tube[i];
329            vfac[i][0] IS_REFINED_TO vfac_circle_plane_ambi(x[i][0],h,r,s,F[i][0]);
330            FOR j IN [1..nb] CREATE
331                x[i][j] = x_base[j] - x_tube[i];
332                x[i][-j] = x_base[j] + x_tube[i];
333                vfac[i][j] IS_REFINED_TO vfac_circle_plane_ambi(x[i][j],h,r,s,F[i][j]);
334                vfac[i][-j] IS_REFINED_TO vfac_circle_plane_ambi(x[i][-j],h,r,s,F[i][-j]);
335            END FOR;
336        END FOR;
337        FOR i IN [1..n] CREATE
338            FOR j IN [1..nb] CREATE
339                F[i][j] = F_cum[i][j] - F_cum[i][j-1];
340                F[i][-j] = F_cum[i][-j] - F_cum[i][-j+1];
341            END FOR;
342        END FOR;
343  METHODS  METHODS
344  METHOD on_load;  METHOD on_load;
345      FIX x1; x1:= 102 {mm};      FIX D,W,theta;
346      FIX x2; x2:= 208 {mm};      D := 200 {mm};
347      FIX h; h:= 117 {mm};      W := 575 {mm};
348      FIX r; r:= 42.164 {mm} / 2.;      theta := 32 {deg};
     FIX s; s:= 575. {mm} / 12 / 2;  
 END on_load;  
 METHOD self_test;  
     ASSERT abs(wrap.L_tan - 150 {mm}) < 1 {mm};  
     ASSERT abs(wrap.theta - 62 {deg}) < 1.5 {deg};  
 END self_test;  
349    
350        FIX r;
351        r:= 42.164 {mm} / 2.;
352    END on_load;
353  END tubebank;  END tubebank;

Legend:
Removed from v.1694  
changed lines
  Added in v.1695

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