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
RevLine 
[72]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*----------------------------------------------------------------------
[1]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";
[6]37using "mixers_splitters/mixer";
[1]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
[125]48        outer PP as Plugin;
49        outer NComp as Integer;
[1]50        NTrays as Integer(Brief="Number of trays", Default=2);
[6]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;
[1]58       
59        VARIABLES
60        trays(NTrays) as tray;
61
62        EQUATIONS
63        "Pressure Drop through the tray"
[6]64        trays([top:topdown:bot]).OutletV.F = (1 + tanh(1 *
65            (trays([top:topdown:bot]).OutletV.P -
[37]66            trays([top:topdown:bot]).InletL.P)/"Pa"))/2 *
[6]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
[1]72        CONNECTIONS
[6]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;
[1]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
[125]88        outer PP as Plugin;
89        outer NComp as Integer;
[1]90        NTrays as Integer(Brief="Number of trays", Default=2);
[6]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;
[1]98       
99        VARIABLES
100        trays(NTrays) as tray;
101        cond as condenser;
102        reb as reboiler;
[6]103        sptop as splitter;
[1]104        pump1 as pump;
105
106        EQUATIONS
107        if (reb.OutletV.P > reb.InletL.P) then
[6]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) );
[1]111        else
[6]112                "No flow in reboiler"
[1]113                reb.OutletV.F = 0.0 * "mol/s";
114        end
115
116        "Pressure Drop through the tray"
[37]117        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/"Pa"))/2 *
[6]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));
[1]120               
[6]121        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
122            (trays([top+topdown:topdown:bot]).OutletV.P -
[37]123            trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
[6]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
[1]129        CONNECTIONS
130        #vapor
[6]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       
[1]135        #liquid
[6]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;
[1]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
[125]159        outer PP as Plugin;
160        outer NComp as Integer;
[1]161        NTrays as Integer(Brief="Number of trays", Default=2);
[6]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;
[1]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
[102]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       
[1]190        "Pressure Drop through the tray"
[37]191        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/"Pa"))/2 *
[46]192                trays(top).Ah/trays(top).vV /2* sqrt(2*(trays(top).OutletV.P -
[6]193                ttop.Outlet.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
[1]194               
[6]195        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
196            (trays([top+topdown:topdown:bot]).OutletV.P -
[37]197            trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
[46]198            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV /2*
[6]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));
[1]202       
203        CONNECTIONS
204        #vapor
[6]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;
[1]208       
209        #liquid
[6]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;
[1]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
[125]235        outer PP as Plugin;
236        outer NComp as Integer;
[1]237        NTrays as Integer(Brief="Number of trays", Default=2);
[6]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;
[1]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
[6]257                "Pressure Drop through the reboiler"
258                reb.OutletV.F = trays(bot).Ah/reb.vV * sqrt((reb.OutletV.P - trays(bot).OutletL.P)
[99]259                                / (trays(bot).alfa*reb.rhoV) );
[1]260        else
[6]261                "No flow in reboiler"
[1]262                reb.OutletV.F = 0.0 * "mol/s";
263        end
264
265        "Pressure Drop through the tray"
[37]266        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/"Pa"))/2 *
[6]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));
[1]269               
[6]270        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
271            (trays([top+topdown:topdown:bot]).OutletV.P -
[37]272            trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
[6]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));
[1]277                       
278        CONNECTIONS
279        #vapor
[6]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;
[1]283       
284        #liquid
285        cond.OutletL to sptop.Inlet;   
286        sptop.Outlet2 to pump1.Inlet;
[6]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;
[1]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
[125]307        outer PP as Plugin;
308        outer NComp as Integer;
[1]309        NTrays as Integer(Brief="Number of trays", Default=2);
[6]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;
[1]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
[6]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) );
[1]331        else
[6]332                "No flow in reboiler"
[1]333                reb.OutletV.F = 0.0 * "mol/s";
334        end
335
336        "Pressure Drop through the tray"
[37]337        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/"Pa"))/2 *
[6]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));
[1]340               
[6]341        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
342            (trays([top+topdown:topdown:bot]).OutletV.P -
[37]343            trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
[6]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));
[1]348       
349        CONNECTIONS
350        #vapor
[6]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;
[1]354       
355        #liquid
[6]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;
[1]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
[125]374        outer PP as Plugin;
375        outer NComp as Integer;
[1]376        NTrays as Integer(Brief="Number of trays", Default=2);
[6]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;
[1]384       
385        VARIABLES
386        trays(NTrays) as tray;
387        cond as condenser;
[6]388        sptop as splitter;
[1]389        pump1 as pump;
390
391        EQUATIONS
392        "Pressure Drop through the tray"
[37]393        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/"Pa"))/2 *
[6]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));
[1]396               
[6]397        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
398            (trays([top+topdown:topdown:bot]).OutletV.P -
[37]399            trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
[6]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));
[1]404       
405        CONNECTIONS
406        #vapor
[6]407        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
408        trays(top).OutletV to cond.InletV;
409       
[1]410        #liquid
[6]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;
[1]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
[125]430        outer PP as Plugin;
431        outer NComp as Integer;
[1]432        NTrays as Integer(Brief="Number of trays", Default=2);
[6]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;
[1]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"
[37]450        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/"Pa"))/2 *
[6]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));
[1]453               
[6]454        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
455            (trays([top+topdown:topdown:bot]).OutletV.P -
[37]456            trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
[6]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));
[1]461       
462        CONNECTIONS
463        #vapor
[6]464        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
465        trays(top).OutletV to cond.InletV;
[1]466       
467        #liquid
[6]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;
[1]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
[125]485        outer PP as Plugin;
486        outer NComp as Integer;
[1]487        NTrays as Integer(Brief="Number of trays", Default=2);
[6]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;
[1]495       
496        VARIABLES
497        trays(NTrays) as tray;
498        cond as condenser;
[6]499        sptop as splitter;
[1]500        pump1 as pump;
501
502        EQUATIONS
503        "Pressure Drop through the tray"
[37]504        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/"Pa"))/2 *
[6]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));
[1]507               
[6]508        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
509            (trays([top+topdown:topdown:bot]).OutletV.P -
[37]510            trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
[6]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));
[1]515       
516        CONNECTIONS
517        #vapor
[6]518        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
519        trays(top).OutletV to cond.InletV;
520       
[1]521        #liquid
[6]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;
[1]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
[125]541        outer PP as Plugin;
542        outer NComp as Integer;
[1]543        NTrays as Integer(Brief="Number of trays", Default=2);
[6]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;
[1]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"
[37]561        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/"Pa"))/2 *
[6]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));
[1]564               
[6]565        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
566            (trays([top+topdown:topdown:bot]).OutletV.P -
[37]567            trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
[6]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));
[1]572       
573        CONNECTIONS
574        #vapor
[6]575        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
576        trays(top).OutletV to cond.InletV;
[1]577       
578        #liquid
[6]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;
[1]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
[125]596        outer PP as Plugin;
597        outer NComp as Integer;
[1]598        NTrays as Integer(Brief="Number of trays", Default=2);
[6]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;
[1]606       
607        VARIABLES
608        trays(NTrays) as tray;
609        cond as condenser;
[6]610        sptop as splitter;
[1]611        pump1 as pump;
612
613        EQUATIONS
614        "Pressure Drop through the tray"
[37]615        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/"Pa"))/2 *
[6]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));
[1]618               
[6]619        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
620            (trays([top+topdown:topdown:bot]).OutletV.P -
[37]621            trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
[6]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));
[1]626       
627        CONNECTIONS
628        #vapor
[6]629        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
630        trays(top).OutletV to cond.InletV;
631       
[1]632        #liquid
[6]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;
[1]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
[125]653        outer PP as Plugin;
654        outer NComp as Integer;
[1]655        NTrays as Integer(Brief="Number of trays", Default=2);
[6]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;
[1]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"
[37]673        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/"Pa"))/2 *
[6]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));
[1]676               
[6]677        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
678            (trays([top+topdown:topdown:bot]).OutletV.P -
[37]679            trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
[6]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));
[1]684       
685        CONNECTIONS
686        #vapor
[6]687        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
688        trays(top).OutletV to cond.InletV;
[1]689       
690        #liquid
[6]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;
[1]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
[125]708        outer PP as Plugin;
709        outer NComp as Integer;
[1]710        NTrays as Integer(Brief="Number of trays", Default=2);
[6]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;
[1]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"
[6]726                reb.OutletV.F = trays(bot).Ah/reb.vV * sqrt((reb.OutletV.P - trays(bot).OutletL.P)
727                                / (trays(bot).beta*reb.rhoV) );
[1]728        else
729                "Prato selado"
730                reb.OutletV.F = 0.0 * "mol/s";
731        end
732
733        "Pressure Drop through the tray"
[6]734        trays([top:topdown:bot]).OutletV.F = (1 + tanh(1 *
735            (trays([top:topdown:bot]).OutletV.P -
[37]736            trays([top:topdown:bot]).InletL.P)/"Pa"))/2 *
[6]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));
[1]741       
742        CONNECTIONS
743        #vapor
[6]744        reb.OutletV to trays(bot).InletV;
745        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
[1]746       
747        #liquid
[6]748        trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
749        trays(bot).OutletL to reb.InletL;
[1]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
[125]764        outer PP as Plugin;
765        outer NComp as Integer;
[1]766        NTrays as Integer(Brief="Number of trays", Default=2);
[6]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;
[1]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"
[6]784                reb.OutletV.F = trays(bot).Ah/reb.vV * sqrt((reb.OutletV.P - trays(bot).OutletL.P)
[99]785                                / (trays(bot).alfa*reb.rhoV) );
[1]786        else
787                "Prato selado"
788                reb.OutletV.F = 0.0 * "mol/s";
789        end
790
791        "Pressure Drop through the tray"
[6]792        trays([top:topdown:bot]).OutletV.F = (1 + tanh(1 *
793            (trays([top:topdown:bot]).OutletV.P -
[37]794            trays([top:topdown:bot]).InletL.P)/"Pa"))/2 *
[6]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));
[1]799       
800        CONNECTIONS
801        #vapor
[6]802        reb.OutletV to trays(bot).InletV;
803        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
[1]804       
805        #liquid
[6]806        trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
807        trays(bot).OutletL to tbottom.Inlet;
[1]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
[125]822        outer PP as Plugin;
823        outer NComp as Integer;
[1]824        NTrays as Integer(Brief="Number of trays", Default=2);
[6]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;
[1]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"
[6]840                reb.OutletV.F = trays(bot).Ah/reb.vV * sqrt((reb.OutletV.P - trays(bot).OutletL.P)
[37]841                                / (trays(bot).beta*reb.rhoV) );
[1]842        else
843                "Prato selado"
844                reb.OutletV.F = 0.0 * "mol/s";
845        end
846
847        "Pressure Drop through the tray"
[6]848        trays([top:topdown:bot]).OutletV.F = (1 + tanh(1 *
849            (trays([top:topdown:bot]).OutletV.P -
[37]850            trays([top:topdown:bot]).InletL.P)/"Pa"))/2 *
[6]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));
[1]855       
856        CONNECTIONS
857        #vapor
[6]858        reb.OutletV to trays(bot).InletV;
859        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
[1]860       
861        #liquid
[6]862        trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
863        trays(bot).OutletL to reb.InletL;
[1]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
[125]878        outer PP as Plugin;
879        outer NComp as Integer;
[1]880        NTrays as Integer(Brief="Number of trays", Default=2);
[6]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;
[1]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"
[6]898                reb.OutletV.F = trays(bot).Ah/reb.vV * sqrt((reb.OutletV.P - trays(bot).OutletL.P)
[99]899                                / (trays(bot).alfa*reb.rhoV) );
[1]900        else
901                "Prato selado"
902                reb.OutletV.F = 0.0 * "mol/s";
903        end
904
905        "Pressure Drop through the tray"
[6]906        trays([top:topdown:bot]).OutletV.F = (1 + tanh(1 *
907            (trays([top:topdown:bot]).OutletV.P -
[37]908            trays([top:topdown:bot]).InletL.P)/"Pa"))/2 *
[6]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));
[1]913       
914        CONNECTIONS
915        #vapor
[6]916        reb.OutletV to trays(bot).InletV;
917        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
[1]918       
919        #liquid
[6]920        trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
921        trays(bot).OutletL to tbottom.Inlet;
[1]922        tbottom.Outlet to spbottom.Inlet;
923        spbottom.Outlet2 to reb.InletL;
924end
[38]925
[72]926#* -------------------------------------------------------------------
927*  Reactive Distillation Column
928*
929* ------------------------------------------------------------------*#
[38]930Model ReactiveDistillation
931        PARAMETERS
[125]932        outer PP as Plugin;
933        outer NComp as Integer;
[38]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.