Parent Directory | Revision Log

Revision **1385** -
(**show annotations**)
(**download**)
(**as text**)

*Sat Apr 7 09:13:41 2007 UTC*
(13 years, 3 months ago)
by *jpye*

File MIME type: text/x-ascend

File size: 3379 byte(s)

File MIME type: text/x-ascend

File size: 3379 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 | by Arthur W. Westerberg |

21 | THIS FILE IS AUTO-IMPORTED INTO THE ASCEND MANUAL! BE CAREFUL WITH EDITS. |

22 | *) |

23 | REQUIRE "atoms.a4l"; |

24 | |

25 | MODEL vessel( |

26 | vessel_vol "the volume contained within the cylindrical vessel" |

27 | WILL_BE volume; |

28 | wall_thickness "the thickness of all of the vessel walls" |

29 | WILL_BE distance; |

30 | metal_density "density of the metal from which the vessel |

31 | is constructed" |

32 | WILL_BE mass_density; |

33 | H_to_D_ratio "the ratio of vessel height to diameter" |

34 | WILL_BE factor; |

35 | metal_mass "the mass of the metal in the walls of the vessel" |

36 | WILL_BE mass; |

37 | ); |

38 | |

39 | NOTES |

40 | 'author' SELF {Arthur W. Westerberg} |

41 | 'creation date' SELF {May, 1998} |

42 | END NOTES; |

43 | |

44 | (* variables *) |

45 | side_area "the area of the cylindrical side wall of the vessel", |

46 | end_area "the area of the flat ends of the vessel" |

47 | IS_A area; |

48 | |

49 | wall_vol "the volume of the walls for the vessel" |

50 | IS_A volume; |

51 | H "the vessel height (of the cylindrical side walls)", |

52 | D "the vessel diameter" |

53 | IS_A distance; |

54 | |

55 | (* equations *) |

56 | FlatEnds: end_area = 1{PI} * D^2 / 4; |

57 | Sides: side_area = 1{PI} * D * H; |

58 | Cylinder: vessel_vol = end_area * H; |

59 | Metal_volume: (side_area + 2 * end_area) * wall_thickness = wall_vol; |

60 | HD_definition: D * H_to_D_ratio = H; |

61 | VesselMass: metal_mass = metal_density * wall_vol; |

62 | |

63 | METHODS |

64 | METHOD specify; |

65 | NOTES |

66 | 'purpose' SELF {to fix four variables and make the problem well-posed} |

67 | END NOTES; |

68 | FIX vessel_vol; |

69 | FIX H_to_D_ratio; |

70 | FIX wall_thickness; |

71 | FIX metal_density; |

72 | END specify; |

73 | |

74 | METHOD values; |

75 | NOTES |

76 | 'purpose' SELF {to set the values for the fixed variables} |

77 | END NOTES; |

78 | H_to_D_ratio := 2; |

79 | vessel_vol := 250 {ft^3}; |

80 | wall_thickness := 5 {mm}; |

81 | metal_density := 5000 {kg/m^3}; |

82 | END values; |

83 | |

84 | METHOD bound_self; |

85 | END bound_self; |

86 | |

87 | METHOD bound_all; |

88 | RUN bound_self; |

89 | END bound_all; |

90 | |

91 | METHOD scale_self; |

92 | END scale_self; |

93 | |

94 | METHOD scale_all; |

95 | RUN scale_self; |

96 | END scale_all; |

97 | |

98 | METHOD default_self; |

99 | D := 1 {m}; |

100 | H := 1 {m}; |

101 | END default_self; |

102 | |

103 | METHOD default_all; |

104 | RUN default_self; |

105 | vessel_vol := 1 {m^3}; |

106 | wall_thickness := 5 {mm}; |

107 | metal_density := 5000 {kg/m^3}; |

108 | H_to_D_ratio := 1; |

109 | END default_all; |

110 | END vessel; |

111 | |

112 | ADD NOTES IN vessel; |

113 | 'description' SELF {This model relates the dimensions of a |

114 | cylindrical vessel -- e.g., diameter, height and wall thickness |

115 | to the volume of metal in the walls. It uses a thin wall |

116 | assumption -- i.e., that the volume of metal is the area of |

117 | the vessel times the wall thickness.} |

118 | 'purpose' SELF {to illustrate the insertion of notes into a model} |

119 | END NOTES; |

john.pye@anu.edu.au | ViewVC Help |

Powered by ViewVC 1.1.22 |