source: trunk/eml/stage_separators/column.mso @ 353

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

Fixing some wiki notation.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 46.0 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 353 2007-08-30 16:12:27Z arge $
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:
[262]43*       - NTrays=number of trays.
[1]44*
45*---------------------------------------------------------------------*#
46Model Section_Column
[262]47        ATTRIBUTES
48        Pallete         = true;
[300]49        Icon            = "icon/SectionColumn";
[262]50        Brief           = "Model of a column section.";
51        Info            =
[353]52"== Model of a column section containing ==
53* NTrays trays.
[262]54       
[353]55== Specify ==
56* the feed stream of each tray (Inlet);
57* the Murphree eficiency for each tray Emv;
58* the InletL stream of the top tray;
59* the InletV stream of the bottom tray.
[262]60       
[353]61== Initial Conditions ==
62* the trays temperature (OutletL.T);
63* the trays liquid level (Level) OR the trays liquid flow (OutletL.F);
64* (NoComps - 1) OutletL (OR OutletV) compositions for each tray.
65";
[262]66       
[1]67        PARAMETERS
[210]68        outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
[125]69        outer NComp as Integer;
[1]70        NTrays as Integer(Brief="Number of trays", Default=2);
[6]71        topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
72        top as Integer(Brief="Number of top tray");
73        bot as Integer(Brief="Number of bottom tray");
74
75        SET
76        top = (NTrays-1)*(1-topdown)/2+1;
77        bot = NTrays/top;
[1]78       
79        VARIABLES
80        trays(NTrays) as tray;
81
82        EQUATIONS
83        "Pressure Drop through the tray"
[6]84        trays([top:topdown:bot]).OutletV.F = (1 + tanh(1 *
85            (trays([top:topdown:bot]).OutletV.P -
[176]86            trays([top:topdown:bot]).InletL.P)/'Pa'))/2 *
[6]87            trays([top:topdown:bot]).Ah/trays([top:topdown:bot]).vV *
88            sqrt(2*(trays([top:topdown:bot]).OutletV.P -
[176]89                trays([top:topdown:bot]).InletL.P + 1e-8 * 'atm') /
[6]90            (trays([top:topdown:bot]).alfa*trays([top:topdown:bot]).rhoV));
91
[1]92        CONNECTIONS
[6]93        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
94        trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
[1]95end
96
97
98#*----------------------------------------------------------------------
99* Model of a  distillation column containing:
100*       - NTrays like tray;
101*       - a kettle reboiler;
102*       - dymamic condenser;
103*       - a splitter which separate reflux and distillate;
104*       - a pump in reflux stream;
105*---------------------------------------------------------------------*#
106Model Distillation_kettle_cond
[262]107        ATTRIBUTES
108        Pallete         = true;
[300]109        Icon            = "icon/DistillationKettleCond";
[262]110        Brief           = "Model of a distillation column with dynamic condenser and dynamic reboiler.";
111        Info            =
[353]112"== Specify ==
113* the feed stream of each tray (Inlet);
114* the Murphree eficiency for each tray Emv;
115* the pump pressure difference;
116* the heat supllied in reboiler and condenser;
117* the condenser vapor outlet flow (OutletV.F);
118* the reboiler liquid outlet flow (OutletL.F);
119* both splitter outlet flows OR one of the splitter outlet flows and the splitter frac.
[262]120       
[353]121== Initial Conditions ==
122* the trays temperature (OutletL.T);
123* the trays liquid level (Level) OR the trays liquid flow (OutletL.F);
124* (NoComps - 1) OutletL (OR OutletV) compositions for each tray;
[262]125       
[353]126* the condenser temperature (OutletL.T);
127* the condenser liquid level (Level);
128* (NoComps - 1) OutletL (OR OutletV) compositions;
[262]129       
[353]130* the reboiler temperature (OutletL.T);
131* the reboiler liquid level (Level);
132* (NoComps - 1) OutletL (OR OutletV) compositions.
133";
[262]134       
[1]135        PARAMETERS
[210]136        outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
[125]137        outer NComp as Integer;
[1]138        NTrays as Integer(Brief="Number of trays", Default=2);
[6]139        topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
140        top as Integer(Brief="Number of top tray");
141        bot as Integer(Brief="Number of bottom tray");
142
143        SET
144        top = (NTrays-1)*(1-topdown)/2+1;
145        bot = NTrays/top;
[1]146       
147        VARIABLES
148        trays(NTrays) as tray;
149        cond as condenser;
150        reb as reboiler;
[6]151        sptop as splitter;
[1]152        pump1 as pump;
153
154        EQUATIONS
155        if (reb.OutletV.P > reb.InletL.P) then
[6]156                "Pressure Drop through the reboiler"
157                reb.OutletV.F = trays(bot).Ah/reb.vV * sqrt((reb.OutletV.P - trays(bot).OutletL.P)
158                                / (trays(bot).beta*reb.rhoV) );
[1]159        else
[6]160                "No flow in reboiler"
[176]161                reb.OutletV.F = 0.0 * 'mol/s';
[1]162        end
163
164        "Pressure Drop through the tray"
[176]165        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/'Pa'))/2 *
[6]166                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
[176]167                cond.OutletL.P + 1e-8 * 'atm') / (trays(top).alfa*trays(top).rhoV));
[1]168               
[6]169        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
170            (trays([top+topdown:topdown:bot]).OutletV.P -
[176]171            trays([top+topdown:topdown:bot]).InletL.P)/'Pa'))/2 *
[6]172            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
173            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
[176]174                trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * 'atm') /
[6]175            (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV));
176
[1]177        CONNECTIONS
178        #vapor
[6]179        reb.OutletV to trays(bot).InletV;
180        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
181        trays(top).OutletV to cond.InletV;
182       
[1]183        #liquid
[6]184        cond.OutletL to sptop.Inlet;   
185        sptop.Outlet2 to pump1.Inlet;
186        pump1.Outlet to trays(top).InletL;
187        trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
188        trays(bot).OutletL to reb.InletL;
[1]189end
190
191
192#* -------------------------------------------------------------------
193* Distillation Column model with:
194*
195*       - NTrays like tray;
196*       - a vessel in the bottom of column;
197*       - a splitter who separate the bottom product and the stream to reboiler;
198*       - steady state reboiler (thermosyphon);
199*       - a steady state condenser with subcooling;
200*       - a vessel drum (layed cilinder);
201*       - a splitter which separate reflux and distillate;
202*       - a pump in reflux stream.
203*
204* ------------------------------------------------------------------*#
205Model Distillation_thermosyphon_subcooling
[262]206        ATTRIBUTES
207        Pallete         = true;
[300]208        Icon            = "icon/DistillationThermosyphonSubcooling";
[262]209        Brief           = "Model of a distillation column with steady condenser and steady reboiler.";
210        Info            =
[353]211"== Specify ==
212* the feed stream of each tray (Inlet);
213* the Murphree eficiency for each tray Emv;
214* the pump head;
215* the condenser pressure drop;
216* the heat supllied in top and bottom tanks;
217* the heat supllied in condenser and reboiler;
218* the Outlet1 flow in the bottom splitter (spbottom.Outlet1.F) that corresponds to the bottom product;
219* both  top splitter outlet flows OR one of the splitter outlet flows and the splitter frac.
[262]220       
[353]221== Initial Conditions ==
222* the trays temperature (OutletL.T);
223* the trays liquid level (Level) OR the trays liquid flow (OutletL.F);
224* (NoComps - 1) OutletL (OR OutletV) compositions for each tray;
[262]225       
[353]226* the top tank temperature (OutletL.T);
227* the top tank liquid level (Level);
228* (NoComps - 1) OutletL (OR OutletV) compositions;
[262]229       
[353]230* the bottom tank temperature (OutletL.T);
231* the bottom tank liquid level (Level);
232* (NoComps - 1) OutletL (OR OutletV) compositions.
233";
[262]234       
[1]235        PARAMETERS
[210]236        outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
[125]237        outer NComp as Integer;
[1]238        NTrays as Integer(Brief="Number of trays", Default=2);
[6]239        topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
240        top as Integer(Brief="Number of top tray");
241        bot as Integer(Brief="Number of bottom tray");
242
243        SET
244        top = (NTrays-1)*(1-topdown)/2+1;
245        bot = NTrays/top;
[1]246       
247        VARIABLES
248        trays(NTrays) as tray;
249        cond as condenserSteady;
250        reb as reboilerSteady;
251        tbottom as tank;
252        ttop as tank_cylindrical;
253        spbottom as splitter;
254        sptop as splitter;
255        pump1 as pump;
256
257        EQUATIONS
[102]258        if (reb.OutletV.P > reb.InletL.P) then
259                "Pressure Drop through the reboiler"
260                reb.OutletV.F = trays(bot).Ah/reb.vV * sqrt((reb.OutletV.P - trays(bot).OutletL.P)
261                                / (trays(bot).alfa*reb.rhoV) );
262        else
263                "No flow in reboiler"
[176]264                reb.OutletV.F = 0.0 * 'mol/s';
[102]265        end     
266       
[1]267        "Pressure Drop through the tray"
[176]268        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/'Pa'))/2 *
[46]269                trays(top).Ah/trays(top).vV /2* sqrt(2*(trays(top).OutletV.P -
[176]270                ttop.Outlet.P + 1e-8 * 'atm') / (trays(top).alfa*trays(top).rhoV));
[1]271               
[6]272        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
273            (trays([top+topdown:topdown:bot]).OutletV.P -
[176]274            trays([top+topdown:topdown:bot]).InletL.P)/'Pa'))/2 *
[46]275            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV /2*
[6]276            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
[176]277                trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * 'atm') /
[6]278            (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV));
[1]279       
280        CONNECTIONS
281        #vapor
[6]282        reb.OutletV to trays(bot).InletV;
283        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
284        trays(top).OutletV to cond.InletV;
[1]285       
286        #liquid
[6]287        cond.OutletL to ttop.Inlet;     
288        ttop.Outlet to sptop.Inlet;
289        sptop.Outlet2 to pump1.Inlet;   
290        pump1.Outlet to trays(top).InletL;
291        trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
292        trays(bot).OutletL to tbottom.Inlet;
[1]293        tbottom.Outlet to spbottom.Inlet;
294        spbottom.Outlet2 to reb.InletL;
295end
296
297
298#* -------------------------------------------------------------------
299* Distillation Column model with:
300*
301*       - NTrays like tray;
302*       - a vessel in the bottom of column;
303*       - a splitter who separate the bottom product and the stream to reboiler;
304*       - steady state reboiler (thermosyphon);
305*       - a dynamic condenser without subcooling;
306*       - a splitter which separate reflux and distillate;
307*       - a pump in reflux stream.
308*
309* ------------------------------------------------------------------*#
310Model Distillation_thermosyphon_cond
[262]311        ATTRIBUTES
312        Pallete         = true;
[300]313        Icon            = "icon/DistillationThermosyphonCond";
[262]314        Brief           = "Model of a distillation column with dynamic condenser and steady reboiler.";
315        Info            =
[353]316"== Specify ==
317* the feed stream of each tray (Inlet);
318* the Murphree eficiency for each tray Emv;
319* the pump head;
320* the condenser vapor outlet flow (OutletV.F);
321* the heat supllied in bottom tank;
322* the heat supllied in condenser and reboiler;
323* the Outlet1 flow in the bottom splitter (spbottom.Outlet1.F) that corresponds to the bottom product;
[262]324       
[353]325== Initial Conditions ==
326* the trays temperature (OutletL.T);
327* the trays liquid level (Level) OR the trays liquid flow (OutletL.F);
328* (NoComps - 1) OutletL (OR OutletV) compositions for each tray;
[262]329       
[353]330* the condenser temperature (OutletL.T);
331* the condenser liquid level (Level);
332* (NoComps - 1) OutletL (OR OutletV) compositions;
[262]333       
[353]334* the bottom tank temperature (OutletL.T);
335* the bottom tank liquid level (Level);
336* (NoComps - 1) OutletL (OR OutletV) compositions.
337";
[262]338
[1]339        PARAMETERS
[210]340        outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
[125]341        outer NComp as Integer;
[1]342        NTrays as Integer(Brief="Number of trays", Default=2);
[6]343        topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
344        top as Integer(Brief="Number of top tray");
345        bot as Integer(Brief="Number of bottom tray");
346
347        SET
348        top = (NTrays-1)*(1-topdown)/2+1;
349        bot = NTrays/top;
[1]350       
351        VARIABLES
352        trays(NTrays) as tray;
353        cond as condenser;
354        reb as reboilerSteady;
355        tbottom as tank;
356        spbottom as splitter;
357        sptop as splitter;
358        pump1 as pump;
359
360        EQUATIONS
361        if (reb.OutletV.P > reb.InletL.P) then
[6]362                "Pressure Drop through the reboiler"
363                reb.OutletV.F = trays(bot).Ah/reb.vV * sqrt((reb.OutletV.P - trays(bot).OutletL.P)
[99]364                                / (trays(bot).alfa*reb.rhoV) );
[1]365        else
[6]366                "No flow in reboiler"
[176]367                reb.OutletV.F = 0.0 * 'mol/s';
[1]368        end
369
370        "Pressure Drop through the tray"
[176]371        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/'Pa'))/2 *
[6]372                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
[176]373                cond.OutletL.P + 1e-8 * 'atm') / (trays(top).alfa*trays(top).rhoV));
[1]374               
[6]375        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
376            (trays([top+topdown:topdown:bot]).OutletV.P -
[176]377            trays([top+topdown:topdown:bot]).InletL.P)/'Pa'))/2 *
[6]378            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
379            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
[176]380                trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * 'atm') /
[6]381            (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV));
[1]382                       
383        CONNECTIONS
384        #vapor
[6]385        reb.OutletV to trays(bot).InletV;
386        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
387        trays(top).OutletV to cond.InletV;
[1]388       
389        #liquid
390        cond.OutletL to sptop.Inlet;   
391        sptop.Outlet2 to pump1.Inlet;
[6]392        pump1.Outlet to trays(top).InletL;
393        trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
394        trays(bot).OutletL to tbottom.Inlet;
[1]395        tbottom.Outlet to spbottom.Inlet;
396        spbottom.Outlet2 to reb.InletL;
397end
398
399#* -------------------------------------------------------------------
400* Distillation Column model with:
401*
402*       - NTrays like tray;
403*       - a kettle reboiler;
404*       - a steady state condenser with subcooling;
405*       - a vessel drum (layed cilinder);
406*       - a splitter which separate reflux and distillate;
407*       - a pump in reflux stream.
408*
409* ------------------------------------------------------------------*#
410Model Distillation_kettle_subcooling
[262]411        ATTRIBUTES
412        Pallete         = true;
[300]413        Icon            = "icon/DistillationKettleSubcooling";
[262]414        Brief           = "Model of a distillation column with steady condenser and dynamic reboiler.";
415        Info            =
[353]416"== Specify ==
417* the feed stream of each tray (Inlet);
418* the Murphree eficiency for each tray (Emv);
419* the pump pressure difference;
420* the heat supllied in reboiler and condenser;
421* the heat supllied in the top tank;
422* the condenser pressure drop;
423* the reboiler liquid outlet flow (OutletL.F);
424* both splitter outlet flows OR one of the splitter outlet flows and the splitter frac.
[262]425       
[353]426== Initial Conditions ==
427* the trays temperature (OutletL.T);
428* the trays liquid level (Level) OR the trays liquid flow (OutletL.F);
429* (NoComps - 1) OutletL (OR OutletV) compositions for each tray;
[262]430       
[353]431* the top tank temperature (OutletL.T);
432* the top tank liquid level (Level);
433* (NoComps - 1) OutletL (OR OutletV) compositions;
[262]434       
[353]435* the reboiler temperature (OutletL.T);
436* the reboiler liquid level (Level);
437* (NoComps - 1) OutletL (OR OutletV) compositions.
438";
[262]439       
[1]440        PARAMETERS
[210]441        outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
[125]442        outer NComp as Integer;
[1]443        NTrays as Integer(Brief="Number of trays", Default=2);
[6]444        topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
445        top as Integer(Brief="Number of top tray");
446        bot as Integer(Brief="Number of bottom tray");
447
448        SET
449        top = (NTrays-1)*(1-topdown)/2+1;
450        bot = NTrays/top;
[1]451       
452        VARIABLES
453        trays(NTrays) as tray;
454        cond as condenserSteady;
455        reb as reboiler;
456        ttop as tank_cylindrical;
457        sptop as splitter;
458        pump1 as pump;
459
460        EQUATIONS
461        if (reb.OutletV.P > reb.InletL.P) then
[6]462                "Pressure Drop through the reboiler"
463                reb.OutletV.F = trays(bot).Ah/reb.vV * sqrt((reb.OutletV.P - trays(bot).OutletL.P)
464                                / (trays(bot).beta*reb.rhoV) );
[1]465        else
[6]466                "No flow in reboiler"
[176]467                reb.OutletV.F = 0.0 * 'mol/s';
[1]468        end
469
470        "Pressure Drop through the tray"
[176]471        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/'Pa'))/2 *
[6]472                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
[176]473                ttop.Outlet.P + 1e-8 * 'atm') / (trays(top).alfa*trays(top).rhoV));
[1]474               
[6]475        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
476            (trays([top+topdown:topdown:bot]).OutletV.P -
[176]477            trays([top+topdown:topdown:bot]).InletL.P)/'Pa'))/2 *
[6]478            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
479            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
[176]480                trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * 'atm') /
[6]481            (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV));
[1]482       
483        CONNECTIONS
484        #vapor
[6]485        reb.OutletV to trays(bot).InletV;
486        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
487        trays(top).OutletV to cond.InletV;
[1]488       
489        #liquid
[6]490        cond.OutletL to ttop.Inlet;     
491        ttop.Outlet to sptop.Inlet;
492        sptop.Outlet2 to pump1.Inlet;   
493        pump1.Outlet to trays(top).InletL;
494        trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
495        trays(bot).OutletL to reb.InletL;
[1]496end
497
498
499#*----------------------------------------------------------------------
500* Model of a  rectifier containing:
501*       - NTrays like tray;
502*       - dymamic condenser without subcooling;
503*       - a splitter which separate reflux and distillate;
504*       - a pump in reflux stream;
505*---------------------------------------------------------------------*#
506Model Rectifier
[262]507        ATTRIBUTES
508        Pallete         = true;
[300]509        Icon            = "icon/RefluxedCond";
[262]510        Brief           = "Model of a rectifier column with dynamic condenser.";
511        Info            =
[353]512"== Specify ==
513* the feed stream of each tray (Inlet);
514* the Murphree eficiency for each tray Emv;
515* the InletV stream of the bottom tray;
516* the pump pressure difference;
517* the heat supllied in the condenser;
518* the condenser vapor outlet flow (OutletV.F);
519* both splitter outlet flows OR one of the splitter outlet flows and the splitter frac.
[262]520       
[353]521== Initial Conditions ==
522* the trays temperature (OutletL.T);
523* the trays liquid level (Level) OR the trays liquid flow (OutletL.F);
524* (NoComps - 1) OutletL (OR OutletV) compositions for each tray;
[262]525       
[353]526* the condenser temperature (OutletL.T);
527* the condenser liquid level (Level);
528* (NoComps - 1) OutletL (OR OutletV) compositions;
529";
[262]530
[1]531        PARAMETERS
[210]532        outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
[125]533        outer NComp as Integer;
[1]534        NTrays as Integer(Brief="Number of trays", Default=2);
[6]535        topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
536        top as Integer(Brief="Number of top tray");
537        bot as Integer(Brief="Number of bottom tray");
538
539        SET
540        top = (NTrays-1)*(1-topdown)/2+1;
541        bot = NTrays/top;
[1]542       
543        VARIABLES
544        trays(NTrays) as tray;
545        cond as condenser;
[6]546        sptop as splitter;
[1]547        pump1 as pump;
548
549        EQUATIONS
550        "Pressure Drop through the tray"
[176]551        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/'Pa'))/2 *
[6]552                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
[176]553                cond.OutletL.P + 1e-8 * 'atm') / (trays(top).alfa*trays(top).rhoV));
[1]554               
[6]555        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
556            (trays([top+topdown:topdown:bot]).OutletV.P -
[176]557            trays([top+topdown:topdown:bot]).InletL.P)/'Pa'))/2 *
[6]558            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
559            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
[176]560                trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * 'atm') /
[6]561            (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV));
[1]562       
563        CONNECTIONS
564        #vapor
[6]565        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
566        trays(top).OutletV to cond.InletV;
567       
[1]568        #liquid
[6]569        cond.OutletL to sptop.Inlet;   
570        sptop.Outlet2 to pump1.Inlet;   
571        pump1.Outlet to trays(top).InletL;
572        trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
[1]573end
574
575
576#* -------------------------------------------------------------------
577* Rectifier Column with:
578*
579*       - NTrays like tray;
580*       - a steady state condenser with subcooling;
581*       - a vessel drum (layed cilinder);
582*       - a splitter which separate reflux and distillate;
583*       - a pump in reflux stream.
584*
585* ------------------------------------------------------------------*#
586Model Rectifier_subcooling
[262]587        ATTRIBUTES
588        Pallete         = true;
[300]589        Icon            = "icon/RefluxedSubcooling";
[262]590        Brief           = "Model of a rectifier column with steady condenser.";
591        Info            =
[353]592"== Specify ==
593* the feed stream of each tray (Inlet);
594* the Murphree eficiency for each tray Emv;
595* the InletV stream of the bottom tray;
596* the pump head;
597* the condenser pressure drop;
598* the heat supllied in  the top tank;
599* the heat supllied in condenser;
600* both  top splitter outlet flows OR one of the splitter outlet flows and the splitter frac.
[262]601       
[353]602== Initial Conditions ==
603* the trays temperature (OutletL.T);
604* the trays liquid level (Level) OR the trays liquid flow (OutletL.F);
605* (NoComps - 1) OutletL (OR OutletV) compositions for each tray;
[262]606       
[353]607* the top tank temperature (OutletL.T);
608* the top tank liquid level (Level);
609* (NoComps - 1) OutletL (OR OutletV) compositions;
610";
[262]611       
[1]612        PARAMETERS
[210]613        outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
[125]614        outer NComp as Integer;
[1]615        NTrays as Integer(Brief="Number of trays", Default=2);
[6]616        topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
617        top as Integer(Brief="Number of top tray");
618        bot as Integer(Brief="Number of bottom tray");
619
620        SET
621        top = (NTrays-1)*(1-topdown)/2+1;
622        bot = NTrays/top;
[1]623       
624        VARIABLES
625        trays(NTrays) as tray;
626        cond as condenserSteady;
627        ttop as tank_cylindrical;
628        sptop as splitter;
629        pump1 as pump;
630
631        EQUATIONS
632        "Pressure Drop through the tray"
[176]633        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/'Pa'))/2 *
[6]634                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
[176]635                ttop.Outlet.P + 1e-8 * 'atm') / (trays(top).alfa*trays(top).rhoV));
[1]636               
[6]637        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
638            (trays([top+topdown:topdown:bot]).OutletV.P -
[176]639            trays([top+topdown:topdown:bot]).InletL.P)/'Pa'))/2 *
[6]640            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
641            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
[176]642                trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * 'atm') /
[6]643            (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV));
[1]644       
645        CONNECTIONS
646        #vapor
[6]647        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
648        trays(top).OutletV to cond.InletV;
[1]649       
650        #liquid
[6]651        cond.OutletL to ttop.Inlet;     
652        ttop.Outlet to sptop.Inlet;
653        sptop.Outlet2 to pump1.Inlet;   
654        pump1.Outlet to trays(top).InletL;
655        trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
[1]656end
657
658
659#*----------------------------------------------------------------------
660* Model of a  Refluxed Stripping column containing:
661*       - NTrays like tray;
662*       - dymamic condenser without subcooling;
663*       - a splitter which separate reflux and distillate;
664*       - a pump in reflux stream;
665*---------------------------------------------------------------------*#
666Model Refluxed_Stripping
[262]667        ATTRIBUTES
668        Pallete         = true;
[300]669        Icon            = "icon/RefluxedCond";
[262]670        Brief           = "Model of a refluxed stripping column with dynamic condenser.";
671        Info            =
[353]672"== Specify ==
673* the feed stream of each tray (Inlet);
674* the Murphree eficiency for each tray Emv;
675* the InletV stream of the bottom tray;
676* the pump pressure difference;
677* the heat supllied in the condenser;
678* the condenser vapor outlet flow (OutletV.F);
679* both splitter outlet flows OR one of the splitter outlet flows and the splitter frac.
[262]680       
[353]681== Initial Conditions ==
682* the trays temperature (OutletL.T);
683* the trays liquid level (Level) OR the trays liquid flow (OutletL.F);
684* (NoComps - 1) OutletL (OR OutletV) compositions for each tray;
[262]685       
[353]686* the condenser temperature (OutletL.T);
687* the condenser liquid level (Level);
688* (NoComps - 1) OutletL (OR OutletV) compositions;
689";
[262]690       
[1]691        PARAMETERS
[210]692        outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
[125]693        outer NComp as Integer;
[1]694        NTrays as Integer(Brief="Number of trays", Default=2);
[6]695        topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
696        top as Integer(Brief="Number of top tray");
697        bot as Integer(Brief="Number of bottom tray");
698
699        SET
700        top = (NTrays-1)*(1-topdown)/2+1;
701        bot = NTrays/top;
[1]702       
703        VARIABLES
704        trays(NTrays) as tray;
705        cond as condenser;
[6]706        sptop as splitter;
[1]707        pump1 as pump;
708
709        EQUATIONS
710        "Pressure Drop through the tray"
[176]711        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/'Pa'))/2 *
[6]712                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
[176]713                cond.OutletL.P + 1e-8 * 'atm') / (trays(top).alfa*trays(top).rhoV));
[1]714               
[6]715        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
716            (trays([top+topdown:topdown:bot]).OutletV.P -
[176]717            trays([top+topdown:topdown:bot]).InletL.P)/'Pa'))/2 *
[6]718            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
719            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
[176]720                trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * 'atm') /
[6]721            (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV));
[1]722       
723        CONNECTIONS
724        #vapor
[6]725        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
726        trays(top).OutletV to cond.InletV;
727       
[1]728        #liquid
[6]729        cond.OutletL to sptop.Inlet;   
730        sptop.Outlet2 to pump1.Inlet;   
731        pump1.Outlet to trays(top).InletL;
732        trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
[1]733end
734
735
736#* -------------------------------------------------------------------
737* Refluxed Stripping Column with:
738*
739*       - NTrays like tray;
740*       - a steady state condenser (with subcooling);
741*       - a vessel drum (layed cilinder);
742*       - a splitter which separate reflux and distillate;
743*       - a pump in reflux stream.
744*
745* ------------------------------------------------------------------*#
746Model Refluxed_Stripping_subcooling
[262]747        ATTRIBUTES
748        Pallete         = true;
[300]749        Icon            = "icon/RefluxedSubcooling";
[262]750        Brief           = "Model of a refluxed stripping column with steady condenser.";
751        Info            =
[353]752"== Specify ==
753* the feed stream of each tray (Inlet);
754* the Murphree eficiency for each tray Emv;
755* the InletV stream of the bottom tray;
756* the pump head;
757* the condenser pressure drop;
758* the heat supllied in  the top tank;
759* the heat supllied in condenser;
760* both  top splitter outlet flows OR one of the splitter outlet flows and the splitter frac.
[262]761       
[353]762== Initial Conditions ==
763* the trays temperature (OutletL.T);
764* the trays liquid level (Level) OR the trays liquid flow (OutletL.F);
765* (NoComps - 1) OutletL (OR OutletV) compositions for each tray;
[262]766       
[353]767* the top tank temperature (OutletL.T);
768* the top tank liquid level (Level);
769* (NoComps - 1) OutletL (OR OutletV) compositions;
770";
[262]771       
[1]772        PARAMETERS
[210]773        outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
[125]774        outer NComp as Integer;
[1]775        NTrays as Integer(Brief="Number of trays", Default=2);
[6]776        topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
777        top as Integer(Brief="Number of top tray");
778        bot as Integer(Brief="Number of bottom tray");
779
780        SET
781        top = (NTrays-1)*(1-topdown)/2+1;
782        bot = NTrays/top;
[1]783       
784        VARIABLES
785        trays(NTrays) as tray;
786        cond as condenserSteady;
787        ttop as tank_cylindrical;
788        sptop as splitter;
789        pump1 as pump;
790
791        EQUATIONS
792        "Pressure Drop through the tray"
[176]793        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/'Pa'))/2 *
[6]794                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
[176]795                ttop.Outlet.P + 1e-8 * 'atm') / (trays(top).alfa*trays(top).rhoV));
[1]796               
[6]797        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
798            (trays([top+topdown:topdown:bot]).OutletV.P -
[176]799            trays([top+topdown:topdown:bot]).InletL.P)/'Pa'))/2 *
[6]800            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
801            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
[176]802                trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * 'atm') /
[6]803            (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV));
[1]804       
805        CONNECTIONS
806        #vapor
[6]807        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
808        trays(top).OutletV to cond.InletV;
[1]809       
810        #liquid
[6]811        cond.OutletL to ttop.Inlet;     
812        ttop.Outlet to sptop.Inlet;
813        sptop.Outlet2 to pump1.Inlet;   
814        pump1.Outlet to trays(top).InletL;
815        trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
[1]816end
817
818
819#*----------------------------------------------------------------------
820* Model of a  Refluxed Absorption column containing:
821*       - NTrays like tray;
822*       - dymamic condenser without subcooling;
823*       - a splitter which separate reflux and distillate;
824*       - a pump in reflux stream;
825*---------------------------------------------------------------------*#
826Model Refluxed_Absorption
[262]827        ATTRIBUTES
828        Pallete         = true;
[300]829        Icon            = "icon/RefluxedCond";
[262]830        Brief           = "Model of a refluxed absorption column with dynamic condenser.";
831        Info            =
[353]832"== Specify ==
833* the feed stream of each tray (Inlet);
834* the Murphree eficiency for each tray Emv;
835* the InletV stream of the bottom tray;
836* the pump pressure difference;
837* the heat supllied in the condenser;
838* the condenser vapor outlet flow (OutletV.F);
839* both splitter outlet flows OR one of the splitter outlet flows and the splitter frac.
[262]840       
[353]841== Initial Conditions ==
842* the trays temperature (OutletL.T);
843* the trays liquid level (Level) OR the trays liquid flow (OutletL.F);
844* (NoComps - 1) OutletL (OR OutletV) compositions for each tray;
[262]845       
[353]846* the condenser temperature (OutletL.T);
847* the condenser liquid level (Level);
848* (NoComps - 1) OutletL (OR OutletV) compositions;
849";
[262]850       
[1]851        PARAMETERS
[210]852        outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
[125]853        outer NComp as Integer;
[1]854        NTrays as Integer(Brief="Number of trays", Default=2);
[6]855        topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
856        top as Integer(Brief="Number of top tray");
857        bot as Integer(Brief="Number of bottom tray");
858
859        SET
860        top = (NTrays-1)*(1-topdown)/2+1;
861        bot = NTrays/top;
[1]862       
863        VARIABLES
864        trays(NTrays) as tray;
865        cond as condenser;
[6]866        sptop as splitter;
[1]867        pump1 as pump;
868
869        EQUATIONS
870        "Pressure Drop through the tray"
[176]871        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/'Pa'))/2 *
[6]872                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
[176]873                cond.OutletL.P + 1e-8 * 'atm') / (trays(top).alfa*trays(top).rhoV));
[1]874               
[6]875        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
876            (trays([top+topdown:topdown:bot]).OutletV.P -
[176]877            trays([top+topdown:topdown:bot]).InletL.P)/'Pa'))/2 *
[6]878            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
879            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
[176]880                trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * 'atm') /
[6]881            (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV));
[1]882       
883        CONNECTIONS
884        #vapor
[6]885        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
886        trays(top).OutletV to cond.InletV;
887       
[1]888        #liquid
[6]889        cond.OutletL to cond.InletV;   
890        cond.OutletL to sptop.Inlet;
891        sptop.Outlet2 to pump1.Inlet;   
892        pump1.Outlet to trays(top).InletL;
893        trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
[1]894end
895
896
897#* -------------------------------------------------------------------
898* Refluxed Absorption Column with:
899*
900*       - NTrays like tray;
901*       - a steady state condenser (with subcooling);
902*       - a vessel drum (layed cilinder);
903*       - a splitter which separate reflux and distillate;
904*       - a pump in reflux stream.
905*
906* ------------------------------------------------------------------*#
907Model Refluxed_Absorption_subcooling
[262]908        ATTRIBUTES
909        Pallete         = true;
[300]910        Icon            = "icon/RefluxedSubcooling";
[262]911        Brief           = "Model of a refluxed absorption column with steady condenser.";
912        Info            =
[353]913"== Specify ==
914* the feed stream of each tray (Inlet);
915* the Murphree eficiency for each tray Emv;
916* the InletV stream of the bottom tray;
917* the pump head;
918* the condenser pressure drop;
919* the heat supllied in  the top tank;
920* the heat supllied in condenser;
921* both  top splitter outlet flows OR one of the splitter outlet flows and the splitter frac.
[262]922       
[353]923== Initial Conditions ==
924* the trays temperature (OutletL.T);
925* the trays liquid level (Level) OR the trays liquid flow (OutletL.F);
926* (NoComps - 1) OutletL (OR OutletV) compositions for each tray;
[262]927       
[353]928* the top tank temperature (OutletL.T);
929* the top tank liquid level (Level);
930* (NoComps - 1) OutletL (OR OutletV) compositions;
931";
[262]932       
[1]933        PARAMETERS
[210]934        outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
[125]935        outer NComp as Integer;
[1]936        NTrays as Integer(Brief="Number of trays", Default=2);
[6]937        topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
938        top as Integer(Brief="Number of top tray");
939        bot as Integer(Brief="Number of bottom tray");
940
941        SET
942        top = (NTrays-1)*(1-topdown)/2+1;
943        bot = NTrays/top;
[1]944       
945        VARIABLES
946        trays(NTrays) as tray;
947        cond as condenserSteady;
948        ttop as tank_cylindrical;
949        sptop as splitter;
950        pump1 as pump;
951
952        EQUATIONS
953        "Pressure Drop through the tray"
[176]954        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/'Pa'))/2 *
[6]955                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
[176]956                ttop.Outlet.P + 1e-8 * 'atm') / (trays(top).alfa*trays(top).rhoV));
[1]957               
[6]958        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
959            (trays([top+topdown:topdown:bot]).OutletV.P -
[176]960            trays([top+topdown:topdown:bot]).InletL.P)/'Pa'))/2 *
[6]961            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
962            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
[176]963                trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * 'atm') /
[6]964            (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV));
[1]965       
966        CONNECTIONS
967        #vapor
[6]968        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
969        trays(top).OutletV to cond.InletV;
[1]970       
971        #liquid
[6]972        cond.OutletL to ttop.Inlet;     
973        ttop.Outlet to sptop.Inlet;
974        sptop.Outlet2 to pump1.Inlet;   
975        pump1.Outlet to trays(top).InletL;
976        trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
[1]977end
978
979
980#* -------------------------------------------------------------------
981* Reboiled Stripping Column model with:
982*
983*       - NTrays like tray;
984*       - a kettle reboiler;
985*
986* ------------------------------------------------------------------*#
987Model Reboiled_Stripping_kettle
[262]988        ATTRIBUTES
989        Pallete         = true;
[300]990        Icon            = "icon/ReboiledKettle";
[262]991        Brief           = "Model of a reboiled stripping column with dynamic reboiler.";
992        Info            =
[353]993"== Specify ==
994* the feed stream of each tray (Inlet);
995* the Murphree eficiency for each tray Emv;
996* the InletL stream of the top tray;
997* the heat supllied in the reboiler;
998* the reboiler liquid outlet flow (OutletL.F);
[262]999       
[353]1000== Initial Conditions ==
1001* the trays temperature (OutletL.T);
1002* the trays liquid level (Level) OR the trays liquid flow (OutletL.F);
1003* (NoComps - 1) OutletL (OR OutletV) compositions for each tray;
[262]1004       
[353]1005* the reboiler temperature (OutletL.T);
1006* the reboiler liquid level (Level);
1007* (NoComps - 1) OutletL (OR OutletV) compositions.
1008";
[262]1009
[1]1010        PARAMETERS
[210]1011        outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
[125]1012        outer NComp as Integer;
[1]1013        NTrays as Integer(Brief="Number of trays", Default=2);
[6]1014        topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
1015        top as Integer(Brief="Number of top tray");
1016        bot as Integer(Brief="Number of bottom tray");
1017
1018        SET
1019        top = (NTrays-1)*(1-topdown)/2+1;
1020        bot = NTrays/top;
[1]1021       
1022        VARIABLES
1023        trays(NTrays) as tray;
1024        reb as reboiler;
1025
1026        EQUATIONS
1027        if (reb.OutletV.P > reb.InletL.P) then
1028                "Pressure Drop through the tray"
[6]1029                reb.OutletV.F = trays(bot).Ah/reb.vV * sqrt((reb.OutletV.P - trays(bot).OutletL.P)
1030                                / (trays(bot).beta*reb.rhoV) );
[1]1031        else
1032                "Prato selado"
[176]1033                reb.OutletV.F = 0.0 * 'mol/s';
[1]1034        end
1035
1036        "Pressure Drop through the tray"
[6]1037        trays([top:topdown:bot]).OutletV.F = (1 + tanh(1 *
1038            (trays([top:topdown:bot]).OutletV.P -
[176]1039            trays([top:topdown:bot]).InletL.P)/'Pa'))/2 *
[6]1040            trays([top:topdown:bot]).Ah/trays([top:topdown:bot]).vV *
1041            sqrt(2*(trays([top:topdown:bot]).OutletV.P -
[176]1042                trays([top:topdown:bot]).InletL.P + 1e-8 * 'atm') /
[6]1043            (trays([top:topdown:bot]).alfa*trays([top:topdown:bot]).rhoV));
[1]1044       
1045        CONNECTIONS
1046        #vapor
[6]1047        reb.OutletV to trays(bot).InletV;
1048        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
[1]1049       
1050        #liquid
[6]1051        trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
1052        trays(bot).OutletL to reb.InletL;
[1]1053end
1054
1055
1056#* -------------------------------------------------------------------
1057* Reboiled Stripping Column model with:
1058*
1059*       - NTrays like tray;
1060*       - a vessel in the bottom of column;
1061*       - a splitter which separate the bottom product and the stream to reboiler;
1062*       - steady state reboiler (thermosyphon);
1063*
1064* ------------------------------------------------------------------*#
1065Model Reboiled_Stripping_thermosyphon
[262]1066        ATTRIBUTES
1067        Pallete         = true;
[300]1068        Icon            = "icon/ReboiledThermosyphon";
[262]1069        Brief           = "Model of a reboiled stripping column with steady reboiler.";
1070        Info            =
[353]1071"== Specify ==
1072* the feed stream of each tray (Inlet);
1073* the Murphree eficiency for each tray (Emv);
1074* the InletL stream of the top tray;
1075* the heat supllied in bottom tank;
1076* the heat supllied in the reboiler;
1077* the Outlet1 flow in the bottom splitter (spbottom.Outlet1.F) that corresponds to the bottom product;
[262]1078       
[353]1079== Initial Conditions ==
1080* the trays temperature (OutletL.T);
1081* the trays liquid level (Level) OR the trays liquid flow (OutletL.F);
1082* (NoComps - 1) OutletL (OR OutletV) compositions for each tray;
[262]1083
[353]1084* the bottom tank temperature (OutletL.T);
1085* the bottom tank liquid level (Level);
1086* (NoComps - 1) OutletL (OR OutletV) compositions.
1087";
[262]1088       
[1]1089        PARAMETERS
[210]1090        outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
[125]1091        outer NComp as Integer;
[1]1092        NTrays as Integer(Brief="Number of trays", Default=2);
[6]1093        topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
1094        top as Integer(Brief="Number of top tray");
1095        bot as Integer(Brief="Number of bottom tray");
1096
1097        SET
1098        top = (NTrays-1)*(1-topdown)/2+1;
1099        bot = NTrays/top;
[1]1100       
1101        VARIABLES
1102        trays(NTrays) as tray;
1103        reb as reboilerSteady;
1104        spbottom as splitter;
1105        tbottom as tank;
1106
1107        EQUATIONS
1108        if (reb.OutletV.P > reb.InletL.P) then
1109                "Pressure Drop through the tray"
[6]1110                reb.OutletV.F = trays(bot).Ah/reb.vV * sqrt((reb.OutletV.P - trays(bot).OutletL.P)
[99]1111                                / (trays(bot).alfa*reb.rhoV) );
[1]1112        else
1113                "Prato selado"
[176]1114                reb.OutletV.F = 0.0 * 'mol/s';
[1]1115        end
1116
1117        "Pressure Drop through the tray"
[6]1118        trays([top:topdown:bot]).OutletV.F = (1 + tanh(1 *
1119            (trays([top:topdown:bot]).OutletV.P -
[176]1120            trays([top:topdown:bot]).InletL.P)/'Pa'))/2 *
[6]1121            trays([top:topdown:bot]).Ah/trays([top:topdown:bot]).vV *
1122            sqrt(2*(trays([top:topdown:bot]).OutletV.P -
[176]1123                trays([top:topdown:bot]).InletL.P + 1e-8 * 'atm') /
[6]1124            (trays([top:topdown:bot]).alfa*trays([top:topdown:bot]).rhoV));
[1]1125       
1126        CONNECTIONS
1127        #vapor
[6]1128        reb.OutletV to trays(bot).InletV;
1129        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
[1]1130       
1131        #liquid
[6]1132        trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
1133        trays(bot).OutletL to tbottom.Inlet;
[1]1134        tbottom.Outlet to spbottom.Inlet;
1135        spbottom.Outlet2 to reb.InletL;
1136end
1137
1138
1139#* -------------------------------------------------------------------
1140* Reboiled Absorption Column model with:
1141*
1142*       - NTrays like tray;
1143*       - a kettle reboiler;
1144*
1145* ------------------------------------------------------------------*#
1146Model Reboiled_Absorption_kettle
[262]1147        ATTRIBUTES
1148        Pallete         = true;
[300]1149        Icon            = "icon/ReboiledKettle";
[262]1150        Brief           = "Model of a reboiled absorption column with dynamic reboiler.";
1151        Info            =
[353]1152"== Specify ==
1153* the feed stream of each tray (Inlet);
1154* the Murphree eficiency for each tray Emv;
1155* the InletL stream of the top tray;
1156* the heat supllied in the reboiler;
1157* the reboiler liquid outlet flow (OutletL.F);
[262]1158       
[353]1159== Initial Conditions ==
1160* the trays temperature (OutletL.T);
1161* the trays liquid level (Level) OR the trays liquid flow (OutletL.F);
1162* (NoComps - 1) OutletL (OR OutletV) compositions for each tray;
[262]1163       
[353]1164* the reboiler temperature (OutletL.T);
1165* the reboiler liquid level (Level);
1166* (NoComps - 1) OutletL (OR OutletV) compositions.
1167";
[262]1168       
[1]1169        PARAMETERS
[210]1170        outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
[125]1171        outer NComp as Integer;
[1]1172        NTrays as Integer(Brief="Number of trays", Default=2);
[6]1173        topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
1174        top as Integer(Brief="Number of top tray");
1175        bot as Integer(Brief="Number of bottom tray");
1176
1177        SET
1178        top = (NTrays-1)*(1-topdown)/2+1;
1179        bot = NTrays/top;
[1]1180       
1181        VARIABLES
1182        trays(NTrays) as tray;
1183        reb as reboiler;
1184
1185        EQUATIONS
1186        if (reb.OutletV.P > reb.InletL.P) then
1187                "Pressure Drop through the tray"
[6]1188                reb.OutletV.F = trays(bot).Ah/reb.vV * sqrt((reb.OutletV.P - trays(bot).OutletL.P)
[37]1189                                / (trays(bot).beta*reb.rhoV) );
[1]1190        else
1191                "Prato selado"
[176]1192                reb.OutletV.F = 0.0 * 'mol/s';
[1]1193        end
1194
1195        "Pressure Drop through the tray"
[6]1196        trays([top:topdown:bot]).OutletV.F = (1 + tanh(1 *
1197            (trays([top:topdown:bot]).OutletV.P -
[176]1198            trays([top:topdown:bot]).InletL.P)/'Pa'))/2 *
[6]1199            trays([top:topdown:bot]).Ah/trays([top:topdown:bot]).vV *
1200            sqrt(2*(trays([top:topdown:bot]).OutletV.P -
[176]1201                trays([top:topdown:bot]).InletL.P + 1e-8 * 'atm') /
[6]1202            (trays([top:topdown:bot]).alfa*trays([top:topdown:bot]).rhoV));
[1]1203       
1204        CONNECTIONS
1205        #vapor
[6]1206        reb.OutletV to trays(bot).InletV;
1207        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
[1]1208       
1209        #liquid
[6]1210        trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
1211        trays(bot).OutletL to reb.InletL;
[1]1212end
1213
1214
1215#* -------------------------------------------------------------------
1216* Reboiled Absorption Column model with:
1217*
1218*       - NTrays like tray;
1219*       - a vessel in the bottom of column;
1220*       - a splitter which separate the bottom product and the stream to reboiler;
1221*       - steady state reboiler (thermosyphon);
1222*
1223* ------------------------------------------------------------------*#
1224Model Reboiled_Absorption_thermosyphon
[262]1225        ATTRIBUTES
1226        Pallete         = true;
[300]1227        Icon            = "icon/ReboiledThermosyphon";
[262]1228        Brief           = "Model of a reboiled absorption column with steady reboiler.";
1229        Info            =
[353]1230"== Specify ==
1231* the feed stream of each tray (Inlet);
1232* the Murphree eficiency for each tray (Emv);
1233* the InletL stream of the top tray;
1234* the heat supllied in bottom tank;
1235* the heat supllied in the reboiler;
1236* the Outlet1 flow in the bottom splitter (spbottom.Outlet1.F) that corresponds to the bottom product;
[262]1237       
[353]1238== Initial Conditions ==
1239* the trays temperature (OutletL.T);
1240* the trays liquid level (Level) OR the trays liquid flow (OutletL.F);
1241* (NoComps - 1) OutletL (OR OutletV) compositions for each tray;
[262]1242
[353]1243* the bottom tank temperature (OutletL.T);
1244* the bottom tank liquid level (Level);
1245* (NoComps - 1) OutletL (OR OutletV) compositions.
1246";
[262]1247       
[1]1248        PARAMETERS
[210]1249        outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
[125]1250        outer NComp as Integer;
[1]1251        NTrays as Integer(Brief="Number of trays", Default=2);
[6]1252        topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
1253        top as Integer(Brief="Number of top tray");
1254        bot as Integer(Brief="Number of bottom tray");
1255
1256        SET
1257        top = (NTrays-1)*(1-topdown)/2+1;
1258        bot = NTrays/top;
[1]1259       
1260        VARIABLES
1261        trays(NTrays) as tray;
1262        reb as reboilerSteady;
1263        spbottom as splitter;
1264        tbottom as tank;
1265
1266        EQUATIONS
1267        if (reb.OutletV.P > reb.InletL.P) then
1268                "Pressure Drop through the tray"
[6]1269                reb.OutletV.F = trays(bot).Ah/reb.vV * sqrt((reb.OutletV.P - trays(bot).OutletL.P)
[99]1270                                / (trays(bot).alfa*reb.rhoV) );
[1]1271        else
1272                "Prato selado"
[176]1273                reb.OutletV.F = 0.0 * 'mol/s';
[1]1274        end
1275
1276        "Pressure Drop through the tray"
[6]1277        trays([top:topdown:bot]).OutletV.F = (1 + tanh(1 *
1278            (trays([top:topdown:bot]).OutletV.P -
[176]1279            trays([top:topdown:bot]).InletL.P)/'Pa'))/2 *
[6]1280            trays([top:topdown:bot]).Ah/trays([top:topdown:bot]).vV *
1281            sqrt(2*(trays([top:topdown:bot]).OutletV.P -
[176]1282                trays([top:topdown:bot]).InletL.P + 1e-8 * 'atm') /
[6]1283            (trays([top:topdown:bot]).alfa*trays([top:topdown:bot]).rhoV));
[1]1284       
1285        CONNECTIONS
1286        #vapor
[6]1287        reb.OutletV to trays(bot).InletV;
1288        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
[1]1289       
1290        #liquid
[6]1291        trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
1292        trays(bot).OutletL to tbottom.Inlet;
[1]1293        tbottom.Outlet to spbottom.Inlet;
1294        spbottom.Outlet2 to reb.InletL;
1295end
[38]1296
[72]1297#* -------------------------------------------------------------------
1298*  Reactive Distillation Column
1299*
1300* ------------------------------------------------------------------*#
[38]1301Model ReactiveDistillation
[262]1302        ATTRIBUTES
1303        Pallete         = true;
[300]1304        Icon            = "icon/DistillationKettleCond";
[262]1305        Brief           = "Model of a reactive distillation column with dynamic condenser and reboiler.";
1306        Info            =
[353]1307"== Specify ==
1308* the reaction related variables for each tray, condenser and reboiler;
1309* the feed stream of each tray (Inlet);
1310* the Murphree eficiency for each tray Emv;
1311* the pump pressure difference;
1312* the heat supllied in reboiler and condenser;
1313* the condenser vapor outlet flow (OutletV.F);
1314* the reboiler liquid outlet flow (OutletL.F);
1315* both splitter outlet flows OR one of the splitter outlet flows and the splitter frac.
[262]1316       
[353]1317== Initial Conditions ==
1318* the trays temperature (OutletL.T);
1319* the trays liquid level (Level) OR the trays liquid flow (OutletL.F);
1320* (NoComps - 1) OutletL (OR OutletV) compositions for each tray;
[262]1321       
[353]1322* the condenser temperature (OutletL.T);
1323* the condenser liquid level (Level);
1324* (NoComps - 1) OutletL (OR OutletV) compositions;
[262]1325       
[353]1326* the reboiler temperature (OutletL.T);
1327* the reboiler liquid level (Level);
1328* (NoComps - 1) OutletL (OR OutletV) compositions.
1329";
[262]1330       
[38]1331        PARAMETERS
[243]1332        outer PP as Plugin(Type="PP");
[125]1333        outer NComp as Integer;
[38]1334        NTrays as Integer(Brief="Number of trays", Default=2);
[243]1335        topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
1336        top as Integer(Brief="Number of top tray");
1337        bot as Integer(Brief="Number of bottom tray");
1338        alfacond as Real;
1339
1340        VapourFlow as Switcher(Valid = ["on", "off"], Default = "off");
[38]1341       
[243]1342        SET
1343        top = (NTrays-1)*(1-topdown)/2+1;
1344        bot = NTrays/top;
1345       
[38]1346        VARIABLES
1347        trays(NTrays) as trayReact;
1348        cond as condenserReact;
1349        reb as reboilerReact;
1350        sp as splitter;
1351        p as pump;
1352       
1353        EQUATIONS
[243]1354       
1355        switch VapourFlow
1356                case "on":
1357                "Pressure Drop through the condenser"
1358                cond.InletV.F*trays(top).vV / 'm^2' =
1359                        sqrt((trays(top).OutletV.P - cond.OutletL.P + 1e-8 * 'atm')/(trays(top).rhoV*alfacond));
1360                when trays(top).OutletV.P < cond.OutletL.P switchto "off";
1361               
1362                case "off":
[38]1363                "Prato selado"
[243]1364                cond.InletV.F = 0.0 * 'mol/s';
1365                when trays(top).OutletV.P > cond.OutletL.P + 1e-3 * 'atm' switchto "on";
[38]1366        end
[243]1367
[38]1368        CONNECTIONS
1369        #vapor
[243]1370        reb.OutletV to trays(bot).InletV;
1371        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
1372        trays(top).OutletV to cond.InletV;
1373       
[38]1374        #liquid
1375        cond.OutletL to sp.Inlet;       
1376        sp.Outlet2 to p.Inlet;
[243]1377        p.Outlet to trays(top).InletL;
1378        trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
1379        trays(bot).OutletL to reb.InletL;
1380       
[38]1381end
Note: See TracBrowser for help on using the repository browser.