source: branches/newlanguage/eml/stage_separators/column.mso @ 125

Last change on this file since 125 was 125, checked in by Rafael de Pelegrini Soares, 15 years ago

Updated some models for the new language proposal

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 31.3 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* File containg models of columns: distillation, stripping, absorbers
17* rectifier, ....
18*
19* The default nomenclature is:
20*               Type_Column_reboilertype_condensertyper
21*
22* where:
23*       Type = refluxed or reboiled or section
24*       Column = Stripping, Absorption, Rectifier, Distillation
25*       Reboiler type (if exists) = kettle or thermosyphon
26*       Condenser type (if exists) = with subccoling or without subcooling
27*
28*-----------------------------------------------------------------------
29* Author: Paula B. Staudt
30* $Id: column.mso 125 2007-01-22 19:57:16Z rafael $
31*---------------------------------------------------------------------*#
32
33using "tray";
34using "reboiler";
35using "condenser";
36using "mixers_splitters/splitter";
37using "mixers_splitters/mixer";
38using "tank";
39using "pressure_changers/pump";
40
41#*----------------------------------------------------------------------
42* Model of a  column section with:
43*       - NTrays=number of trays trays.
44*
45*---------------------------------------------------------------------*#
46Model Section_Column
47        PARAMETERS
48        outer PP as Plugin;
49        outer NComp as Integer;
50        NTrays as Integer(Brief="Number of trays", Default=2);
51        topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
52        top as Integer(Brief="Number of top tray");
53        bot as Integer(Brief="Number of bottom tray");
54
55        SET
56        top = (NTrays-1)*(1-topdown)/2+1;
57        bot = NTrays/top;
58       
59        VARIABLES
60        trays(NTrays) as tray;
61
62        EQUATIONS
63        "Pressure Drop through the tray"
64        trays([top:topdown:bot]).OutletV.F = (1 + tanh(1 *
65            (trays([top:topdown:bot]).OutletV.P -
66            trays([top:topdown:bot]).InletL.P)/"Pa"))/2 *
67            trays([top:topdown:bot]).Ah/trays([top:topdown:bot]).vV *
68            sqrt(2*(trays([top:topdown:bot]).OutletV.P -
69                trays([top:topdown:bot]).InletL.P + 1e-8 * "atm") /
70            (trays([top:topdown:bot]).alfa*trays([top:topdown:bot]).rhoV));
71
72        CONNECTIONS
73        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
74        trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
75end
76
77
78#*----------------------------------------------------------------------
79* Model of a  distillation column containing:
80*       - NTrays like tray;
81*       - a kettle reboiler;
82*       - dymamic condenser;
83*       - a splitter which separate reflux and distillate;
84*       - a pump in reflux stream;
85*---------------------------------------------------------------------*#
86Model Distillation_kettle_cond
87        PARAMETERS
88        outer PP as Plugin;
89        outer NComp as Integer;
90        NTrays as Integer(Brief="Number of trays", Default=2);
91        topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
92        top as Integer(Brief="Number of top tray");
93        bot as Integer(Brief="Number of bottom tray");
94
95        SET
96        top = (NTrays-1)*(1-topdown)/2+1;
97        bot = NTrays/top;
98       
99        VARIABLES
100        trays(NTrays) as tray;
101        cond as condenser;
102        reb as reboiler;
103        sptop as splitter;
104        pump1 as pump;
105
106        EQUATIONS
107        if (reb.OutletV.P > reb.InletL.P) then
108                "Pressure Drop through the reboiler"
109                reb.OutletV.F = trays(bot).Ah/reb.vV * sqrt((reb.OutletV.P - trays(bot).OutletL.P)
110                                / (trays(bot).beta*reb.rhoV) );
111        else
112                "No flow in reboiler"
113                reb.OutletV.F = 0.0 * "mol/s";
114        end
115
116        "Pressure Drop through the tray"
117        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/"Pa"))/2 *
118                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
119                cond.OutletL.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
120               
121        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
122            (trays([top+topdown:topdown:bot]).OutletV.P -
123            trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
124            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
125            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
126                trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * "atm") /
127            (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV));
128
129        CONNECTIONS
130        #vapor
131        reb.OutletV to trays(bot).InletV;
132        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
133        trays(top).OutletV to cond.InletV;
134       
135        #liquid
136        cond.OutletL to sptop.Inlet;   
137        sptop.Outlet2 to pump1.Inlet;
138        pump1.Outlet to trays(top).InletL;
139        trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
140        trays(bot).OutletL to reb.InletL;
141end
142
143
144#* -------------------------------------------------------------------
145* Distillation Column model with:
146*
147*       - NTrays like tray;
148*       - a vessel in the bottom of column;
149*       - a splitter who separate the bottom product and the stream to reboiler;
150*       - steady state reboiler (thermosyphon);
151*       - a steady state condenser with subcooling;
152*       - a vessel drum (layed cilinder);
153*       - a splitter which separate reflux and distillate;
154*       - a pump in reflux stream.
155*
156* ------------------------------------------------------------------*#
157Model Distillation_thermosyphon_subcooling
158        PARAMETERS
159        outer PP as Plugin;
160        outer NComp as Integer;
161        NTrays as Integer(Brief="Number of trays", Default=2);
162        topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
163        top as Integer(Brief="Number of top tray");
164        bot as Integer(Brief="Number of bottom tray");
165
166        SET
167        top = (NTrays-1)*(1-topdown)/2+1;
168        bot = NTrays/top;
169       
170        VARIABLES
171        trays(NTrays) as tray;
172        cond as condenserSteady;
173        reb as reboilerSteady;
174        tbottom as tank;
175        ttop as tank_cylindrical;
176        spbottom as splitter;
177        sptop as splitter;
178        pump1 as pump;
179
180        EQUATIONS
181        if (reb.OutletV.P > reb.InletL.P) then
182                "Pressure Drop through the reboiler"
183                reb.OutletV.F = trays(bot).Ah/reb.vV * sqrt((reb.OutletV.P - trays(bot).OutletL.P)
184                                / (trays(bot).alfa*reb.rhoV) );
185        else
186                "No flow in reboiler"
187                reb.OutletV.F = 0.0 * "mol/s";
188        end     
189       
190        "Pressure Drop through the tray"
191        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/"Pa"))/2 *
192                trays(top).Ah/trays(top).vV /2* sqrt(2*(trays(top).OutletV.P -
193                ttop.Outlet.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
194               
195        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
196            (trays([top+topdown:topdown:bot]).OutletV.P -
197            trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
198            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV /2*
199            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
200                trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * "atm") /
201            (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV));
202       
203        CONNECTIONS
204        #vapor
205        reb.OutletV to trays(bot).InletV;
206        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
207        trays(top).OutletV to cond.InletV;
208       
209        #liquid
210        cond.OutletL to ttop.Inlet;     
211        ttop.Outlet to sptop.Inlet;
212        sptop.Outlet2 to pump1.Inlet;   
213        pump1.Outlet to trays(top).InletL;
214        trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
215        trays(bot).OutletL to tbottom.Inlet;
216        tbottom.Outlet to spbottom.Inlet;
217        spbottom.Outlet2 to reb.InletL;
218end
219
220
221#* -------------------------------------------------------------------
222* Distillation Column model with:
223*
224*       - NTrays like tray;
225*       - a vessel in the bottom of column;
226*       - a splitter who separate the bottom product and the stream to reboiler;
227*       - steady state reboiler (thermosyphon);
228*       - a dynamic condenser without subcooling;
229*       - a splitter which separate reflux and distillate;
230*       - a pump in reflux stream.
231*
232* ------------------------------------------------------------------*#
233Model Distillation_thermosyphon_cond
234        PARAMETERS
235        outer PP as Plugin;
236        outer NComp as Integer;
237        NTrays as Integer(Brief="Number of trays", Default=2);
238        topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
239        top as Integer(Brief="Number of top tray");
240        bot as Integer(Brief="Number of bottom tray");
241
242        SET
243        top = (NTrays-1)*(1-topdown)/2+1;
244        bot = NTrays/top;
245       
246        VARIABLES
247        trays(NTrays) as tray;
248        cond as condenser;
249        reb as reboilerSteady;
250        tbottom as tank;
251        spbottom as splitter;
252        sptop as splitter;
253        pump1 as pump;
254
255        EQUATIONS
256        if (reb.OutletV.P > reb.InletL.P) then
257                "Pressure Drop through the reboiler"
258                reb.OutletV.F = trays(bot).Ah/reb.vV * sqrt((reb.OutletV.P - trays(bot).OutletL.P)
259                                / (trays(bot).alfa*reb.rhoV) );
260        else
261                "No flow in reboiler"
262                reb.OutletV.F = 0.0 * "mol/s";
263        end
264
265        "Pressure Drop through the tray"
266        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/"Pa"))/2 *
267                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
268                cond.OutletL.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
269               
270        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
271            (trays([top+topdown:topdown:bot]).OutletV.P -
272            trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
273            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
274            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
275                trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * "atm") /
276            (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV));
277                       
278        CONNECTIONS
279        #vapor
280        reb.OutletV to trays(bot).InletV;
281        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
282        trays(top).OutletV to cond.InletV;
283       
284        #liquid
285        cond.OutletL to sptop.Inlet;   
286        sptop.Outlet2 to pump1.Inlet;
287        pump1.Outlet to trays(top).InletL;
288        trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
289        trays(bot).OutletL to tbottom.Inlet;
290        tbottom.Outlet to spbottom.Inlet;
291        spbottom.Outlet2 to reb.InletL;
292end
293
294#* -------------------------------------------------------------------
295* Distillation Column model with:
296*
297*       - NTrays like tray;
298*       - a kettle reboiler;
299*       - a steady state condenser with subcooling;
300*       - a vessel drum (layed cilinder);
301*       - a splitter which separate reflux and distillate;
302*       - a pump in reflux stream.
303*
304* ------------------------------------------------------------------*#
305Model Distillation_kettle_subcooling
306        PARAMETERS
307        outer PP as Plugin;
308        outer NComp as Integer;
309        NTrays as Integer(Brief="Number of trays", Default=2);
310        topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
311        top as Integer(Brief="Number of top tray");
312        bot as Integer(Brief="Number of bottom tray");
313
314        SET
315        top = (NTrays-1)*(1-topdown)/2+1;
316        bot = NTrays/top;
317       
318        VARIABLES
319        trays(NTrays) as tray;
320        cond as condenserSteady;
321        reb as reboiler;
322        ttop as tank_cylindrical;
323        sptop as splitter;
324        pump1 as pump;
325
326        EQUATIONS
327        if (reb.OutletV.P > reb.InletL.P) then
328                "Pressure Drop through the reboiler"
329                reb.OutletV.F = trays(bot).Ah/reb.vV * sqrt((reb.OutletV.P - trays(bot).OutletL.P)
330                                / (trays(bot).beta*reb.rhoV) );
331        else
332                "No flow in reboiler"
333                reb.OutletV.F = 0.0 * "mol/s";
334        end
335
336        "Pressure Drop through the tray"
337        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/"Pa"))/2 *
338                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
339                ttop.Outlet.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
340               
341        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
342            (trays([top+topdown:topdown:bot]).OutletV.P -
343            trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
344            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
345            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
346                trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * "atm") /
347            (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV));
348       
349        CONNECTIONS
350        #vapor
351        reb.OutletV to trays(bot).InletV;
352        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
353        trays(top).OutletV to cond.InletV;
354       
355        #liquid
356        cond.OutletL to ttop.Inlet;     
357        ttop.Outlet to sptop.Inlet;
358        sptop.Outlet2 to pump1.Inlet;   
359        pump1.Outlet to trays(top).InletL;
360        trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
361        trays(bot).OutletL to reb.InletL;
362end
363
364
365#*----------------------------------------------------------------------
366* Model of a  rectifier containing:
367*       - NTrays like tray;
368*       - dymamic condenser without subcooling;
369*       - a splitter which separate reflux and distillate;
370*       - a pump in reflux stream;
371*---------------------------------------------------------------------*#
372Model Rectifier
373        PARAMETERS
374        outer PP as Plugin;
375        outer NComp as Integer;
376        NTrays as Integer(Brief="Number of trays", Default=2);
377        topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
378        top as Integer(Brief="Number of top tray");
379        bot as Integer(Brief="Number of bottom tray");
380
381        SET
382        top = (NTrays-1)*(1-topdown)/2+1;
383        bot = NTrays/top;
384       
385        VARIABLES
386        trays(NTrays) as tray;
387        cond as condenser;
388        sptop as splitter;
389        pump1 as pump;
390
391        EQUATIONS
392        "Pressure Drop through the tray"
393        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/"Pa"))/2 *
394                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
395                cond.OutletL.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
396               
397        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
398            (trays([top+topdown:topdown:bot]).OutletV.P -
399            trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
400            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
401            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
402                trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * "atm") /
403            (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV));
404       
405        CONNECTIONS
406        #vapor
407        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
408        trays(top).OutletV to cond.InletV;
409       
410        #liquid
411        cond.OutletL to sptop.Inlet;   
412        sptop.Outlet2 to pump1.Inlet;   
413        pump1.Outlet to trays(top).InletL;
414        trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
415end
416
417
418#* -------------------------------------------------------------------
419* Rectifier Column with:
420*
421*       - NTrays like tray;
422*       - a steady state condenser with subcooling;
423*       - a vessel drum (layed cilinder);
424*       - a splitter which separate reflux and distillate;
425*       - a pump in reflux stream.
426*
427* ------------------------------------------------------------------*#
428Model Rectifier_subcooling
429        PARAMETERS
430        outer PP as Plugin;
431        outer NComp as Integer;
432        NTrays as Integer(Brief="Number of trays", Default=2);
433        topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
434        top as Integer(Brief="Number of top tray");
435        bot as Integer(Brief="Number of bottom tray");
436
437        SET
438        top = (NTrays-1)*(1-topdown)/2+1;
439        bot = NTrays/top;
440       
441        VARIABLES
442        trays(NTrays) as tray;
443        cond as condenserSteady;
444        ttop as tank_cylindrical;
445        sptop as splitter;
446        pump1 as pump;
447
448        EQUATIONS
449        "Pressure Drop through the tray"
450        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/"Pa"))/2 *
451                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
452                ttop.Outlet.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
453               
454        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
455            (trays([top+topdown:topdown:bot]).OutletV.P -
456            trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
457            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
458            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
459                trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * "atm") /
460            (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV));
461       
462        CONNECTIONS
463        #vapor
464        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
465        trays(top).OutletV to cond.InletV;
466       
467        #liquid
468        cond.OutletL to ttop.Inlet;     
469        ttop.Outlet to sptop.Inlet;
470        sptop.Outlet2 to pump1.Inlet;   
471        pump1.Outlet to trays(top).InletL;
472        trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
473end
474
475
476#*----------------------------------------------------------------------
477* Model of a  Refluxed Stripping column containing:
478*       - NTrays like tray;
479*       - dymamic condenser without subcooling;
480*       - a splitter which separate reflux and distillate;
481*       - a pump in reflux stream;
482*---------------------------------------------------------------------*#
483Model Refluxed_Stripping
484        PARAMETERS
485        outer PP as Plugin;
486        outer NComp as Integer;
487        NTrays as Integer(Brief="Number of trays", Default=2);
488        topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
489        top as Integer(Brief="Number of top tray");
490        bot as Integer(Brief="Number of bottom tray");
491
492        SET
493        top = (NTrays-1)*(1-topdown)/2+1;
494        bot = NTrays/top;
495       
496        VARIABLES
497        trays(NTrays) as tray;
498        cond as condenser;
499        sptop as splitter;
500        pump1 as pump;
501
502        EQUATIONS
503        "Pressure Drop through the tray"
504        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/"Pa"))/2 *
505                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
506                cond.OutletL.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
507               
508        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
509            (trays([top+topdown:topdown:bot]).OutletV.P -
510            trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
511            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
512            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
513                trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * "atm") /
514            (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV));
515       
516        CONNECTIONS
517        #vapor
518        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
519        trays(top).OutletV to cond.InletV;
520       
521        #liquid
522        cond.OutletL to sptop.Inlet;   
523        sptop.Outlet2 to pump1.Inlet;   
524        pump1.Outlet to trays(top).InletL;
525        trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
526end
527
528
529#* -------------------------------------------------------------------
530* Refluxed Stripping Column with:
531*
532*       - NTrays like tray;
533*       - a steady state condenser (with subcooling);
534*       - a vessel drum (layed cilinder);
535*       - a splitter which separate reflux and distillate;
536*       - a pump in reflux stream.
537*
538* ------------------------------------------------------------------*#
539Model Refluxed_Stripping_subcooling
540        PARAMETERS
541        outer PP as Plugin;
542        outer NComp as Integer;
543        NTrays as Integer(Brief="Number of trays", Default=2);
544        topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
545        top as Integer(Brief="Number of top tray");
546        bot as Integer(Brief="Number of bottom tray");
547
548        SET
549        top = (NTrays-1)*(1-topdown)/2+1;
550        bot = NTrays/top;
551       
552        VARIABLES
553        trays(NTrays) as tray;
554        cond as condenserSteady;
555        ttop as tank_cylindrical;
556        sptop as splitter;
557        pump1 as pump;
558
559        EQUATIONS
560        "Pressure Drop through the tray"
561        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/"Pa"))/2 *
562                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
563                ttop.Outlet.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
564               
565        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
566            (trays([top+topdown:topdown:bot]).OutletV.P -
567            trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
568            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
569            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
570                trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * "atm") /
571            (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV));
572       
573        CONNECTIONS
574        #vapor
575        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
576        trays(top).OutletV to cond.InletV;
577       
578        #liquid
579        cond.OutletL to ttop.Inlet;     
580        ttop.Outlet to sptop.Inlet;
581        sptop.Outlet2 to pump1.Inlet;   
582        pump1.Outlet to trays(top).InletL;
583        trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
584end
585
586
587#*----------------------------------------------------------------------
588* Model of a  Refluxed Absorption column containing:
589*       - NTrays like tray;
590*       - dymamic condenser without subcooling;
591*       - a splitter which separate reflux and distillate;
592*       - a pump in reflux stream;
593*---------------------------------------------------------------------*#
594Model Refluxed_Absorption
595        PARAMETERS
596        outer PP as Plugin;
597        outer NComp as Integer;
598        NTrays as Integer(Brief="Number of trays", Default=2);
599        topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
600        top as Integer(Brief="Number of top tray");
601        bot as Integer(Brief="Number of bottom tray");
602
603        SET
604        top = (NTrays-1)*(1-topdown)/2+1;
605        bot = NTrays/top;
606       
607        VARIABLES
608        trays(NTrays) as tray;
609        cond as condenser;
610        sptop as splitter;
611        pump1 as pump;
612
613        EQUATIONS
614        "Pressure Drop through the tray"
615        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/"Pa"))/2 *
616                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
617                cond.OutletL.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
618               
619        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
620            (trays([top+topdown:topdown:bot]).OutletV.P -
621            trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
622            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
623            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
624                trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * "atm") /
625            (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV));
626       
627        CONNECTIONS
628        #vapor
629        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
630        trays(top).OutletV to cond.InletV;
631       
632        #liquid
633        cond.OutletL to cond.InletV;   
634        cond.OutletL to sptop.Inlet;
635        sptop.Outlet2 to pump1.Inlet;   
636        pump1.Outlet to trays(top).InletL;
637        trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
638end
639
640
641#* -------------------------------------------------------------------
642* Refluxed Absorption Column with:
643*
644*       - NTrays like tray;
645*       - a steady state condenser (with subcooling);
646*       - a vessel drum (layed cilinder);
647*       - a splitter which separate reflux and distillate;
648*       - a pump in reflux stream.
649*
650* ------------------------------------------------------------------*#
651Model Refluxed_Absorption_subcooling
652        PARAMETERS
653        outer PP as Plugin;
654        outer NComp as Integer;
655        NTrays as Integer(Brief="Number of trays", Default=2);
656        topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
657        top as Integer(Brief="Number of top tray");
658        bot as Integer(Brief="Number of bottom tray");
659
660        SET
661        top = (NTrays-1)*(1-topdown)/2+1;
662        bot = NTrays/top;
663       
664        VARIABLES
665        trays(NTrays) as tray;
666        cond as condenserSteady;
667        ttop as tank_cylindrical;
668        sptop as splitter;
669        pump1 as pump;
670
671        EQUATIONS
672        "Pressure Drop through the tray"
673        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/"Pa"))/2 *
674                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
675                ttop.Outlet.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
676               
677        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
678            (trays([top+topdown:topdown:bot]).OutletV.P -
679            trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
680            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
681            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
682                trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * "atm") /
683            (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV));
684       
685        CONNECTIONS
686        #vapor
687        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
688        trays(top).OutletV to cond.InletV;
689       
690        #liquid
691        cond.OutletL to ttop.Inlet;     
692        ttop.Outlet to sptop.Inlet;
693        sptop.Outlet2 to pump1.Inlet;   
694        pump1.Outlet to trays(top).InletL;
695        trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
696end
697
698
699#* -------------------------------------------------------------------
700* Reboiled Stripping Column model with:
701*
702*       - NTrays like tray;
703*       - a kettle reboiler;
704*
705* ------------------------------------------------------------------*#
706Model Reboiled_Stripping_kettle
707        PARAMETERS
708        outer PP as Plugin;
709        outer NComp as Integer;
710        NTrays as Integer(Brief="Number of trays", Default=2);
711        topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
712        top as Integer(Brief="Number of top tray");
713        bot as Integer(Brief="Number of bottom tray");
714
715        SET
716        top = (NTrays-1)*(1-topdown)/2+1;
717        bot = NTrays/top;
718       
719        VARIABLES
720        trays(NTrays) as tray;
721        reb as reboiler;
722
723        EQUATIONS
724        if (reb.OutletV.P > reb.InletL.P) then
725                "Pressure Drop through the tray"
726                reb.OutletV.F = trays(bot).Ah/reb.vV * sqrt((reb.OutletV.P - trays(bot).OutletL.P)
727                                / (trays(bot).beta*reb.rhoV) );
728        else
729                "Prato selado"
730                reb.OutletV.F = 0.0 * "mol/s";
731        end
732
733        "Pressure Drop through the tray"
734        trays([top:topdown:bot]).OutletV.F = (1 + tanh(1 *
735            (trays([top:topdown:bot]).OutletV.P -
736            trays([top:topdown:bot]).InletL.P)/"Pa"))/2 *
737            trays([top:topdown:bot]).Ah/trays([top:topdown:bot]).vV *
738            sqrt(2*(trays([top:topdown:bot]).OutletV.P -
739                trays([top:topdown:bot]).InletL.P + 1e-8 * "atm") /
740            (trays([top:topdown:bot]).alfa*trays([top:topdown:bot]).rhoV));
741       
742        CONNECTIONS
743        #vapor
744        reb.OutletV to trays(bot).InletV;
745        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
746       
747        #liquid
748        trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
749        trays(bot).OutletL to reb.InletL;
750end
751
752
753#* -------------------------------------------------------------------
754* Reboiled Stripping Column model with:
755*
756*       - NTrays like tray;
757*       - a vessel in the bottom of column;
758*       - a splitter which separate the bottom product and the stream to reboiler;
759*       - steady state reboiler (thermosyphon);
760*
761* ------------------------------------------------------------------*#
762Model Reboiled_Stripping_thermosyphon
763        PARAMETERS
764        outer PP as Plugin;
765        outer NComp as Integer;
766        NTrays as Integer(Brief="Number of trays", Default=2);
767        topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
768        top as Integer(Brief="Number of top tray");
769        bot as Integer(Brief="Number of bottom tray");
770
771        SET
772        top = (NTrays-1)*(1-topdown)/2+1;
773        bot = NTrays/top;
774       
775        VARIABLES
776        trays(NTrays) as tray;
777        reb as reboilerSteady;
778        spbottom as splitter;
779        tbottom as tank;
780
781        EQUATIONS
782        if (reb.OutletV.P > reb.InletL.P) then
783                "Pressure Drop through the tray"
784                reb.OutletV.F = trays(bot).Ah/reb.vV * sqrt((reb.OutletV.P - trays(bot).OutletL.P)
785                                / (trays(bot).alfa*reb.rhoV) );
786        else
787                "Prato selado"
788                reb.OutletV.F = 0.0 * "mol/s";
789        end
790
791        "Pressure Drop through the tray"
792        trays([top:topdown:bot]).OutletV.F = (1 + tanh(1 *
793            (trays([top:topdown:bot]).OutletV.P -
794            trays([top:topdown:bot]).InletL.P)/"Pa"))/2 *
795            trays([top:topdown:bot]).Ah/trays([top:topdown:bot]).vV *
796            sqrt(2*(trays([top:topdown:bot]).OutletV.P -
797                trays([top:topdown:bot]).InletL.P + 1e-8 * "atm") /
798            (trays([top:topdown:bot]).alfa*trays([top:topdown:bot]).rhoV));
799       
800        CONNECTIONS
801        #vapor
802        reb.OutletV to trays(bot).InletV;
803        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
804       
805        #liquid
806        trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
807        trays(bot).OutletL to tbottom.Inlet;
808        tbottom.Outlet to spbottom.Inlet;
809        spbottom.Outlet2 to reb.InletL;
810end
811
812
813#* -------------------------------------------------------------------
814* Reboiled Absorption Column model with:
815*
816*       - NTrays like tray;
817*       - a kettle reboiler;
818*
819* ------------------------------------------------------------------*#
820Model Reboiled_Absorption_kettle
821        PARAMETERS
822        outer PP as Plugin;
823        outer NComp as Integer;
824        NTrays as Integer(Brief="Number of trays", Default=2);
825        topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
826        top as Integer(Brief="Number of top tray");
827        bot as Integer(Brief="Number of bottom tray");
828
829        SET
830        top = (NTrays-1)*(1-topdown)/2+1;
831        bot = NTrays/top;
832       
833        VARIABLES
834        trays(NTrays) as tray;
835        reb as reboiler;
836
837        EQUATIONS
838        if (reb.OutletV.P > reb.InletL.P) then
839                "Pressure Drop through the tray"
840                reb.OutletV.F = trays(bot).Ah/reb.vV * sqrt((reb.OutletV.P - trays(bot).OutletL.P)
841                                / (trays(bot).beta*reb.rhoV) );
842        else
843                "Prato selado"
844                reb.OutletV.F = 0.0 * "mol/s";
845        end
846
847        "Pressure Drop through the tray"
848        trays([top:topdown:bot]).OutletV.F = (1 + tanh(1 *
849            (trays([top:topdown:bot]).OutletV.P -
850            trays([top:topdown:bot]).InletL.P)/"Pa"))/2 *
851            trays([top:topdown:bot]).Ah/trays([top:topdown:bot]).vV *
852            sqrt(2*(trays([top:topdown:bot]).OutletV.P -
853                trays([top:topdown:bot]).InletL.P + 1e-8 * "atm") /
854            (trays([top:topdown:bot]).alfa*trays([top:topdown:bot]).rhoV));
855       
856        CONNECTIONS
857        #vapor
858        reb.OutletV to trays(bot).InletV;
859        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
860       
861        #liquid
862        trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
863        trays(bot).OutletL to reb.InletL;
864end
865
866
867#* -------------------------------------------------------------------
868* Reboiled Absorption Column model with:
869*
870*       - NTrays like tray;
871*       - a vessel in the bottom of column;
872*       - a splitter which separate the bottom product and the stream to reboiler;
873*       - steady state reboiler (thermosyphon);
874*
875* ------------------------------------------------------------------*#
876Model Reboiled_Absorption_thermosyphon
877        PARAMETERS
878        outer PP as Plugin;
879        outer NComp as Integer;
880        NTrays as Integer(Brief="Number of trays", Default=2);
881        topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
882        top as Integer(Brief="Number of top tray");
883        bot as Integer(Brief="Number of bottom tray");
884
885        SET
886        top = (NTrays-1)*(1-topdown)/2+1;
887        bot = NTrays/top;
888       
889        VARIABLES
890        trays(NTrays) as tray;
891        reb as reboilerSteady;
892        spbottom as splitter;
893        tbottom as tank;
894
895        EQUATIONS
896        if (reb.OutletV.P > reb.InletL.P) then
897                "Pressure Drop through the tray"
898                reb.OutletV.F = trays(bot).Ah/reb.vV * sqrt((reb.OutletV.P - trays(bot).OutletL.P)
899                                / (trays(bot).alfa*reb.rhoV) );
900        else
901                "Prato selado"
902                reb.OutletV.F = 0.0 * "mol/s";
903        end
904
905        "Pressure Drop through the tray"
906        trays([top:topdown:bot]).OutletV.F = (1 + tanh(1 *
907            (trays([top:topdown:bot]).OutletV.P -
908            trays([top:topdown:bot]).InletL.P)/"Pa"))/2 *
909            trays([top:topdown:bot]).Ah/trays([top:topdown:bot]).vV *
910            sqrt(2*(trays([top:topdown:bot]).OutletV.P -
911                trays([top:topdown:bot]).InletL.P + 1e-8 * "atm") /
912            (trays([top:topdown:bot]).alfa*trays([top:topdown:bot]).rhoV));
913       
914        CONNECTIONS
915        #vapor
916        reb.OutletV to trays(bot).InletV;
917        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
918       
919        #liquid
920        trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
921        trays(bot).OutletL to tbottom.Inlet;
922        tbottom.Outlet to spbottom.Inlet;
923        spbottom.Outlet2 to reb.InletL;
924end
925
926#* -------------------------------------------------------------------
927*  Reactive Distillation Column
928*
929* ------------------------------------------------------------------*#
930Model ReactiveDistillation
931        PARAMETERS
932        outer PP as Plugin;
933        outer NComp as Integer;
934        NTrays as Integer(Brief="Number of trays", Default=2);
935       
936        VARIABLES
937        trays(NTrays) as trayReact;
938        cond as condenserReact;
939        reb as reboilerReact;
940        sp as splitter;
941        p as pump;
942       
943        EQUATIONS
944        if ( reb.OutletV.P > 1 * "atm" ) then
945                "Pressure Drop through the tray"
946                reb.OutletV.F = trays(1).Ah/reb.vV * sqrt((reb.OutletV.P - 1*"atm") / (0.15*reb.rhoV) );
947        else
948                "Prato selado"
949                reb.OutletV.F = 0.0 * "mol/s";
950        end
951       
952        CONNECTIONS
953        #vapor
954        reb.OutletV to trays([NTrays]).InletV;
955        trays([2:NTrays]).OutletV to trays([1:NTrays-1]).InletV;
956        trays(1).OutletV to cond.InletV;
957
958        #liquid
959        cond.OutletL to sp.Inlet;       
960        sp.Outlet2 to p.Inlet;
961        p.Outlet to trays(1).InletL;
962        trays([1:NTrays-1]).OutletL to trays([2:NTrays]).InletL;
963        trays(NTrays).OutletL to reb.InletL;
964end
Note: See TracBrowser for help on using the repository browser.