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

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

More shots

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