/[ascend]/trunk/models/test/canvas/blocktypes.a4c
ViewVC logotype

Contents of /trunk/models/test/canvas/blocktypes.a4c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1984 - (show annotations) (download) (as text)
Wed Jan 21 22:56:28 2009 UTC (13 years, 5 months ago) by jpye
File MIME type: text/x-ascend
File size: 1298 byte(s)
Added Library::loadString method for loading string modules.
First steps on 'run' command for canvas-based models.
Fixed bug with use of obrowser.
Minor correction to blocktypes.a4c.
1 REQUIRE "atoms.a4l";
2
3 ATOM specific_enthalpy REFINES solver_var
4 DIMENSION L^2/T^2
5 DEFAULT 1000{kJ/kg};
6 lower_bound := 0{kJ/kg};
7 upper_bound := 1e50{kJ/kg};
8 nominal := 1000{kJ/kg};
9 END specific_enthalpy;
10
11 ATOM specific_volume REFINES solver_var
12 DIMENSION L^3/M
13 DEFAULT 0.001{m^3/kg};
14 lower_bound := 0{m^3/kg};
15 upper_bound := 1e50{m^3/kg};
16 nominal := 0.001{m^3/kg};
17 END specific_volume;
18
19 MODEL stream;
20 p IS_A pressure;
21 v IS_A specific_volume;
22 h IS_A specific_enthalpy;
23 mdot IS_A mass_rate;
24 END stream;
25
26 MODEL equipment;
27 inlet "in: NAMED IN equipment" IS_A stream;
28 outlet "out:"IS_A stream;
29 END equipment;
30
31 MODEL pump REFINES equipment;
32 NOTES
33 'block' SELF {Tee piece}
34 'icon' SELF {pump.svg}
35 END NOTES;
36 inlet.p - 1 {bar} = outlet.p;
37 END pump;
38
39 MODEL tee REFINES equipment;
40 NOTES
41 'block' SELF {Tee piece}
42 'icon' SELF {tee.svg}
43 END NOTES;
44 side "out:" IS_A stream;
45 inlet.mdot = outlet.mdot + side.mdot;
46 END tee;
47
48 MODEL join REFINES equipment;
49 NOTES
50 'block' SELF {Joiner piece}
51 'inline' inlet {in: AS NAMED IN 'join'}
52 'icon' SELF {join.svg}
53 END NOTES;
54 side "in:" IS_A stream;
55 inlet.mdot + side.mdot = outlet.mdot;
56 END join;
57
58 MODEL heater REFINES join;
59 NOTES
60 'block' SELF {Feedwater heater}
61 'icon' SELF {heater.svg}
62 END NOTES;
63 V IS_A volume;
64 END heater;

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