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

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

Temporary tray files

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 13.4 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 448 2008-01-22 17:14:11Z 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 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
279#*-------------------------------------------------------------------
280* Model of a tray with reaction
281*-------------------------------------------------------------------*#
282Model trayReact
283        ATTRIBUTES
284        Pallete         = false;
285        Icon            = "icon/Tray";
286        Brief           = "Model of a tray with reaction.";
287        Info            =
288"== Assumptions ==
289* both phases (liquid and vapour) exists all the time;
290* thermodymanic equilibrium with Murphree plate efficiency;
291* no entrainment of liquid or vapour phase;
292* no weeping;
293* the dymanics in the downcomer are neglected.
294       
295== Specify ==
296* the Feed stream;
297* the Liquid inlet stream;
298* the Vapour inlet stream;
299* the Vapour outlet flow (OutletV.F);
300* the reaction related variables.
301       
302== Initial ==
303* the plate temperature (OutletL.T)
304* the liquid height (Level) OR the liquid flow OutletL.F
305* (NoComps - 1) OutletL compositions
306";
307
308        PARAMETERS
309        outer PP as Plugin(Type="PP");
310        outer NComp as Integer;
311        V as volume(Brief="Total Volume of the tray");
312        Q as power (Brief="Rate of heat supply");
313        Ap as area (Brief="Plate area = Atray - Adowncomer");
314       
315        Ah as area (Brief="Total holes area");
316        lw as length (Brief="Weir length");
317        g as acceleration (Default=9.81);
318        hw as length (Brief="Weir height");
319        beta as fraction (Brief="Aeration fraction");
320        alfa as fraction (Brief="Dry pressure drop coefficient");
321
322        stoic(NComp) as Real(Brief="Stoichiometric matrix");
323        Hr as energy_mol;
324        Pstartup as pressure;
325       
326        VapourFlow as Switcher(Valid = ["on", "off"], Default = "off");
327        LiquidFlow as Switcher(Valid = ["on", "off"], Default = "off");
328       
329        VARIABLES
330in      Inlet as stream (Brief="Feed stream", PosX=0, PosY=0.4932, Symbol="_{in}");
331in      InletL as stream (Brief="Inlet liquid stream", PosX=0.5195, PosY=0, Symbol="_{inL}");
332in      InletV as stream (Brief="Inlet vapour stream", PosX=0.4994, PosY=1, Symbol="_{inV}");
333out     OutletL as liquid_stream (Brief="Outlet liquid stream", PosX=0.8277, PosY=1, Symbol="_{outL}");
334out     OutletV as vapour_stream (Brief="Outlet vapour stream", PosX=0.8043, PosY=0, Symbol="_{outV}");
335
336        yideal(NComp) as fraction;
337        Emv as Real (Brief = "Murphree efficiency");
338
339        M(NComp) as mol (Brief="Molar Holdup in the tray");
340        ML as mol (Brief="Molar liquid holdup");
341        MV as mol (Brief="Molar vapour holdup");
342        E as energy (Brief="Total Energy Holdup on tray");
343        vL as volume_mol (Brief="Liquid Molar Volume");
344        vV as volume_mol (Brief="Vapour Molar volume");
345        Level as length (Brief="Height of clear liquid on plate");
346        Vol as volume;
347       
348        rhoL as dens_mass;
349        rhoV as dens_mass;
350        r3 as reaction_mol (Brief = "Reaction resulting ethyl acetate", DisplayUnit = 'mol/l/s');
351        C(NComp) as conc_mol (Brief = "Molar concentration", Lower = -1); #, Unit = "mol/l");
352       
353        EQUATIONS
354        "Molar Concentration"
355        OutletL.z = vL * C;
356       
357        "Reaction"
358        r3 = exp(-7150*'K'/OutletL.T)*(4.85e4*C(1)*C(2) - 1.23e4*C(3)*C(4))*'l/mol/s';
359       
360        "Component Molar Balance"
361        diff(M)=Inlet.F*Inlet.z + InletL.F*InletL.z + InletV.F*InletV.z
362                - OutletL.F*OutletL.z - OutletV.F*OutletV.z + stoic*r3*ML*vL;
363       
364        "Energy Balance"
365        diff(E) = ( Inlet.F*Inlet.h + InletL.F*InletL.h + InletV.F*InletV.h
366                - OutletL.F*OutletL.h - OutletV.F*OutletV.h + Q ) + Hr * r3 * vL*ML;
367       
368        "Molar Holdup"
369        M = ML*OutletL.z + MV*OutletV.z;
370       
371        "Energy Holdup"
372        E = ML*OutletL.h + MV*OutletV.h - OutletL.P*V;
373       
374        "Mol fraction normalisation"
375        sum(OutletL.z)= 1.0;
376       
377        "Liquid Volume"
378        vL = PP.LiquidVolume(OutletL.T, OutletL.P, OutletL.z);
379        "Vapour Volume"
380        vV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z);
381
382        "Thermal Equilibrium"
383        OutletV.T = OutletL.T;
384       
385        "Mechanical Equilibrium"
386        OutletV.P = OutletL.P;
387       
388        "Level of clear liquid over the weir"
389        Level = ML*vL/Ap;
390
391        Vol = ML*vL;
392       
393        "Liquid Density"
394        rhoL = PP.LiquidDensity(OutletL.T, OutletL.P, OutletL.z);
395        "Vapour Density"
396        rhoV = PP.VapourDensity(InletV.T, InletV.P, InletV.z);
397
398        switch LiquidFlow
399                case "on":
400                "Francis Equation"
401                OutletL.F*vL = 1.84*'1/s'*lw*((Level-(beta*hw)+1e-6*'m')/(beta))^2;
402                when Level < (beta * hw) switchto "off";
403               
404                case "off":
405                "Low level"
406                OutletL.F = 0 * 'mol/h';
407                when Level > (beta * hw) + 1e-6*'m' switchto "on";
408        end
409
410        switch VapourFlow
411                case "on":
412                #InletV.P = OutletV.P + Level*g*rhoL + rhoV*alfa*(InletV.F*vV/Ah)^2;
413                InletV.F*vV = sqrt((InletV.P - OutletV.P - Level*g*rhoL + 1e-8 * 'atm')/(rhoV*alfa))*Ah;
414                when InletV.P < OutletV.P + Level*g*rhoL switchto "off";
415               
416                case "off":
417                InletV.F = 0 * 'mol/s';
418                when InletV.P > OutletV.P + Level*g*rhoL + 3e-2 * 'atm' switchto "on";
419                #when InletV.P > OutletV.P + Level*beta*g*rhoL + 1e-2 * 'atm' switchto "on";
420        end
421
422        "Chemical Equilibrium"
423        PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z =
424                PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, yideal)*yideal;
425       
426        OutletV.z = Emv * (yideal - InletV.z) + InletV.z;
427       
428        sum(OutletL.z)= sum(OutletV.z);
429       
430        "Geometry Constraint"
431        V = ML* vL + MV*vV;
432end
Note: See TracBrowser for help on using the repository browser.