source: trunk/eml/stage_separators/tray.mso @ 498

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

First official version of packed stage and packed column with samples

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 14.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 498 2008-04-11 18:21:24Z 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
171#*-------------------------------------------------------------------
172* Model of a tray with reaction
173*-------------------------------------------------------------------*#
174Model trayReact
175        ATTRIBUTES
176        Pallete         = false;
177        Icon            = "icon/Tray";
178        Brief           = "Model of a tray with reaction.";
179        Info            =
180"== Assumptions ==
181* both phases (liquid and vapour) exists all the time;
182* thermodymanic equilibrium with Murphree plate efficiency;
183* no entrainment of liquid or vapour phase;
184* no weeping;
185* the dymanics in the downcomer are neglected.
186       
187== Specify ==
188* the Feed stream;
189* the Liquid inlet stream;
190* the Vapour inlet stream;
191* the Vapour outlet flow (OutletV.F);
192* the reaction related variables.
193       
194== Initial ==
195* the plate temperature (OutletL.T)
196* the liquid height (Level) OR the liquid flow OutletL.F
197* (NoComps - 1) OutletL compositions
198";
199
200        PARAMETERS
201        outer PP as Plugin(Type="PP");
202        outer NComp as Integer;
203        V as volume(Brief="Total Volume of the tray");
204        Q as power (Brief="Rate of heat supply");
205        Ap as area (Brief="Plate area = Atray - Adowncomer");
206       
207        Ah as area (Brief="Total holes area");
208        lw as length (Brief="Weir length");
209        g as acceleration (Default=9.81);
210        hw as length (Brief="Weir height");
211        beta as fraction (Brief="Aeration fraction");
212        alfa as fraction (Brief="Dry pressure drop coefficient");
213
214        stoic(NComp) as Real(Brief="Stoichiometric matrix");
215        Hr as energy_mol;
216        Pstartup as pressure;
217       
218        VapourFlow as Switcher(Valid = ["on", "off"], Default = "off");
219        LiquidFlow as Switcher(Valid = ["on", "off"], Default = "off");
220       
221        VARIABLES
222in      Inlet as stream (Brief="Feed stream", PosX=0, PosY=0.4932, Symbol="_{in}");
223in      InletL as stream (Brief="Inlet liquid stream", PosX=0.5195, PosY=0, Symbol="_{inL}");
224in      InletV as stream (Brief="Inlet vapour stream", PosX=0.4994, PosY=1, Symbol="_{inV}");
225out     OutletL as liquid_stream (Brief="Outlet liquid stream", PosX=0.8277, PosY=1, Symbol="_{outL}");
226out     OutletV as vapour_stream (Brief="Outlet vapour stream", PosX=0.8043, PosY=0, Symbol="_{outV}");
227
228        yideal(NComp) as fraction;
229        Emv as Real (Brief = "Murphree efficiency");
230
231        M(NComp) as mol (Brief="Molar Holdup in the tray");
232        ML as mol (Brief="Molar liquid holdup");
233        MV as mol (Brief="Molar vapour holdup");
234        E as energy (Brief="Total Energy Holdup on tray");
235        vL as volume_mol (Brief="Liquid Molar Volume");
236        vV as volume_mol (Brief="Vapour Molar volume");
237        Level as length (Brief="Height of clear liquid on plate");
238        Vol as volume;
239       
240        rhoL as dens_mass;
241        rhoV as dens_mass;
242        r3 as reaction_mol (Brief = "Reaction resulting ethyl acetate", DisplayUnit = 'mol/l/s');
243        C(NComp) as conc_mol (Brief = "Molar concentration", Lower = -1); #, Unit = "mol/l");
244       
245        EQUATIONS
246        "Molar Concentration"
247        OutletL.z = vL * C;
248       
249        "Reaction"
250        r3 = exp(-7150*'K'/OutletL.T)*(4.85e4*C(1)*C(2) - 1.23e4*C(3)*C(4))*'l/mol/s';
251       
252        "Component Molar Balance"
253        diff(M)=Inlet.F*Inlet.z + InletL.F*InletL.z + InletV.F*InletV.z
254                - OutletL.F*OutletL.z - OutletV.F*OutletV.z + stoic*r3*ML*vL;
255       
256        "Energy Balance"
257        diff(E) = ( Inlet.F*Inlet.h + InletL.F*InletL.h + InletV.F*InletV.h
258                - OutletL.F*OutletL.h - OutletV.F*OutletV.h + Q ) + Hr * r3 * vL*ML;
259       
260        "Molar Holdup"
261        M = ML*OutletL.z + MV*OutletV.z;
262       
263        "Energy Holdup"
264        E = ML*OutletL.h + MV*OutletV.h - OutletL.P*V;
265       
266        "Mol fraction normalisation"
267        sum(OutletL.z)= 1.0;
268       
269        "Liquid Volume"
270        vL = PP.LiquidVolume(OutletL.T, OutletL.P, OutletL.z);
271        "Vapour Volume"
272        vV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z);
273
274        "Thermal Equilibrium"
275        OutletV.T = OutletL.T;
276       
277        "Mechanical Equilibrium"
278        OutletV.P = OutletL.P;
279       
280        "Level of clear liquid over the weir"
281        Level = ML*vL/Ap;
282
283        Vol = ML*vL;
284       
285        "Liquid Density"
286        rhoL = PP.LiquidDensity(OutletL.T, OutletL.P, OutletL.z);
287        "Vapour Density"
288        rhoV = PP.VapourDensity(InletV.T, InletV.P, InletV.z);
289
290        switch LiquidFlow
291                case "on":
292                "Francis Equation"
293                OutletL.F*vL = 1.84*'1/s'*lw*((Level-(beta*hw)+1e-6*'m')/(beta))^2;
294                when Level < (beta * hw) switchto "off";
295               
296                case "off":
297                "Low level"
298                OutletL.F = 0 * 'mol/h';
299                when Level > (beta * hw) + 1e-6*'m' switchto "on";
300        end
301
302        switch VapourFlow
303                case "on":
304                #InletV.P = OutletV.P + Level*g*rhoL + rhoV*alfa*(InletV.F*vV/Ah)^2;
305                InletV.F*vV = sqrt((InletV.P - OutletV.P - Level*g*rhoL + 1e-8 * 'atm')/(rhoV*alfa))*Ah;
306                when InletV.P < OutletV.P + Level*g*rhoL switchto "off";
307               
308                case "off":
309                InletV.F = 0 * 'mol/s';
310                when InletV.P > OutletV.P + Level*g*rhoL + 3e-2 * 'atm' switchto "on";
311                #when InletV.P > OutletV.P + Level*beta*g*rhoL + 1e-2 * 'atm' switchto "on";
312        end
313
314        "Chemical Equilibrium"
315        PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z =
316                PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, yideal)*yideal;
317       
318        OutletV.z = Emv * (yideal - InletV.z) + InletV.z;
319       
320        sum(OutletL.z)= sum(OutletV.z);
321       
322        "Geometry Constraint"
323        V = ML* vL + MV*vV;
324end
325
326#*-------------------------------------
327* Model of a packed column stage
328-------------------------------------*#
329Model packedStage
330        ATTRIBUTES
331        Pallete         = false;
332        Icon            = "icon/Tray";
333        Brief           = "Complete model of a packed column stage.";
334        Info            =
335"== Specify ==
336* the Feed stream
337* the Liquid inlet stream
338* the Vapour inlet stream
339* the stage pressure drop (deltaP)
340       
341== Initial ==
342* the plate temperature (OutletL.T)
343* the liquid molar holdup ML
344* (NoComps - 1) OutletL compositions
345";     
346       
347        PARAMETERS
348outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
349outer NComp as Integer;
350        PPwater as Plugin(Brief="Physical Properties",
351                Type="PP",
352                Components = [ "water" ],
353                LiquidModel = "PR",
354                VapourModel = "PR"
355        );
356
357        V as volume(Brief="Total Volume of the tray");
358        Q as heat_rate (Brief="Rate of heat supply");
359        d as length (Brief="Column diameter"); 
360
361        a as Real (Brief="surface area per packing volume", Unit='m^2/m^3');
362        g as acceleration;
363        e as Real (Brief="Void fraction of packing, m^3/m^3");
364        Cpo as Real (Brief="Constant for resitance equation"); # Billet and Schultes, 1999.
365        Mw(NComp)       as molweight    (Brief = "Component Mol Weight");
366        hs as length (Brief="Height of the packing stage");
367        Qsil as positive (Brief="Resistance coefficient on the liquid load", Default=1);
368
369        VARIABLES
370in      Inlet as stream (Brief="Feed stream", PosX=0, PosY=0.4932, Symbol="_{in}");
371in      InletL as stream (Brief="Inlet liquid stream", PosX=0.5195, PosY=0, Symbol="_{inL}");
372in      InletV as stream (Brief="Inlet vapour stream", PosX=0.4994, PosY=1, Symbol="_{inV}");
373out     OutletL as liquid_stream (Brief="Outlet liquid stream", PosX=0.8277, PosY=1, Symbol="_{outL}");
374out     OutletV as vapour_stream (Brief="Outlet vapour stream", PosX=0.8043, PosY=0, Symbol="_{outV}");
375
376        M(NComp) as mol (Brief="Molar Holdup in the tray", Default=0.01, Lower=0, Upper=100);
377        ML as mol (Brief="Molar liquid holdup", Default=0.01, Lower=0, Upper=100);
378        MV as mol (Brief="Molar vapour holdup", Default=0.01, Lower=0, Upper=100);
379        E as energy (Brief="Total Energy Holdup on tray", Default=-500);
380        vL as volume_mol (Brief="Liquid Molar Volume");
381        vV as volume_mol (Brief="Vapour Molar volume");
382       
383        miL as viscosity (Brief="Liquid dynamic viscosity", DisplayUnit='kg/m/s');
384        miV as viscosity (Brief="Vapor dynamic viscosity", DisplayUnit='kg/m/s');
385        rhoL as dens_mass;
386        rhoV as dens_mass;
387       
388        deltaP as pressure;
389       
390        uL as velocity (Brief="volume flow rate of liquid, m^3/m^2/s", Lower=-10, Upper=100);
391        uV as velocity (Brief="volume flow rate of vapor, m^3/m^2/s", Lower=-10, Upper=100);
392        dp as length (Brief="Particle diameter", Default=1e-3, Lower=0, Upper=10);
393        invK as positive (Brief="Wall factor", Default=1, Upper=10);
394        Rev as Real (Brief="Reynolds number of the vapor stream", Default=4000);
395        Al as area (Brief="Area occupied by the liquid", Default=0.001, Upper=1);
396        hl as positive (Brief="Column holdup", Unit='m^3/m^3', Default=0.01,Upper=10);
397
398        SET
399        Mw = PP.MolecularWeight();
400
401        EQUATIONS
402        "Component Molar Balance"
403        diff(M)=Inlet.F*Inlet.z + InletL.F*InletL.z + InletV.F*InletV.z
404                - OutletL.F*OutletL.z - OutletV.F*OutletV.z;
405
406        "Energy Balance"
407        diff(E) = ( Inlet.F*Inlet.h + InletL.F*InletL.h + InletV.F*InletV.h
408                - OutletL.F*OutletL.h - OutletV.F*OutletV.h + Q );
409       
410        "Molar Holdup"
411        M = ML*OutletL.z + MV*OutletV.z;
412       
413        "Energy Holdup"
414        E = ML*OutletL.h + MV*OutletV.h - OutletL.P*V;
415       
416        "Mol fraction normalisation"
417        sum(OutletL.z)= 1.0;
418       
419        "Liquid Volume"
420        vL = PP.LiquidVolume(OutletL.T, OutletL.P, OutletL.z);
421        "Vapour Volume"
422        vV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z);
423       
424        "Chemical Equilibrium"
425        PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z =
426                PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, OutletV.z)*OutletV.z;
427       
428        "Thermal Equilibrium"
429        OutletV.T = OutletL.T;
430       
431        "Mechanical Equilibrium"
432        OutletL.P = OutletV.P;
433       
434        "Geometry Constraint"
435        V*e = ML*vL + MV*vV;
436       
437        "Liquid Density"
438        rhoL = PP.LiquidDensity(OutletL.T, OutletL.P, OutletL.z);
439        "Vapour Density"
440        rhoV = PP.VapourDensity(InletV.T, InletV.P, InletV.z);
441        "Liquid viscosity"
442        miL = PP.LiquidViscosity(OutletL.T, OutletL.P, OutletL.z);
443        "Vapour viscosity"
444        miV = PP.VapourViscosity(InletV.T, InletV.P, InletV.z);
445
446        "Area occupied by the liquid"
447        Al = ML*vL/hs;
448
449        "Volume flow rate of liquid, m^3/m^2/s"
450        uL * Al = OutletL.F * vL;
451        "Volume flow rate of vapor, m^3/m^2/s"
452        uV * ((d^2*3.14159/4)*e - Al) = OutletV.F * vV;
453       
454        "Liquid holdup"
455        hl = ML*vL/V/e;
456       
457        "Particle diameter"
458        dp = 6 * (1-e)/a;
459       
460        "Wall Factor"
461        invK = (1 + (2*dp/(3*d*(1-e))));
462       
463        "Reynolds number of the vapor stream"
464        Rev*invK = dp*uV*rhoV / (miV*(1-e));
465       
466        deltaP = InletV.P - OutletV.P;
467       
468        "Pressure drop and Vapor flow"
469        deltaP/hs  = Qsil*a*uV^2*rhoV*invK / (2*(e-hl)^3);
470
471        "Liquid holdup"
472        hl = (12*miL*a^2*uL/rhoL/g)^1/3;
473end
Note: See TracBrowser for help on using the repository browser.