source: branches/new_gui/eml/stage_separators/tray.mso @ 890

Last change on this file since 890 was 890, checked in by gerson bicca, 13 years ago

added more folders

File size: 20.9 KB
Line 
1#*-------------------------------------------------------------------
2* EMSO Model Library (EML) Copyright (C) 2004 - 2007 ALSOC.
3*
4* This LIBRARY is free software; you can distribute it and/or modify
5* it under the therms of the ALSOC FREE LICENSE as available at
6* http://www.enq.ufrgs.br/alsoc.
7*
8* EMSO Copyright (C) 2004 - 2007 ALSOC, original code
9* from http://www.rps.eng.br Copyright (C) 2002-2004.
10* All rights reserved.
11*
12* EMSO is distributed under the therms of the ALSOC LICENSE as
13* available at http://www.enq.ufrgs.br/alsoc.
14*
15*----------------------------------------------------------------------
16* Author: Paula B. Staudt
17* $Id: tray.mso 522 2008-05-21 23:21:12Z arge $
18*--------------------------------------------------------------------*#
19
20using "streams/streams";
21
22Model tray
23
24ATTRIBUTES
25        Pallete         = false;
26        Icon            = "icon/Tray";
27        Brief           = "Complete model of a column tray.";
28        Info            =
29"== Assumptions ==
30* both phases (liquid and vapour) exists all the time;
31* thermodymanic equilibrium with Murphree plate efficiency;
32* no entrainment of liquid or vapour phase;
33* no weeping;
34* the dymanics in the downcomer are neglected.
35
36== Options ==
37You can choose the equation for the liquid outlet flow and the vapour
38inlet flow calculation through the VapourFlowModel and LiquidFlowModel
39switchers.
40
41== References ==
42* ELGUE, S.; PRAT, L.; CABASSUD, M.; LANN, J. L.; CéZERAC, J. Dynamic models for start-up operations of batch distillation columns with experimental validation. Computers and Chemical Engineering, v. 28, p. 2735-2747, 2004.
43* FEEHERY, W. F. Dynamic Optimization with Path Constraints. Tese (Doutorado) - Massachusetts Institute of Technology, June 1998.
44* KLINGBERG, A. Modeling and Optimization of Batch Distillation. Dissertação (Mestrado) - Department of Automatic Control, Lund Institute of Technology, Lund, Sweden, fev. 2000.
45* OLSEN, I.; ENDRESTOL, G. O.; SIRA, T. A rigorous and efficient distillation column model for engineering and training simulators. Computers and Chemical Engineering,v. 21, n. Suppl, p. S193-S198, 1997.
46* REEPMEYER, F.; REPKE, J.-U.; WOZNY, G. Analysis of the start-up process for reactive distillation. Chemical Engineering Technology, v. 26, p. 81-86, 2003.
47* ROFFEL, B.; BETLEM, B.; RUIJTER, J. de. First principles dynamic modeling and multivariable control of a cryogenic distillation column process. Computers and Chemical Engineering, v. 24, p. 111-123, 2000.
48* WANG, L.; LI, P.; WOZNY, G.; WANG, S. A start-up model for simulation of batch distillation starting from a cold state. Computers and Chemical Engineering, v. 27, p.1485-1497, 2003.
49";     
50       
51PARAMETERS
52outer PP                as Plugin               (Brief = "External Physical Properties", Type="PP");
53outer NComp     as Integer              (Brief="Number of components");
54
55        Mw(NComp)                                                       as molweight            (Brief="Component Mol Weight",Hidden=true);
56        Gconst                                                          as acceleration         (Brief="Gravity Acceleration",Default=9.81,Hidden=true);
57        zero_flow                                                       as flow_mol             (Brief = "Stream Flow closed",Default = 0, Hidden=true);
58        low_flow                                                        as flow_mol             (Brief = "Low stream Flow",Default = 1E-6, Hidden=true);
59        Pi                                                                      as constant             (Brief="Pi Number",Default=3.14159265, Symbol = "\pi",Hidden=true);
60       
61        TrayDiameter_                   as length               (Brief="Tray Diameter",Default=1.600);
62        TraySpacing_                    as length               (Brief="Tray Spacing",Default=0.600);
63        Fraction_HoleArea_              as fraction     (Brief="Fraction of the active area that is occupied by the holes with respect to the total tray area",Default=0.10);
64        Fraction_DowncomerArea_ as fraction     (Brief="Fraction of the downcomer area with respect to the total tray area",Default=0.20);
65        WeirLength_                             as length               (Brief="Weir length", Default = 1);
66        WeirHeight_                     as length               (Brief="Weir height", Default= 0.05);
67        TrayLiquidPasses_               as positive     (Brief="Number of liquid passes in the tray", Lower = 1,Default=1);
68        HeatSupply_                     as heat_rate    (Brief="Rate of heat supply",Default = 0);
69        AerationFraction_               as Real                 (Brief="Aeration fraction", Default = 1);
70        DryPdropCoeff_                  as Real                 (Brief="Dry pressure drop coefficient", Default= 0.60);
71        MurphreeEff_                    as Real                 (Brief="Murphree efficiency for All Trays",Lower=0.01,Upper=1);
72
73        PlateArea_                              as area                 (Brief="Plate area = Atray - Adowncomer",Protected=true);
74        TrayVolume_                             as volume               (Brief="Total Volume of the tray",Protected=true);
75        HolesArea_                              as area                 (Brief="Total holes area",Protected=true);
76       
77        FeeheryCoeff    as Real         (Brief="Feeherys correlation coefficient", Unit='1/m^4', Default=1,Hidden=true);
78        ElgueCoeff              as Real         (Brief="Elgues correlation coefficient", Unit='kg/m/mol^2', Default=1,Hidden=true);
79        OlsenCoeff              as Real         (Brief="Olsens correlation coefficient", Default=1,Hidden=true);
80       
81        VapourFlow      as Switcher     (Brief="Flag for Vapour Flow condition",Valid = ["on", "off"], Default = "off",Hidden=true);
82        LiquidFlow      as Switcher     (Brief="Flag for Liquid Flow condition",Valid = ["on", "off"], Default = "off",Hidden=true);
83       
84VARIABLES
85
86        Inlet                           as stream                       (Brief="Feed stream", Hidden=true, PosX=0, PosY=0.4932, Symbol="_{in}");
87        LiquidSideStream        as liquid_stream        (Brief="liquid Sidestream", Hidden=true, Symbol="_{outL}");
88        VapourSideStream        as vapour_stream        (Brief="vapour Sidestream", Hidden=true, Symbol="_{outV}");
89
90in      InletLiquid     as stream                       (Brief="Inlet liquid stream", PosX=0.5195, PosY=0, Symbol="_{inL}");
91in      InletVapour     as stream                       (Brief="Inlet vapour stream", PosX=0.4994, PosY=1, Symbol="_{inV}");
92out     OutletLiquid    as liquid_stream        (Brief="Outlet liquid stream", PosX=0.8277, PosY=1, Symbol="_{outL}");
93out     OutletVapour    as vapour_stream        (Brief="Outlet vapour stream", PosX=0.8043, PosY=0, Symbol="_{outV}");
94
95        LFlowModel      as positive     (Brief="Flag for Liquid Flow Model",Lower = 1, Default = 1 , Hidden=true);
96        VFlowModel      as positive     (Brief="Flag for Vapour Flow Model",Lower = 1, Default = 1 , Hidden=true);
97
98        M(NComp)                        as mol                  (Brief="Molar Holdup in the tray");
99        ML                                      as mol                  (Brief="Molar liquid holdup");
100        MV                                      as mol                  (Brief="Molar vapour holdup");
101        E                                       as energy               (Brief="Total Energy Holdup on tray");
102        vL                                      as volume_mol   (Brief="Liquid Molar Volume");
103        vV                                      as volume_mol   (Brief="Vapour Molar volume");
104        Level                           as length               (Brief="Height of clear liquid on plate");
105        yideal(NComp)           as fraction;
106        rhoL                            as dens_mass    (Brief="Mass Density of liquid phase");
107        rhoV                            as dens_mass    (Brief="Mass Density of vapour phase");
108
109SET
110
111        Mw = PP.MolecularWeight();
112        zero_flow = 0 * 'kmol/h';
113        low_flow = 1E-6 * 'kmol/h';
114
115        PlateArea_ = 0.25*Pi*(TrayDiameter_^2)*(1-Fraction_DowncomerArea_);
116        TrayVolume_ = 0.25*Pi*(TrayDiameter_^2)*TraySpacing_;
117        HolesArea_ = 0.25*Pi*(TrayDiameter_^2)*Fraction_HoleArea_;
118
119EQUATIONS
120
121# LiquidFlow and VapourFlow equations need to be linerized to avoid indetermination !
122switch LiquidFlow
123
124        case "on":
125                       
126                        if LFlowModel equal 1 then
127                                "Francis Equation"
128                                OutletLiquid.F*vL = 1.84*'1/s'*WeirLength_*((Level-(AerationFraction_*WeirHeight_))/(AerationFraction_))^2;
129                       
130                        else if LFlowModel equal 2 then
131                                "Wang_Fl"
132                                OutletLiquid.F*vL = 1.84*'m^0.5/s'*WeirLength_*((Level-(AerationFraction_*WeirHeight_))/(AerationFraction_))^1.5;
133                       
134                        else if LFlowModel equal 3 then
135                                "Olsen"
136                                OutletLiquid.F / 'mol/s'= WeirLength_*TrayLiquidPasses_*rhoL/sum(Mw*OutletVapour.z)/(0.665*OlsenCoeff)^1.5 * ((ML*sum(Mw*OutletLiquid.z)/rhoL/PlateArea_)-WeirHeight_)^1.5 * 'm^0.5/mol';
137                       
138                        else if LFlowModel equal 4 then 
139                                "Feehery_Fl"
140                                OutletLiquid.F = WeirLength_*rhoL/sum(Mw*OutletLiquid.z) * ((Level-WeirHeight_)/750/'mm')^1.5 * 'm^2/s';
141                       
142                        else   
143                                "Roffel_Fl"
144                                OutletLiquid.F = 2/3*rhoL/sum(Mw*OutletLiquid.z)*WeirLength_*(ML*sum(Mw*OutletLiquid.z)/(PlateArea_*1.3)/rhoL)^1.5*sqrt(2*Gconst/
145                                                        (2*(1 - 0.3593/'Pa^0.0888545'*abs(OutletVapour.F*sum(Mw*OutletVapour.z)/(PlateArea_*1.3)/sqrt(rhoV))^0.177709)-1)); #/'(kg/m)^0.0888545/s^0.177709';
146end
147end
148end
149end
150               
151                when Level < (AerationFraction_ *WeirHeight_) switchto "off";
152               
153                case "off":
154               
155                "Low level"
156                OutletLiquid.F = zero_flow;
157               
158                when Level > (AerationFraction_ * WeirHeight_) switchto "on";
159               
160end
161       
162switch VapourFlow
163       
164        case "on":
165                       
166                        if VFlowModel equal 1 then
167                                "Reepmeyer"
168                                InletVapour.F*vV = sqrt((InletVapour.P - OutletVapour.P)/(rhoV*DryPdropCoeff_))*HolesArea_;
169                       
170                        else if VFlowModel equal 2 then
171                                "Feehery_Fv"
172                                InletVapour.F = rhoV/PlateArea_/FeeheryCoeff/sum(Mw*OutletVapour.z) * sqrt(((InletVapour.P - OutletVapour.P)-(rhoV*Gconst*ML*vL/PlateArea_))/rhoV);
173                       
174                        else if VFlowModel equal 3 then
175                                "Roffel_Fv"
176                                InletVapour.F^1.08 * 0.0013 * 'kg/m/mol^1.08/s^0.92*1e5' = (InletVapour.P - OutletVapour.P)*1e5 - (AerationFraction_*sum(M*Mw)/(PlateArea_*1.3)*Gconst*1e5) * (rhoV*HolesArea_/sum(Mw*OutletVapour.z))^1.08 * 'm^1.08/mol^1.08';
177                       
178                        else if VFlowModel equal 4  then
179                                "Klingberg"
180                                InletVapour.F * vV = PlateArea_ * sqrt(((InletVapour.P - OutletVapour.P)-rhoL*Gconst*Level)/rhoV);
181                       
182                        else if VFlowModel equal 5 then
183                                "Wang_Fv"
184                                InletVapour.F * vV = PlateArea_ * sqrt(((InletVapour.P - OutletVapour.P)-rhoL*Gconst*Level)/rhoV*DryPdropCoeff_);
185                               
186                        else
187                                "Elgue"
188                                InletVapour.F  = sqrt((InletVapour.P - OutletVapour.P)/ElgueCoeff);
189end
190end
191end
192end
193end
194       
195        when InletVapour.F < low_flow switchto "off";
196
197        case "off":
198                InletVapour.F = zero_flow;
199               
200        when InletVapour.P > OutletVapour.P switchto "on";
201
202end
203
204"Murphree Efficiency"
205        OutletVapour.z =  MurphreeEff_ * (yideal - InletVapour.z) + InletVapour.z;
206       
207"Energy Balance"
208        diff(E) = ( Inlet.F*Inlet.h + InletLiquid.F*InletLiquid.h + InletVapour.F*InletVapour.h- OutletLiquid.F*OutletLiquid.h - OutletVapour.F*OutletVapour.h
209        - VapourSideStream.F*VapourSideStream.h - LiquidSideStream.F*LiquidSideStream.h + HeatSupply_ );
210
211"Energy Holdup"
212        E = ML*OutletLiquid.h + MV*OutletVapour.h - OutletLiquid.P*TrayVolume_;
213
214"Geometry Constraint"
215        TrayVolume_ = ML* vL + MV*vV;
216
217"Level of clear liquid over the weir"
218        Level = ML*vL/PlateArea_;
219
220"Component Molar Balance"
221        diff(M)=Inlet.F*Inlet.z + InletLiquid.F*InletLiquid.z + InletVapour.F*InletVapour.z- OutletLiquid.F*OutletLiquid.z - OutletVapour.F*OutletVapour.z-
222        LiquidSideStream.F*LiquidSideStream.z-VapourSideStream.F*VapourSideStream.z;
223
224"Molar Holdup"
225        M = ML*OutletLiquid.z + MV*OutletVapour.z;
226
227"Mol fraction normalisation"
228        sum(OutletLiquid.z)= 1.0;
229
230"Mol fraction constraint"
231        sum(OutletLiquid.z)= sum(OutletVapour.z);
232
233"Liquid Volume"
234        vL = PP.LiquidVolume(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z);
235
236"Vapour Volume"
237        vV = PP.VapourVolume(OutletVapour.T, OutletVapour.P, OutletVapour.z);
238
239"Liquid Density"
240        rhoL = PP.LiquidDensity(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z);
241       
242"Vapour Density"
243        rhoV = PP.VapourDensity(InletVapour.T, InletVapour.P, InletVapour.z);
244
245"Chemical Equilibrium"
246        PP.LiquidFugacityCoefficient(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z)*OutletLiquid.z = PP.VapourFugacityCoefficient(OutletVapour.T, OutletVapour.P, yideal)*yideal;
247
248"Thermal Equilibrium"
249        OutletVapour.T = OutletLiquid.T;
250
251"Mechanical Equilibrium"
252        OutletVapour.P = OutletLiquid.P;
253       
254"Thermal Equilibrium Vapour Side Stream"
255        OutletVapour.T = VapourSideStream.T;
256
257"Thermal Equilibrium Liquid Side Stream"
258        OutletLiquid.T = LiquidSideStream.T;
259
260"Mechanical Equilibrium Vapour Side Stream"
261        OutletVapour.P= VapourSideStream.P;
262
263"Mechanical Equilibrium Liquid Side Stream"
264        OutletLiquid.P = LiquidSideStream.P;
265
266"Composition Liquid Side Stream"
267        OutletLiquid.z= LiquidSideStream.z;
268       
269"Composition Vapour Side Stream"
270        OutletVapour.z= VapourSideStream.z;
271
272end
273
274Model trayReac
275        ATTRIBUTES
276        Pallete         = false;
277        Icon            = "icon/Tray";
278        Brief           = "Model of a tray with reaction.";
279        Info            =
280"== Assumptions ==
281* both phases (liquid and vapour) exists all the time;
282* thermodymanic equilibrium with Murphree plate efficiency;
283* no entrainment of liquid or vapour phase;
284* no weeping;
285* the dymanics in the downcomer are neglected.
286       
287== Specify ==
288* the Feed stream;
289* the Liquid inlet stream;
290* the Vapour inlet stream;
291* the Vapour outlet flow (OutletVapour.F);
292* the reaction related variables.
293       
294== Initial ==
295* the plate temperature (OutletLiquid.T)
296* the liquid height (Level) OR the liquid flow OutletLiquid.F
297* (NoComps - 1) OutletLiquid compositions
298";
299
300PARAMETERS
301
302        outer PP                        as Plugin(Type="PP");
303        outer NComp     as Integer;
304       
305VARIABLES
306
307        Inlet                                           as stream                               (Brief="Feed stream", PosX=0, PosY=0.4932, Symbol="_{in}");
308        LiquidSideStream        as liquid_stream        (Brief="liquid Sidestream", Hidden=true, Symbol="_{outL}");
309        VapourSideStream as vapour_stream       (Brief="vapour Sidestream", Hidden=true, Symbol="_{outV}");
310       
311
312in              InletLiquid             as      stream                          (Brief="Inlet liquid stream", PosX=0.5195, PosY=0, Symbol="_{inL}");
313in              InletVapour             as      stream                          (Brief="Inlet vapour stream", PosX=0.4994, PosY=1, Symbol="_{inV}");
314out     OutletLiquid    as      liquid_stream           (Brief="Outlet liquid stream", PosX=0.8277, PosY=1, Symbol="_{outL}");
315out     OutletVapour    as      vapour_stream   (Brief="Outlet vapour stream", PosX=0.8043, PosY=0, Symbol="_{outV}");
316
317        yideal(NComp)   as fraction;
318
319        M(NComp)                as mol                          (Brief="Molar Holdup in the tray");
320        ML                                              as mol                          (Brief="Molar liquid holdup");
321        MV                                              as mol                          (Brief="Molar vapour holdup");
322        E                                               as energy                       (Brief="Total Energy Holdup on tray");
323        vL                                              as volume_mol   (Brief="Liquid Molar Volume");
324        vV                                              as volume_mol   (Brief="Vapour Molar volume");
325        Level                                   as length                       (Brief="Height of clear liquid on plate");
326        Vol                                             as volume;
327       
328        rhoL                    as dens_mass;
329        rhoV                    as dens_mass;
330        r3                              as reaction_mol         (Brief = "Reaction resulting ethyl acetate", DisplayUnit = 'mol/l/s');
331        C(NComp)        as conc_mol             (Brief = "Molar concentration", Lower = -1);
332       
333EQUATIONS
334
335"Molar Concentration"
336        OutletLiquid.z = vL * C;
337       
338"Reaction"
339        r3 = exp(-7150*'K'/OutletLiquid.T)*(4.85e4*C(1)*C(2) - 1.23e4*C(3)*C(4))*'l/mol/s';
340       
341"Molar Holdup"
342        M = ML*OutletLiquid.z + MV*OutletVapour.z;
343
344"Thermal Equilibrium Vapour Side Stream"
345        OutletVapour.T = VapourSideStream.T;
346
347"Thermal Equilibrium Liquid Side Stream"
348        OutletLiquid.T = LiquidSideStream.T;
349
350"Mechanical Equilibrium Vapour Side Stream"
351        OutletVapour.P= VapourSideStream.P;
352
353"Mechanical Equilibrium Liquid Side Stream"
354        OutletLiquid.P = LiquidSideStream.P;
355
356"Composition Liquid Side Stream"
357        OutletLiquid.z= LiquidSideStream.z;
358       
359"Composition Vapour Side Stream"
360        OutletVapour.z= VapourSideStream.z;
361
362"Mol fraction normalisation"
363        sum(OutletLiquid.z)= 1.0;
364
365"Liquid Volume"
366        vL = PP.LiquidVolume(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z);
367
368"Vapour Volume"
369        vV = PP.VapourVolume(OutletVapour.T, OutletVapour.P, OutletVapour.z);
370
371"Thermal Equilibrium"
372        OutletVapour.T = OutletLiquid.T;
373
374"Mechanical Equilibrium"
375        OutletVapour.P = OutletLiquid.P;
376
377        Vol = ML*vL;
378       
379"Liquid Density"
380        rhoL = PP.LiquidDensity(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z);
381
382"Vapour Density"
383        rhoV = PP.VapourDensity(InletVapour.T, InletVapour.P, InletVapour.z);
384
385"Chemical Equilibrium"
386        PP.LiquidFugacityCoefficient(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z)*OutletLiquid.z =   PP.VapourFugacityCoefficient(OutletVapour.T, OutletVapour.P, yideal)*yideal;
387
388        sum(OutletLiquid.z)= sum(OutletVapour.z);
389
390end
391
392Model packedStage
393
394ATTRIBUTES
395        Pallete         = false;
396        Brief           = "Complete model of a packed column stage.";
397        Info            =
398"== Specify ==
399* the Feed stream
400* the Liquid inlet stream
401* the Vapour inlet stream
402* the stage pressure drop (deltaP)
403       
404== Initial ==
405* the plate temperature (OutletLiquid.T)
406* the liquid molar holdup ML
407* (NoComps - 1) OutletLiquid compositions
408";
409
410PARAMETERS
411
412outer PP        as Plugin       (Brief = "External Physical Properties", Type="PP");
413outer NComp as Integer  (Brief = "Number Of Components");
414
415        LiquidResistanceCoeff   as positive     (Brief="Resistance coefficient on the liquid load", Default=1,Hidden=true);
416        AreaPerPackingVolume    as Real                 (Brief="surface area per packing volume", Unit='m^2/m^3',Hidden=true);
417        ColumnInternalDiameter  as length               (Brief="Column diameter",Hidden=true);
418        PackingVoidFraction             as Real                 (Brief="Void fraction of packing, (m^3 void space/m^3 packed bed)",Hidden=true);
419        HeightOfPacking                 as length               (Brief="Height of packing",Hidden=true);
420        Number_Stages                   as Integer              (Brief="Number of Stages", Default=3,Hidden=true);
421        HeatOnStage                     as heat_rate    (Brief="Rate of heat supply",Hidden=true);
422
423        HETP                    as length               (Brief="The Height Equivalent to a Theoretical Plate",Hidden=true);
424        ColumnArea              as area                 (Brief="Column Sectional Cross Area",Hidden=true);
425        V                               as volume               (Brief="Total Volume of the tray",Hidden=true);
426        Pi                              as constant     (Brief="Pi Number",Default=3.14159265, Symbol = "\pi",Hidden=true);
427        Gconst                  as acceleration (Brief="Gravity Acceleration",Default=9.81,Hidden=true);
428       
429        low_flow                as flow_mol     (Brief ="Low Flow",Default = 1E-6, Hidden=true);
430        low_pressure    as pressure     (Brief ="Low Pressure",Default = 1E-6, Hidden=true);
431        zero_flow               as flow_mol     (Brief ="No Flow",Default = 0, Hidden=true);
432
433        Mw(NComp)       as molweight    (Brief = "Component Mol Weight",Hidden=true);
434        VapourFlow  as Switcher         (Brief = "Vapour Flow", Valid = ["on", "off"], Default = "on",Hidden=true);
435
436SET
437        Mw = PP.MolecularWeight();
438       
439        ColumnArea      = 0.25*Pi*ColumnInternalDiameter^2;
440        HETP            = HeightOfPacking/Number_Stages;       
441        V                       = HETP * ColumnArea;
442       
443        low_pressure = 1E-4 * 'atm';
444        low_flow = 1E-6 * 'kmol/h';
445        zero_flow = 0 * 'kmol/h';
446
447VARIABLES
448
449        Inlet                   as stream                       (Brief="Feed stream", Symbol="_{in}",Protected=true);
450in      InletLiquid     as stream                       (Brief="Inlet liquid stream",  Symbol="_{inL}",Protected=true);
451in      InletVapour     as stream                       (Brief="Inlet vapour stream",  Symbol="_{inV}",Protected=true);
452out     OutletLiquid    as liquid_stream        (Brief="Outlet liquid stream", Symbol="_{outL}",Protected=true);
453out     OutletVapour    as vapour_stream        (Brief="Outlet vapour stream", Symbol="_{outV}",Protected=true);
454
455        M(NComp)        as mol                  (Brief="Molar Holdup in the tray", Default=0.01, Lower=0, Upper=100,Protected=true);
456        ML                      as mol                  (Brief="Molar liquid holdup", Default=0.01, Lower=0, Upper=100,Protected=true);
457        MV                      as mol                  (Brief="Molar vapour holdup", Default=0.01, Lower=0, Upper=100,Protected=true);
458        E                       as energy               (Brief="Total Energy Holdup on tray", Default=-500,Protected=true);
459        vL                      as volume_mol   (Brief="Liquid Molar Volume",Protected=true);
460        vV                      as volume_mol   (Brief="Vapour Molar volume",Protected=true);
461        miL             as viscosity    (Brief="Liquid dynamic viscosity", DisplayUnit='kg/m/s',Protected=true);
462        rhoL            as dens_mass    (Brief="Liquid mass density",Protected=true);
463        rhoV            as dens_mass    (Brief="Vapour mass density",Protected=true);
464        uL                      as velocity     (Brief="volume flow rate of liquid, m^3/m^2/s", Lower=-10, Upper=1000,Protected=true);
465        uV                      as velocity     (Brief="volume flow rate of vapor, m^3/m^2/s", Lower=-10, Upper=1000,Protected=true);
466        Al                      as area                 (Brief="Area occupied by the liquid", Default=0.001, Upper=10,Protected=true);
467        hl                      as positive     (Brief="Column holdup", Unit='m^3/m^3', Default=0.01,Upper=10,Protected=true);
468        deltaP          as pressure     (Brief="Stage Pressure drop",Protected=true);
469
470EQUATIONS
471
472switch VapourFlow
473       
474        case "on":
475"Pressure drop and Vapor flow, Billet (4-58)"
476        deltaP/HETP  = LiquidResistanceCoeff *( 0.5*AreaPerPackingVolume + 2/ColumnInternalDiameter) * 1/((PackingVoidFraction-hl)^3) * (uV^2) *rhoV;
477       
478        when InletVapour.F < low_flow switchto "off";
479       
480        case "off":
481"Vapour Flow"
482        InletVapour.F = zero_flow;
483       
484        when deltaP > low_pressure switchto "on";
485
486end
487
488"Energy Balance"
489        diff(E) = (Inlet.F*Inlet.h + InletLiquid.F*InletLiquid.h + InletVapour.F*InletVapour.h- OutletLiquid.F*OutletLiquid.h
490        - OutletVapour.F*OutletVapour.h + HeatOnStage );
491
492"Energy Holdup"
493        E = ML*OutletLiquid.h + MV*OutletVapour.h - OutletLiquid.P*V;
494
495"Geometry Constraint"
496        V*PackingVoidFraction= ML*vL + MV*vV;
497
498"Volume flow rate of vapor, m^3/m^2/s"
499        uV * (V*PackingVoidFraction/HETP - Al) = InletVapour.F * vV;
500
501"Liquid holdup"
502        hl*V*PackingVoidFraction = ML*vL;
503
504"Liquid velocity as a function of liquid holdup, Billet (4-27)"
505        hl^3 = (12/Gconst) * AreaPerPackingVolume^2 * (miL/rhoL) * uL;
506
507"Area occupied by the liquid"
508        Al = ML*vL/HETP;
509
510"Component Molar Balance"
511        diff(M)=Inlet.F*Inlet.z + InletLiquid.F*InletLiquid.z + InletVapour.F*InletVapour.z- OutletLiquid.F*OutletLiquid.z - OutletVapour.F*OutletVapour.z;
512
513"Molar Holdup"
514        M = ML*OutletLiquid.z + MV*OutletVapour.z;
515
516"Mol Fraction Normalisation"
517        sum(OutletLiquid.z)= 1.0;
518
519"Mol Fraction Constraint"
520        sum(OutletLiquid.z)= sum(OutletVapour.z);
521       
522"Liquid Volume"
523        vL = PP.LiquidVolume(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z);
524
525"Vapour Volume"
526        vV = PP.VapourVolume(OutletVapour.T, OutletVapour.P, OutletVapour.z);
527       
528"Chemical Equilibrium"
529        PP.LiquidFugacityCoefficient(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z)*OutletLiquid.z =   PP.VapourFugacityCoefficient(OutletVapour.T, OutletVapour.P, OutletVapour.z)*OutletVapour.z;
530       
531"Thermal Equilibrium"
532        OutletVapour.T = OutletLiquid.T;
533       
534"Mechanical Equilibrium"
535        OutletLiquid.P = OutletVapour.P;
536       
537"Liquid Density"
538        rhoL = PP.LiquidDensity(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z);
539
540"Vapour Density"
541        rhoV = PP.VapourDensity(InletVapour.T, InletVapour.P, InletVapour.z);
542
543"Liquid viscosity"
544        miL = PP.LiquidViscosity(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z);
545
546"Volume flow rate of liquid, m^3/m^2/s"
547        uL * Al = OutletLiquid.F * vL;
548       
549"Pressure Drop"
550        deltaP = InletVapour.P - OutletVapour.P;       
551
552end
553
Note: See TracBrowser for help on using the repository browser.