source: branches/packed/eml/stage_separators/tray.mso @ 470

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

More changes

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 20.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 470 2008-03-04 21:20:36Z paula $
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 flow OutletL.F
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
171Model packedStage_Navaes as trayBasic
172        PARAMETERS
173        PPwater as Plugin(Brief="Physical Properties",
174                Type="PP",
175                Components = [ "water" ],
176                LiquidModel = "PR",
177                VapourModel = "PR"
178        );
179       
180#       PackingType as Switcher(Valid = ["random", "structured"], Default = "randon");
181#       PressureDropModel as Switcher(Valid = ["Leva", "Prahl"], Default = "Prahl");
182
183        a as Real (Brief="Constant used in Leva equation", Default=873.55);
184        b as Real (Brief="Constant used in Leva equation", Default=0.058);
185#       Fp as Real (Brief="Packing factor", Default = 300);
186        e as fraction (Brief="Packing Porosity", Default=0.84);
187        dp as length (Brief="Packing Dimension", Default=0.013);
188#       C as Real (Brief="Prahl method constant", Unit = 'kg^0.2*m^1.8/s^2.2', Default = 2.994);
189
190#       S as length (Brief="Structured packing parameter", Default=0.009);
191#       teta as Real (Brief="Structured packing parameter", Unit= 'deg', Default=45);
192#       C3 as Real (Brief="Structured packing parameter", Default=3.38);
193
194        Across as area (Brief="Tower cross section area");
195        Mw(NComp)       as molweight    (Brief = "Component Mol Weight");
196        g as acceleration (Default=9.81);
197
198        SET
199        Mw = PP.MolecularWeight();
200        Ap = Across;
201       
202        VARIABLES
203        rhoL as dens_mass (Brief="Liquid density");
204        rhoV as dens_mass (Brief="Vapor density");
205        viscL as viscosity (Brief="Liquid Viscosity");
206        viscV as viscosity (Brief="Vapor Viscosity");
207        rhow as dens_mass (Brief="Water density");
208        visclw as viscosity (Brief="Water viscosity");
209       
210        L as flux_mass (Brief="Liquid mass flux");
211        G as flux_mass (Brief="Liquid mass flux");
212        Llin as flux_mass (Brief="Water contribution on liquid mass flux");
213#       X as Real (Brief="Term in Prahl correlation");
214#       Y as Real (Brief="Term in Prahl correlation");
215#       Reg as Real (Brief="Packing Reynolds");
216#       Ge as velocity (Brief="Temporay variable");
217#       Fr as Real (Brief="Froud number");
218        phiL as Real (Brief="Liquid holdup in packed towers");
219       
220#       deltaP_z as Real (Unit = 'inH2O/ft');
221       
222        EQUATIONS
223#       deltaP_z = (InletV.P - OutletV.P) / (V/Across);
224       
225        "If the liquid is not water - mass flux correction"
226        Llin = L * rhow/rhoL;
227       
228        "Base unit conversion (mol -> mass)"
229        L = OutletL.F*sum(Mw*OutletL.z)/Across;
230        G = OutletV.F*sum(Mw*OutletV.z)/Across;
231       
232#       "X in Prahl correlation"
233#       X * G = L * (rhoV/rhoL)^0.5;
234       
235#       "Y in Prahl correlation"
236#       Y = G^2 * Fp * (rhow/rhoL) * viscL^0.2 / (rhoV*rhoL*C) ;
237       
238        "Water Liquid Viscosity"
239        visclw = PPwater.LiquidViscosity(OutletL.T, OutletL.P, 1);
240        "Water Liquid Density"
241        rhow = PPwater.LiquidDensity(OutletL.T, OutletL.P, 1);
242        "Liquid Viscosity"
243        viscL = PP.LiquidViscosity(OutletL.T, OutletL.P, OutletL.z);
244        "Vapor Viscosity"
245        viscV = PP.VapourViscosity(OutletV.T, OutletV.P, OutletV.z);
246        "Liquid Density"
247        rhoL = PP.LiquidDensity(OutletL.T, OutletL.P, OutletL.z);
248        "Vapour Density"
249        rhoV = PP.VapourDensity(InletV.T, InletV.P, InletV.z);
250       
251#       "Froud number"
252#       Fr = (L/rhoL)^2 / S/g;
253#       "Reynolds number"
254#       Reg = S*(G/rhoV/(e*sin(teta)))*rhoV/viscV;
255#       "Temporary variable"
256#       Ge = G/rhoV /(e*sin(teta));
257        "Conversion from ML to phiL"
258        phiL = ML*vL / V;
259
260#       switch PackingType
261#               case "random":
262#                       switch PressureDropModel
263#                               case "Leva":
264                                        (InletV.P - OutletV.P)/'Pa' / (V/'m^3'/(Across/'m^2') ) = a * 10^(b*Llin/'kg/m^2/s') * (G/('kg/m^2/s'))^2/(rhoV/('kg/m^3'));
265                                        #(InletV.P - OutletV.P) / (V/(Across) ) =  a * 10^(b*Llin) * (G)^2/(rhoV);
266#                               case "Prahl":
267#                                       (InletV.P - OutletV.P)/'0.03937*inH2O' = (V/Across)/'m' * Y*(1116*X+500)/(1-Y*(35*X+3));
268#                       end
269                        phiL = (1.53e-4 + (2.9e-5*e*(dp*L/(viscL*e))^0.66 * (viscL/visclw)^0.75)) * (dp/'m')^(-1.2);
270#*              case "structured":
271                        (InletV.P - OutletV.P)/'Pa'= (V/Across)/'m' * ( (0.171 + 92.7/Reg) * (rhoV/('kg/m^3')*(Ge/('m/s'))^2/(S/'m')) )
272                                                   * (1/(1-C3 * sqrt(Fr) ))^5;
273               
274                        phiL = C3 * sqrt(Fr);
275        end
276*#
277end
278
279Model packedStage_Billet as trayBasic
280        PARAMETERS
281        a as Real (Brief="surface area per packing volume", Unit='m^2/m^3');
282        g as acceleration;
283        e as Real (Brief="Void fraction of packing, m^3/m^3");
284        Across as area;
285        ds as length (Brief="Column diameter");
286        d as length (Brief="size of an element of packing");
287        #h as length (Brief="Height of packing");
288        C as Real (Brief="Constant for resitance factor equation"); #Billet pp 80 (Cf+Cfl)/2
289        Cp as Real (Brief="Constant for resitance at loading point factor equation"); # Billet pp94
290        Mw(NComp)       as molweight    (Brief = "Component Mol Weight");
291
292        VARIABLES
293        niL as viscosity (Brief="Liquid dynamic viscosity", DisplayUnit='kg/m/s');
294        niV as viscosity (Brief="Vapor dynamic viscosity", DisplayUnit='kg/m/s');
295        rhoL as dens_mass;
296        rhoV as dens_mass;
297        hL as Real (Brief="Liquid holdup", Default = 0.424);
298        VL as volume (Brief="Liquid volume", Default = 0.025);
299        uL as velocity (Brief="volume flow rate of liquid, m^3/m^2/s", Default = 0.007);
300        uV as velocity (Brief="volume flow rate of vapor, m^3/m^2/s", Default = 1.14);
301        ksi as Real (Brief="Coefficient of Resistance", Default = 0.784);
302        ksil as Real (Brief="Coefficient of Resistance", Default = 0.032);
303        Rev as Real(Brief="Vapor Reynolds",Default = 0.966);
304        hLs as Real(Default = 0.037);
305        hs as length (Brief="Height of the packing stage");
306       
307        SET
308        Mw = PP.MolecularWeight();
309        Ap = Across;
310       
311        EQUATIONS
312        "Liquid Density"
313        rhoL = PP.LiquidDensity(OutletL.T, OutletL.P, OutletL.z);
314        "Vapour Density"
315        rhoV = PP.VapourDensity(InletV.T, InletV.P, InletV.z);
316        "Liquid viscosity"
317        niL = PP.LiquidViscosity(OutletL.T, OutletL.P, OutletL.z);
318        "Vapour viscosity"
319        niV = PP.VapourViscosity(InletV.T, InletV.P, InletV.z);
320
321        "Liquid volume"
322        VL = vL * ML;
323        "Liquid holdup"
324        hL = VL/V;
325
326        "Volume flow rate of liquid, m^3/m^2/s"
327        uL * Across = OutletL.F * vL;
328        "Volume flow rate of vapor, m^3/m^2/s"
329        uV * Across = OutletV.F * vV;
330       
331        "Coefficient of Resistance"
332        ksi * C^2 * (uL/uV * sqrt(rhoV/rhoL) * (niL/niV)^2)^0.5 = g/1*'s^2/m';
333        #ksil = Cp * (exp(uL*rhoL/a/niL/200)*(hL/hLs)^0.3) * (64/Rev+(1.8/Rev)) *
334        ksil = Cp * (exp(uL*rhoL/a/niL/200)*(hL/hLs)^0.3) * (64/Rev+(1.8/Rev)) *
335                                        ((e-hL)/e)^1.5;
336       
337#       "Liquid holdup and Liquid flow"
338#       a^2 * niL * uL = hL^1 *(g*rhoL/3 - ksi*a*rhoV*uV^2/(4*hL*(e-hL)^2));
339
340#       "Pressure drop and Vapor flow"
341#       (InletV.P - OutletV.P)/hs = ksil *(a/2 + 2/ds)*(uV^2*rhoV/(e-hL)^3);
342       
343        "Vapor Reynolds number"
344        Rev = uV * (d-2*hL/a) * rhoV/ niV;
345
346        "Theoretical Liquid Holdup"
347        hLs = (12*a^2*niL*uL/g/rhoL)^0.333;
348        #hLs = (12*a^2*niL*uL/g/rhoL);
349end
350
351Model packedStage_BilletSchultes as trayBasic
352        PARAMETERS
353        a as Real (Brief="surface area per packing volume", Unit='m^2/m^3');
354        g as acceleration;
355        e as Real (Brief="Void fraction of packing, m^3/m^3");
356        ds as length (Brief="Column diameter");
357        Cpo as Real (Brief="Constant for resitance equation"); # Billet and Schultes, 1999.
358        Mw(NComp)       as molweight    (Brief = "Component Mol Weight");
359        hs as length (Brief="Height of the packing stage");
360        Qsio as Real (Brief="Resistance coefficient", Lower = 0);
361       
362        VARIABLES
363        miL as viscosity (Brief="Liquid dynamic viscosity", DisplayUnit='kg/m/s');
364        miV as viscosity (Brief="Vapor dynamic viscosity", DisplayUnit='kg/m/s');
365        rhoL as dens_mass;
366        rhoV as dens_mass;
367        uL as Real (Brief="volume flow rate of liquid, m^3/m^2/s", Default = 0.007);
368        uV as Real (Brief="volume flow rate of vapor, m^3/m^2/s", Default = 1.14);
369        dp as length (Brief="Particle diameter", Default=1e-3);
370        invK as Real (Brief="Wall factor");
371        #Rev as Real (Brief="Reynolds number of the vapor stream", Lower = 0, Default=100);
372        #Qsio as Real (Brief="Resistance coefficient", Lower = 0);
373       
374        SET
375        Mw = PP.MolecularWeight();
376       
377        EQUATIONS
378        "Liquid Density"
379        rhoL = PP.LiquidDensity(OutletL.T, OutletL.P, OutletL.z);
380        "Vapour Density"
381        rhoV = PP.VapourDensity(InletV.T, InletV.P, InletV.z);
382        "Liquid viscosity"
383        miL = PP.LiquidViscosity(OutletL.T, OutletL.P, OutletL.z);
384        "Vapour viscosity"
385        miV = PP.VapourViscosity(InletV.T, InletV.P, InletV.z);
386
387        "Volume flow rate of liquid, m^3/m^2/s"
388        uL * Ap * e = OutletL.F * vL;
389        "Volume flow rate of vapor, m^3/m^2/s"
390        uV * Ap * e = OutletV.F * vV;
391       
392        "Liquid holdup and Liquid flow"
393        vL * ML = (12*miL*a^2*uL/rhoL/g)^1/3 * hs * Ap;
394       
395        "Particle diameter"
396        dp = 6 * (1-e)/a;
397       
398        "Wall Factor"
399        invK = (1 + (2*dp/(3*ds*(1-e))));
400       
401        #"Reynolds number of the vapor stream"
402        #Rev*invK = dp*uV*rhoV / (miV*(1-e));
403
404#*      if Rev > 1e-4 then
405                "Resistance Coefficient"       
406                Qsio = Cpo * (64/Rev + 1.8/Rev^0.08);
407        else
408                Qsio = 1;
409        end
410*#
411        "Pressure drop and Vapor flow"
412        (InletV.P - OutletV.P)/hs  = Qsio*a*uV^2*rhoV*invK / (2*e^3);
413       
414        "Efficiency"
415        Emv = 1;
416end
417
418#*-------------------------------------------------------------------
419* Model of a tray with reaction
420*------------------------------------------------------------------*#
421Model trayReact
422        ATTRIBUTES
423        Pallete         = false;
424        Icon            = "icon/Tray";
425        Brief           = "Model of a tray with reaction.";
426        Info            =
427"== Assumptions ==
428* both phases (liquid and vapour) exists all the time;
429* thermodymanic equilibrium with Murphree plate efficiency;
430* no entrainment of liquid or vapour phase;
431* no weeping;
432* the dymanics in the downcomer are neglected.
433       
434== Specify ==
435* the Feed stream;
436* the Liquid inlet stream;
437* the Vapour inlet stream;
438* the Vapour outlet flow (OutletV.F);
439* the reaction related variables.
440       
441== Initial ==
442* the plate temperature (OutletL.T)
443* the liquid height (Level) OR the liquid flow OutletL.F
444* (NoComps - 1) OutletL compositions
445";
446
447        PARAMETERS
448        outer PP as Plugin(Type="PP");
449        outer NComp as Integer;
450        V as volume(Brief="Total Volume of the tray");
451        Q as power (Brief="Rate of heat supply");
452        Ap as area (Brief="Plate area = Atray - Adowncomer");
453       
454        Ah as area (Brief="Total holes area");
455        lw as length (Brief="Weir length");
456        g as acceleration (Default=9.81);
457        hw as length (Brief="Weir height");
458        beta as fraction (Brief="Aeration fraction");
459        alfa as fraction (Brief="Dry pressure drop coefficient");
460
461        stoic(NComp) as Real(Brief="Stoichiometric matrix");
462        Hr as energy_mol;
463        Pstartup as pressure;
464       
465        VapourFlow as Switcher(Valid = ["on", "off"], Default = "off");
466        LiquidFlow as Switcher(Valid = ["on", "off"], Default = "off");
467       
468        VARIABLES
469in      Inlet as stream (Brief="Feed stream", PosX=0, PosY=0.4932, Symbol="_{in}");
470in      InletL as stream (Brief="Inlet liquid stream", PosX=0.5195, PosY=0, Symbol="_{inL}");
471in      InletV as stream (Brief="Inlet vapour stream", PosX=0.4994, PosY=1, Symbol="_{inV}");
472out     OutletL as liquid_stream (Brief="Outlet liquid stream", PosX=0.8277, PosY=1, Symbol="_{outL}");
473out     OutletV as vapour_stream (Brief="Outlet vapour stream", PosX=0.8043, PosY=0, Symbol="_{outV}");
474
475        yideal(NComp) as fraction;
476        Emv as Real (Brief = "Murphree efficiency");
477
478        M(NComp) as mol (Brief="Molar Holdup in the tray");
479        ML as mol (Brief="Molar liquid holdup");
480        MV as mol (Brief="Molar vapour holdup");
481        E as energy (Brief="Total Energy Holdup on tray");
482        vL as volume_mol (Brief="Liquid Molar Volume");
483        vV as volume_mol (Brief="Vapour Molar volume");
484        Level as length (Brief="Height of clear liquid on plate");
485        Vol as volume;
486       
487        rhoL as dens_mass;
488        rhoV as dens_mass;
489        r3 as reaction_mol (Brief = "Reaction resulting ethyl acetate", DisplayUnit = 'mol/l/s');
490        C(NComp) as conc_mol (Brief = "Molar concentration", Lower = -1); #, Unit = "mol/l");
491       
492        EQUATIONS
493        "Molar Concentration"
494        OutletL.z = vL * C;
495       
496        "Reaction"
497        r3 = exp(-7150*'K'/OutletL.T)*(4.85e4*C(1)*C(2) - 1.23e4*C(3)*C(4))*'l/mol/s';
498       
499        "Component Molar Balance"
500        diff(M)=Inlet.F*Inlet.z + InletL.F*InletL.z + InletV.F*InletV.z
501                - OutletL.F*OutletL.z - OutletV.F*OutletV.z + stoic*r3*ML*vL;
502       
503        "Energy Balance"
504        diff(E) = ( Inlet.F*Inlet.h + InletL.F*InletL.h + InletV.F*InletV.h
505                - OutletL.F*OutletL.h - OutletV.F*OutletV.h + Q ) + Hr * r3 * vL*ML;
506       
507        "Molar Holdup"
508        M = ML*OutletL.z + MV*OutletV.z;
509       
510        "Energy Holdup"
511        E = ML*OutletL.h + MV*OutletV.h - OutletL.P*V;
512       
513        "Mol fraction normalisation"
514        sum(OutletL.z)= 1.0;
515       
516        "Liquid Volume"
517        vL = PP.LiquidVolume(OutletL.T, OutletL.P, OutletL.z);
518        "Vapour Volume"
519        vV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z);
520
521        "Thermal Equilibrium"
522        OutletV.T = OutletL.T;
523       
524        "Mechanical Equilibrium"
525        OutletV.P = OutletL.P;
526       
527        "Level of clear liquid over the weir"
528        Level = ML*vL/Ap;
529
530        Vol = ML*vL;
531       
532        "Liquid Density"
533        rhoL = PP.LiquidDensity(OutletL.T, OutletL.P, OutletL.z);
534        "Vapour Density"
535        rhoV = PP.VapourDensity(InletV.T, InletV.P, InletV.z);
536
537        switch LiquidFlow
538                case "on":
539                "Francis Equation"
540                OutletL.F*vL = 1.84*'1/s'*lw*((Level-(beta*hw)+1e-6*'m')/(beta))^2;
541                when Level < (beta * hw) switchto "off";
542               
543                case "off":
544                "Low level"
545                OutletL.F = 0 * 'mol/h';
546                when Level > (beta * hw) + 1e-6*'m' switchto "on";
547        end
548
549        switch VapourFlow
550                case "on":
551                #InletV.P = OutletV.P + Level*g*rhoL + rhoV*alfa*(InletV.F*vV/Ah)^2;
552                InletV.F*vV = sqrt((InletV.P - OutletV.P - Level*g*rhoL + 1e-8 * 'atm')/(rhoV*alfa))*Ah;
553                when InletV.P < OutletV.P + Level*g*rhoL switchto "off";
554               
555                case "off":
556                InletV.F = 0 * 'mol/s';
557                when InletV.P > OutletV.P + Level*g*rhoL + 3e-2 * 'atm' switchto "on";
558                #when InletV.P > OutletV.P + Level*beta*g*rhoL + 1e-2 * 'atm' switchto "on";
559        end
560
561        "Chemical Equilibrium"
562        PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z =
563                PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, yideal)*yideal;
564       
565        OutletV.z = Emv * (yideal - InletV.z) + InletV.z;
566       
567        sum(OutletL.z)= sum(OutletV.z);
568       
569        "Geometry Constraint"
570        V = ML* vL + MV*vV;
571end
572
573FlowSheet test
574        PARAMETERS
575        a as Real (Brief="surface area per packing volume", Unit='m^2/m^3');
576#       N as Real (Brief="Number of elements per volume",Unit='1/m^3');
577        niL as Real (Brief="Liquid dynamic viscosity", Unit='kg/m/s');
578        niV as Real (Brief="Vapor dynamic viscosity", Unit='kg/m/s');
579        g as acceleration;
580        rhoL as dens_mass;
581        rhoV as dens_mass;
582        e as Real (Brief="Void fraction of packing, m^3/m^3");
583        V as volume;
584        Across as area;
585        ds as length (Brief="Column diameter");
586        d as length (Brief="size of an element of packing");
587        h as length (Brief="Height of packing");
588        C as Real (Brief="Constant for resitance factor equation");
589        Cp as Real (Brief="Constant for resitance at loading point factor equation");
590       
591        vL as volume_mol;
592        vV as volume_mol;
593        ML as mol;
594        Mw as molweight;
595        dP as pressure (DisplayUnit='atm');
596       
597        VARIABLES
598        hL as Real (Brief="Liquid holdup", Default = 0.424);
599        VL as volume (Brief="Liquid volume", Default = 0.025);
600        uL as velocity (Brief="volume flow rate of liquid, m^3/m^2/s", Default = 0.007);
601        uV as velocity (Brief="volume flow rate of vapor, m^3/m^2/s", Default = 1.14);
602#       n as Real;
603        FV as flow_mol(Default = 149);
604        FL as flow_mol(Default = 222);
605        ksi as Real (Brief="Coefficient of Resistance", Default = 0.784);
606        ksil as Real (Brief="Coefficient of Resistance", Default = 0.032);
607        Rev as Real(Default = 0.966);
608        hLs as Real(Default = 0.037);
609       
610        EQUATIONS
611        VL = vL * ML;
612        hL = VL/V;
613        uL * Across = FL * vL;
614        uV * Across = FV * vV;
615       
616        ksi * C^2 * (uL/uV * sqrt(rhoV/rhoL) * (niL/niV)^5.8)^3 = g/1*'s^2/m';
617       
618        a^2 * niL * uL = hL^1 *(g*rhoL/3 - ksi*a*rhoV*uV^2/(4*hL*(e-hL)^2));
619       
620        dP/h = ksil *(a/2 + 2/ds)*(uV^2*rhoV/(e-hL)^3);
621       
622        ksil = Cp * (exp(uL*rhoL/a/niL/200)*(hL/hLs)^0.3) * (64/Rev+(1.8/Rev)) *
623                                ((e-hL)/e);#1.5
624       
625        Rev = uV * (d-2*hL/a) * rhoV/ niV;
626       
627        hLs = (12*a^2*niL*uL/g/rhoL)^0.333;
628
629        SPECIFY
630#       FV = 147.1 * 'kmol/h';
631#       FL = 229.5 * 'kmol/h';
632#       ksi = 0.809623;
633       
634        SET
635        Mw = 75 * 'g/mol';
636        vL = 9.5e-5 * 'm^3/mol';
637        vV = 0.022 * 'm^3/mol';
638        niL = 0.00032 * 'kg/m/s';
639        niV = 8.2e-5 * 'kg/m/s';
640        rhoL = 809 * 'kg/m^3';
641        rhoV  = 4.63 * 'kg/m^3';
642        ML = 0.268 * 'kmol';
643        dP = 0.1984 * 0.001 * 'atm';#0.1984 * 'atm';
644       
645        V = 0.06 * 'm^3';#0.06 * 'm^3';
646        Across = 0.8 * 'm^2';
647        h = 0.075 * 'm';
648        ds = 1.009 * 'm';
649        d = 50 * 'mm';
650
651#       ksi = 0.8;
652        C = 2.37;
653        Cp = 0.662;
654        e = 0.78;
655        a = 120 * 'm^2/m^3';
656#       N = 6400 * '1/m^3';
657
658        OPTIONS
659        GuessFile = "/home/paula/test.rlt";
660       
661end
662
663
Note: See TracBrowser for help on using the repository browser.