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: Maurício Carvalho Maciel |
---|
17 | * $Id: batch_dist.mso 353 2007-08-30 16:12:27Z arge $ |
---|
18 | *--------------------------------------------------------------------*# |
---|
19 | using "streams"; |
---|
20 | |
---|
21 | Model Diff_Dist |
---|
22 | ATTRIBUTES |
---|
23 | Pallete = true; |
---|
24 | Icon = "icon/BatchDist"; |
---|
25 | Brief = "Model of a Batch Differential Distillation."; |
---|
26 | Info = |
---|
27 | "== Assumptions == |
---|
28 | * perfect mixing of both phases; |
---|
29 | * thermodynamics equilibrium; |
---|
30 | * no liquid entrainment in the vapour stream. |
---|
31 | |
---|
32 | == Specify == |
---|
33 | * the inlet stream; |
---|
34 | * the liquid inlet stream; |
---|
35 | * the molar flow of the vapour outlet stream. |
---|
36 | |
---|
37 | == Initial Conditions == |
---|
38 | * the distillator temperature (T); |
---|
39 | * the distillator liquid level (Level); |
---|
40 | * (NoComps - 1) compositions in the distillator or in the OutletV. |
---|
41 | "; |
---|
42 | |
---|
43 | PARAMETERS |
---|
44 | outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); |
---|
45 | outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); |
---|
46 | Across as area (Brief = "Cross Section Area"); |
---|
47 | V as volume (Brief = "Total volume"); |
---|
48 | |
---|
49 | VARIABLES |
---|
50 | in Inlet as stream (Brief="Feed stream", PosX=0, PosY=0.9385, Symbol="_{in}"); |
---|
51 | in InletL as stream (Brief="Liquid inlet stream", PosX=0.5, PosY=0.1984, Symbol="_{inL}"); # FIXME |
---|
52 | out OutletV as vapour_stream (Brief="Vapour outlet stream", PosX=1, PosY=0.1984, Symbol="_{outV}"); |
---|
53 | in InletQ as energy_stream (Brief="Heat supplied", PosX=1, PosY=0.9578, Symbol="_{in}"); |
---|
54 | |
---|
55 | M(NComp) as mol (Brief="Molar Holdup in the distillator"); |
---|
56 | ML as mol (Brief="Molar liquid holdup"); |
---|
57 | MV as mol (Brief="Molar vapour holdup"); |
---|
58 | E as energy (Brief="Total Energy holdup on distillator"); |
---|
59 | volL as volume_mol (Brief="Liquid Molar Volume"); |
---|
60 | volV as volume_mol (Brief="Vapour Molar volume"); |
---|
61 | Level as length (Brief="Level of liquid phase", Default=1, Lower=0); |
---|
62 | T as temperature (Brief="Temperature on distillator"); |
---|
63 | P as pressure (Brief="Pressure on distillator"); |
---|
64 | x(NComp) as fraction (Brief = "Molar Fraction of the Liquid of the distillator"); |
---|
65 | h as enth_mol (Brief="Molar Enthalpy of the liquid of the distillator"); |
---|
66 | |
---|
67 | EQUATIONS |
---|
68 | |
---|
69 | "Component Molar Balance" |
---|
70 | diff(M)= Inlet.F*Inlet.z + InletL.F*InletL.z - OutletV.F*OutletV.z; |
---|
71 | |
---|
72 | "Energy Balance" |
---|
73 | diff(E) = Inlet.F*Inlet.h + InletL.F*InletL.h - OutletV.F*OutletV.h + InletQ.Q; |
---|
74 | |
---|
75 | "Molar Holdup" |
---|
76 | M = ML*x + MV*OutletV.z; |
---|
77 | |
---|
78 | "Energy Holdup" |
---|
79 | E = ML*h + MV*OutletV.h - P*V; |
---|
80 | |
---|
81 | "Mol fraction normalisation" |
---|
82 | sum(x)=1.0; |
---|
83 | sum(x)=sum(OutletV.z); |
---|
84 | |
---|
85 | "Liquid Volume" |
---|
86 | volL = PP.LiquidVolume(T, P, x); |
---|
87 | |
---|
88 | "Vapour Volume" |
---|
89 | volV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z); |
---|
90 | |
---|
91 | "Chemical Equilibrium" |
---|
92 | PP.LiquidFugacityCoefficient(T, P, x)*x = |
---|
93 | PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, OutletV.z)*OutletV.z; |
---|
94 | |
---|
95 | "Mechanical Equilibrium" |
---|
96 | P = OutletV.P; |
---|
97 | |
---|
98 | "Thermal Equilibrium" |
---|
99 | T = OutletV.T; |
---|
100 | |
---|
101 | "Geometry Constraint" |
---|
102 | V = ML*volL + MV*volV; |
---|
103 | |
---|
104 | "Level of liquid phase" |
---|
105 | Level = ML*volL/Across; |
---|
106 | |
---|
107 | "Enthalpy" |
---|
108 | h = PP.LiquidEnthalpy(T, P, x); |
---|
109 | |
---|
110 | end |
---|
111 | |
---|
112 | |
---|
113 | |
---|