source: branches/rate/eml/stage_separators/tray.mso @ 517

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

Updating tray rate model.

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