source: trunk/sample/stage_separators/sample_flash.mso @ 997

Last change on this file since 997 was 918, checked in by Rafael de Pelegrini Soares, 14 years ago

Fixed some flash and cost models

File size: 3.5 KB
Line 
1#*----------------------------------------------
2* FlowSheet generated automaticaly by EMSO-GUI
3*----------------------------------------------*#
4
5using "pressure_changers/valve";
6using "controllers/PIDs";
7using "stage_separators/flash";
8
9FlowSheet sample_flash
10        PARAMETERS
11        PP as Plugin(Brief="Physical Properties",
12                Type="PP",
13                Components = ["n-butane","benzene","n-octane"],
14                LiquidModel = "SRK",
15                VapourModel = "SRK"
16        );
17        NComp as Integer;
18        SET
19        NComp = PP.NumberOfComponents;
20
21        DEVICES
22        LCV as valve_flow;
23
24        SET
25        LCV.MinFlow = 0 * 'kmol/h';
26        LCV.MaxFlow = 700 * 'kmol/h';
27
28        SPECIFY
29
30        INITIAL
31
32        GUESS
33
34        DEVICES
35        Feed as simple_source;
36
37        SET
38
39        SPECIFY
40        Feed.MolarComposition(1) = 0.3;
41        Feed.MolarComposition(2) = 0.3;
42        Feed.MolarComposition(3) = 0.4;
43        Feed.T = 338 * 'K';
44        Feed.P = 5 * 'atm';
45
46        INITIAL
47
48        GUESS
49
50        DEVICES
51        PCV as valve_flow;
52
53        SET
54        PCV.MinFlow = 0 * 'kmol/h';
55        PCV.MaxFlow = 500 * 'kmol/h';
56
57        SPECIFY
58
59        INITIAL
60
61        GUESS
62
63        DEVICES
64        VaporProduct as sink;
65
66        SET
67
68        SPECIFY
69
70        INITIAL
71
72        GUESS
73
74        DEVICES
75        LiquidProduct as sink;
76
77        SET
78
79        SPECIFY
80
81        INITIAL
82
83        GUESS
84
85        DEVICES
86        FeedValve as valve_flow;
87
88        SET
89        FeedValve.MinFlow = 0 * 'kmol/h';
90        FeedValve.MaxFlow = 1000 * 'kmol/h';
91
92        SPECIFY
93
94        INITIAL
95
96        GUESS
97
98        DEVICES
99        FeedStep as StepSignal;
100
101        SET
102        FeedStep.StepTime = 1.5 * 'h';
103        FeedStep.StartValue = 0.5;
104        FeedStep.FinalValue = 0.6;
105
106        SPECIFY
107
108        INITIAL
109
110        GUESS
111
112        DEVICES
113        PID_PC as PID;
114
115        SET
116        PID_PC.PID_Select = "Parallel_AWBT";
117        PID_PC.Action = "Direct";
118        PID_PC.Mode = "Automatic";
119        PID_PC.Clip = "Clipped";
120        PID_PC.alpha = 1;
121        PID_PC.beta = 1;
122        PID_PC.bias = 0.5;
123        PID_PC.derivTime = 18 * 's';
124        PID_PC.intTime = 72 * 's';
125        PID_PC.gain = 0.9275;
126        PID_PC.gamma = 1;
127        PID_PC.tau = 1 * 's';
128        PID_PC.tauSet = 1 * 's';
129        PID_PC.MinInput = 0;
130        PID_PC.MaxInput = 6;
131        PID_PC.MinOutput = 0;
132        PID_PC.MaxOutput = 1;
133
134        SPECIFY
135        PID_PC.SetPoint = 0.6;
136
137        INITIAL
138
139        GUESS
140
141        DEVICES
142        PID_LC as PID;
143
144        SET
145        PID_LC.PID_Select = "Parallel_AWBT";
146        PID_LC.Action = "Direct";
147        PID_LC.Mode = "Automatic";
148        PID_LC.Clip = "Clipped";
149        PID_LC.alpha = 1;
150        PID_LC.beta = 1;
151        PID_LC.bias = 0.5;
152        PID_LC.derivTime = 19 * 's';
153        PID_LC.intTime = 76 * 's';
154        PID_LC.gain = 1.1776;
155        PID_LC.gamma = 1;
156        PID_LC.tau = 1 * 's';
157        PID_LC.tauSet = 1 * 's';
158        PID_LC.MinInput = 0;
159        PID_LC.MaxInput = 2;
160        PID_LC.MinOutput = 0;
161        PID_LC.MaxOutput = 1;
162
163        SPECIFY
164        PID_LC.SetPoint = 0.7;
165
166        INITIAL
167
168        GUESS
169
170        DEVICES
171        F101 as flash;
172
173        SET
174        F101.Orientation = "vertical";
175        F101.Heads = "hemispherical";
176        F101.Diameter = 2 * 'm';
177        F101.Lenght = 5 * 'm';
178        F101.Levelpercent_Initial = 0.80;
179        F101.Temperature_Initial = 373 * 'K';
180        F101.Composition_Initial(1) = 0.30;
181        F101.Composition_Initial(2) = 0.40;
182        F101.Composition_Initial(3) = 0.30;
183
184        SPECIFY
185
186        INITIAL
187
188        GUESS
189
190        DEVICES
191        heat_duty as energy_source2;
192
193        SET
194
195        SPECIFY
196        heat_duty.OutletQ = 1026.32 * 'kW';
197
198        INITIAL
199
200        GUESS
201
202        CONNECTIONS
203        PCV.Outlet to VaporProduct.Inlet;
204        LCV.Outlet to LiquidProduct.Inlet;
205        Feed.Outlet to FeedValve.Inlet;
206        FeedStep.OutSignal to FeedValve.FlowFraction;
207        PID_LC.Output to LCV.FlowFraction;
208        PID_PC.Output to PCV.FlowFraction;
209        FeedValve.Outlet to F101.Inlet;
210        heat_duty.OutletQ to F101.InletQ;
211        F101.OutletLiquid to LCV.Inlet;
212        F101.OutletVapour to PCV.Inlet;
213        F101.LI to PID_LC.Input;
214        F101.PI to PID_PC.Input;
215
216        OPTIONS
217        Dynamic = true;
218        TimeStep = 0.02;
219        TimeEnd = 3;
220        TimeUnit = 'h';
221        Integration = "original";
222        NLASolver(
223                File = "sundials",
224                RelativeAccuracy = 1e-3,
225                AbsoluteAccuracy = 1e-3,
226                MaxIterations = 100
227        );
228        DAESolver(
229                File = "sundials",
230                RelativeAccuracy = 1e-3,
231                AbsoluteAccuracy = 1e-6,
232                EventAccuracy = 1e-2
233        );
234end
Note: See TracBrowser for help on using the repository browser.