1 |
johnpye |
1294 |
(* ASCEND modelling environment |
2 |
|
|
Copyright (C) 1998, 2007 Carnegie Mellon University |
3 |
|
|
|
4 |
|
|
This program is free software; you can redistribute it and/or modify |
5 |
|
|
it under the terms of the GNU General Public License as published by |
6 |
|
|
the Free Software Foundation; either version 2, or (at your option) |
7 |
|
|
any later version. |
8 |
|
|
|
9 |
|
|
This program is distributed in the hope that it will be useful, |
10 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 |
|
|
GNU General Public License for more details. |
13 |
|
|
|
14 |
|
|
You should have received a copy of the GNU General Public License |
15 |
jpye |
2649 |
along with this program. If not, see <http://www.gnu.org/licenses/>. |
16 |
johnpye |
1294 |
*) |
17 |
|
|
REQUIRE "atoms.a4l"; (* => atoms.a4l, measures.a4l, system.a4l, basemodel.a4l *) |
18 |
aw0a |
1 |
(* |
19 |
johnpye |
1294 |
by Art Westerberg, 1998 |
20 |
aw0a |
1 |
|
21 |
johnpye |
1294 |
This model illustrates how variables are declared and relations written. |
22 |
|
|
The model contains no initialisation for any of the variable values, and |
23 |
|
|
does not specify which variables are 'fixed' and which ones should be |
24 |
|
|
solved for. For this reason, when loaded, this model will cause problems |
25 |
|
|
that ASCEND will attempt to resolve through warnings to the user. |
26 |
|
|
*) |
27 |
aw0a |
1 |
|
28 |
johnpye |
1294 |
MODEL vesselPlain; |
29 |
|
|
|
30 |
aw0a |
1 |
(* variables *) |
31 |
johnpye |
1294 |
side_area, end_area IS_A area; |
32 |
|
|
vessel_vol, wall_vol IS_A volume; |
33 |
|
|
wall_thickness, H, D IS_A distance; |
34 |
|
|
H_to_D_ratio IS_A factor; |
35 |
|
|
metal_density IS_A mass_density; |
36 |
|
|
metal_mass IS_A mass; |
37 |
aw0a |
1 |
|
38 |
|
|
(* equations *) |
39 |
johnpye |
1294 |
FlatEnds: end_area = 1{PI} * D^2 / 4; |
40 |
|
|
Sides: side_area = 1{PI} * D * H; |
41 |
|
|
Cylinder: vessel_vol = end_area * H; |
42 |
|
|
Metal_volume: (side_area + 2 * end_area) * wall_thickness = wall_vol; |
43 |
|
|
HD_definition: D * H_to_D_ratio = H; |
44 |
|
|
VesselMass: metal_mass = metal_density * wall_vol; |
45 |
aw0a |
1 |
|
46 |
johnpye |
1294 |
END vesselPlain; |