source: trunk/sample/stage_separators/Sample_Distillation_kettle_cond_Eff.mso @ 607

Last change on this file since 607 was 607, checked in by Argimiro Resende Secchi, 15 years ago

Updating tray efficiency models.

File size: 27.9 KB
RevLine 
[593]1#*--------------------------------------------------------------------
2* Sample file for column model With Tray Efficiency Prediction
3*--------------------------------------------------------------------
4*
5*----------------------------------------------------------------------
6* Author: Josias J. Junges
7*--------------------------------------------------------------------*#
8
9using "stage_separators/column_Eff";
10using "controllers/PIDIncr";
11
12FlowSheet Sample_Distillation_kettle_cond_EffEmp
13        PARAMETERS
14        PP      as Plugin(Brief="Physical Properties",
15                Type="PP",
16                Components = [ "benzene", "toluene" ],
17                LiquidModel = "UNIFAC",
18                VapourModel = "SRK"
19        );
20        NComp   as Integer;
21        iLK as Integer;
22        iHK as Integer;
23
24        Pmin as pressure (Brief="Minimum column temperature");
25        Pmax as pressure (Brief="Minimum column temperature");
26        Qcmin as heat_rate (Brief="Minimum Condenser Heat supplied");
27        Qcmax as heat_rate (Brief="Maximum Condenser Heat supplied");
28        Hmint as length (Brief="Minimum liquid level in top tank");
29        Hmaxt as length (Brief="Maximum liquid level in top tank");
30    Hminb as length (Brief="Minimum liquid level in reboiler");
31        Hmaxb as length (Brief="Maximum liquid level in reboiler");
32        Frmin as flow_mol (Brief="Minimum bottom flow rate");
33        Frmax as flow_mol (Brief="Maximum bottom flow rate");
34        Fcmin as flow_mol (Brief="Minimum reflux flow rate");
35        Fcmax as flow_mol (Brief="Maximum reflux flow rate");
36
37        VARIABLES
38        Qc as energy_source (Brief="Heat rate removed from condenser");
39        Qr as energy_source (Brief="Heat rate supplied to reboiler");
40        Padc as Real (Brief="Dimensionless pressure");
41        Had_top as Real (Brief="Dimensionless condenser level");
42        Had_bot as Real (Brief="Dimensionless reboiler level");
43        DF as fraction (Brief="Distillation to feed ratio");
44        RR as Real (Brief="Reflux ratio");
45       
46        SET
47        NComp = PP.NumberOfComponents;
48
49        DEVICES
50       
51        col as Distillation_kettle_cond_EffEmp;
52        feed as source;
53        zero as stream;
54        LCtop as PIDIncr;
55        LCbot as PIDIncr;
56        PCcond as PIDIncr;
57       
58        SET
59        col.NTrays = 8;
60       
61        CONNECTIONS
62        feed.Outlet to col.trays(4).Inlet;
63        zero to col.reb.Inlet;
64        zero to col.trays([1:3]).Inlet;
65        zero to col.trays([5:col.NTrays]).Inlet;
66        Qc.OutletQ to col.cond.InletQ;
67        Qr.OutletQ to col.reb.InletQ;
68       
69        EQUATIONS
70   
71   "Pressure Controller Cond"
72        PCcond.Parameters.tau = 0*'s'; 
73        PCcond.Parameters.tauSet = 0*'s';       
74        PCcond.Parameters.alpha = 0.3;
75        PCcond.Parameters.bias = 0.67; 
76        PCcond.Parameters.gamma = 1;
77        PCcond.Parameters.beta = 1;
78        PCcond.Options.action = 1;
79        PCcond.Options.clip = 1;
80        PCcond.Options.autoMan = 0;
81        PCcond.Parameters.intTime = 60*'min';
82        PCcond.Parameters.gain = 0.1;
83        PCcond.Parameters.derivTime = 10*'min';
84        PCcond.Ports.setPoint = (0.2 * 'bar' - Pmin)/(Pmax-Pmin);
85        PCcond.Ports.input = Padc;
86        Padc = (col.cond.OutletL.P-Pmin)/(Pmax-Pmin);
87        Qc.OutletQ.Q = Qcmin+(Qcmax-Qcmin)*PCcond.Ports.output;
88
89        "Ttop Level Controller"
90        LCtop.Parameters.tau = 0*'s';   
91        LCtop.Parameters.tauSet = 0*'s';       
92        LCtop.Parameters.alpha = 0.3;
93        LCtop.Parameters.bias = 0.5;   
94        LCtop.Parameters.gamma = 1;
95        LCtop.Parameters.beta = 1;
96        LCtop.Options.action = -1;
97        LCtop.Options.clip = 1;
98        LCtop.Options.autoMan = 0;
99        LCtop.Parameters.intTime = 20*'min';
100        LCtop.Parameters.gain = 0.9;
101        LCtop.Parameters.derivTime = 0*'s';
102        LCtop.Ports.setPoint = (1 * 'm' - Hmint)/(Hmaxt-Hmint);
103        LCtop.Ports.input = Had_top;
104        Had_top = (col.cond.Level-Hmint)/(Hmaxt-Hmint);
105        col.sptop.Outlet2.F = Fcmin + (Fcmax-Fcmin) * LCtop.Ports.output;
106
107        "Tbottom Level Controller"
108        LCbot.Parameters.tau = 0*'s';   
109        LCbot.Parameters.tauSet = 0*'s';       
110        LCbot.Parameters.alpha = 0.3;
111        LCbot.Parameters.bias = 0.5;   
112        LCbot.Parameters.gamma = 1;
113        LCbot.Parameters.beta = 1;
114        LCbot.Options.action = -1;
115        LCbot.Options.clip = 1;
116        LCbot.Options.autoMan = 0;
117        LCbot.Parameters.intTime = 20*'min';
118        LCbot.Parameters.gain = 0.9;
119        LCbot.Parameters.derivTime = 0*'s';
120        LCbot.Ports.setPoint = (1 * 'm' - Hminb)/(Hmaxb-Hminb);
121        LCbot.Ports.input = Had_bot;
122        Had_bot = (col.reb.Level-Hminb)/(Hmaxb-Hminb);
123        col.reb.OutletL.F = Frmin + (Frmax-Frmin) * LCbot.Ports.output;
124       
125        DF = col.sptop.Outlet1.F / feed.Outlet.F;
126        RR * (col.sptop.Outlet1.F + col.cond.OutletV.F) = col.sptop.Outlet2.F;
127       
128        SPECIFY
129        feed.Outlet.F = 200 * 'kmol/h';
130        feed.Outlet.T = (60+273.15) * 'K';
131        feed.Outlet.P = 1 * 'bar';
132        feed.Outlet.z(1) = 0.6;
133        feed.Outlet.z(2)=0.4;
134       
135        zero.F = 0 * 'kmol/h';
136        zero.T = 300 * 'K';
137        zero.P = 1 * 'atm';
138        zero.z = 1/NComp;
139        zero.v = 0;
140        zero.h = 0 * 'J/mol';
141       
142        RR = 1;
143
144        col.cond.OutletV.F = 0 * 'kmol/h';
145        Qr.OutletQ.Q = 1854471.14*0.985 * 'W';
146        col.pump1.dP = 0.0000000001* 'kPa';
147       
148        col.alfaTopo = 2;
149       
150        #col.trays(1).Emv = 0.47806479;
151        #col.trays(2).Emv = 0.53702951;
152        #col.trays(3).Emv = 0.59429546;
153        #col.trays(4).Emv = 0.63645948;
154        #col.trays(5).Emv = 0.71892244;
155        #col.trays(6).Emv = 0.7437489;
156        #col.trays(7).Emv = 0.76615292;
157        #col.trays(8).Emv = 0.79338953;
158
159        #para modelo de eff
160        col.trays.Dv = 3.2556e-6*'m^2/s';
161        col.trays.Dl = 6.1085e-9*'m^2/s';
162        col.trays(1).sigma=0.02649902*'N/m';
163        col.trays(2).sigma=0.02578077*'N/m';
164        col.trays(3).sigma=0.02510972*'N/m';
165        col.trays(4).sigma=0.02445816*'N/m';
166        col.trays(5).sigma=0.02402951*'N/m';
167        col.trays(6).sigma=0.02359190*'N/m';
168        col.trays(7).sigma=0.02311517*'N/m';
169        col.trays(8).sigma=0.02256425*'N/m';
170       
171        SET
172
173        #eff model
174        col.trays.z = 1.35*'m';
175        col.trays.d = 1.85*'m';
176        col.trays.fi= 0.1407;
177        col.trays.Ts= 0.5*'m';
178        col.trays.Aa=2.2542*'m^2';     
179       
180        col.trays.V = 1.344 * 'm^3';
181        col.trays.Ah = 0.37824 * 'm^2';
182        col.trays.hw = 0.052 * 'm';
183        col.trays.lw = 1.264 * 'm';
184        col.trays.Q = 0 * 'kW';
185        col.trays.beta = 0.65;
186        col.trays.alfa = 23;
187        col.trays.Ap = 2.4711 * 'm^2';
188       
189        col.cond.V = 4*1.344 * 'm^3';
190        col.cond.Across = 2.688 * 'm^2';
191       
192        col.reb.V = 4*1.344 * 'm^3';
193        col.reb.Across = 2.688 * 'm^2';
194       
195        # Controllers type
196        PCcond.PID_Select = "Ideal_AW";
197        LCtop.PID_Select = "Ideal_AW";
198        LCbot.PID_Select = "Ideal_AW";
199       
200        Frmin = 25 * 'kmol/h';
201        Frmax = 115 * 'kmol/h';
202        Fcmin = 90 * 'kmol/h';
203        Fcmax = 110 * 'kmol/h';
204        Hmint = 0.01 * 'm';
205        Hmaxt = 2.0 * 'm';
206        Hminb = 0.01 * 'm';
207        Hmaxb = 2.0 * 'm';
208        Pmin = 0.05 * 'bar';
209        Pmax = 0.4 * 'bar';
210        Qcmax = -1e6 * 'W';
211        Qcmin = -4e6 * 'W';
212       
213        INITIAL
214        # condenser
215        col.cond.OutletL.T = 309.637705*'K';
216        col.cond.Level = 1* 'm';
217        col.cond.OutletL.z([1]) = [0.93];
218
219        # reboiler
220        col.reb.OutletL.T = 350.460542 *'K';
221        col.reb.Level = 1 * 'm';
222        col.reb.OutletL.z([1]) = [0.26];
223
224        # column trays
225        col.trays(1).OutletL.T = 311.172941 * 'K';
226        col.trays(2).OutletL.T = 317.117053 * 'K';
227        col.trays(3).OutletL.T = 322.578424 * 'K';
228        col.trays(4).OutletL.T = 327.515251 * 'K';
229        col.trays(5).OutletL.T = 331.108803 * 'K';
230        col.trays(6).OutletL.T = 334.854461 * 'K';
231        col.trays(7).OutletL.T = 338.976196 * 'K';
232        col.trays(8).OutletL.T = 343.713225 * 'K';
233        col.trays.Level = 1.2 * col.trays.hw;
234        col.trays(1).OutletL.z([1]) = [0.83];
235        col.trays(2).OutletL.z([1]) = [0.74];
236        col.trays(3).OutletL.z([1]) = [0.67];
237        col.trays(4).OutletL.z([1]) = [0.60];
238        col.trays(5).OutletL.z([1]) = [0.58];
239        col.trays(6).OutletL.z([1]) = [0.53];
240        col.trays(7).OutletL.z([1]) = [0.48];
241        col.trays(8).OutletL.z([1]) = [0.40];
242       
243        OPTIONS
244        TimeStep = 0.2;
245        TimeEnd = 10;
246        TimeUnit = 'h';
247        NLASolver (File="sundials");
248        DAESolver (File="mebdf");
249        InitialFile="Sample_Distillation_kettle_cond_EffEmp1.rlt";
250        #Dynamic = false;       
251end
252
253FlowSheet Sample_Distillation_kettle_cond_EffFund
254        PARAMETERS
255        PP      as Plugin(Brief="Physical Properties",
256                Type="PP",
257                Components = [ "benzene", "toluene" ],
258                LiquidModel = "UNIFAC",
259                VapourModel = "SRK"
260        );
261        NComp   as Integer;
262        iLK as Integer;
263        iHK as Integer;
264
265        Pmin as pressure (Brief="Minimum column temperature");
266        Pmax as pressure (Brief="Minimum column temperature");
267        Qcmin as heat_rate (Brief="Minimum Condenser Heat supplied");
268        Qcmax as heat_rate (Brief="Maximum Condenser Heat supplied");
269        Hmint as length (Brief="Minimum liquid level in top tank");
270        Hmaxt as length (Brief="Maximum liquid level in top tank");
271    Hminb as length (Brief="Minimum liquid level in reboiler");
272        Hmaxb as length (Brief="Maximum liquid level in reboiler");
273        Frmin as flow_mol (Brief="Minimum bottom flow rate");
274        Frmax as flow_mol (Brief="Maximum bottom flow rate");
275        Fcmin as flow_mol (Brief="Minimum reflux flow rate");
276        Fcmax as flow_mol (Brief="Maximum reflux flow rate");
277
278        VARIABLES
279        Qc as energy_source (Brief="Heat rate removed from condenser");
280        Qr as energy_source (Brief="Heat rate supplied to reboiler");
281        Padc as Real (Brief="Dimensionless pressure");
282        Had_top as Real (Brief="Dimensionless condenser level");
283        Had_bot as Real (Brief="Dimensionless reboiler level");
284        DF as fraction (Brief="Distillation to feed ratio");
285        RR as Real (Brief="Reflux ratio");
286       
287        SET
288        NComp = PP.NumberOfComponents;
289
290        DEVICES
291       
292        col as Distillation_kettle_cond_EffFund;
293        feed as source;
294        zero as stream;
295        LCtop as PIDIncr;
296        LCbot as PIDIncr;
297        PCcond as PIDIncr;
298       
299        SET
300        col.NTrays = 8;
301       
302        CONNECTIONS
303        feed.Outlet to col.trays(4).Inlet;
304        zero to col.reb.Inlet;
305        zero to col.trays([1:3]).Inlet;
306        zero to col.trays([5:col.NTrays]).Inlet;
307        Qc.OutletQ to col.cond.InletQ;
308        Qr.OutletQ to col.reb.InletQ;
309       
310        EQUATIONS
311   
312   "Pressure Controller Cond"
313        PCcond.Parameters.tau = 0*'s'; 
314        PCcond.Parameters.tauSet = 0*'s';       
315        PCcond.Parameters.alpha = 0.3;
316        PCcond.Parameters.bias = 0.67; 
317        PCcond.Parameters.gamma = 1;
318        PCcond.Parameters.beta = 1;
319        PCcond.Options.action = 1;
320        PCcond.Options.clip = 1;
321        PCcond.Options.autoMan = 0;
322        PCcond.Parameters.intTime = 60*'min';
323        PCcond.Parameters.gain = 0.1;
324        PCcond.Parameters.derivTime = 10*'min';
325        PCcond.Ports.setPoint = (0.2 * 'bar' - Pmin)/(Pmax-Pmin);
326        PCcond.Ports.input = Padc;
327        Padc = (col.cond.OutletL.P-Pmin)/(Pmax-Pmin);
328        Qc.OutletQ.Q = Qcmin+(Qcmax-Qcmin)*PCcond.Ports.output;
329
330        "Ttop Level Controller"
331        LCtop.Parameters.tau = 0*'s';   
332        LCtop.Parameters.tauSet = 0*'s';       
333        LCtop.Parameters.alpha = 0.3;
334        LCtop.Parameters.bias = 0.5;   
335        LCtop.Parameters.gamma = 1;
336        LCtop.Parameters.beta = 1;
337        LCtop.Options.action = -1;
338        LCtop.Options.clip = 1;
339        LCtop.Options.autoMan = 0;
340        LCtop.Parameters.intTime = 20*'min';
341        LCtop.Parameters.gain = 0.9;
342        LCtop.Parameters.derivTime = 0*'s';
343        LCtop.Ports.setPoint = (1 * 'm' - Hmint)/(Hmaxt-Hmint);
344        LCtop.Ports.input = Had_top;
345        Had_top = (col.cond.Level-Hmint)/(Hmaxt-Hmint);
346        col.sptop.Outlet2.F = Fcmin + (Fcmax-Fcmin) * LCtop.Ports.output;
347
348        "Tbottom Level Controller"
349        LCbot.Parameters.tau = 0*'s';   
350        LCbot.Parameters.tauSet = 0*'s';       
351        LCbot.Parameters.alpha = 0.3;
352        LCbot.Parameters.bias = 0.5;   
353        LCbot.Parameters.gamma = 1;
354        LCbot.Parameters.beta = 1;
355        LCbot.Options.action = -1;
356        LCbot.Options.clip = 1;
357        LCbot.Options.autoMan = 0;
358        LCbot.Parameters.intTime = 20*'min';
359        LCbot.Parameters.gain = 0.9;
360        LCbot.Parameters.derivTime = 0*'s';
361        LCbot.Ports.setPoint = (1 * 'm' - Hminb)/(Hmaxb-Hminb);
362        LCbot.Ports.input = Had_bot;
363        Had_bot = (col.reb.Level-Hminb)/(Hmaxb-Hminb);
364        col.reb.OutletL.F = Frmin + (Frmax-Frmin) * LCbot.Ports.output;
365       
366        DF = col.sptop.Outlet1.F / feed.Outlet.F;
367        RR * (col.sptop.Outlet1.F + col.cond.OutletV.F) = col.sptop.Outlet2.F;
368       
369        SPECIFY
370        feed.Outlet.F = 200 * 'kmol/h';
371        feed.Outlet.T = (60+273.15) * 'K';
372        feed.Outlet.P = 1 * 'bar';
373        feed.Outlet.z(1) = 0.6;
374        feed.Outlet.z(2)=0.4;
375       
376        zero.F = 0 * 'kmol/h';
377        zero.T = 300 * 'K';
378        zero.P = 1 * 'atm';
379        zero.z = 1/NComp;
380        zero.v = 0;
381        zero.h = 0 * 'J/mol';
382       
383        RR = 1;
[607]384       
385        col.trays.psi=1;
386        col.trays.psi1=1;
387       
[593]388        col.cond.OutletV.F = 0 * 'kmol/h';
389        Qr.OutletQ.Q = 1854471.14 * 'W';
[607]390        col.pump1.dP = 0.000000001* 'kPa';
[593]391       
392        col.alfaTopo = 2;
393       
[607]394        #*col.trays.Emv = [0.47806479
[593]3950.53702951
3960.59429546
3970.63645948
3980.71892244
3990.7437489
4000.76615292
[607]4010.79338953];*#
402
[593]403        #eff model
404        col.trays.Dv = 3.2556e-6*'m^2/s';
405        col.trays.Dl = 6.1085e-9*'m^2/s';
406        col.trays(1).sigma=0.02649902*'N/m';
407        col.trays(2).sigma=0.02578077*'N/m';
408        col.trays(3).sigma=0.02510972*'N/m';
409        col.trays(4).sigma=0.02445816*'N/m';
410        col.trays(5).sigma=0.02402951*'N/m';
411        col.trays(6).sigma=0.02359190*'N/m';
412        col.trays(7).sigma=0.02311517*'N/m';
413        col.trays(8).sigma=0.02256425*'N/m';
414       
415        SET
416
417        #para modelo de eff
418        #col.trays.z = 1.35*'m';
419        col.trays.d = 1.85*'m';
420        col.trays.fi= 0.1407;
421        col.trays.Ts= 0.5*'m';
422        col.trays.Aa=2.2542*'m^2';
423        col.trays.dh=0.040*'m';
424       
425        col.trays.V = 1.344 * 'm^3';
426        col.trays.Ah = 0.37824 * 'm^2';
427        col.trays.hw = 0.052 * 'm';
428        col.trays.lw = 1.264 * 'm';
429        col.trays.Q = 0 * 'kW';
430        col.trays.beta = 0.4;
431        col.trays.alfa = 100;
432        col.trays.Ap = 2.4711 * 'm^2';
433       
434        col.cond.V = 4*1.344 * 'm^3';
435        col.cond.Across = 2.688 * 'm^2';
436       
437        col.reb.V = 4*1.344 * 'm^3';
438        col.reb.Across = 2.688 * 'm^2';
439       
440        # Controllers type
441        PCcond.PID_Select = "Ideal_AW";
442        LCtop.PID_Select = "Ideal_AW";
443        LCbot.PID_Select = "Ideal_AW";
444       
445        Frmin = 25 * 'kmol/h';
446        Frmax = 115 * 'kmol/h';
447        Fcmin = 90 * 'kmol/h';
448        Fcmax = 110 * 'kmol/h';
449        Hmint = 0.01 * 'm';
450        Hmaxt = 2.0 * 'm';
451        Hminb = 0.01 * 'm';
452        Hmaxb = 2.0 * 'm';
453        Pmin = 0.05 * 'bar';
454        Pmax = 0.4 * 'bar';
455        Qcmax = -1e6 * 'W';
456        Qcmin = -4e6 * 'W';
457       
458        INITIAL
459        # condenser
460        col.cond.OutletL.T = 309.637705*'K';
461        col.cond.Level = 1* 'm';
462        col.cond.OutletL.z([1]) = [0.93];
463
464        # reboiler
465        col.reb.OutletL.T = 350.460542 *'K';
466        col.reb.Level = 1 * 'm';
467        col.reb.OutletL.z([1]) = [0.26];
468
469        # column trays
470        col.trays(1).OutletL.T = 311.172941 * 'K';
471        col.trays(2).OutletL.T = 317.117053 * 'K';
472        col.trays(3).OutletL.T = 322.578424 * 'K';
473        col.trays(4).OutletL.T = 327.515251 * 'K';
474        col.trays(5).OutletL.T = 331.108803 * 'K';
475        col.trays(6).OutletL.T = 334.854461 * 'K';
476        col.trays(7).OutletL.T = 338.976196 * 'K';
477        col.trays(8).OutletL.T = 343.713225 * 'K';
478        col.trays.Level = 1.2 * col.trays.hw;
479        col.trays(1).OutletL.z([1]) = [0.83];
480        col.trays(2).OutletL.z([1]) = [0.74];
481        col.trays(3).OutletL.z([1]) = [0.67];
482        col.trays(4).OutletL.z([1]) = [0.60];
483        col.trays(5).OutletL.z([1]) = [0.58];
484        col.trays(6).OutletL.z([1]) = [0.53];
485        col.trays(7).OutletL.z([1]) = [0.48];
486        col.trays(8).OutletL.z([1]) = [0.40];
487       
488       
489
490        OPTIONS
491        TimeStep = 1;
492        TimeEnd = 30;
493        TimeUnit = 'h';
494        NLASolver (File="sundials");
495        DAESolver (File="mebdf");
496        InitialFile="Sample_Distillation_kettle_cond_EffFund1.rlt";
497        #Dynamic = false;       
498end
499
500FlowSheet Sample_Distillation_kettle_cond_EffEmp_Multi
501        PARAMETERS
502        PP      as Plugin(Brief="Physical Properties",
503                Type="PP",
504                Components = [ "benzene", "toluene", "p-xylene" ],
505                LiquidModel = "UNIFAC",
506                VapourModel = "SRK"
507        );
508        NComp   as Integer;
509        iLK as Integer;
510        iHK as Integer;
511
512        Pmin as pressure (Brief="Minimum column temperature");
513        Pmax as pressure (Brief="Minimum column temperature");
514        Qcmin as heat_rate (Brief="Minimum Condenser Heat supplied");
515        Qcmax as heat_rate (Brief="Maximum Condenser Heat supplied");
516        Hmint as length (Brief="Minimum liquid level in top tank");
517        Hmaxt as length (Brief="Maximum liquid level in top tank");
518    Hminb as length (Brief="Minimum liquid level in reboiler");
519        Hmaxb as length (Brief="Maximum liquid level in reboiler");
520        Frmin as flow_mol (Brief="Minimum bottom flow rate");
521        Frmax as flow_mol (Brief="Maximum bottom flow rate");
522        Fcmin as flow_mol (Brief="Minimum reflux flow rate");
523        Fcmax as flow_mol (Brief="Maximum reflux flow rate");
524
525        VARIABLES
526        Qc as energy_source (Brief="Heat rate removed from condenser");
527        Qr as energy_source (Brief="Heat rate supplied to reboiler");
528        Padc as Real (Brief="Dimensionless pressure");
529        Had_top as Real (Brief="Dimensionless condenser level");
530        Had_bot as Real (Brief="Dimensionless reboiler level");
531        DF as fraction (Brief="Distillation to feed ratio");
532        RR as Real (Brief="Reflux ratio");
533       
534        SET
535        NComp = PP.NumberOfComponents;
536        iLK=1;
537        iHK=3;
538
539        DEVICES
540       
541        col as Distillation_kettle_cond_EffEmp;
542        feed as source;
543        zero as stream;
544        LCtop as PIDIncr;
545        LCbot as PIDIncr;
546        PCcond as PIDIncr;
547       
548        SET
549        col.NTrays = 8;
550       
551        CONNECTIONS
552        feed.Outlet to col.trays(4).Inlet;
553        zero to col.reb.Inlet;
554        zero to col.trays([1:3]).Inlet;
555        zero to col.trays([5:col.NTrays]).Inlet;
556        Qc.OutletQ to col.cond.InletQ;
557        Qr.OutletQ to col.reb.InletQ;
558       
559        EQUATIONS
560   
561   "Pressure Controller Cond"
562        PCcond.Parameters.tau = 0*'s'; 
563        PCcond.Parameters.tauSet = 0*'s';       
564        PCcond.Parameters.alpha = 0.3;
565        PCcond.Parameters.bias = 0.67; 
566        PCcond.Parameters.gamma = 1;
567        PCcond.Parameters.beta = 1;
568        PCcond.Options.action = 1;
569        PCcond.Options.clip = 1;
570        PCcond.Options.autoMan = 0;
571        PCcond.Parameters.intTime = 60*'min';
572        PCcond.Parameters.gain = 0.1;
573        PCcond.Parameters.derivTime = 10*'min';
574        PCcond.Ports.setPoint = (0.2 * 'bar' - Pmin)/(Pmax-Pmin);
575        PCcond.Ports.input = Padc;
576        Padc = (col.cond.OutletL.P-Pmin)/(Pmax-Pmin);
577        Qc.OutletQ.Q = Qcmin+(Qcmax-Qcmin)*PCcond.Ports.output;
578
579        "Ttop Level Controller"
580        LCtop.Parameters.tau = 0*'s';   
581        LCtop.Parameters.tauSet = 0*'s';       
582        LCtop.Parameters.alpha = 0.3;
583        LCtop.Parameters.bias = 0.5;   
584        LCtop.Parameters.gamma = 1;
585        LCtop.Parameters.beta = 1;
586        LCtop.Options.action = -1;
587        LCtop.Options.clip = 1;
588        LCtop.Options.autoMan = 0;
589        LCtop.Parameters.intTime = 20*'min';
590        LCtop.Parameters.gain = 0.9;
591        LCtop.Parameters.derivTime = 0*'s';
592        LCtop.Ports.setPoint = (1 * 'm' - Hmint)/(Hmaxt-Hmint);
593        LCtop.Ports.input = Had_top;
594        Had_top = (col.cond.Level-Hmint)/(Hmaxt-Hmint);
595        col.sptop.Outlet2.F = Fcmin + (Fcmax-Fcmin) * LCtop.Ports.output;
596
597        "Tbottom Level Controller"
598        LCbot.Parameters.tau = 0*'s';   
599        LCbot.Parameters.tauSet = 0*'s';       
600        LCbot.Parameters.alpha = 0.3;
601        LCbot.Parameters.bias = 0.5;   
602        LCbot.Parameters.gamma = 1;
603        LCbot.Parameters.beta = 1;
604        LCbot.Options.action = -1;
605        LCbot.Options.clip = 1;
606        LCbot.Options.autoMan = 0;
607        LCbot.Parameters.intTime = 20*'min';
608        LCbot.Parameters.gain = 0.9;
609        LCbot.Parameters.derivTime = 0*'s';
610        LCbot.Ports.setPoint = (1 * 'm' - Hminb)/(Hmaxb-Hminb);
611        LCbot.Ports.input = Had_bot;
612        Had_bot = (col.reb.Level-Hminb)/(Hmaxb-Hminb);
613        col.reb.OutletL.F = Frmin + (Frmax-Frmin) * LCbot.Ports.output;
614       
615        DF = col.sptop.Outlet1.F / feed.Outlet.F;
616        RR * (col.sptop.Outlet1.F + col.cond.OutletV.F) = col.sptop.Outlet2.F;
617       
618        SPECIFY
619        feed.Outlet.F = 200 * 'kmol/h';
620        feed.Outlet.T = (60+273.15) * 'K';
621        feed.Outlet.P = 1 * 'bar';
622        feed.Outlet.z(1) = 0.5;
623        feed.Outlet.z(2)=0.4;
624        feed.Outlet.z(3)=0.1;
625       
626       
627        zero.F = 0 * 'kmol/h';
628        zero.T = 300 * 'K';
629        zero.P = 1 * 'atm';
630        zero.z = 1/NComp;
631        zero.v = 0;
632        zero.h = 0 * 'J/mol';
633       
634        RR = 1;
635
636        col.cond.OutletV.F = 0 * 'kmol/h';
637        Qr.OutletQ.Q = 1854471.14* 'W';
638        col.pump1.dP = 0.0000000001* 'kPa';
639       
640        col.alfaTopo = 2;
641       
642        #col.trays(1).Emv = 0.47806479;
643        #col.trays(2).Emv = 0.53702951;
644        #col.trays(3).Emv = 0.59429546;
645        #col.trays(4).Emv = 0.63645948;
646        #col.trays(5).Emv = 0.71892244;
647        #col.trays(6).Emv = 0.7437489;
648        #col.trays(7).Emv = 0.76615292;
649        #col.trays(8).Emv = 0.79338953;
650
651        #eff model
652        col.trays.Dv = 3.2556e-6*'m^2/s';
653        col.trays.Dl = 6.1085e-9*'m^2/s';
654        col.trays(1).sigma=0.02649902*'N/m';
655        col.trays(2).sigma=0.02578077*'N/m';
656        col.trays(3).sigma=0.02510972*'N/m';
657        col.trays(4).sigma=0.02445816*'N/m';
658        col.trays(5).sigma=0.02402951*'N/m';
659        col.trays(6).sigma=0.02359190*'N/m';
660        col.trays(7).sigma=0.02311517*'N/m';
661        col.trays(8).sigma=0.02256425*'N/m';
662       
663        SET
664
665        #para modelo de eff
666        col.trays.z = 1.35*'m';
667        col.trays.d = 1.85*'m';
668        col.trays.fi= 0.1407;
669        col.trays.Ts= 0.5*'m';
670        col.trays.Aa=2.2542*'m^2';     
671       
672        col.trays.V = 1.344 * 'm^3';
673        col.trays.Ah = 0.37824 * 'm^2';
674        col.trays.hw = 0.052 * 'm';
675        col.trays.lw = 1.264 * 'm';
676        col.trays.Q = 0 * 'kW';
677        col.trays.beta = 0.4;
678        col.trays.alfa = 18;
679        col.trays.Ap = 2.4711 * 'm^2';
680       
681        col.cond.V = 4*1.344 * 'm^3';
682        col.cond.Across = 2.688 * 'm^2';
683       
684        col.reb.V = 4*1.344 * 'm^3';
685        col.reb.Across = 2.688 * 'm^2';
686       
687        # Controllers type
688        PCcond.PID_Select = "Ideal_AW";
689        LCtop.PID_Select = "Ideal_AW";
690        LCbot.PID_Select = "Ideal_AW";
691       
692        Frmin = 25 * 'kmol/h';
693        Frmax = 115 * 'kmol/h';
694        Fcmin = 90 * 'kmol/h';
695        Fcmax = 110 * 'kmol/h';
696        Hmint = 0.01 * 'm';
697        Hmaxt = 2.0 * 'm';
698        Hminb = 0.01 * 'm';
699        Hmaxb = 2.0 * 'm';
700        Pmin = 0.05 * 'bar';
701        Pmax = 0.4 * 'bar';
702        Qcmax = -1e6 * 'W';
703        Qcmin = -4e6 * 'W';
704       
705        INITIAL
706        # condenser
707        col.cond.OutletL.T = 310.87*'K';
708        col.cond.Level = 1* 'm';
709        col.cond.OutletL.z([1 2]) = [0.86 0.13];
710
711        # reboiler
712        col.reb.OutletL.T = 358.45 *'K';
713        col.reb.Level = 1 * 'm';
714        col.reb.OutletL.z([1 2]) = [0.135 0.66];
715
716        # column trays
717        col.trays(1).OutletL.T = 312.625461 * 'K';
718        col.trays(2).OutletL.T = 318.954211* 'K';
719        col.trays(3).OutletL.T = 324.962929 * 'K';
720        col.trays(4).OutletL.T = 331.041158 * 'K';
721        col.trays(5).OutletL.T = 335.259862  * 'K';
722        col.trays(6).OutletL.T = 339.7895  * 'K';
723        col.trays(7).OutletL.T = 344.823955 * 'K';
724        col.trays(8).OutletL.T = 350.486538 * 'K';
725
726        col.trays.Level = 1.2 * col.trays.hw;
727        col.trays(1).OutletL.z([1 2]) = [0.77 0.21];
728        col.trays(2).OutletL.z([1 2]) = [0.67 0.30];
729        col.trays(3).OutletL.z([1 2]) = [0.58 0.38];
730        col.trays(4).OutletL.z([1 2]) = [0.49 0.42];
731        col.trays(5).OutletL.z([1 2]) = [0.45 0.45];
732        col.trays(6).OutletL.z([1 2]) = [0.41 0.50];
733        col.trays(7).OutletL.z([1 2]) = [0.33 0.57];
734        col.trays(8).OutletL.z([1 2]) = [0.24 0.63];
735
736        OPTIONS
737        TimeStep = 1;
738        TimeEnd = 30;
739        TimeUnit = 'h';
740        NLASolver (File="sundials");
741        DAESolver (File="mebdf");
742        #GuessFile="Sample_Distillation_kettle_cond_EffEmp_sem_eff.rlt";
743        InitialFile="Sample_Distillation_kettle_cond_EffEmp_Multi1.rlt";
744        #Dynamic = false;       
745end
746
[607]747FlowSheet Sample_Distillation_kettle_cond_EffFund_Dual
748        PARAMETERS
749        PP      as Plugin(Brief="Physical Properties",
750                Type="PP",
751                Components = [ "propane", "propylene" ],
752                LiquidModel = "PR",
753                VapourModel = "PR"
754        );
755        NComp   as Integer;
756        iLK as Integer;
757        iHK as Integer;
[593]758
[607]759        Pcmin as pressure (Brief="Minimum column temperature");
760        Pcmax as pressure (Brief="Minimum column temperature");
761        Qcmin as heat_rate (Brief="Minimum Condenser Heat supplied");
762        Qcmax as heat_rate (Brief="Maximum Condenser Heat supplied");
763        Hmint as length (Brief="Minimum liquid level in top tank");
764        Hmaxt as length (Brief="Maximum liquid level in top tank");
765    Hminb as length (Brief="Minimum liquid level in reboiler");
766        Hmaxb as length (Brief="Maximum liquid level in reboiler");
767        Frmin as flow_mol (Brief="Minimum bottom flow rate");
768        Frmax as flow_mol (Brief="Maximum bottom flow rate");
769        Fcmin as flow_mol (Brief="Minimum reflux flow rate");
770        Fcmax as flow_mol (Brief="Maximum reflux flow rate");
771
772        VARIABLES
773        Qc as energy_source (Brief="Heat rate removed from condenser");
774        Qr as energy_source (Brief="Heat rate supplied to reboiler");
775        Padc as Real (Brief="Dimensionless pressure");
776        Had_top as Real (Brief="Dimensionless condenser level");
777        Had_bot as Real (Brief="Dimensionless reboiler level");
778        DF as fraction (Brief="Distillation to feed ratio");
779        RR as Real (Brief="Reflux ratio");
780       
781        SET
782        NComp = PP.NumberOfComponents;
783
784        DEVICES
785       
786        col as Distillation_kettle_cond_EffFund;
787        feed as source;
788        zero as stream;
789        LCtop as PIDIncr;
790        LCbot as PIDIncr;
791        PCcond as PIDIncr;
792       
793       
794        SET
795        col.NTrays = 8;
796        col.trays.tray_type = "Dualflow";
797       
798        CONNECTIONS
799        feed.Outlet to col.trays(4).Inlet;
800        zero to col.reb.Inlet;
801        zero to col.trays([1:3]).Inlet;
802        zero to col.trays([5:col.NTrays]).Inlet;
803        Qc.OutletQ to col.cond.InletQ;
804        Qr.OutletQ to col.reb.InletQ;
805       
806        EQUATIONS
807   
808   "Pressure Controller Cond"
809        PCcond.Parameters.tau = 0*'s'; 
810        PCcond.Parameters.tauSet = 0*'s';       
811        PCcond.Parameters.alpha = 0.3;
812        PCcond.Parameters.bias = 0.67; 
813        PCcond.Parameters.gamma = 1;
814        PCcond.Parameters.beta = 1;
815        PCcond.Options.action = 1;
816        PCcond.Options.clip = 1;
817        PCcond.Options.autoMan = 0;
818        PCcond.Parameters.intTime = 60*'s';
819        PCcond.Parameters.gain = 0.6;
820        PCcond.Parameters.derivTime = 1*'s';
821        PCcond.Ports.setPoint = (10 * 'bar' - Pcmin)/(Pcmax-Pcmin);
822        PCcond.Ports.input = Padc;
823        Padc = (col.cond.OutletL.P-Pcmin)/(Pcmax-Pcmin);
824        Qc.OutletQ.Q = Qcmin+(Qcmax-Qcmin)*PCcond.Ports.output;
825       
826        "Ttop Level Controller"
827        LCtop.Parameters.tau = 0*'s';   
828        LCtop.Parameters.tauSet = 0*'s';       
829        LCtop.Parameters.alpha = 0.3;
830        LCtop.Parameters.bias = 0.5;   
831        LCtop.Parameters.gamma = 1;
832        LCtop.Parameters.beta = 1;
833        LCtop.Options.action = -1;
834        LCtop.Options.clip = 1;
835        LCtop.Options.autoMan = 0;
836        LCtop.Parameters.intTime = 20*'min';
837        LCtop.Parameters.gain = 0.9;
838        LCtop.Parameters.derivTime = 0*'s';
839        LCtop.Ports.setPoint = (2 * 'm' - Hmint)/(Hmaxt-Hmint);
840        LCtop.Ports.input = Had_top;
841        Had_top = (col.cond.Level-Hmint)/(Hmaxt-Hmint);
842        col.sptop.Outlet2.F = Fcmin + (Fcmax-Fcmin) * LCtop.Ports.output;
843
844        "Tbottom Level Controller"
845        LCbot.Parameters.tau = 0*'s';   
846        LCbot.Parameters.tauSet = 0*'s';       
847        LCbot.Parameters.alpha = 0.3;
848        LCbot.Parameters.bias = 0.5;   
849        LCbot.Parameters.gamma = 1;
850        LCbot.Parameters.beta = 1;
851        LCbot.Options.action = -1;
852        LCbot.Options.clip = 1;
853        LCbot.Options.autoMan = 0;
854        LCbot.Parameters.intTime = 20*'min';
855        LCbot.Parameters.gain = 0.9;
856        LCbot.Parameters.derivTime = 0*'s';
857        LCbot.Ports.setPoint = (2 * 'm' - Hminb)/(Hmaxb-Hminb);
858        LCbot.Ports.input = Had_bot;
859        Had_bot = (col.reb.Level-Hminb)/(Hmaxb-Hminb);
860        col.reb.OutletL.F = Frmin + (Frmax-Frmin) * LCbot.Ports.output;
861       
862        DF = col.sptop.Outlet1.F / feed.Outlet.F;
863        RR * (col.sptop.Outlet1.F + col.cond.OutletV.F) = col.sptop.Outlet2.F;
864       
865        "Correction factor of liquid entrainment in dualflow trays"
866        col.trays.psi=1.9771*col.trays.ff-1.4857;
867        col.trays.psi1=-0.9333*col.trays.ff+0.94;
868
869        SPECIFY
870        feed.Outlet.F = 800 * 'kmol/h';
871        feed.Outlet.T = (33.1+273.15) * 'K';
872        feed.Outlet.P = 11.25 * 'bar';
873        feed.Outlet.z(1) = 0.1;
874        feed.Outlet.z(2)=0.9;
875       
876        zero.F = 0 * 'kmol/h';
877        zero.T = 300 * 'K';
878        zero.P = 1 * 'atm';
879        zero.z = 1/NComp;
880        zero.v = 0;
881        zero.h = 0 * 'J/mol';
882       
883        RR = 15;
884
885        col.cond.OutletV.F = 0 * 'kmol/h';
886        Qr.OutletQ.Q = 27582461.8 * 'W';
887        col.pump1.dP = 0.0000000001* 'kPa';
888       
889       
890        col.alfaTopo = 2;
891       
892        #col.trays.Emv = 0.75;
893
894        #para modelo de eff
895        col.trays.Dv = 4.64e-7*'m^2/s';
896        col.trays.Dl = 1.3e-8*'m^2/s';
897        col.trays.sigma=[0.00762423
898                                        0.00750252
899                                        0.00738331
900                                        0.00726649
901                                        0.00715206
902                                        0.00703969
903                                        0.00692930
904                                        0.00682079]*'N/m';
905       
906        SET
907
908        #para modelo de eff
909        #col.trays.z = 1.35*'m';
910        col.trays.d = 4.4*'m';
911        col.trays.fi= 0.2074;
912        col.trays.Ts= 0.4*'m';
913        col.trays.T= 0.0025*'m';
914        col.trays.Aa=15.205*'m^2';
915        col.trays.dh=0.009*'m';
916       
917        col.trays.V = 6.08 * 'm^3';
918        col.trays.Ah = 3.15447 * 'm^2';
919        col.trays.hw = 0.052 * 'm';
920        col.trays.lw = 1.264 * 'm';
921        col.trays.Q = 0 * 'kW';
922        col.trays.beta = 0.25;#fluxo de liquido
923        col.trays.alfa =80;#parametro de ajuste para queda de pressão
924        col.trays.Ap = 15.205 * 'm^2';
925       
926        col.cond.V = 10*6.08 * 'm^3';
927        col.cond.Across = 18 * 'm^2';
928       
929        col.reb.V = 10*6.08 * 'm^3';
930        col.reb.Across = 20 * 'm^2';
931       
932        # Controllers type
933        PCcond.PID_Select = "Ideal_AW";
934        LCtop.PID_Select = "Ideal_AW";
935        LCbot.PID_Select = "Ideal_AW";
936       
937        Frmin = 120 * 'kmol/h';
938        Frmax = 400 * 'kmol/h';
939        Fcmin = 6800 * 'kmol/h';
940        Fcmax = 7500 * 'kmol/h';
941        Hmint = 0.01 * 'm';
942        Hmaxt = 2.5 * 'm';
943        Hminb = 0.01 * 'm';
944        Hmaxb = 2.5 * 'm';
945        Pcmin = 8 * 'bar';
946        Pcmax = 12 * 'bar';
947        Qcmax = -15e6 * 'W';
948        Qcmin = -30e6 * 'W';
949
950       
951        INITIAL
952        # condenser
953        col.cond.OutletL.T = 292.473621*'K';
954        col.cond.Level = 2* 'm';
955        col.cond.OutletL.z([1]) = [0.0842132];
956
957        # reboiler
958        col.reb.OutletL.T = 299.8068 *'K';
959        col.reb.Level = 1 * 'm';
960        col.reb.OutletL.z([1]) = [0.1236802];
961
962        # column trays
963        col.trays.OutletL.T = [292.497341
964                                                293.463727
965                                                294.413253
966                                                295.346614
967                                                296.263841
968                                                297.167167
969                                                298.05727
970                                                298.934812] * 'K';
971       
972        col.trays.Level = 1 * col.trays.hw;
973        col.trays.OutletL.z([1]) = [0.08822571
974                                                                0.09221042
975                                                                0.09616891
976                                                                0.10010309
977                                                                0.1038177
978                                                                0.10781901
979                                                                0.11213108
980                                                                0.1167803];
981       
982
983        OPTIONS
984        TimeStep = 100;
985        TimeEnd = 3600;
986        TimeUnit = 's';
987        NLASolver (File="sundials");
988        DAESolver (File="mebdf", RelativeAccuracy=1e-4, AbsoluteAccuracy=1e-4);
989        InitialFile="Sample_Distillation_kettle_cond_EffFund_Dual1.rlt";
990        #Dynamic = false;       
991end
Note: See TracBrowser for help on using the repository browser.