source: branches/packed/eml/stage_separators/column.mso @ 448

Last change on this file since 448 was 448, checked in by Paula Bettio Staudt, 15 years ago

Temporary tray files

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