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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 615 - (show annotations) (download) (as text)
Wed May 17 06:29:40 2006 UTC (18 years, 9 months ago) by johnpye
File MIME type: text/x-ascend
File size: 3104 byte(s)
Forced pygtk to share major env vars with base library.
Modified 'can't use this here' error messages.
Added notification when colour codes are being disabled.
1 (* ASCEND model library
2 Copyright (c) 2006 Carnegie Mellon University
3
4 This program is free software; you can redistribute it
5 and/or modify it under the terms of the GNU General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later
8 version.
9
10 This program is distributed in the hope that it will be
11 useful, but WITHOUT ANY WARRANTY; without even the implied
12 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13 PURPOSE. See the GNU General Public License for more
14 details.
15
16 You should have received a copy of the GNU General Public
17 License along with this program; if not, write to the Free
18 Software Foundation, Inc., 59 Temple Place, Suite 330,
19 Boston, MA 02111-1307 USA
20 *)(**
21 This is a simple model for computing the
22 steady-state temperature and heat loss profile
23 of a multi-layered pipe-plus-insulation
24
25 by John Pye
26 *)
27
28 REQUIRE "atoms.a4l";
29 REQUIRE "johnpye/thermo_types.a4c";
30
31 MODEL radial_loss;
32 D_1 IS_A distance;
33 D_2 IS_A distance;
34 q IS_A energy_rate;
35 L IS_A distance;
36 T_1, T_2 IS_A temperature;
37 METHODS
38 METHOD specify;
39 FIX D_1, D_2;
40 END specify;
41 END radial_loss;
42
43 (*
44 Wall conduction
45 *)
46 MODEL wall_conduction REFINES radial_loss;
47 k IS_A thermal_conductivity;
48
49 q = 2 * 1{PI} * L * k *(T_1 - T_2) / ln(D_2/D_1);
50
51 END wall_conduction;
52
53 (*
54 Convection boundary
55 *)
56 MODEL convection_boundary REFINES radial_loss;
57 h IS_A heat_transfer_coefficient;
58 D_1, D_2 ARE_THE_SAME;
59
60 q = h * 1{PI} * D_1 * (T_1 - T_2);
61
62 END convection_boundary;
63
64 MODEL pipe_test REFINES radial_loss;
65
66 n IS_A integer_constant;
67 n:==5;
68
69 loss[1..5] IS_A radial_loss;
70
71 loss[1] IS_REFINED_TO convection_boundary;
72 loss[2] IS_REFINED_TO wall_conduction;
73 loss[3] IS_REFINED_TO wall_conduction;
74 loss[4] IS_REFINED_TO wall_conduction;
75 loss[5] IS_REFINED_TO convection_boundary;
76
77 L, loss[1..5].L ARE_THE_SAME;
78
79 FOR i IN [2..n] CREATE
80 (* layers are touching *)
81 loss[i].D_1, loss[i-1].D_2 ARE_THE_SAME;
82
83 (* steady state: heat rate is uniform *)
84 loss[i].q,loss[i-1].q ARE_THE_SAME;
85
86 loss[i].T_1, loss[i-1].T_2 ARE_THE_SAME;
87 END FOR;
88
89 loss[i].D_1, D_1 ARE_THE_SAME;
90 loss[n].D_2, D_2 ARE_THE_SAME;
91
92 loss[i].T_1, T_1 ARE_THE_SAME;
93 loss[i].T_2, T_2 ARE_THE_SAME;
94
95 loss[i].q, q ARE_THE_SAME;
96
97 METHODS
98 METHOD default_self;
99 RUN reset; RUN values;
100 END default_self;
101
102 METHOD specify;
103 FIX loss[1].h;
104 FIX loss[2..4].k;
105 FIX loss[5].h;
106
107 FIX loss[2].D_1, loss[2].D_2;
108 FIX loss[4].D_1, loss[4].D_2;
109 END specify;
110
111 METHOD values;
112 L = 1 {m};
113
114 loss[1].h := 1000 {W/m^2/K};
115 loss[2].k := 40 {W/m/K}; (* 'alloy steel', Ashby & Jones, Eng Matls 2, p.11 *)
116 loss[3].k := 0.05 {W/m/K}; (* Masud's figure for lagging *)
117 loss[4].k := 240 {W/m/K}; (* aluminium, Ashby & Jones, Eng Matls 2, p.11 *)
118 loss[5].h := 50 {W/m^2/K};
119
120 loss[1].D_1 := 0.05 {m}; (* pipe interior *)
121 loss[1].D_2 := 0.07 {m}; (* pipe exterior *)
122 loss[4].D_1 := 0.17 {m}; (* cover interior *)
123 loss[4].D_2 := 0.19 {m}; (* cover exterior *)
124 END values;
125 END pipe_test;

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