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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1687 - (show annotations) (download) (as text)
Mon Dec 24 07:27:44 2007 UTC (13 years, 1 month ago) by jpye
File MIME type: text/x-ascend
File size: 4765 byte(s)
Added model of radiation from a tube bank. Requires CMSlv solver.
Seems to require several 'F9' presses before it solves, but it does solve.
1 (*
2 View factor calculation from a bank of tubes
3 (one touching the next) to an opposing flat surface
4 *)
5
6 REQUIRE "atoms.a4l";
7
8 MODEL wrapping_angle(
9 x WILL_BE delta_distance;
10 h WILL_BE distance;
11 r WILL_BE distance;
12 theta WILL_BE angle;
13 );
14 costheta IS_A factor;
15 costheta = (x*sqrt(h^2 + x^2 - r^2) - h*r) / (x^2 + h^2);
16 theta = arccos(costheta);
17 END wrapping_angle;
18
19 (*
20 Calculate the length of a piece of string from the top
21 of a circle stretched around the circle to a point
22 located below the circle and to one side.
23
24 This will be used in the Hottel 'crossed string' method to
25 calculate view factors from a tube bank to a plane wall.
26 *)
27 MODEL wrapping_length(
28 x WILL_BE delta_distance;
29 h WILL_BE distance;
30 r WILL_BE distance;
31 L WILL_BE distance; (* resulting length (output) *)
32 );
33 theta IS_A angle;
34 wrap_ang IS_A wrapping_angle(x,h,r,theta);
35
36 L_tan, L_arc IS_A distance;
37 L_tan = sqrt(h^2 + x^2 - r^2);
38 L_arc = r*theta;
39 L = L_tan + L_arc;
40 END wrapping_length;
41
42 MODEL wrapping_length_obstructed(
43 x WILL_BE delta_distance;
44 h WILL_BE distance;
45 r WILL_BE distance;
46 s WILL_BE distance;
47 L WILL_BE distance; (* resulting length (output) *)
48 );
49 phi IS_A angle;
50 phi = arcsin(r/s);
51
52 L_arc, L_span, L_tan IS_A distance;
53 L_arc = r*phi;
54 L_span = 2*sqrt(s^2-r^2);
55
56 x1 IS_A delta_distance;
57 -x1 = (x - 2*s);
58 psi IS_A angle;
59 wrap IS_A wrapping_angle(x1,h,r,psi);
60
61 L_hug IS_A delta_distance;
62 L_hug = r*(psi - (1{PI} - phi));
63
64 L_tan = sqrt(h^2 + x1^2 - r^2);
65
66 L = L_arc + L_span + L_hug + L_tan;
67
68 END wrapping_length_obstructed;
69
70 MODEL wrapping_length_ambi(
71 x WILL_BE delta_distance;
72 h WILL_BE distance;
73 r WILL_BE distance;
74 s WILL_BE distance;
75 L WILL_BE distance; (* resulting length (output) *)
76 );
77 phi IS_A angle;
78 phi = arcsin(r/s);
79
80 L_arc, L_span, L_tan IS_A distance;
81 L_span = 2*sqrt(s^2-r^2);
82
83 x1 IS_A delta_distance;
84 -x1 = (x - 2*s);
85 psi IS_A angle;
86 wrap IS_A wrapping_angle(x1,h,r,psi);
87
88 L_hug IS_A delta_distance;
89 L_hug = r*(psi - (1{PI} - phi));
90
91 L_tan_obstructed: L_tan = sqrt(h^2 + x1^2 - r^2);
92 L_tan_clear: L_tan = sqrt(h^2 + x^2 - r^2);
93
94 theta IS_A angle;
95 wrap_clear IS_A wrapping_angle(x,h,r,theta);
96 L_arc_obstructed: L_arc = r*phi;
97 L_arc_clear: L_arc = r*theta;
98
99 L_obstructed_expr: L = L_arc + L_span + L_hug + L_tan;
100 L_clear_expr: L = L_arc + L_tan;
101
102 CONDITIONAL
103 hug_expr: L_hug > 0 {mm};
104 END CONDITIONAL;
105 is_hug IS_A boolean_var;
106 is_hug == SATISFIED(hug_expr, 1e-3{m});
107 WHEN(is_hug)
108 CASE TRUE:
109 USE L_obstructed_expr;
110 USE L_arc_obstructed;
111 USE L_tan_obstructed;
112 CASE FALSE:
113 USE L_clear_expr;
114 USE L_arc_clear;
115 USE L_tan_clear;
116 END WHEN;
117
118 END wrapping_length_ambi;
119
120 MODEL vfac_circle_plane(
121 x WILL_BE delta_distance;
122 h WILL_BE distance;
123 r WILL_BE distance;
124 F WILL_BE fraction; (* output *)
125 );
126 xzero IS_A delta_distance;
127 xzero = 0;
128 OBF, OECF, ADBF, ACF IS_A distance;
129 OBF_wrap IS_A wrapping_length(xzero,h,r,OBF);
130 OECF,OBF ARE_THE_SAME;
131 xneg IS_A delta_distance;
132 xneg = -x;
133 ADBF_wrap IS_A wrapping_length(xneg,h,r,ADBF);
134 ACF_wrap IS_A wrapping_length(x,h,r,ACF);
135
136 F = ((ADBF + OECF) - (OBF + ACF)) / (4{PI}*r);
137 END vfac_circle_plane;
138
139 MODEL vfac_circle_plane_obstructed(
140 x WILL_BE delta_distance;
141 h WILL_BE distance;
142 r WILL_BE distance;
143 s WILL_BE distance;
144 F WILL_BE fraction; (* output *)
145 );
146 xzero IS_A delta_distance;
147 xzero = 0;
148 OBF, OEGF, JKBF, JIHGF IS_A distance;
149 OBF_wrap IS_A wrapping_length(xzero,h,r,OBF);
150 OEGF,OBF ARE_THE_SAME;
151 xneg IS_A delta_distance;
152 xneg = -x;
153 JKBF_wrap IS_A wrapping_length(xneg,h,r,JKBF);
154 JIHGF_wrap IS_A wrapping_length_obstructed(x,h,r,s,JIHGF);
155
156 F = ((JKBF + OEGF) - (OBF + JIHGF)) / (4{PI}*r);
157 END vfac_circle_plane_obstructed;
158
159 MODEL vfac_circle_plane_ambi(
160 x WILL_BE delta_distance;
161 h WILL_BE distance;
162 r WILL_BE distance;
163 s WILL_BE distance;
164 F WILL_BE fraction; (* output *)
165 );
166 xzero IS_A delta_distance;
167 xzero = 0;
168 OBF, OEGF, JKBF, JIHGF IS_A distance;
169 OBF_wrap IS_A wrapping_length(xzero,h,r,OBF);
170 OEGF,OBF ARE_THE_SAME;
171 xneg IS_A delta_distance;
172 xneg = -x;
173 JKBF_wrap IS_A wrapping_length(xneg,h,r,JKBF);
174 JIHGF_wrap IS_A wrapping_length_ambi(x,h,r,s,JIHGF);
175
176 F = ((JKBF + OEGF) - (OBF + JIHGF)) / (4{PI}*r);
177 END vfac_circle_plane_ambi;
178
179 MODEL tubebank;
180 x1, x2 IS_A delta_distance;
181 h IS_A distance;
182 r IS_A distance;
183 L IS_A distance;
184 s IS_A distance;
185
186 F1, F2, F IS_A fraction;
187 F1_wrap IS_A vfac_circle_plane_ambi(x1,h,r,s,F1);
188 F2_wrap IS_A vfac_circle_plane_ambi(x2,h,r,s,F2);
189 F = F2 - F1;
190 METHODS
191 METHOD on_load;
192 FIX x1; x1:= 102 {mm};
193 FIX x2; x2:= 208 {mm};
194 FIX h; h:= 117 {mm};
195 FIX r; r:= 38 {mm};
196
197 FIX s; s:= 41 {mm};
198 END on_load;
199 METHOD self_test;
200 ASSERT abs(wrap.L_tan - 150 {mm}) < 1 {mm};
201 ASSERT abs(wrap.theta - 62 {deg}) < 1.5 {deg};
202 END self_test;
203
204 END tubebank;

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