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

Annotation of /trunk/models/vessel.a4c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 576 - (hide annotations) (download) (as text)
Tue May 9 03:42:08 2006 UTC (18 years, 1 month ago) by johnpye
File MIME type: text/x-ascend
File size: 3456 byte(s)
Changed all cases of *.fixed := {TRUE,FALSE} to 'FIX' and 'FREE' statements.
1 aw0a 1 REQUIRE "atoms.a4l";
2     (* => atoms.a4l, measures.a4l, system.a4l, basemodel.a4l *)
3     PROVIDE "vessel.a4c";
4     (*
5     * This file is part of the ASCEND Modeling Library and is released
6     * under the GNU Public License as described at the end of this file.
7     *)
8    
9     MODEL vessel;
10    
11     (* variables *)
12     side_area, end_area IS_A area;
13     vessel_vol, wall_vol IS_A volume;
14     wall_thickness, H, D IS_A distance;
15     H_to_D_ratio IS_A factor;
16     metal_density IS_A mass_density;
17     metal_mass IS_A mass;
18    
19     (* equations *)
20     FlatEnds: end_area = 1{PI} * D^2 / 4;
21     Sides: side_area = 1{PI} * D * H;
22     Cylinder: vessel_vol = end_area * H;
23     Metal_volume: (side_area + 2 * end_area) * wall_thickness = wall_vol;
24     HD_definition: D * H_to_D_ratio = H;
25     VesselMass: metal_mass = metal_density * wall_vol;
26    
27     METHODS
28    
29     METHOD defaults;
30     H_to_D_ratio := 2;
31     END defaults;
32    
33     METHOD clear;
34 johnpye 576 FREE side_area;
35     FREE end_area;
36     FREE vessel_vol;
37     FREE wall_vol;
38     FREE wall_thickness;
39     FREE H;
40     FREE D;
41     FREE H_to_D_ratio;
42     FREE metal_density;
43     FREE metal_mass;
44 aw0a 1 END clear;
45    
46     METHOD specify;
47 johnpye 576 FIX vessel_vol;
48     FIX H_to_D_ratio;
49     FIX wall_thickness;
50     FIX metal_density;
51 aw0a 1 END specify;
52    
53     METHOD reset;
54     RUN clear;
55     RUN specify;
56     END reset;
57    
58     METHOD values;
59     vessel_vol := 250 {ft^3};
60     wall_thickness := 5 {mm};
61     metal_density := 13000 {kg/m^3};
62     END values;
63    
64     END vessel;
65    
66     MODEL vessel_optimize REFINES vessel;
67    
68     cost IS_A monetary_unit;
69     a IS_A cost_per_volume;
70    
71     obj1def: cost = a * wall_thickness * (side_area + 2*(4/1{PI})*end_area);
72    
73     obj1: MINIMIZE cost;
74    
75     METHODS
76    
77     METHOD clear;
78 johnpye 576 FREE side_area;
79     FREE end_area;
80     FREE vessel_vol;
81     FREE wall_vol;
82     FREE wall_thickness;
83     FREE H;
84     FREE D;
85     FREE H_to_D_ratio;
86     FREE metal_density;
87     FREE metal_mass;
88     FREE cost;
89     FREE a;
90 aw0a 1 END clear;
91    
92     METHOD specify;
93 johnpye 576 FIX vessel_vol;
94     FIX wall_thickness;
95     FIX metal_density;
96     FIX a;
97 aw0a 1 END specify;
98    
99     METHOD min_cost;
100     RUN clear;
101     RUN specify;
102     END min_cost;
103    
104     METHOD values;
105     vessel_vol := 250 {ft^3};
106     wall_thickness := 5 {mm};
107     metal_density := 13000 {kg/m^3};
108    
109     (* a is the cost per cubic foot of metal. rather arbitrary. *)
110 johnpye 109 a := 10 {USD};
111 aw0a 1 END values;
112    
113     END vessel_optimize;
114    
115     (*
116     * vessel.a4c
117     * by Arthur W Westerberg, Benjamin A Allan
118     * Part of the ASCEND Library
119     * $Date: 1998/06/17 19:35:43 $
120     * $Revision: 1.3 $
121     * $Author: mthomas $
122     * $Source: /afs/cs.cmu.edu/project/ascend/Repository/models/vessel.a4c,v $
123     *
124     * This file is part of the ASCEND Modeling Library.
125     *
126     * Copyright (C) 1998 Carnegie Mellon University
127     *
128     * The ASCEND Modeling Library is free software; you can redistribute
129     * it and/or modify it under the terms of the GNU General Public
130     * License as published by the Free Software Foundation; either
131     * version 2 of the License, or (at your option) any later version.
132     *
133     * The ASCEND Modeling Library is distributed in hope that it
134     * will be useful, but WITHOUT ANY WARRANTY; without even the implied
135     * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
136     * See the GNU General Public License for more details.
137     *
138     * You should have received a copy of the GNU General Public License
139     * along with the program; if not, write to the Free Software
140     * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139 USA.
141     *)

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