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

Annotation of /trunk/models/johnpye/cavity.a4c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1727 - (hide annotations) (download) (as text)
Tue Jan 15 23:03:20 2008 UTC (16 years, 6 months ago) by jpye
File MIME type: text/x-ascend
File size: 7236 byte(s)
Updated cavity to current CLFR design Stage 2.
Added 'singletube' model to tubebank.
Improved functionality of the Module view in PyGTK GUI (corrected highlighting of instantiable types, enabled doubleclick expansion of module type list).
Added reporting of inline notes via console output (TODO: incorporate this into the GUI).
Added Type::isModel and corrected Type::hasParameters (C++).
1 johnpye 373 (*
2     ASCEND model library: radiation heat transfer model
3     Copyright (C) John Pye 2006
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     This is a radiation heat transfer model that is being used
25     to simulate (just a rough model) the absorber of a large solar
26     thermal energy system. For more information see
27     http://pye.dyndns.org or google for 'CLFR'. This is a linear
28     concentrator, so the cavity is simulated with a two-dimensional
29     model. The cavity is trapezoidal in shape, wider at the base
30     through which radiation enters.
31    
32     The upper inside surface 'W' is the absorber. The cavity has a flat
33     base 'B', and side walls 'L' and 'R' (of length N). This model
34     calculates view factors between these surfaces then implements a
35     'network' model to determine the equilibrium temperatures and
36     heat transfer between the surfaces inside the cavity. External heat
37     losses are allowed for: radiation and convention at the cavity
38     base, plus convection off the side-walls.
39     *)
40    
41 johnpye 343 REQUIRE "atoms.a4l";
42    
43     ATOM energy_rate_per_length REFINES solver_var
44     DIMENSION M*L/T^3
45     DEFAULT 1000{W/m};
46     lower_bound := -1e50{W/m};
47     upper_bound := 1e50{W/m};
48     nominal := 1000{W/m};
49     END energy_rate_per_length;
50    
51     ATOM energy_flux REFINES solver_var
52     DIMENSION M/T^3
53     DEFAULT 1000{W/m^2};
54     lower_bound := -1e50{W/m^2};
55     upper_bound := 1e50{W/m^2};
56     nominal := 1000{W/m^2};
57     END energy_flux;
58    
59 johnpye 354 ATOM heat_transfer_coefficient REFINES solver_var
60     DIMENSION M/T^3/TMP
61     DEFAULT 5{W/m^2/K};
62    
63     lower_bound := 0{W/m^2/K};
64     upper_bound := 1e50{W/m^2/K};
65     nominal := 5{W/m^2/K};
66 johnpye 373 END heat_transfer_coefficient;
67    
68     ATOM specific_heat_capacity REFINES solver_var
69     DIMENSION L^2/T^2/TMP
70     DEFAULT 4.0{kJ/kg/K};
71    
72     lower_bound := 0{kJ/kg/K};
73     upper_bound := 1e50{kJ/kg/K};
74     nominal := 4.2{kJ/kg/K};
75     END specific_heat_capacity;
76 johnpye 354
77 johnpye 343 MODEL cavity;
78     W,B,S,N,C,E,D IS_A distance;
79     theta, phi, psi IS_A angle;
80    
81     F_WN, F_WW, F_WB IS_A factor;
82     F_NB, F_NW, F_NN, F_BW, F_BN IS_A factor;
83     F_WS IS_A factor;
84    
85 johnpye 373 z_N: N * sin(theta) = D;
86     z_S: S * tan(theta) = D;
87     z_B: B = W + 2 * S;
88     z_E: E^2 = W^2 + D^2;
89     z_phi: phi = arctan(D/W);
90     z_psi: psi = 1{PI} - phi;
91     z_C: C^2 = E^2 + S^2 - 2* E * S * cos(psi);
92 johnpye 343
93 johnpye 373 z_F_WN: F_WN = (W+N-C)/2/W;
94     z_F_WW: F_WW = (2*E-2*D)/2/W; (* from top to directly opp part of bottom *)
95     z_F_WB: F_WB = 1 - 2 * F_WN;
96     z_F_WS: F_WS = (1 - 2 * F_WN - F_WB)/2;
97     z_F_NB: F_NB = (N+B-C)/2/N;
98     z_F_NW: F_NW = (N+W-C)/2/N;
99 johnpye 343
100 johnpye 373 z_F_BN: F_BN = F_NB*N/B;
101     z_F_NN: F_NN = 1 - F_NW - F_NB;
102     z_F_BW: F_BW = F_WB*W/B;
103 johnpye 354
104 johnpye 343 n IS_A set OF symbol_constant;
105     n :== ['W','B','L','R'];
106    
107     (* Put lengths into a vector *)
108    
109     A[n] IS_A distance;
110     A['W'], W ARE_THE_SAME;
111     A['B'], B ARE_THE_SAME;
112     A['L'], N ARE_THE_SAME;
113     A['R'], N ARE_THE_SAME;
114    
115     (* View factor matrix *)
116    
117     F[n][n] IS_A factor;
118    
119     F['W']['L'], F['W']['R'], F_WN ARE_THE_SAME;
120     F['W']['B'], F_WB ARE_THE_SAME;
121 johnpye 373 z_F_WW1: F['W']['W'] = 0;
122 johnpye 343
123     F['B']['L'], F['B']['R'], F_BN ARE_THE_SAME;
124     F['B']['W'], F_BW ARE_THE_SAME;
125 johnpye 373 z_F_BB1: F['B']['B'] = 0;
126 johnpye 343
127     F['L']['R'], F['R']['L'], F_NN ARE_THE_SAME;
128     F['L']['B'], F['R']['B'], F_NB ARE_THE_SAME;
129     F['L']['W'], F['R']['W'], F_NW ARE_THE_SAME;
130 johnpye 373 z_F_LL: F['L']['L'] = 0;
131     z_F_RR: F['R']['R'] = 0;
132 johnpye 343
133     (* Radiation equations *)
134     q[n] IS_A energy_rate_per_length;
135    
136     E_b[n] IS_A energy_flux;
137     J[n] IS_A energy_flux;
138     T[n] IS_A temperature;
139     eps[n] IS_A factor; (* emissivity *)
140    
141     FOR i IN n CREATE
142 johnpye 373 z_q[i]: q[i] = SUM[ (J[i]-J[j])*(A[i]*F[i][j]) | j IN n];
143 johnpye 343 END FOR;
144    
145     FOR i IN n CREATE
146 johnpye 373 z_E_b[i]: E_b[i] = 1{SIGMA_C} * T[i]^4;
147 johnpye 343 END FOR;
148    
149     FOR i IN n CREATE
150 johnpye 373 z_J[i]: q[i] * (1-eps[i]) = (E_b[i] - J[i]) * (eps[i]*A[i]);
151 johnpye 343 END FOR;
152 johnpye 354
153 johnpye 343 METHODS
154     METHOD default_self;
155     RUN reset; RUN values; RUN bound_self;
156     END default_self;
157    
158     METHOD bound_self;
159     phi.lower_bound := 0 {deg};
160     phi.upper_bound := 90 {deg};
161     psi.lower_bound := 90 {deg};
162     psi.upper_bound := 180 {deg};
163     END bound_self;
164    
165     METHOD specify;
166     FIX T['W', 'B'];
167     FIX q['L','R'];
168     FIX W,D,theta;
169     FIX eps[n];
170     END specify;
171    
172     METHOD values;
173     T['W'] := 550 {K};
174     T['B'] := 373.15 {K};
175 johnpye 346 q['L','R'] := 0 {W/m};
176 johnpye 343
177 jpye 1727 W := 575 {mm};
178     D := 200 {mm};
179     theta := 32 {deg};
180 johnpye 346
181     eps['W'] := 0.49;
182     eps['B'] := 0.9;
183     eps['L','R'] := 0.1;
184    
185 johnpye 343 END values;
186    
187 johnpye 354 END cavity;
188    
189 johnpye 373 (*
190     The following model adds external convection coefficients to
191     the model, and an ambient temperature.
192 johnpye 354
193 johnpye 373 We also calculate the 'F_rad' correlation parameter (see
194     http://pye.dyndns.org for more information).
195 johnpye 354 *)
196     MODEL cavity_losses REFINES cavity;
197     h_B, h_N IS_A heat_transfer_coefficient;
198     T_amb IS_A temperature;
199    
200 johnpye 360 (* external heat loss *)
201    
202 johnpye 373 q_ext_rad IS_A energy_rate_per_length;
203     q_ext_conv IS_A energy_rate_per_length;
204 johnpye 360 q_ext_conv = h_B * B * (T['B'] - T_amb);
205     q_ext_rad = B * eps['B'] * 1{SIGMA_C} * (T['B']^4 - T_amb^4);
206 johnpye 373 z_q_B: - q['B'] = q_ext_conv + q_ext_rad;
207     z_q_L: - q['L'] = h_N * N * (T['L'] - T_amb);
208     z_q_R:- q['R'] = h_N * N * (T['L'] - T_amb);
209 johnpye 354
210 johnpye 360 (* Determine 'F_rad' from overall heatloss... *)
211    
212 johnpye 354 F_rad IS_A factor;
213     F_rad_1 IS_A factor;
214    
215 johnpye 373 z_F_rad: q['W'] = F_rad * W * eps['W'] * 1{SIGMA_C} * (T['W']^4 - T['B']^4);
216 johnpye 354
217 johnpye 373 z_F_rad_1: q['W'] = F_rad_1 * W * 1{SIGMA_C} * (T['W']^4 - T['B']^4) /
218 johnpye 354 (1/eps['B'] + 1/eps['W'] - 1);
219    
220     METHODS
221     METHOD specify;
222     FIX T['W'], T_amb;
223     FIX h_B, h_N;
224     FIX W,D,theta;
225     FIX eps[n];
226     END specify;
227     METHOD values;
228     T['W'] := 550 {K};
229     T_amb := 290 {K};
230 jpye 1727 W := 575 {mm};
231     D := 200 {mm};
232     theta := 32 {deg};
233 johnpye 354 eps['W'] := 0.49;
234     eps['B'] := 0.9;
235     eps['L','R'] := 0.1;
236     h_B := 10 {W/m^2/K};
237     h_N := 0.5 {W/m^2/K};
238     (* free values *)
239     T['L','R'] := 500 {K};
240     T['B'] := 400 {K};
241     END values;
242 johnpye 373 END cavity_losses;
243    
244     (*
245     This final model will examine the possible convection
246     behaviour inside the stratified cavity
247     *)
248     MODEL cavity_convection;
249     W, D_strat IS_A distance;
250     k IS_A thermal_conductivity;
251     Q IS_A energy_rate_per_length;
252     T[1,2] IS_A temperature;
253    
254     Q * D_strat = W * k * (T[1] - T[2]); (* conduction through stratified zone*)
255    
256     (* rho IS_A mass_density;
257     cp IS_A specific_heat_capacity;
258    
259     Pr IS_A factor;
260     Pr = mu / rho / alpha;
261    
262     mu IS_A viscosity;
263     alpha IS_A diffusivity;
264     alpha = k / rho / cp;
265     *)
266    
267     METHODS
268     METHOD specify;
269     FIX k, mu, cp, rho;
270     FIX T[1,2];
271     FIX W, D_strat;
272     END specify;
273     METHOD default_self;
274     RUN reset; RUN values;
275     END default_self;
276     METHOD values;
277     D_strat := 0.15 {m};
278 jpye 1727 W := 575 {mm};
279 johnpye 373 k := 0.039 {W/m/K};
280     T[1] := 550 {K};
281     T[2] := 332 {K};
282     END values;
283     END cavity_convection;
284    
285    
286    

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