source: branches/gui/eml/stage_separators/tray.mso @ 705

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

Fixed missing comment close

File size: 19.6 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";
21
22Model trayBasic
23        ATTRIBUTES
24        Pallete         = false;
25        Icon            = "icon/Tray";
26        Brief           = "Basic equations of a tray column model.";
27        Info            =
28"This model contains only the main equations of a column tray equilibrium model without
29the hidraulic equations.
30       
31== Assumptions ==
32* both phases (liquid and vapour) exists all the time;
33* thermodymanic equilibrium with Murphree plate efficiency;
34* no entrainment of liquid or vapour phase;
35* no weeping;
36* the dymanics in the downcomer are neglected.
37";
38       
39PARAMETERS
40outer PP                        as Plugin               (Brief = "External Physical Properties", Type="PP");
41outer NComp     as Integer;
42
43VARIABLES
44
45        Inlet                                                   as stream                               (Brief="Feed stream", Hidden=true, PosX=0, PosY=0.4932, Symbol="_{in}");
46        LiquidSideStream                as liquid_stream        (Brief="liquid Sidestream", Hidden=true, Symbol="_{outL}");
47        VapourSideStream        as vapour_stream        (Brief="vapour Sidestream", Hidden=true, Symbol="_{outV}");
48
49in      InletL                  as stream                               (Brief="Inlet liquid stream", PosX=0.5195, PosY=0, Symbol="_{inL}");
50in      InletV                  as stream                               (Brief="Inlet vapour stream", PosX=0.4994, PosY=1, Symbol="_{inV}");
51out     OutletL         as liquid_stream        (Brief="Outlet liquid stream", PosX=0.8277, PosY=1, Symbol="_{outL}");
52out     OutletV         as vapour_stream        (Brief="Outlet vapour stream", PosX=0.8043, PosY=0, Symbol="_{outV}");
53
54
55        M(NComp)                        as mol                          (Brief="Molar Holdup in the tray");
56        ML                                              as mol                          (Brief="Molar liquid holdup");
57        MV                                              as mol                          (Brief="Molar vapour holdup");
58        E                                                       as energy                       (Brief="Total Energy Holdup on tray");
59        vL                                              as volume_mol   (Brief="Liquid Molar Volume");
60        vV                                              as volume_mol   (Brief="Vapour Molar volume");
61        Level                                   as length                       (Brief="Height of clear liquid on plate");
62        yideal(NComp)           as fraction;
63
64
65EQUATIONS
66"Component Molar Balance"
67        diff(M)=Inlet.F*Inlet.z + InletL.F*InletL.z + InletV.F*InletV.z- OutletL.F*OutletL.z - OutletV.F*OutletV.z-
68        LiquidSideStream.F*LiquidSideStream.z-VapourSideStream.F*VapourSideStream.z;
69
70"Molar Holdup"
71        M = ML*OutletL.z + MV*OutletV.z;
72
73"Mol fraction normalisation"
74        sum(OutletL.z)= 1.0;
75        sum(OutletL.z)= sum(OutletV.z);
76
77"Liquid Volume"
78        vL = PP.LiquidVolume(OutletL.T, OutletL.P, OutletL.z);
79
80"Vapour Volume"
81        vV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z);
82
83"Chemical Equilibrium"
84        PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z = PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, yideal)*yideal;
85
86"Thermal Equilibrium"
87        OutletV.T = OutletL.T;
88
89"Mechanical Equilibrium"
90        OutletV.P = OutletL.P;
91       
92"Thermal Equilibrium Vapour Side Stream"
93        OutletV.T = VapourSideStream.T;
94
95"Thermal Equilibrium Liquid Side Stream"
96        OutletL.T = LiquidSideStream.T;
97
98"Mechanical Equilibrium Vapour Side Stream"
99        OutletV.P= VapourSideStream.P;
100
101"Mechanical Equilibrium Liquid Side Stream"
102        OutletL.P = LiquidSideStream.P;
103
104"Composition Liquid Side Stream"
105        OutletL.z= LiquidSideStream.z;
106       
107"Composition Vapour Side Stream"
108        OutletV.z= VapourSideStream.z;
109
110end
111
112Model tray as trayBasic
113        ATTRIBUTES
114        Pallete         = false;
115        Icon            = "icon/Tray";
116        Brief           = "Complete model of a column tray.";
117        Info            =
118"== Specify ==
119* the Feed stream
120* the Liquid inlet stream
121* the Vapour inlet stream
122* the Vapour outlet flow (OutletV.F)
123       
124== Initial ==
125* the plate temperature (OutletL.T)
126* the liquid height (Level) OR the liquid flow OutletL.F
127* (NoComps - 1) OutletL compositions
128
129== Options ==
130You can choose the equation for the liquid outlet flow and the vapour
131inlet flow calculation through the VapourFlowModel and LiquidFlowModel
132switchers.
133
134== References ==
135* 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.
136* FEEHERY, W. F. Dynamic Optimization with Path Constraints. Tese (Doutorado) - Massachusetts Institute of Technology, June 1998.
137* KLINGBERG, A. Modeling and Optimization of Batch Distillation. Dissertação (Mestrado) - Department of Automatic Control, Lund Institute of Technology, Lund, Sweden, fev. 2000.
138* 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.
139* 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.
140* 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.
141* 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.
142";     
143
144VARIABLES
145        rhoL as dens_mass;
146        rhoV as dens_mass;
147
148        btemp as Real (Brief="Temporary variable of Roffels liquid flow equation");
149       
150EQUATIONS
151
152"Liquid Density"
153        rhoL = PP.LiquidDensity(OutletL.T, OutletL.P, OutletL.z);
154       
155"Vapour Density"
156        rhoV = PP.VapourDensity(InletV.T, InletV.P, InletV.z);
157
158end
159
160#*-------------------------------------------------------------------
161* Model of a tray with reaction
162*-------------------------------------------------------------------*#
163Model trayReac
164        ATTRIBUTES
165        Pallete         = false;
166        Icon            = "icon/Tray";
167        Brief           = "Model of a tray with reaction.";
168        Info            =
169"== Assumptions ==
170* both phases (liquid and vapour) exists all the time;
171* thermodymanic equilibrium with Murphree plate efficiency;
172* no entrainment of liquid or vapour phase;
173* no weeping;
174* the dymanics in the downcomer are neglected.
175       
176== Specify ==
177* the Feed stream;
178* the Liquid inlet stream;
179* the Vapour inlet stream;
180* the Vapour outlet flow (OutletV.F);
181* the reaction related variables.
182       
183== Initial ==
184* the plate temperature (OutletL.T)
185* the liquid height (Level) OR the liquid flow OutletL.F
186* (NoComps - 1) OutletL compositions
187";
188
189PARAMETERS
190
191        outer PP                        as Plugin(Type="PP");
192        outer NComp     as Integer;
193       
194VARIABLES
195
196        Inlet                                           as stream                               (Brief="Feed stream", PosX=0, PosY=0.4932, Symbol="_{in}");
197        LiquidSideStream        as liquid_stream        (Brief="liquid Sidestream", Hidden=true, Symbol="_{outL}");
198        VapourSideStream as vapour_stream       (Brief="vapour Sidestream", Hidden=true, Symbol="_{outV}");
199       
200
201in              InletL          as      stream                          (Brief="Inlet liquid stream", PosX=0.5195, PosY=0, Symbol="_{inL}");
202in              InletV          as      stream                          (Brief="Inlet vapour stream", PosX=0.4994, PosY=1, Symbol="_{inV}");
203out     OutletL         as      liquid_stream           (Brief="Outlet liquid stream", PosX=0.8277, PosY=1, Symbol="_{outL}");
204out     OutletV         as      vapour_stream   (Brief="Outlet vapour stream", PosX=0.8043, PosY=0, Symbol="_{outV}");
205
206        yideal(NComp)   as fraction;
207
208        M(NComp)                as mol                          (Brief="Molar Holdup in the tray");
209        ML                                              as mol                          (Brief="Molar liquid holdup");
210        MV                                              as mol                          (Brief="Molar vapour holdup");
211        E                                               as energy                       (Brief="Total Energy Holdup on tray");
212        vL                                              as volume_mol   (Brief="Liquid Molar Volume");
213        vV                                              as volume_mol   (Brief="Vapour Molar volume");
214        Level                                   as length                       (Brief="Height of clear liquid on plate");
215        Vol                                             as volume;
216       
217        rhoL                    as dens_mass;
218        rhoV                    as dens_mass;
219        r3                              as reaction_mol         (Brief = "Reaction resulting ethyl acetate", DisplayUnit = 'mol/l/s');
220        C(NComp)        as conc_mol             (Brief = "Molar concentration", Lower = -1);
221       
222EQUATIONS
223
224"Molar Concentration"
225        OutletL.z = vL * C;
226       
227"Reaction"
228        r3 = exp(-7150*'K'/OutletL.T)*(4.85e4*C(1)*C(2) - 1.23e4*C(3)*C(4))*'l/mol/s';
229       
230"Molar Holdup"
231        M = ML*OutletL.z + MV*OutletV.z;
232
233"Thermal Equilibrium Vapour Side Stream"
234        OutletV.T = VapourSideStream.T;
235
236"Thermal Equilibrium Liquid Side Stream"
237        OutletL.T = LiquidSideStream.T;
238
239"Mechanical Equilibrium Vapour Side Stream"
240        OutletV.P= VapourSideStream.P;
241
242"Mechanical Equilibrium Liquid Side Stream"
243        OutletL.P = LiquidSideStream.P;
244
245"Composition Liquid Side Stream"
246        OutletL.z= LiquidSideStream.z;
247       
248"Composition Vapour Side Stream"
249        OutletV.z= VapourSideStream.z;
250
251"Mol fraction normalisation"
252        sum(OutletL.z)= 1.0;
253
254"Liquid Volume"
255        vL = PP.LiquidVolume(OutletL.T, OutletL.P, OutletL.z);
256
257"Vapour Volume"
258        vV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z);
259
260"Thermal Equilibrium"
261        OutletV.T = OutletL.T;
262
263"Mechanical Equilibrium"
264        OutletV.P = OutletL.P;
265
266        Vol = ML*vL;
267       
268"Liquid Density"
269        rhoL = PP.LiquidDensity(OutletL.T, OutletL.P, OutletL.z);
270
271"Vapour Density"
272        rhoV = PP.VapourDensity(InletV.T, InletV.P, InletV.z);
273
274"Chemical Equilibrium"
275        PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z =       PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, yideal)*yideal;
276
277        sum(OutletL.z)= sum(OutletV.z);
278
279end
280
281#*-------------------------------------
282* Model of a packed column stage
283-------------------------------------*#
284Model packedStage
285        ATTRIBUTES
286        Pallete         = false;
287        Icon            = "icon/PackedStage";
288        Brief           = "Complete model of a packed column stage.";
289        Info            =
290"== Specify ==
291* the Feed stream
292* the Liquid inlet stream
293* the Vapour inlet stream
294* the stage pressure drop (deltaP)
295       
296== Initial ==
297* the plate temperature (OutletL.T)
298* the liquid molar holdup ML
299* (NoComps - 1) OutletL compositions
300";     
301       
302PARAMETERS
303
304outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
305outer NComp as Integer;
306
307        PPwater as Plugin(Brief="Physical Properties",Type="PP",Components = [ "water" ],
308                LiquidModel = "PR",
309                VapourModel = "PR"
310        );
311       
312        Mw(NComp)       as molweight    (Brief = "Component Mol Weight");
313       
314VARIABLES
315
316        Inlet                   as stream                               (Brief="Feed stream", PosX=0, PosY=0.4932, Symbol="_{in}");
317in      InletL                  as stream                               (Brief="Inlet liquid stream", PosX=0.5195, PosY=0, Symbol="_{inL}");
318in      InletV                  as stream                               (Brief="Inlet vapour stream", PosX=0.4994, PosY=1, Symbol="_{inV}");
319out     OutletL         as liquid_stream        (Brief="Outlet liquid stream", PosX=0.8277, PosY=1, Symbol="_{outL}");
320out     OutletV         as vapour_stream        (Brief="Outlet vapour stream", PosX=0.8043, PosY=0, Symbol="_{outV}");
321
322        M(NComp) as mol (Brief="Molar Holdup in the tray", Default=0.01, Lower=0, Upper=100);
323        ML as mol (Brief="Molar liquid holdup", Default=0.01, Lower=0, Upper=100);
324        MV as mol (Brief="Molar vapour holdup", Default=0.01, Lower=0, Upper=100);
325        E as energy (Brief="Total Energy Holdup on tray", Default=-500);
326        vL as volume_mol (Brief="Liquid Molar Volume");
327        vV as volume_mol (Brief="Vapour Molar volume");
328       
329        miL as viscosity (Brief="Liquid dynamic viscosity", DisplayUnit='kg/m/s');
330        miV as viscosity (Brief="Vapor dynamic viscosity", DisplayUnit='kg/m/s');
331        rhoL as dens_mass;
332        rhoV as dens_mass;
333       
334        deltaP as pressure;
335       
336        uL as velocity (Brief="volume flow rate of liquid, m^3/m^2/s", Lower=-10, Upper=100);
337        uV as velocity (Brief="volume flow rate of vapor, m^3/m^2/s", Lower=-10, Upper=100);
338        dp as length (Brief="Particle diameter", Default=1e-3, Lower=0, Upper=10);
339        invK as positive (Brief="Wall factor", Default=1, Upper=10);
340        Rev as Real (Brief="Reynolds number of the vapor stream", Default=4000);
341        Al as area (Brief="Area occupied by the liquid", Default=0.001, Upper=1);
342        hl as positive (Brief="Column holdup", Unit='m^3/m^3', Default=0.01,Upper=10);
343
344SET
345        Mw = PP.MolecularWeight();
346
347EQUATIONS
348
349"Component Molar Balance"
350        diff(M)=Inlet.F*Inlet.z + InletL.F*InletL.z + InletV.F*InletV.z- OutletL.F*OutletL.z - OutletV.F*OutletV.z;
351
352"Molar Holdup"
353        M = ML*OutletL.z + MV*OutletV.z;
354       
355"Mol fraction normalisation"
356        sum(OutletL.z)= 1.0;
357       
358"Liquid Volume"
359        vL = PP.LiquidVolume(OutletL.T, OutletL.P, OutletL.z);
360
361"Vapour Volume"
362        vV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z);
363       
364"Chemical Equilibrium"
365        PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z =       PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, OutletV.z)*OutletV.z;
366       
367"Thermal Equilibrium"
368        OutletV.T = OutletL.T;
369       
370"Mechanical Equilibrium"
371        OutletL.P = OutletV.P;
372       
373"Liquid Density"
374        rhoL = PP.LiquidDensity(OutletL.T, OutletL.P, OutletL.z);
375
376"Vapour Density"
377        rhoV = PP.VapourDensity(InletV.T, InletV.P, InletV.z);
378
379"Liquid viscosity"
380        miL = PP.LiquidViscosity(OutletL.T, OutletL.P, OutletL.z);
381
382"Vapour viscosity"
383        miV = PP.VapourViscosity(InletV.T, InletV.P, InletV.z);
384
385"Volume flow rate of liquid, m^3/m^2/s"
386        uL * Al = OutletL.F * vL;
387       
388        deltaP = InletV.P - OutletV.P;
389       
390end
391
392#*-------------------------------------
393* Nonequilibrium Model
394-------------------------------------*
395Model interfaceTeste
396       
397        ATTRIBUTES
398        Pallete         = false;
399        Icon            = "icon/Tray";
400        Brief           = "Descrition of variables of the equilibrium interface.";
401        Info            =
402"This model contains only the variables of the equilibrium interface.";
403
404        PARAMETERS
405outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
406outer NComp as Integer;
407outer NC1 as Integer;
408       
409        VARIABLES
410        NL(NComp) as flow_mol_delta     (Brief = "Stream Molar Rate on Liquid Phase");
411        NV(NComp) as flow_mol_delta     (Brief = "Stream Molar Rate on Vapour Phase");
412        T as temperature                (Brief = "Stream Temperature");
413        P as pressure                   (Brief = "Stream Pressure");
414        x(NComp) as fraction    (Brief = "Stream Molar Fraction on Liquid Phase");
415        y(NComp) as fraction    (Brief = "Stream Molar Fraction on Vapour Phase");
416        a as area                           (Brief = "Interface Area");
417        htL as heat_trans_coeff (Brief = "Heat Transference Coefficient on Liquid Phase");
418        htV as heat_trans_coeff (Brief = "Heat Transference Coefficient on Vapour Phase");     
419        E_liq as heat_rate      (Brief = "Liquid Energy Rate at interface");
420    E_vap as heat_rate      (Brief = "Vapour Energy Rate at interface");       
421        hL as enth_mol          (Brief = "Liquid Molar Enthalpy");
422        hV as enth_mol          (Brief = "Vapour Molar Enthalpy");
423        kL(NC1,NC1) as velocity (Brief = "Mass Transfer Coefficients");
424        kV(NC1,NC1) as velocity (Brief = "Mass Transfer Coefficients");
425       
426        EQUATIONS
427        "Liquid Enthalpy"
428        hL = PP.LiquidEnthalpy(T, P, x);
429       
430        "Vapour Enthalpy"
431        hV = PP.VapourEnthalpy(T, P, y);
432
433end
434
435Model trayRateBasicTeste
436        ATTRIBUTES
437        Pallete         = false;
438        Icon            = "icon/Tray";
439        Brief           = "Basic equations of a tray rate column model.";
440        Info            =
441"This model contains only the main equations of a column tray nonequilibrium model without
442the hidraulic equations.
443       
444== Assumptions ==
445* both phases (liquid and vapour) exists all the time;
446* no entrainment of liquid or vapour phase;
447* no weeping;
448* the dymanics in the downcomer are neglected.
449";
450       
451        PARAMETERS
452outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
453outer NComp as Integer;
454    NC1 as Integer;
455        V as volume(Brief="Total Volume of the tray");
456        Q as heat_rate (Brief="Rate of heat supply");
457        Ap as area (Brief="Plate area = Atray - Adowncomer");
458       
459        VARIABLES
460in      Inlet as stream (Brief="Feed stream", PosX=0, PosY=0.4932, Symbol="_{in}");
461in      InletFV as stream (Brief="Feed stream", PosX=0, PosY=0.4932, Symbol="_{in}");
462in      InletL as stream (Brief="Inlet liquid stream", PosX=0.5195, PosY=0, Symbol="_{inL}");
463in      InletV as stream (Brief="Inlet vapour stream", PosX=0.4994, PosY=1, Symbol="_{inV}");
464out     OutletL as liquid_stream (Brief="Outlet liquid stream", PosX=0.8277, PosY=1, Symbol="_{outL}");
465out     OutletV as vapour_stream (Brief="Outlet vapour stream", PosX=0.8043, PosY=0, Symbol="_{outV}");
466
467        M_liq(NComp) as mol (Brief="Liquid Molar Holdup in the tray");
468        M_vap(NComp) as mol (Brief="Vapour Molar Holdup in the tray");
469        ML as mol (Brief="Molar liquid holdup");
470        MV as mol (Brief="Molar vapour holdup");
471        E_liq as energy (Brief="Total Liquid Energy Holdup on tray");
472        E_vap as energy (Brief="Total Vapour Energy Holdup on tray");
473        vL as volume_mol (Brief="Liquid Molar Volume");
474        vV as volume_mol (Brief="Vapour Molar volume");
475        Level as length (Brief="Height of clear liquid on plate");
476        interf as interfaceTeste;       
477
478        SET   
479        NC1=NComp-1;
480
481        EQUATIONS
482        "Component Molar Balance"
483        diff(M_liq)=Inlet.F*Inlet.z + InletL.F*InletL.z
484        - OutletL.F*OutletL.z + interf.NL;
485       
486        diff(M_vap)=InletFV.F*InletFV.z + InletV.F*InletV.z
487        - OutletV.F*OutletV.z - interf.NV;
488       
489        "Energy Balance"
490        diff(E_liq) = Inlet.F*Inlet.h + InletL.F*InletL.h
491                - OutletL.F*OutletL.h  + Q + interf.E_liq;
492       
493        diff(E_vap) = InletFV.F*InletFV.h + InletV.F*InletV.h
494                - OutletV.F*OutletV.h  - interf.E_vap;
495       
496        "Molar Holdup"
497        M_liq = ML*OutletL.z;
498       
499        M_vap = MV*OutletV.z;
500       
501        "Energy Holdup"
502        E_liq = ML*(OutletL.h - OutletL.P*vL);
503       
504        E_vap = MV*(OutletV.h - OutletV.P*vV);
505       
506        "Energy Rate through the interface"
507        interf.E_liq = interf.htL*interf.a*(interf.T-OutletL.T)+sum(interf.NL)*interf.hL;       
508       
509        interf.E_vap = interf.htV*interf.a*(OutletV.T-interf.T)+sum(interf.NV)*interf.hV;
510       
511        "Mass Conservation"
512        interf.NL = interf.NV;
513       
514        "Energy Conservation"
515        interf.E_liq = interf.E_vap;
516       
517        "Mol fraction normalisation"
518        sum(OutletL.z)= 1.0;
519        sum(OutletL.z)= sum(OutletV.z);
520        sum(interf.x)=1.0;
521        sum(interf.x)=sum(interf.y);
522       
523        "Liquid Volume"
524        vL = PP.LiquidVolume(OutletL.T, OutletL.P, OutletL.z);
525        "Vapour Volume"
526        vV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z);
527       
528        "Chemical Equilibrium"
529        PP.LiquidFugacityCoefficient(interf.T, interf.P, interf.x)*interf.x =
530                PP.VapourFugacityCoefficient(interf.T, interf.P, interf.y)*interf.y;
531
532        "Geometry Constraint"
533        V = ML*vL + MV*vV;
534       
535        "Level of clear liquid over the weir"
536        Level = ML*vL/Ap;
537
538        "Total Mass Transfer Rates"
539        interf.NL(1:NC1)=interf.a*sumt(interf.kL*(interf.x(1:NC1)-OutletL.z(1:NC1)))/vL+
540                OutletL.z(1:NC1)*sum(interf.NL);
541
542#       interf.NL(1:NC1)=0.01*'kmol/s';
543       
544        interf.NV(1:NC1)=interf.a*sumt(interf.kV*(OutletV.z(1:NC1)-interf.y(1:NC1)))/vV+
545                OutletV.z(1:NC1)*sum(interf.NV);
546
547        "Mechanical Equilibrium"
548        OutletV.P = OutletL.P;
549        interf.P=OutletL.P;
550end
551
552Model trayRateTeste as trayRateBasicTeste
553        ATTRIBUTES
554        Pallete         = false;
555        Icon            = "icon/Tray";
556        Brief           = "Complete rate model of a column tray.";
557        Info            =
558"== Specify ==
559* the Feed stream
560* the Liquid inlet stream
561* the Vapour inlet stream
562* the Vapour outlet flow (OutletV.F)
563       
564== Initial ==
565* the plate temperature of both phases (OutletL.T and OutletV.T)
566* the liquid height (Level) OR the liquid flow holdup (ML)
567* the vapor holdup (MV)
568* (NoComps - 1) OutletL compositions
569";
570
571        PARAMETERS
572        Ah as area (Brief="Total holes area");
573        lw as length (Brief="Weir length");
574        g as acceleration (Default=9.81);
575        hw as length (Brief="Weir height");
576        beta as fraction (Brief="Aeration fraction");
577        alfa as fraction (Brief="Dry pressure drop coefficient");
578       
579        VapourFlow as Switcher(Valid = ["on", "off"], Default = "on");
580        LiquidFlow as Switcher(Valid = ["on", "off"], Default = "on");
581       
582        VARIABLES
583        rhoL as dens_mass;
584        rhoV as dens_mass;
585
586        EQUATIONS
587        "Liquid Density"
588        rhoL = PP.LiquidDensity(OutletL.T, OutletL.P, OutletL.z);
589        "Vapour Density"
590        rhoV = PP.VapourDensity(InletV.T, InletV.P, InletV.z);
591
592        switch LiquidFlow
593                case "on":
594                "Francis Equation"
595#               OutletL.F*vL = 1.84*'m^0.5/s'*lw*((Level-(beta*hw))/(beta))^1.5;
596                OutletL.F*vL = 1.84*'1/s'*lw*((Level-(beta*hw))/(beta))^2;
597                when Level < (beta * hw) switchto "off";
598               
599                case "off":
600                "Low level"
601                OutletL.F = 0 * 'mol/h';
602                when Level > (beta * hw) + 1e-6*'m' switchto "on";
603        end
604
605        switch VapourFlow
606                case "on":
607                InletV.F*vV = sqrt((InletV.P - OutletV.P)/(rhoV*alfa))*Ah;
608                when InletV.F < 1e-6 * 'kmol/h' switchto "off";
609               
610                case "off":
611                InletV.F = 0 * 'mol/s';
612                when InletV.P > OutletV.P + Level*g*rhoL + 1e-1 * 'atm' switchto "on";
613        end     
614end
615
616*#
Note: See TracBrowser for help on using the repository browser.