1 | #*------------------------------------------------------------------- |
---|
2 | * Model of a separator of components |
---|
3 | *-------------------------------------------------------------------- |
---|
4 | * |
---|
5 | * Streams: |
---|
6 | * * a inlet stream |
---|
7 | * * "Noutlet" outlet streams |
---|
8 | * |
---|
9 | * Assumptions: |
---|
10 | * * thermodynamics equilibrium |
---|
11 | * * adiabatic |
---|
12 | * |
---|
13 | * Specify: |
---|
14 | * * the inlet stream |
---|
15 | * * (NComp - 1) molar fractions to (Noutlet - 1) outlet streams |
---|
16 | * * (Noutlet - 1) frac (fraction of split of the outlet streams): |
---|
17 | * |
---|
18 | * frac(i) = (Mole Flow of the outlet stream "i" / |
---|
19 | * Mole Flow of the inlet stream) |
---|
20 | * where i = 1, 2,...,Noutlet |
---|
21 | * or |
---|
22 | * |
---|
23 | * (Noutlet - 1) recovery (Recovery of the component specified in the outlet stream i): |
---|
24 | * |
---|
25 | * recovery(i) = (Mole Flow of the component specified in the Outlet stream i/ |
---|
26 | * Mole Flow of the component specified in the inlet stream) |
---|
27 | * where i = 1, 2,...,Noutlet |
---|
28 | * |
---|
29 | *---------------------------------------------------------------------- |
---|
30 | * Author: Maurício Carvalho Maciel |
---|
31 | * $Id: sepComp.mso 1 2006-06-20 17:33:53Z rafael $ |
---|
32 | *--------------------------------------------------------------------*# |
---|
33 | |
---|
34 | |
---|
35 | using "streams"; |
---|
36 | |
---|
37 | |
---|
38 | Model sepComp_n |
---|
39 | |
---|
40 | |
---|
41 | PARAMETERS |
---|
42 | ext PP as CalcObject (Brief = "External Physical Properties"); |
---|
43 | ext NComp as Integer (Brief = "Number of chemical components", Lower = 1); |
---|
44 | NOutlet as Integer (Brief = "Number of Outlet Streams", Lower = 1); |
---|
45 | mainComp as Integer (Brief = "Component specified", Default = 1, Lower = 1); |
---|
46 | |
---|
47 | VARIABLES |
---|
48 | in Inlet as stream; |
---|
49 | out Outlet(NOutlet) as stream; |
---|
50 | frac(NOutlet) as fraction (Brief = "Distribution of the Outlet streams"); |
---|
51 | recovery(NOutlet) as fraction (Brief = "Recovery of the component specified"); |
---|
52 | |
---|
53 | EQUATIONS |
---|
54 | |
---|
55 | "Flow" |
---|
56 | sum(Outlet.F) = Inlet.F; |
---|
57 | |
---|
58 | |
---|
59 | for i in [1:NOutlet-1] |
---|
60 | |
---|
61 | "Mol fraction normalisation" |
---|
62 | sum(Outlet(i).z) = 1; |
---|
63 | end |
---|
64 | |
---|
65 | |
---|
66 | for i in [1:NComp] |
---|
67 | |
---|
68 | "Composition" |
---|
69 | sum(Outlet.F*Outlet.z(i)) = Inlet.F*Inlet.z(i); |
---|
70 | |
---|
71 | end |
---|
72 | |
---|
73 | |
---|
74 | for i in [1:NOutlet] |
---|
75 | |
---|
76 | "Flow" |
---|
77 | Outlet(i).F = Inlet.F*frac(i); |
---|
78 | |
---|
79 | "Recovery" |
---|
80 | recovery(i)*Inlet.z(mainComp) = frac(i)*Outlet(i).z(mainComp); |
---|
81 | |
---|
82 | "Pressure" |
---|
83 | Outlet(i).P = Inlet.P; |
---|
84 | |
---|
85 | "Enthalpy" |
---|
86 | Outlet(i).h = (1-Outlet(i).v)*PP.LiquidEnthalpy(Outlet(i).T, Outlet(i).P, Outlet(i).z) + |
---|
87 | Outlet(i).v*PP.VapourEnthalpy(Outlet(i).T, Outlet(i).P, Outlet(i).z); |
---|
88 | |
---|
89 | "Temperature" |
---|
90 | Outlet(i).T = Inlet.T; |
---|
91 | |
---|
92 | "Vapourization Fraction" |
---|
93 | Outlet(i).v = PP.VapourFraction(Outlet(i).T, Outlet(i).P, Outlet(i).z); |
---|
94 | end |
---|
95 | end |
---|
96 | |
---|
97 | |
---|
98 | Model sepComp |
---|
99 | |
---|
100 | PARAMETERS |
---|
101 | ext PP as CalcObject (Brief = "External Physical Properties"); |
---|
102 | ext NComp as Integer (Brief = "Number of chemical components", Lower = 1); |
---|
103 | mainComp as Integer (Brief = "Component specified", Default = 1, Lower = 1); |
---|
104 | |
---|
105 | VARIABLES |
---|
106 | in Inlet as stream; |
---|
107 | out Outlet1 as stream; |
---|
108 | out Outlet2 as stream; |
---|
109 | frac as fraction (Brief = "Fraction to Outlet 1"); |
---|
110 | recovery as fraction (Brief = "Recovery of the component specified"); |
---|
111 | |
---|
112 | EQUATIONS |
---|
113 | |
---|
114 | "Flow" |
---|
115 | Outlet1.F = Inlet.F * frac; |
---|
116 | Outlet1.F + Outlet2.F = Inlet.F; |
---|
117 | |
---|
118 | recovery*Inlet.z(mainComp) = frac*Outlet1.z(mainComp); |
---|
119 | |
---|
120 | sum(Outlet1.z) = 1; |
---|
121 | |
---|
122 | for i in [1:NComp] |
---|
123 | |
---|
124 | "Composition" |
---|
125 | Outlet1.F*Outlet1.z(i) + Outlet2.F*Outlet2.z(i) = Inlet.F*Inlet.z(i); |
---|
126 | end |
---|
127 | |
---|
128 | "Pressure" |
---|
129 | Outlet1.P = Inlet.P; |
---|
130 | Outlet2.P = Inlet.P; |
---|
131 | |
---|
132 | "Enthalpy" |
---|
133 | Outlet1.h = (1-Outlet1.v)*PP.LiquidEnthalpy(Outlet1.T, Outlet1.P, Outlet1.z) + |
---|
134 | Outlet1.v*PP.VapourEnthalpy(Outlet1.T, Outlet1.P, Outlet1.z); |
---|
135 | Outlet2.h = (1-Outlet2.v)*PP.LiquidEnthalpy(Outlet2.T, Outlet2.P, Outlet2.z) + |
---|
136 | Outlet2.v*PP.VapourEnthalpy(Outlet2.T, Outlet2.P, Outlet2.z); |
---|
137 | |
---|
138 | "Temperature" |
---|
139 | Outlet1.T = Inlet.T; |
---|
140 | Outlet2.T = Inlet.T; |
---|
141 | |
---|
142 | "Vapourization Fraction" |
---|
143 | Outlet1.v = PP.VapourFraction(Outlet1.T, Outlet1.P, Outlet1.z); |
---|
144 | Outlet2.v = PP.VapourFraction(Outlet2.T, Outlet2.P, Outlet2.z); |
---|
145 | end |
---|
146 | |
---|
147 | |
---|