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

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

A new shot. Model with Billet and Schultes correlations

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 20.2 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 454 2008-02-08 20:20:12Z 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
360        VARIABLES
361        miL as viscosity (Brief="Liquid dynamic viscosity", DisplayUnit='kg/m/s');
362        miV as viscosity (Brief="Vapor dynamic viscosity", DisplayUnit='kg/m/s');
363        rhoL as dens_mass;
364        rhoV as dens_mass;
365        uL as velocity (Brief="volume flow rate of liquid, m^3/m^2/s", Default = 0.007);
366        uV as velocity (Brief="volume flow rate of vapor, m^3/m^2/s", Default = 1.14);
367        hs as length (Brief="Height of the packing stage");
368        dp as length (Brief="Particle diameter");
369        K as Real (Brief="Wall factor");
370        Rev as Real (Brief="Reynolds number of the vapor stream");
371        Qsio as Real (Brief="Resistance coefficient");
372       
373        SET
374        Mw = PP.MolecularWeight();
375       
376        EQUATIONS
377        "Liquid Density"
378        rhoL = PP.LiquidDensity(OutletL.T, OutletL.P, OutletL.z);
379        "Vapour Density"
380        rhoV = PP.VapourDensity(InletV.T, InletV.P, InletV.z);
381        "Liquid viscosity"
382        miL = PP.LiquidViscosity(OutletL.T, OutletL.P, OutletL.z);
383        "Vapour viscosity"
384        miV = PP.VapourViscosity(InletV.T, InletV.P, InletV.z);
385
386        "Volume flow rate of liquid, m^3/m^2/s"
387        uL * Ap = OutletL.F * vL;
388        "Volume flow rate of vapor, m^3/m^2/s"
389        uV * Ap = OutletV.F * vV;
390       
391#       "Liquid holdup and Liquid flow"
392#       vL * ML = (12*miL*a^2*uL/rhoL/g)^1/3 * hs * Ap;
393       
394        "Particle diameter"
395        dp = 6 * ((1-e)/a);
396       
397        "Wall Factor"
398        1 = K * 1+(2*dp/(3*ds*(1-e)));
399       
400        "Reynolds number of the vapor stream"
401        Rev = K*dp*uV*rhoV / (miV*(1-e));
402       
403        #"Resistance Coefficient"
404        #Qsio = Cpo * (64/Rev) + 1.8/Rev^0.08);
405        #Qsio = Cpo * (64/Rev);# + 1.8/Rev^0.08);
406
407        "Pressure drop and Vapor flow"
408        (InletV.P - OutletV.P)/hs = Qsio*a*uV^2*rhoV / (2*e^2*K);
409end
410
411#*-------------------------------------------------------------------
412* Model of a tray with reaction
413*-------------------------------------------------------------------*#
414Model trayReact
415        ATTRIBUTES
416        Pallete         = false;
417        Icon            = "icon/Tray";
418        Brief           = "Model of a tray with reaction.";
419        Info            =
420"== Assumptions ==
421* both phases (liquid and vapour) exists all the time;
422* thermodymanic equilibrium with Murphree plate efficiency;
423* no entrainment of liquid or vapour phase;
424* no weeping;
425* the dymanics in the downcomer are neglected.
426       
427== Specify ==
428* the Feed stream;
429* the Liquid inlet stream;
430* the Vapour inlet stream;
431* the Vapour outlet flow (OutletV.F);
432* the reaction related variables.
433       
434== Initial ==
435* the plate temperature (OutletL.T)
436* the liquid height (Level) OR the liquid flow OutletL.F
437* (NoComps - 1) OutletL compositions
438";
439
440        PARAMETERS
441        outer PP as Plugin(Type="PP");
442        outer NComp as Integer;
443        V as volume(Brief="Total Volume of the tray");
444        Q as power (Brief="Rate of heat supply");
445        Ap as area (Brief="Plate area = Atray - Adowncomer");
446       
447        Ah as area (Brief="Total holes area");
448        lw as length (Brief="Weir length");
449        g as acceleration (Default=9.81);
450        hw as length (Brief="Weir height");
451        beta as fraction (Brief="Aeration fraction");
452        alfa as fraction (Brief="Dry pressure drop coefficient");
453
454        stoic(NComp) as Real(Brief="Stoichiometric matrix");
455        Hr as energy_mol;
456        Pstartup as pressure;
457       
458        VapourFlow as Switcher(Valid = ["on", "off"], Default = "off");
459        LiquidFlow as Switcher(Valid = ["on", "off"], Default = "off");
460       
461        VARIABLES
462in      Inlet as stream (Brief="Feed stream", PosX=0, PosY=0.4932, Symbol="_{in}");
463in      InletL as stream (Brief="Inlet liquid stream", PosX=0.5195, PosY=0, Symbol="_{inL}");
464in      InletV as stream (Brief="Inlet vapour stream", PosX=0.4994, PosY=1, Symbol="_{inV}");
465out     OutletL as liquid_stream (Brief="Outlet liquid stream", PosX=0.8277, PosY=1, Symbol="_{outL}");
466out     OutletV as vapour_stream (Brief="Outlet vapour stream", PosX=0.8043, PosY=0, Symbol="_{outV}");
467
468        yideal(NComp) as fraction;
469        Emv as Real (Brief = "Murphree efficiency");
470
471        M(NComp) as mol (Brief="Molar Holdup in the tray");
472        ML as mol (Brief="Molar liquid holdup");
473        MV as mol (Brief="Molar vapour holdup");
474        E as energy (Brief="Total Energy Holdup on tray");
475        vL as volume_mol (Brief="Liquid Molar Volume");
476        vV as volume_mol (Brief="Vapour Molar volume");
477        Level as length (Brief="Height of clear liquid on plate");
478        Vol as volume;
479       
480        rhoL as dens_mass;
481        rhoV as dens_mass;
482        r3 as reaction_mol (Brief = "Reaction resulting ethyl acetate", DisplayUnit = 'mol/l/s');
483        C(NComp) as conc_mol (Brief = "Molar concentration", Lower = -1); #, Unit = "mol/l");
484       
485        EQUATIONS
486        "Molar Concentration"
487        OutletL.z = vL * C;
488       
489        "Reaction"
490        r3 = exp(-7150*'K'/OutletL.T)*(4.85e4*C(1)*C(2) - 1.23e4*C(3)*C(4))*'l/mol/s';
491       
492        "Component Molar Balance"
493        diff(M)=Inlet.F*Inlet.z + InletL.F*InletL.z + InletV.F*InletV.z
494                - OutletL.F*OutletL.z - OutletV.F*OutletV.z + stoic*r3*ML*vL;
495       
496        "Energy Balance"
497        diff(E) = ( Inlet.F*Inlet.h + InletL.F*InletL.h + InletV.F*InletV.h
498                - OutletL.F*OutletL.h - OutletV.F*OutletV.h + Q ) + Hr * r3 * vL*ML;
499       
500        "Molar Holdup"
501        M = ML*OutletL.z + MV*OutletV.z;
502       
503        "Energy Holdup"
504        E = ML*OutletL.h + MV*OutletV.h - OutletL.P*V;
505       
506        "Mol fraction normalisation"
507        sum(OutletL.z)= 1.0;
508       
509        "Liquid Volume"
510        vL = PP.LiquidVolume(OutletL.T, OutletL.P, OutletL.z);
511        "Vapour Volume"
512        vV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z);
513
514        "Thermal Equilibrium"
515        OutletV.T = OutletL.T;
516       
517        "Mechanical Equilibrium"
518        OutletV.P = OutletL.P;
519       
520        "Level of clear liquid over the weir"
521        Level = ML*vL/Ap;
522
523        Vol = ML*vL;
524       
525        "Liquid Density"
526        rhoL = PP.LiquidDensity(OutletL.T, OutletL.P, OutletL.z);
527        "Vapour Density"
528        rhoV = PP.VapourDensity(InletV.T, InletV.P, InletV.z);
529
530        switch LiquidFlow
531                case "on":
532                "Francis Equation"
533                OutletL.F*vL = 1.84*'1/s'*lw*((Level-(beta*hw)+1e-6*'m')/(beta))^2;
534                when Level < (beta * hw) switchto "off";
535               
536                case "off":
537                "Low level"
538                OutletL.F = 0 * 'mol/h';
539                when Level > (beta * hw) + 1e-6*'m' switchto "on";
540        end
541
542        switch VapourFlow
543                case "on":
544                #InletV.P = OutletV.P + Level*g*rhoL + rhoV*alfa*(InletV.F*vV/Ah)^2;
545                InletV.F*vV = sqrt((InletV.P - OutletV.P - Level*g*rhoL + 1e-8 * 'atm')/(rhoV*alfa))*Ah;
546                when InletV.P < OutletV.P + Level*g*rhoL switchto "off";
547               
548                case "off":
549                InletV.F = 0 * 'mol/s';
550                when InletV.P > OutletV.P + Level*g*rhoL + 3e-2 * 'atm' switchto "on";
551                #when InletV.P > OutletV.P + Level*beta*g*rhoL + 1e-2 * 'atm' switchto "on";
552        end
553
554        "Chemical Equilibrium"
555        PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z =
556                PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, yideal)*yideal;
557       
558        OutletV.z = Emv * (yideal - InletV.z) + InletV.z;
559       
560        sum(OutletL.z)= sum(OutletV.z);
561       
562        "Geometry Constraint"
563        V = ML* vL + MV*vV;
564end
565
566
567FlowSheet test
568        PARAMETERS
569        a as Real (Brief="surface area per packing volume", Unit='m^2/m^3');
570#       N as Real (Brief="Number of elements per volume",Unit='1/m^3');
571        niL as Real (Brief="Liquid dynamic viscosity", Unit='kg/m/s');
572        niV as Real (Brief="Vapor dynamic viscosity", Unit='kg/m/s');
573        g as acceleration;
574        rhoL as dens_mass;
575        rhoV as dens_mass;
576        e as Real (Brief="Void fraction of packing, m^3/m^3");
577        V as volume;
578        Across as area;
579        ds as length (Brief="Column diameter");
580        d as length (Brief="size of an element of packing");
581        h as length (Brief="Height of packing");
582        C as Real (Brief="Constant for resitance factor equation");
583        Cp as Real (Brief="Constant for resitance at loading point factor equation");
584       
585        vL as volume_mol;
586        vV as volume_mol;
587        ML as mol;
588        Mw as molweight;
589        dP as pressure (DisplayUnit='atm');
590       
591        VARIABLES
592        hL as Real (Brief="Liquid holdup", Default = 0.424);
593        VL as volume (Brief="Liquid volume", Default = 0.025);
594        uL as velocity (Brief="volume flow rate of liquid, m^3/m^2/s", Default = 0.007);
595        uV as velocity (Brief="volume flow rate of vapor, m^3/m^2/s", Default = 1.14);
596#       n as Real;
597        FV as flow_mol(Default = 149);
598        FL as flow_mol(Default = 222);
599        ksi as Real (Brief="Coefficient of Resistance", Default = 0.784);
600        ksil as Real (Brief="Coefficient of Resistance", Default = 0.032);
601        Rev as Real(Default = 0.966);
602        hLs as Real(Default = 0.037);
603       
604        EQUATIONS
605        VL = vL * ML;
606        hL = VL/V;
607        uL * Across = FL * vL;
608        uV * Across = FV * vV;
609       
610        ksi * C^2 * (uL/uV * sqrt(rhoV/rhoL) * (niL/niV)^5.8)^3 = g/1*'s^2/m';
611       
612        a^2 * niL * uL = hL^1 *(g*rhoL/3 - ksi*a*rhoV*uV^2/(4*hL*(e-hL)^2));
613       
614        dP/h = ksil *(a/2 + 2/ds)*(uV^2*rhoV/(e-hL)^3);
615       
616        ksil = Cp * (exp(uL*rhoL/a/niL/200)*(hL/hLs)^0.3) * (64/Rev+(1.8/Rev)) *
617                                ((e-hL)/e);#1.5
618       
619        Rev = uV * (d-2*hL/a) * rhoV/ niV;
620       
621        hLs = (12*a^2*niL*uL/g/rhoL)^0.333;
622
623        SPECIFY
624#       FV = 147.1 * 'kmol/h';
625#       FL = 229.5 * 'kmol/h';
626#       ksi = 0.809623;
627       
628        SET
629        Mw = 75 * 'g/mol';
630        vL = 9.5e-5 * 'm^3/mol';
631        vV = 0.022 * 'm^3/mol';
632        niL = 0.00032 * 'kg/m/s';
633        niV = 8.2e-5 * 'kg/m/s';
634        rhoL = 809 * 'kg/m^3';
635        rhoV  = 4.63 * 'kg/m^3';
636        ML = 0.268 * 'kmol';
637        dP = 0.1984 * 0.001 * 'atm';#0.1984 * 'atm';
638       
639        V = 0.06 * 'm^3';#0.06 * 'm^3';
640        Across = 0.8 * 'm^2';
641        h = 0.075 * 'm';
642        ds = 1.009 * 'm';
643        d = 50 * 'mm';
644
645#       ksi = 0.8;
646        C = 2.37;
647        Cp = 0.662;
648        e = 0.78;
649        a = 120 * 'm^2/m^3';
650#       N = 6400 * '1/m^3';
651
652        OPTIONS
653        GuessFile = "/home/paula/test.rlt";
654       
655end
656
657
Note: See TracBrowser for help on using the repository browser.