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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1895 - (show annotations) (download) (as text)
Wed Sep 24 13:59:50 2008 UTC (15 years, 8 months ago) by jpye
File MIME type: text/x-ascend
File size: 2317 byte(s)
Added new worked example of FEA from Holman.
1 (*
2 This file gives a solution to problem 3.5 from Holman, Heat Transfer,
3 9th Ed., McGraw-Hill.
4
5 The problem a 2-D solid with its left face maintained at 100°C and its top
6 face maintained at 500°C, and the other two faces exposed to convection
7 with h = 10 W/m²K and an ambient temperature of 100°C. The solid has a
8 conductivity of k = 10 W/m·K, and is 1 m in size. Compute the steady-state
9 temperatures over a 4 × 4 grid of nodes (of which 3 x 3 of the nodes have
10 temperatures that are as yet unknown), and compute the heat flows at the
11 boundaries.
12 *)
13
14 REQUIRE "atoms.a4l";
15 REQUIRE "johnpye/thermo_types.a4c";
16
17 MODEL holman_ex_3_5;
18
19 T[0..3][0..3] IS_A temperature;
20
21 FOR m IN [1,2] CREATE
22 FOR n IN [1,2] CREATE
23 T[m+1][n] + T[m-1][n] + T[m][n-1] + T[m][n+1] - 4*T[m][n] = 0;
24 END FOR;
25 END FOR;
26
27
28 (* boundary conditions *)
29 T_amb IS_A temperature;
30 h IS_A heat_transfer_coefficient;
31 k IS_A thermal_conductivity;
32 dx IS_A distance;
33 Bi IS_A factor;
34 Bi = h*dx/k;
35
36 (* right edge convection *)
37 FOR m IN [3] CREATE
38 FOR n IN [1,2] CREATE
39 0 = Bi*T_amb + 0.5*(2*T[m-1][n] + T[m][n+1] + T[m][n-1]) - (Bi + 2)*T[m][n];
40 END FOR;
41 END FOR;
42
43 (* bottom edge convection *)
44 FOR m IN [1,2] CREATE
45 FOR n IN [3] CREATE
46 0 = Bi*T_amb + 0.5*(2*T[m][n-1] + T[m+1][n] + T[m-1][n]) - (Bi + 2)*T[m][n];
47 END FOR;
48 END FOR;
49
50 (* bottom-right corner convection *)
51 FOR m IN [3] CREATE
52 FOR n IN [3] CREATE
53 0 = 2*Bi*T_amb + (T[m-1][n] + T[m][n-1]) - 2*(Bi+1)*T[m][n];
54 END FOR;
55 END FOR;
56
57 (* total heat fluxes *)
58 q['top','left','right','bottom'], q_bal IS_A energy_rate;
59
60 q['top'] = k*(SUM[T[m][0] - T[m][1] | m IN [1..2]] + 0.5*(T[3][0] - T[3][1]));
61 q['left'] = k*(SUM[T[0][n] - T[1][n] | n IN [1..2]] + 0.5*(T[0][3] - T[1][3]));
62
63 q['right'] = SUM[h*dx*(T_amb - T[3][n]) | n IN [1..2]] + h*0.5*dx*(T_amb - T[3][3]);
64 q['bottom'] = SUM[h*dx*(T_amb - T[m][3]) | m IN [1..2]] + h*0.5*dx*(T_amb - T[3][3]);
65
66 q_bal = SUM[q[i] | i IN ['top','left','right','bottom']];
67 METHODS
68 METHOD on_load;
69 FOR m IN [0..3] DO
70 FIX T[m][0];
71 T[m][0] := 500 {K};
72 END FOR;
73
74 FOR n IN [0..3] DO
75 FIX T[0][n];
76 T[0][n] := 100 {K};
77 END FOR;
78
79 FIX h;
80 h := 10 {W/m^2/K};
81
82 FIX k;
83 k := 10 {W/m/K};
84
85 FIX T_amb;
86 T_amb := 100 {K};
87
88 FIX dx;
89 dx := 1.0 {m} / 3;
90 END on_load;
91
92 END holman_ex_3_5;

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