source: trunk/sample/stage_separators/sample_column.mso @ 391

Last change on this file since 391 was 346, checked in by Argimiro Resende Secchi, 16 years ago

Adding entropy in streamPH, sources and sinks.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 12.4 KB
Line 
1#*-------------------------------------------------------------------
2* EMSO Model Library (EML) Copyright (C) 2004 - 2007 ALSOC.
3*
4* This LIBRARY is free software; you can distribute it and/or modify
5* it under the therms of the ALSOC FREE LICENSE as available at
6* http://www.enq.ufrgs.br/alsoc.
7*
8* EMSO Copyright (C) 2004 - 2007 ALSOC, original code
9* from http://www.rps.eng.br Copyright (C) 2002-2004.
10* All rights reserved.
11*
12* EMSO is distributed under the therms of the ALSOC LICENSE as
13* available at http://www.enq.ufrgs.br/alsoc.
14*
15*--------------------------------------------------------------------
16* Sample file for column model
17*--------------------------------------------------------------------
18*
19* This sample file needs VRTherm DEMO(www.vrtech.com.br) to run
20* SectionColumn_Test and needs VRTherm full to run the distillation
21* column flowsheet.
22*
23*----------------------------------------------------------------------
24* Author: Paula B. Staudt
25* $Id: sample_column.mso 346 2007-08-20 01:32:18Z arge $
26*--------------------------------------------------------------------*#
27
28using "stage_separators/column";
29using "controllers/PIDIncr";
30
31# column section with 2 trays
32FlowSheet SectionColumn_Test_with2tray
33        PARAMETERS
34        PP      as Plugin(Brief="Physical Properties",
35                Type="PP",
36                Components = [ "isobutane", "benzene"],
37                LiquidModel = "PR",
38                VapourModel = "PR"
39        );
40        NComp   as Integer;
41
42        SET
43        NComp = PP.NumberOfComponents;
44       
45        DEVICES
46        sec as Section_Column;
47        feed as liquid_stream;
48        reb as vapour_stream;
49        cond as liquid_stream;
50        zero as stream;
51       
52        CONNECTIONS
53        feed to sec.trays(2).Inlet;
54        zero to sec.trays(1).Inlet;
55        reb to sec.trays(2).InletV;
56        cond to sec.trays(1).InletL;
57       
58        SPECIFY
59        feed.F = 113.4 * 'kmol/h';
60        feed.T = 291 * 'K';
61        feed.P = 168.3 * 'kPa';
62        feed.z = [0.5, 0.5];
63
64        zero.F = 0 * 'kmol/h';
65        zero.T = 300 * 'K';
66        zero.P = 1 * 'atm';
67        zero.z = [0.5, 0.5];
68        zero.v = 0;
69        zero.h = 0 * 'J/mol';
70       
71        cond.F = 68 * 'kmol/h';
72        cond.P = 150 * 'kPa';
73        cond.T = 281.75 * 'K';
74        cond.z = [0.6664, 0.3336];
75
76        reb.F = 153 * 'kmol/h';
77        reb.P = 185 * 'kPa';
78        reb.T = 328.12 * 'K';
79        reb.z = [0.001848, 0.9982];
80       
81        sec.trays.Emv = 1;
82
83        SET
84        sec.NTrays = 2;
85        #COLUMN
86        sec.trays.V = 4 * 'ft^3';
87        sec.trays.Ah = 0.394 * 'ft^2';
88        sec.trays.lw = 20.94 * 'in';
89        sec.trays.hw = 0.125 * 'ft';
90        sec.trays.Q = 0 * 'kW';
91        sec.trays.beta = 0.6;
92        sec.trays.alfa = 4;
93        sec.trays.Ap = 3.94 * 'ft^2';
94
95        INITIAL
96        sec.trays.OutletL.T = 290 *'K';
97        sec.trays.Level = 0.9 * sec.trays.hw;
98        sec.trays.OutletL.z(1) = 0.5;
99       
100        OPTIONS
101        TimeStep = 10;
102        TimeEnd = 1000;
103       
104# After running few seconds of transient the steady-state
105# can be obtained by using the results from that transient:
106
107        #GuessFile="SectionColumn_Test_with2tray.rlt";
108        #Dynamic = false;
109end
110
111# column section with 8 trays
112FlowSheet SectionColumn_Test_with8tray
113        PARAMETERS
114        PP      as Plugin(Brief="Physical Properties",
115                Type="PP",
116                Components = [ "isobutane", "benzene"],
117                LiquidModel = "PR",
118                VapourModel = "PR"
119        );
120        NComp   as Integer;
121
122        SET
123        NComp = PP.NumberOfComponents;
124       
125        DEVICES
126        sec as Section_Column;
127        feed as liquid_stream;
128        reb as vapour_stream;
129        cond as liquid_stream;
130        zero as stream;
131       
132        CONNECTIONS
133        feed to sec.trays(5).Inlet;
134       
135        zero to sec.trays([1:4]).Inlet;
136        zero to sec.trays([6:8]).Inlet;
137       
138        reb to sec.trays(8).InletV;
139        cond to sec.trays(1).InletL;
140       
141        SPECIFY
142        feed.F = 113.4 * 'kmol/h';
143        feed.T = 291 * 'K';
144        feed.P = 168.3 * 'kPa';
145        feed.z = [0.5, 0.5];
146
147        zero.F = 0 * 'kmol/h';
148        zero.T = 300 * 'K';
149        zero.P = 1 * 'atm';
150        zero.z = [0.5, 0.5];
151        zero.v = 0;
152        zero.h = 0 * 'J/mol';
153       
154        cond.F = 68 * 'kmol/h';
155        cond.P = 150 * 'kPa';
156        cond.T = 281.75 * 'K';
157        cond.z = [0.6664, 0.3336];
158
159        reb.F = 153 * 'kmol/h';
160        reb.P = 185 * 'kPa';
161        reb.T = 328.12 * 'K';
162        reb.z = [0.001848, 0.9982];
163       
164        sec.trays.Emv = 1;
165
166        SET
167        sec.NTrays = 8;
168        #COLUMN
169        sec.trays.V = 4 * 'ft^3';
170        sec.trays.Ah = 0.394 * 'ft^2';
171        sec.trays.lw = 20.94 * 'in';
172        sec.trays.hw = 0.125 * 'ft';
173        sec.trays.Q = 0 * 'kW';
174        sec.trays.beta = 0.6;
175        sec.trays.alfa = 4;
176        sec.trays.Ap = 3.94 * 'ft^2';
177
178        INITIAL
179        sec.trays.OutletL.T = [290:(330-290)/(sec.NTrays-1):330] *'K';
180        sec.trays.Level = 0.3 * sec.trays.hw;
181        sec.trays.OutletL.z(1) = 0.5;
182       
183        OPTIONS
184        TimeStep = 1;
185        TimeEnd = 100;
186        #GuessFile="SectionColumn_Test_with8tray.rlt";
187        #Dynamic = false;
188end
189
190
191FlowSheet Distillation_kettle_cond_Test
192        PARAMETERS
193        PP      as Plugin(Brief="Physical Properties",
194                Type="PP",
195                Components = [ "isobutane", "n-pentane", "propylene",
196                "benzene", "isobutene" ],
197                LiquidModel = "PR",
198                VapourModel = "PR"
199        );
200        NComp   as Integer;
201       
202        VARIABLES
203        Qc as energy_source (Brief="Heat rate removed from condenser");
204        Qr as energy_source (Brief="Heat rate supplied to reboiler");
205       
206        SET
207        NComp = PP.NumberOfComponents;
208
209        DEVICES
210        col as Distillation_kettle_cond;
211        feed as source;
212        zero as stream;
213       
214        CONNECTIONS
215        feed.Outlet to col.trays(5).Inlet;
216        zero to col.reb.Inlet;
217        zero to col.trays([1:4]).Inlet;
218        zero to col.trays([6:col.NTrays]).Inlet;
219        Qc.OutletQ to col.cond.InletQ;
220        Qr.OutletQ to col.reb.InletQ;
221       
222        SPECIFY
223        feed.Outlet.F = 113.4 * 'kmol/h';
224        feed.Outlet.T = 291 * 'K';
225        feed.Outlet.P = 168.3 * 'kPa';
226        feed.Outlet.z = 1/NComp;
227       
228        zero.F = 0 * 'kmol/h';
229        zero.T = 300 * 'K';
230        zero.P = 1 * 'atm';
231        zero.z = 1/NComp;
232        zero.v = 0;
233        zero.h = 0 * 'J/mol';
234       
235        col.sptop.Outlet2.F = 85 * 'kmol/h';
236        col.reb.OutletL.F = 28.4 * 'kmol/h';
237        col.sptop.frac = 0.444445;
238        col.cond.OutletV.F = 0 * 'kmol/h';
239        Qr.OutletQ.Q = 3.7743e6 * 'kJ/h';
240        Qc.OutletQ.Q = -3.71e6 * 'kJ/h';
241        col.pump1.dP = 16 * 'kPa';
242        col.trays.Emv = 1;
243       
244        SET
245        col.NTrays = 8;
246        col.cond.V = 2 * 'm^3';
247        col.cond.Across = 1 * 'm^2';
248        col.trays.V = 4 * 'ft^3';
249        col.trays.Ah = 0.394 * 'ft^2';
250        col.trays.lw = 20.94 * 'in';
251        col.trays.hw = 0.125 * 'ft';
252        col.trays.Q = 0 * 'kW';
253        col.trays.beta = 0.6;
254        col.trays.alfa = 4;
255        col.trays.Ap = 3.94 * 'ft^2';
256        col.reb.V = 2 * 'm^3';
257        col.reb.Across = 1 * 'm^2';
258       
259        INITIAL
260        # condenser
261        col.cond.OutletL.T = 260 *'K';
262        col.cond.Level = 1 * 'm';
263        col.cond.OutletL.z([1:4]) = [0.65, 0.05, 0.01, 0.01];
264
265        # reboiler
266        col.reb.OutletL.T = 330 *'K';
267        col.reb.Level = 1 * 'm';
268        col.reb.OutletL.z([1:4]) = [0.1, 0.7, 0.01, 0.01];
269
270        # column trays
271        col.trays.OutletL.T = [290:(330-290)/(col.NTrays-1):330] * 'K';
272        col.trays.Level = 1.2 * col.trays.hw;
273        col.trays.OutletL.z([1:4]) = [0.5, 0.05, 0.01, 0.01];
274
275        OPTIONS
276        TimeStep = 0.1;
277        TimeEnd = 50;
278        #GuessFile="Distillation_kettle_cond_Test.rlt";
279        #Dynamic = false;       
280end
281
282
283FlowSheet Column_ctrl
284        PARAMETERS
285        PP      as Plugin(Brief="Physical Properties",
286                Type="PP",
287                Components = [ "isobutane", "n-pentane", "propylene",
288                        "benzene", "isobutene" ],
289                LiquidModel = "PR",
290                VapourModel = "PR"
291        );
292        NComp   as Integer;
293       
294        Qcmin as heat_rate (Brief="Minimum Condenser Heat supplied");
295        Qcmax as heat_rate (Brief="Maximum Condenser Heat supplied");
296        Qrmin as heat_rate (Brief="Minimum Reboiler Heat supplied");
297        Qrmax as heat_rate (Brief="Maximum Reboiler Heat supplied");
298        Frmin as flow_mol (Brief="Minimum bottom flow rate");
299        Frmax as flow_mol (Brief="Maximum bottom flow rate");
300        Fcmin as flow_mol (Brief="Minimum reflux flow rate");
301        Fcmax as flow_mol (Brief="Maximum reflux flow rate");
302        Hmint as length (Brief="Minimum liquid level in top tank");
303        Hmaxt as length (Brief="Maximum liquid level in top tank");
304    Hminb as length (Brief="Minimum liquid level in reboiler");
305        Hmaxb as length (Brief="Maximum liquid level in reboiler");
306        Pmax as pressure (Brief="Maximum column pressure");
307        Pmin as pressure (Brief="Minimum column pressure");
308        Tmax as temperature (Brief="Maximum column temperature");
309        Tmin as temperature (Brief="Minimum column temperature");
310
311        VARIABLES
312        Qc as energy_source (Brief="Heat rate removed from condenser");
313        Qr as energy_source (Brief="Heat rate supplied to reboiler");
314        Had_top as Real (Brief="Dimensionless condenser level");
315        Had_bot as Real (Brief="Dimensionless reboiler level");
316        Pad as Real (Brief="Dimensionless pressure");
317        Tad as Real (Brief="Dimensionless temperature");
318        RR      as positive (Brief="Reflux ratio");
319
320        SET
321        NComp = PP.NumberOfComponents;
322
323        DEVICES
324        col as Distillation_kettle_cond;
325        feed as source;
326        zero as stream;
327        TCcond as PIDIncr;
328        LCtop as PIDIncr;
329        LCbot as PIDIncr;
330        PC as PIDIncr;
331
332        CONNECTIONS
333        feed.Outlet to col.trays(5).Inlet;
334        zero to col.reb.Inlet;
335        zero to col.trays([1:4]).Inlet;
336        zero to col.trays([6:col.NTrays]).Inlet;
337        Qc.OutletQ to col.cond.InletQ;
338        Qr.OutletQ to col.reb.InletQ;
339
340        EQUATIONS
341   "Temperature Controller"
342        TCcond.Parameters.tau = 0*'s'; 
343        TCcond.Parameters.tauSet = 0*'s';       
344        TCcond.Parameters.alpha = 0.3;
345        TCcond.Parameters.bias = 0.5;   
346        TCcond.Parameters.gamma = 1;
347        TCcond.Parameters.beta = 1;
348        TCcond.Options.action = 1;
349        TCcond.Options.clip = 1;
350        TCcond.Options.autoMan = 0;
351        TCcond.Parameters.intTime = 60*'s';
352        TCcond.Parameters.gain = 0.6;
353        TCcond.Parameters.derivTime = 1*'s';
354        TCcond.Ports.setPoint = ((15+273.15) * 'K' - Tmin)/(Tmax-Tmin);
355        TCcond.Ports.input = Tad;
356        Tad = (col.cond.OutletL.T-Tmin)/(Tmax-Tmin);
357        Qc.OutletQ.Q = Qcmin+(Qcmax-Qcmin)*TCcond.Ports.output;
358
359        "Pressure Controller"
360        PC.Parameters.tau = 0*'s';     
361        PC.Parameters.tauSet = 0*'s';   
362        PC.Parameters.alpha = 0.3;
363        PC.Parameters.bias = 0;
364        PC.Parameters.gamma = 1;
365        PC.Parameters.beta = 1;
366        PC.Options.action = -1;
367        PC.Options.clip = 1;
368        PC.Options.autoMan = 0;
369        PC.Parameters.intTime = 50*'s';
370        PC.Parameters.gain = 0.5;
371        PC.Parameters.derivTime = 1*'s';
372        PC.Ports.setPoint = (4.0*'bar'-Pmin)/(Pmax-Pmin);
373        PC.Ports.input = Pad;
374        Pad = (col.cond.OutletV.P-Pmin)/(Pmax-Pmin);
375        col.cond.OutletV.F = (Fcmin+(Fcmax-Fcmin)*PC.Ports.output);     
376       
377        "Ttop Level Controller"
378        LCtop.Parameters.tau = 0*'s';   
379        LCtop.Parameters.tauSet = 0*'s';       
380        LCtop.Parameters.alpha = 0.3;
381        LCtop.Parameters.bias = 0.5;   
382        LCtop.Parameters.gamma = 1;
383        LCtop.Parameters.beta = 1;
384        LCtop.Options.action = -1;
385        LCtop.Options.clip = 1;
386        LCtop.Options.autoMan = 0;
387        LCtop.Parameters.intTime = 10*'s';
388        LCtop.Parameters.gain = 1;
389        LCtop.Parameters.derivTime = 0*'s';
390        LCtop.Ports.setPoint = (1.0 * 'm' - Hmint)/(Hmaxt-Hmint);
391        LCtop.Ports.input = Had_top;
392        Had_top = (col.cond.Level-Hmint)/(Hmaxt-Hmint);
393        col.sptop.Outlet1.F = Fcmin + (Fcmax-Fcmin) * LCtop.Ports.output;
394
395        "Tbottom Level Controller"
396        LCbot.Parameters.tau = 0*'s';   
397        LCbot.Parameters.tauSet = 0*'s';       
398        LCbot.Parameters.alpha = 0.3;
399        LCbot.Parameters.bias = 0.5;   
400        LCbot.Parameters.gamma = 1;
401        LCbot.Parameters.beta = 1;
402        LCbot.Options.action = -1;
403        LCbot.Options.clip = 1;
404        LCbot.Options.autoMan = 0;
405        LCbot.Parameters.intTime = 100*'s';
406        LCbot.Parameters.gain = 1;
407        LCbot.Parameters.derivTime = 0*'s';
408        LCbot.Ports.setPoint = (1.0 * 'm' - Hminb)/(Hmaxb-Hminb);
409        LCbot.Ports.input = Had_bot;
410        Had_bot = (col.reb.Level-Hminb)/(Hmaxb-Hminb);
411        col.reb.OutletL.F = Frmin + (Frmax-Frmin) * LCbot.Ports.output;
412
413        RR * (col.cond.OutletV.F + col.sptop.Outlet1.F) = col.sptop.Outlet2.F;
414       
415        if time < 1 * 'h' then
416                col.sptop.Outlet2.F = 75 * 'kmol/h'; # reflux
417        else
418                col.sptop.Outlet2.F = 85 * 'kmol/h'; # reflux
419        end
420
421        SPECIFY
422        feed.Outlet.F = 113.4 * 'kmol/h';
423        feed.Outlet.T = 291 * 'K';
424        feed.Outlet.P = 5 * 'bar';
425        feed.Outlet.z = 1/NComp;
426       
427        zero.F = 0 * 'kmol/h';
428        zero.T = 300 * 'K';
429        zero.P = 1 * 'atm';
430        zero.z = 1/NComp;
431        zero.v = 0;
432        zero.h = 0 * 'J/mol';
433       
434        Qr.OutletQ.Q = 4e6 * 'kJ/h';
435        col.pump1.dP = 16 * 'kPa';
436        col.trays.Emv = 1;
437
438        SET
439        col.NTrays = 8;
440        col.cond.V = 2 * 'm^3';
441        col.cond.Across = 1 * 'm^2';
442        col.trays.V = 4 * 'ft^3';
443        col.trays.Ah = 0.394 * 'ft^2';
444        col.trays.lw = 20.94 * 'in';
445        col.trays.hw = 0.125 * 'ft';
446        col.trays.Q = 0 * 'kW';
447        col.trays.beta = 0.6;
448        col.trays.alfa = 4;
449        col.trays.Ap = 3.94 * 'ft^2';
450        col.reb.V = 2 * 'm^3';
451        col.reb.Across = 1 * 'm^2';
452
453        # Controllers type
454        TCcond.PID_Select = "Ideal_AW";
455        PC.PID_Select = "Ideal_AW";
456        LCtop.PID_Select = "Ideal_AW";
457        LCbot.PID_Select = "Ideal_AW";
458
459        Qrmax = 5e6 * 'kJ/h';
460        Qrmin = 1e6 * 'kJ/h';
461        Frmin = 0 * 'kmol/h';
462        Frmax = 60 * 'kmol/h';
463        Fcmin = 0 * 'kmol/h';
464        Fcmax = 120 * 'kmol/h';
465        Hmint = 0 * 'm';
466        Hmaxt = 2 * 'm';
467        Hminb = 0 * 'm';
468        Hmaxb = 2 * 'm';
469        Pmin = 0.5 * 'bar';
470        Pmax = 6 * 'bar';
471        Qcmax = -5e5 * 'kJ/h';
472        Qcmin = -5e6 * 'kJ/h';
473        Tmax = (30+273.15) * 'K';
474        Tmin = (-20+273.15) * 'K';
475       
476        INITIAL
477        # condenser
478        col.cond.OutletL.T = 260 *'K';
479        col.cond.Level = 1 * 'm';
480        col.cond.OutletL.z([1:4]) = [0.2, 0.2, 0.4, 0.05];
481
482        # reboiler
483        col.reb.OutletL.T = 350 *'K';
484        col.reb.Level = 1 * 'm';
485        col.reb.OutletL.z([1:4]) = [0.1, 0.4, 0.1, 0.3];
486
487        # column trays
488        col.trays.OutletL.T = [290:(330-290)/(col.NTrays-1):330] * 'K';
489        col.trays.Level = 1.2 * col.trays.hw;
490        col.trays.OutletL.z([1:4]) = [0.15, 0.3, 0.25, 0.2];
491
492        OPTIONS
493        TimeStep = 0.1;
494        TimeEnd = 5;
495        TimeUnit = 'h';
496        InitialFile = "Column_ctrl.rlt";
497        #GuessFile = "Column_ctrl.rlt";
498        #Dynamic = false;
499end
500
501
Note: See TracBrowser for help on using the repository browser.