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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 883 - (show annotations) (download) (as text)
Tue Oct 10 12:24:42 2006 UTC (18 years, 3 months ago) by johnpye
File MIME type: text/x-ascend
File size: 1291 byte(s)
Added a newton's law of cooling model.
1 REQUIRE "ivpsystem.a4l";
2 REQUIRE "johnpye/thermo_types.a4c";
3
4 (*
5 this model aims to show the evolution of thermal equilibrium between
6 two containers of water/steam with a simple convection coefficient
7 relation at the interface
8
9 This simple model works without any realistic fluid properties. It's basically
10 just demonstrating Newton's Law of Cooling.
11
12 This model was used as a test case for the Integrator functionality in the
13 PyGTK GUI.
14 *)
15 MODEL thermalequilibrium;
16 T_1 IS_A temperature;
17 T_2 IS_A temperature;
18 m_1, m_2 IS_A mass;
19 C_p IS_A specific_heat_capacity;
20 h IS_A heat_transfer_coefficient;
21 A IS_A area;
22
23 Q IS_A energy_rate;
24 Q = h*A*(T_1 - T_2); (* rate of heat transfer from 1 to 2 *)
25 m_1*C_p*dT1dt = -Q;
26 m_2*C_p*dT2dt = +Q;
27
28 dT1dt IS_A temperature_rate;
29 dT2dt IS_A temperature_rate;
30
31 t IS_A time;
32 METHODS
33 METHOD on_load;
34 FIX C_p, h, A, m_1, m_2, T_1, T_2;
35 A := 1 {m^2};
36 h := 10 {W/m^2/K};
37 C_p := 4.2 {kJ/kg/K};
38 m_1 := 10 {kg};
39 m_2 := 10 {kg};
40
41 T_1 := 500 {K};
42 T_2 := 290 {K};
43
44 t.ode_type := -1;
45
46 T_1.ode_id := 1;
47 dT1dt.ode_id := 1;
48 T_1.ode_type := 1;
49 dT1dt.ode_type := 2;
50
51 T_2.ode_id := 2;
52 dT2dt.ode_id := 2;
53 T_2.ode_type := 1;
54 dT2dt.ode_type := 2;
55
56 Q.obs_id := 2;
57 T_1.obs_id := 3;
58 T_2.obs_id := 4;
59
60 END on_load;
61
62 END thermalequilibrium;

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