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

Last change on this file since 700 was 700, checked in by gerson bicca, 14 years ago

improved model DistillationReac? (BRANCH)

File size: 20.8 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 packedStageTeste
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       
302        PARAMETERS
303outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
304outer NComp as Integer;
305        PPwater as Plugin(Brief="Physical Properties",
306                Type="PP",
307                Components = [ "water" ],
308                LiquidModel = "PR",
309                VapourModel = "PR"
310        );
311
312        V as volume(Brief="Total Volume of the tray");
313        Q as heat_rate (Brief="Rate of heat supply");
314        d as length (Brief="Column diameter"); 
315
316        a as Real (Brief="surface area per packing volume", Unit='m^2/m^3');
317        g as acceleration;
318        e as Real (Brief="Void fraction of packing, m^3/m^3");
319        Cpo as Real (Brief="Constant for resitance equation"); # Billet and Schultes, 1999.
320        Mw(NComp)       as molweight    (Brief = "Component Mol Weight");
321        hs as length (Brief="Height of the packing stage");
322        Qsil as positive (Brief="Resistance coefficient on the liquid load", Default=1);
323
324        VARIABLES
325in      Inlet as stream (Brief="Feed stream", PosX=0, PosY=0.4932, Symbol="_{in}");
326in      InletL as stream (Brief="Inlet liquid stream", PosX=0.5195, PosY=0, Symbol="_{inL}");
327in      InletV as stream (Brief="Inlet vapour stream", PosX=0.4994, PosY=1, Symbol="_{inV}");
328out     OutletL as liquid_stream (Brief="Outlet liquid stream", PosX=0.8277, PosY=1, Symbol="_{outL}");
329out     OutletV as vapour_stream (Brief="Outlet vapour stream", PosX=0.8043, PosY=0, Symbol="_{outV}");
330
331        M(NComp) as mol (Brief="Molar Holdup in the tray", Default=0.01, Lower=0, Upper=100);
332        ML as mol (Brief="Molar liquid holdup", Default=0.01, Lower=0, Upper=100);
333        MV as mol (Brief="Molar vapour holdup", Default=0.01, Lower=0, Upper=100);
334        E as energy (Brief="Total Energy Holdup on tray", Default=-500);
335        vL as volume_mol (Brief="Liquid Molar Volume");
336        vV as volume_mol (Brief="Vapour Molar volume");
337       
338        miL as viscosity (Brief="Liquid dynamic viscosity", DisplayUnit='kg/m/s');
339        miV as viscosity (Brief="Vapor dynamic viscosity", DisplayUnit='kg/m/s');
340        rhoL as dens_mass;
341        rhoV as dens_mass;
342       
343        deltaP as pressure;
344       
345        uL as velocity (Brief="volume flow rate of liquid, m^3/m^2/s", Lower=-10, Upper=100);
346        uV as velocity (Brief="volume flow rate of vapor, m^3/m^2/s", Lower=-10, Upper=100);
347        dp as length (Brief="Particle diameter", Default=1e-3, Lower=0, Upper=10);
348        invK as positive (Brief="Wall factor", Default=1, Upper=10);
349        Rev as Real (Brief="Reynolds number of the vapor stream", Default=4000);
350        Al as area (Brief="Area occupied by the liquid", Default=0.001, Upper=1);
351        hl as positive (Brief="Column holdup", Unit='m^3/m^3', Default=0.01,Upper=10);
352
353        SET
354        Mw = PP.MolecularWeight();
355
356        EQUATIONS
357        "Component Molar Balance"
358        diff(M)=Inlet.F*Inlet.z + InletL.F*InletL.z + InletV.F*InletV.z
359                - OutletL.F*OutletL.z - OutletV.F*OutletV.z;
360
361        "Energy Balance"
362        diff(E) = ( Inlet.F*Inlet.h + InletL.F*InletL.h + InletV.F*InletV.h
363                - OutletL.F*OutletL.h - OutletV.F*OutletV.h + Q );
364       
365        "Molar Holdup"
366        M = ML*OutletL.z + MV*OutletV.z;
367       
368        "Energy Holdup"
369        E = ML*OutletL.h + MV*OutletV.h - OutletL.P*V;
370       
371        "Mol fraction normalisation"
372        sum(OutletL.z)= 1.0;
373       
374        "Liquid Volume"
375        vL = PP.LiquidVolume(OutletL.T, OutletL.P, OutletL.z);
376        "Vapour Volume"
377        vV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z);
378       
379        "Chemical Equilibrium"
380        PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z =
381                PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, OutletV.z)*OutletV.z;
382       
383        "Thermal Equilibrium"
384        OutletV.T = OutletL.T;
385       
386        "Mechanical Equilibrium"
387        OutletL.P = OutletV.P;
388       
389        "Geometry Constraint"
390        V*e = ML*vL + MV*vV;
391       
392        "Liquid Density"
393        rhoL = PP.LiquidDensity(OutletL.T, OutletL.P, OutletL.z);
394        "Vapour Density"
395        rhoV = PP.VapourDensity(InletV.T, InletV.P, InletV.z);
396        "Liquid viscosity"
397        miL = PP.LiquidViscosity(OutletL.T, OutletL.P, OutletL.z);
398        "Vapour viscosity"
399        miV = PP.VapourViscosity(InletV.T, InletV.P, InletV.z);
400
401        "Area occupied by the liquid"
402        Al = ML*vL/hs;
403
404        "Volume flow rate of liquid, m^3/m^2/s"
405        uL * Al = OutletL.F * vL;
406        "Volume flow rate of vapor, m^3/m^2/s"
407        uV * ((d^2*3.14159/4)*e - Al) = OutletV.F * vV;
408       
409        "Liquid holdup"
410        hl = ML*vL/V/e;
411       
412        "Particle diameter"
413        dp = 6 * (1-e)/a;
414       
415        "Wall Factor"
416        invK = (1 + (2*dp/(3*d*(1-e))));
417       
418        "Reynolds number of the vapor stream"
419        Rev*invK = dp*uV*rhoV / (miV*(1-e));
420       
421        deltaP = InletV.P - OutletV.P;
422       
423        "Pressure drop and Vapor flow"
424        deltaP/hs  = Qsil*a*uV^2*rhoV*invK / (2*(e-hl)^3);
425
426        "Liquid holdup"
427        hl = (12*miL*a^2*uL/rhoL/g)^1/3;
428end
429
430#*-------------------------------------
431* Nonequilibrium Model
432-------------------------------------*#
433Model interfaceTeste
434       
435        ATTRIBUTES
436        Pallete         = false;
437        Icon            = "icon/Tray";
438        Brief           = "Descrition of variables of the equilibrium interface.";
439        Info            =
440"This model contains only the variables of the equilibrium interface.";
441
442        PARAMETERS
443outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
444outer NComp as Integer;
445outer NC1 as Integer;
446       
447        VARIABLES
448        NL(NComp) as flow_mol_delta     (Brief = "Stream Molar Rate on Liquid Phase");
449        NV(NComp) as flow_mol_delta     (Brief = "Stream Molar Rate on Vapour Phase");
450        T as temperature                (Brief = "Stream Temperature");
451        P as pressure                   (Brief = "Stream Pressure");
452        x(NComp) as fraction    (Brief = "Stream Molar Fraction on Liquid Phase");
453        y(NComp) as fraction    (Brief = "Stream Molar Fraction on Vapour Phase");
454        a as area                           (Brief = "Interface Area");
455        htL as heat_trans_coeff (Brief = "Heat Transference Coefficient on Liquid Phase");
456        htV as heat_trans_coeff (Brief = "Heat Transference Coefficient on Vapour Phase");     
457        E_liq as heat_rate      (Brief = "Liquid Energy Rate at interface");
458    E_vap as heat_rate      (Brief = "Vapour Energy Rate at interface");       
459        hL as enth_mol          (Brief = "Liquid Molar Enthalpy");
460        hV as enth_mol          (Brief = "Vapour Molar Enthalpy");
461        kL(NC1,NC1) as velocity (Brief = "Mass Transfer Coefficients");
462        kV(NC1,NC1) as velocity (Brief = "Mass Transfer Coefficients");
463       
464        EQUATIONS
465        "Liquid Enthalpy"
466        hL = PP.LiquidEnthalpy(T, P, x);
467       
468        "Vapour Enthalpy"
469        hV = PP.VapourEnthalpy(T, P, y);
470
471end
472
473Model trayRateBasicTeste
474        ATTRIBUTES
475        Pallete         = false;
476        Icon            = "icon/Tray";
477        Brief           = "Basic equations of a tray rate column model.";
478        Info            =
479"This model contains only the main equations of a column tray nonequilibrium model without
480the hidraulic equations.
481       
482== Assumptions ==
483* both phases (liquid and vapour) exists all the time;
484* no entrainment of liquid or vapour phase;
485* no weeping;
486* the dymanics in the downcomer are neglected.
487";
488       
489        PARAMETERS
490outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
491outer NComp as Integer;
492    NC1 as Integer;
493        V as volume(Brief="Total Volume of the tray");
494        Q as heat_rate (Brief="Rate of heat supply");
495        Ap as area (Brief="Plate area = Atray - Adowncomer");
496       
497        VARIABLES
498in      Inlet as stream (Brief="Feed stream", PosX=0, PosY=0.4932, Symbol="_{in}");
499in      InletFV as stream (Brief="Feed stream", PosX=0, PosY=0.4932, Symbol="_{in}");
500in      InletL as stream (Brief="Inlet liquid stream", PosX=0.5195, PosY=0, Symbol="_{inL}");
501in      InletV as stream (Brief="Inlet vapour stream", PosX=0.4994, PosY=1, Symbol="_{inV}");
502out     OutletL as liquid_stream (Brief="Outlet liquid stream", PosX=0.8277, PosY=1, Symbol="_{outL}");
503out     OutletV as vapour_stream (Brief="Outlet vapour stream", PosX=0.8043, PosY=0, Symbol="_{outV}");
504
505        M_liq(NComp) as mol (Brief="Liquid Molar Holdup in the tray");
506        M_vap(NComp) as mol (Brief="Vapour Molar Holdup in the tray");
507        ML as mol (Brief="Molar liquid holdup");
508        MV as mol (Brief="Molar vapour holdup");
509        E_liq as energy (Brief="Total Liquid Energy Holdup on tray");
510        E_vap as energy (Brief="Total Vapour Energy Holdup on tray");
511        vL as volume_mol (Brief="Liquid Molar Volume");
512        vV as volume_mol (Brief="Vapour Molar volume");
513        Level as length (Brief="Height of clear liquid on plate");
514        interf as interfaceTeste;       
515
516        SET   
517        NC1=NComp-1;
518
519        EQUATIONS
520        "Component Molar Balance"
521        diff(M_liq)=Inlet.F*Inlet.z + InletL.F*InletL.z
522        - OutletL.F*OutletL.z + interf.NL;
523       
524        diff(M_vap)=InletFV.F*InletFV.z + InletV.F*InletV.z
525        - OutletV.F*OutletV.z - interf.NV;
526       
527        "Energy Balance"
528        diff(E_liq) = Inlet.F*Inlet.h + InletL.F*InletL.h
529                - OutletL.F*OutletL.h  + Q + interf.E_liq;
530       
531        diff(E_vap) = InletFV.F*InletFV.h + InletV.F*InletV.h
532                - OutletV.F*OutletV.h  - interf.E_vap;
533       
534        "Molar Holdup"
535        M_liq = ML*OutletL.z;
536       
537        M_vap = MV*OutletV.z;
538       
539        "Energy Holdup"
540        E_liq = ML*(OutletL.h - OutletL.P*vL);
541       
542        E_vap = MV*(OutletV.h - OutletV.P*vV);
543       
544        "Energy Rate through the interface"
545        interf.E_liq = interf.htL*interf.a*(interf.T-OutletL.T)+sum(interf.NL)*interf.hL;       
546       
547        interf.E_vap = interf.htV*interf.a*(OutletV.T-interf.T)+sum(interf.NV)*interf.hV;
548       
549        "Mass Conservation"
550        interf.NL = interf.NV;
551       
552        "Energy Conservation"
553        interf.E_liq = interf.E_vap;
554       
555        "Mol fraction normalisation"
556        sum(OutletL.z)= 1.0;
557        sum(OutletL.z)= sum(OutletV.z);
558        sum(interf.x)=1.0;
559        sum(interf.x)=sum(interf.y);
560       
561        "Liquid Volume"
562        vL = PP.LiquidVolume(OutletL.T, OutletL.P, OutletL.z);
563        "Vapour Volume"
564        vV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z);
565       
566        "Chemical Equilibrium"
567        PP.LiquidFugacityCoefficient(interf.T, interf.P, interf.x)*interf.x =
568                PP.VapourFugacityCoefficient(interf.T, interf.P, interf.y)*interf.y;
569
570        "Geometry Constraint"
571        V = ML*vL + MV*vV;
572       
573        "Level of clear liquid over the weir"
574        Level = ML*vL/Ap;
575
576        "Total Mass Transfer Rates"
577        interf.NL(1:NC1)=interf.a*sumt(interf.kL*(interf.x(1:NC1)-OutletL.z(1:NC1)))/vL+
578                OutletL.z(1:NC1)*sum(interf.NL);
579
580#       interf.NL(1:NC1)=0.01*'kmol/s';
581       
582        interf.NV(1:NC1)=interf.a*sumt(interf.kV*(OutletV.z(1:NC1)-interf.y(1:NC1)))/vV+
583                OutletV.z(1:NC1)*sum(interf.NV);
584
585        "Mechanical Equilibrium"
586        OutletV.P = OutletL.P;
587        interf.P=OutletL.P;
588end
589
590Model trayRateTeste as trayRateBasicTeste
591        ATTRIBUTES
592        Pallete         = false;
593        Icon            = "icon/Tray";
594        Brief           = "Complete rate model of a column tray.";
595        Info            =
596"== Specify ==
597* the Feed stream
598* the Liquid inlet stream
599* the Vapour inlet stream
600* the Vapour outlet flow (OutletV.F)
601       
602== Initial ==
603* the plate temperature of both phases (OutletL.T and OutletV.T)
604* the liquid height (Level) OR the liquid flow holdup (ML)
605* the vapor holdup (MV)
606* (NoComps - 1) OutletL compositions
607";
608
609        PARAMETERS
610        Ah as area (Brief="Total holes area");
611        lw as length (Brief="Weir length");
612        g as acceleration (Default=9.81);
613        hw as length (Brief="Weir height");
614        beta as fraction (Brief="Aeration fraction");
615        alfa as fraction (Brief="Dry pressure drop coefficient");
616       
617        VapourFlow as Switcher(Valid = ["on", "off"], Default = "on");
618        LiquidFlow as Switcher(Valid = ["on", "off"], Default = "on");
619       
620        VARIABLES
621        rhoL as dens_mass;
622        rhoV as dens_mass;
623
624        EQUATIONS
625        "Liquid Density"
626        rhoL = PP.LiquidDensity(OutletL.T, OutletL.P, OutletL.z);
627        "Vapour Density"
628        rhoV = PP.VapourDensity(InletV.T, InletV.P, InletV.z);
629
630        switch LiquidFlow
631                case "on":
632                "Francis Equation"
633#               OutletL.F*vL = 1.84*'m^0.5/s'*lw*((Level-(beta*hw))/(beta))^1.5;
634                OutletL.F*vL = 1.84*'1/s'*lw*((Level-(beta*hw))/(beta))^2;
635                when Level < (beta * hw) switchto "off";
636               
637                case "off":
638                "Low level"
639                OutletL.F = 0 * 'mol/h';
640                when Level > (beta * hw) + 1e-6*'m' switchto "on";
641        end
642
643        switch VapourFlow
644                case "on":
645                InletV.F*vV = sqrt((InletV.P - OutletV.P)/(rhoV*alfa))*Ah;
646                when InletV.F < 1e-6 * 'kmol/h' switchto "off";
647               
648                case "off":
649                InletV.F = 0 * 'mol/s';
650                when InletV.P > OutletV.P + Level*g*rhoL + 1e-1 * 'atm' switchto "on";
651        end     
652end
Note: See TracBrowser for help on using the repository browser.