source: branches/newlanguage/eml/stage_separators/batch_dist.mso @ 123

Last change on this file since 123 was 72, checked in by Paula Bettio Staudt, 16 years ago

Updated stage_separators file header and added headers template files

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.5 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* Model of a Batch Distillation (or Differential Distilation)
17*--------------------------------------------------------------------
18*
19*       Streams:
20*               * a liquid inlet stream
21*               * a vapour outlet stream
22*               * a inlet stream
23*
24*       Assumptions:
25*               * perfect mixing of both phases
26*               * thermodynamics equilibrium
27*               * no liquid entrainment in the vapour stream
28*
29*       Specify:
30*               * the inlet stream
31*               * the liquid inlet stream
32*               * the molar flow of the vapour outlet stream
33*
34*       Initial:
35*               * the distillator temperature (T)
36*               * the distillator liquid level (Ll)
37*               * (NoComps - 1) compositions in the distillator
38*                                       or in the OutletV
39*               
40*
41*----------------------------------------------------------------------
42* Author: Maurício Carvalho Maciel
43* $Id: batch_dist.mso 72 2006-12-08 18:29:10Z paula $
44*--------------------------------------------------------------------*#
45using "streams";
46       
47Model Diff_Dist
48       
49        PARAMETERS
50ext PP          as CalcObject   (Brief = "External Physical Properties");
51ext NComp       as Integer              (Brief = "Number of chemical components", Lower = 1);
52        Across  as area                 (Brief="Cross Section Area");
53        V               as volume               (Brief="Total volume");
54       
55        VARIABLES
56in      Inlet   as stream;              #(Brief="Feed stream");
57in      InletL  as stream;              #(Brief="Liquid inlet stream");
58out     OutletV as stream_therm; #(Brief="Vapour outlet stream");
59
60        M(NComp)        as mol                  (Brief="Molar Holdup in the distillator");
61        ML                      as mol                  (Brief="Molar liquid holdup");
62        MV                      as mol                  (Brief="Molar vapour holdup");
63        E                       as energy               (Brief="Total Energy holdup on distillator");
64        volL            as volume_mol   (Brief="Liquid Molar Volume");
65        volV            as volume_mol   (Brief="Vapour Molar volume");
66        Level           as length               (Brief="Level of liquid phase", Default=1, Lower=0);
67        T                       as temperature  (Brief="Temperature on distillator");
68        P                       as pressure             (Brief="Pressure on distillator");
69        x(NComp)        as fraction     (Brief = "Molar Fraction of the Liquid of the distillator");
70        h                       as enth_mol             (Brief="Molar Enthalpy of the liquid of the distillator");
71        Q                       as heat_rate    (Brief="Heat supplied");
72       
73        EQUATIONS
74       
75        "Component Molar Balance"
76        diff(M)= Inlet.F*Inlet.z + InletL.F*InletL.z - OutletV.F*OutletV.z;
77       
78        "Energy Balance"
79        diff(E) = Inlet.F*Inlet.h + InletL.F*InletL.h - OutletV.F*OutletV.h + Q;
80       
81        "Molar Holdup"
82        M = ML*x + MV*OutletV.z;
83       
84        "Energy Holdup"
85        E = ML*h + MV*OutletV.h - P*V;
86       
87        "Mol fraction normalisation"
88        sum(x)=1.0;
89        sum(x)=sum(OutletV.z);
90
91        "Liquid Volume"
92        volL = PP.LiquidVolume(T, P, x);
93       
94        "Vapour Volume"
95        volV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z);
96       
97        "Chemical Equilibrium"
98        PP.LiquidFugacityCoefficient(T, P, x)*x =
99                PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, OutletV.z)*OutletV.z;
100
101        "Mechanical Equilibrium"
102        P = OutletV.P;
103       
104        "Thermal Equilibrium"
105        T = OutletV.T;
106       
107        "Geometry Constraint"
108        V = ML*volL + MV*volV;
109       
110        "Level of liquid phase"
111        Level = ML*volL/Across;
112       
113        "vaporization fraction "
114        OutletV.v = 1.0;
115       
116        "Enthalpy"
117        h = PP.LiquidEnthalpy(T, P, x);
118       
119end
120       
121       
122
Note: See TracBrowser for help on using the repository browser.