/[ascend]/trunk/models/vesselTabulated.a4c
ViewVC logotype

Contents of /trunk/models/vesselTabulated.a4c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1385 - (show annotations) (download) (as text)
Sat Apr 7 09:13:41 2007 UTC (17 years, 2 months ago) by jpye
File MIME type: text/x-ascend
File size: 4879 byte(s)
Some work on adding 'listing' support in the ASCEND manual.
1 (* 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 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA.
18 *)
19 (*
20 Use of this module is demonstrated by the associated script file
21 vesselTabulated.a4s.
22
23 by Arthur W. Westerberg
24 THIS FILE IS AUTO-IMPORTED INTO THE ASCEND MANUAL! BE CAREFUL WITH EDITS.
25 *)
26 REQUIRE "atoms.a4l";
27 PROVIDE "vesselTabulated.a4c";
28
29 MODEL vessel(
30 vessel_vol "the volume contained within the cylindrical vessel"
31 WILL_BE volume;
32 wall_thickness "the thickness of all of the vessel walls"
33 WILL_BE distance;
34 metal_density "density of the metal from which the vessel
35 is constructed"
36 WILL_BE mass_density;
37 H_to_D_ratio "the ratio of vessel height to diameter"
38 WILL_BE factor;
39 metal_mass "the mass of the metal in the walls of the vessel"
40 WILL_BE mass;
41 );
42
43 NOTES
44 'author' SELF {Arthur W. Westerberg}
45 'creation date' SELF {May, 1998}
46 END NOTES;
47
48 (* variables *)
49 side_area "the area of the cylindrical side wall of the vessel",
50 end_area "the area of the flat ends of the vessel"
51 IS_A area;
52
53 wall_vol "the volume of the walls for the vessel"
54 IS_A volume;
55 H "the vessel height (of the cylindrical side walls)",
56 D "the vessel diameter"
57 IS_A distance;
58
59 (* equations *)
60 FlatEnds: end_area = 1{PI} * D^2 / 4;
61 Sides: side_area = 1{PI} * D * H;
62 Cylinder: vessel_vol = end_area * H;
63 Metal_volume: (side_area + 2 * end_area) * wall_thickness = wall_vol;
64 HD_definition: D * H_to_D_ratio = H;
65 VesselMass: metal_mass = metal_density * wall_vol;
66
67 METHODS
68
69 METHOD specify;
70 NOTES
71 'purpose' SELF {to fix four variables and make the problem well-posed}
72 END NOTES;
73 FIX vessel_vol;
74 FIX H_to_D_ratio;
75 FIX wall_thickness;
76 FIX metal_density;
77 END specify;
78
79 METHOD values;
80 NOTES
81 'purpose' SELF {to set the values for the fixed variables}
82 END NOTES;
83 H_to_D_ratio := 2;
84 vessel_vol := 250 {ft^3};
85 wall_thickness := 5 {mm};
86 metal_density := 5000 {kg/m^3};
87 END values;
88
89 METHOD bound_self;
90 END bound_self;
91
92 METHOD bound_all;
93 RUN bound_self;
94 END bound_all;
95
96 METHOD scale_self;
97 END scale_self;
98
99 METHOD scale_all;
100 RUN scale_self;
101 END scale_all;
102
103 METHOD default_self;
104 D := 1 {m};
105 H := 1 {m};
106 END default_self;
107
108 METHOD default_all;
109 RUN default_self;
110 vessel_vol := 1 {m^3};
111 wall_thickness := 5 {mm};
112 metal_density := 5000 {kg/m^3};
113 H_to_D_ratio := 1;
114 END default_all;
115
116 END vessel;
117
118 ADD NOTES IN vessel;
119 'description' SELF {This model relates the dimensions of a
120 cylindrical vessel -- e.g., diameter, height and wall thickness
121 to the volume of metal in the walls. It uses a thin wall
122 assumption -- i.e., that the volume of metal is the area of
123 the vessel times the wall thickness.}
124 'purpose' SELF {to illustrate the insertion of notes into a model}
125 END NOTES;
126
127 MODEL tabulated_vessel_values;
128 vessel_volume "volume of all the tabulated vessels"
129 IS_A volume;
130 wall_thickness "thickness of all the walls for all the vessels"
131 IS_A distance;
132 metal_density "density of metal used for all vessels"
133 IS_A mass_density;
134 n_entries "number of vessels to simulate"
135 IS_A integer_constant;
136 n_entries :== 20;
137 H_to_D_ratio[1..n_entries] "set of H to D ratios for which we are
138 computing metal mass"
139 IS_A factor;
140 metal_mass[1..n_entries] "mass of metal in walls of vessels"
141 IS_A mass;
142 FOR i IN [1..n_entries] CREATE
143 v[i] "the i-th vessel model"
144 IS_A vessel(vessel_volume, wall_thickness,
145 metal_density, H_to_D_ratio[i], metal_mass[i]);
146 END FOR;
147
148 METHODS
149
150 METHOD default_self;
151 END default_self;
152
153 METHOD specify;
154 RUN v[1..n_entries].specify;
155 END specify;
156
157 METHOD values;
158 NOTES 'purpose' SELF {to set up 20 vessel models having H to D ratios
159 ranging from 0.1 to 2.}
160 END NOTES;
161 vessel_volume := 250 {ft^3};
162 wall_thickness := 5 {mm};
163 metal_density := 5000 {kg/m^3};
164 FOR i IN [1..n_entries] DO
165 H_to_D_ratio[i] := i/10.0;
166 END FOR;
167 END values;
168
169 METHOD scale_self;
170 END scale_self;
171
172 END tabulated_vessel_values;
173
174 ADD NOTES IN tabulated_vessel_values;
175 'description' SELF {This model sets up an array of vessels to
176 compute a range of metal_mass values for different values
177 of H_to_D_ratio.}
178 'purpose' SELF {to illustrate the use of arrays in ASCEND}
179 END NOTES;

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