[1] | 1 | #*------------------------------------------------------------------- |
---|
[76] | 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 | * |
---|
[1] | 15 | *---------------------------------------------------------------------- |
---|
| 16 | * Author: Maurício Carvalho Maciel |
---|
| 17 | * $Id: sepComp.mso 574 2008-07-25 14:18:50Z rafael $ |
---|
| 18 | *--------------------------------------------------------------------*# |
---|
| 19 | |
---|
| 20 | using "streams"; |
---|
| 21 | |
---|
| 22 | Model sepComp_n |
---|
[269] | 23 | ATTRIBUTES |
---|
| 24 | Pallete = true; |
---|
[304] | 25 | Icon = "icon/splitter_n"; |
---|
[269] | 26 | Brief = "Model of a separator of components"; |
---|
[354] | 27 | Info = |
---|
| 28 | "== Assumptions == |
---|
| 29 | * thermodynamics equilibrium |
---|
| 30 | * adiabatic |
---|
| 31 | |
---|
| 32 | == Specify == |
---|
| 33 | * the inlet stream |
---|
| 34 | * (NComp - 1) molar fractions to (Noutlet - 1) outlet streams |
---|
| 35 | * (Noutlet - 1) frac (fraction of split of the outlet streams): |
---|
| 36 | |
---|
| 37 | frac(i) = (Mole Flow of the outlet stream i / |
---|
| 38 | Mole Flow of the inlet stream) |
---|
| 39 | where i = 1, 2,...,Noutlet |
---|
[356] | 40 | |
---|
[269] | 41 | or |
---|
| 42 | |
---|
[356] | 43 | * (Noutlet - 1) recovery (Recovery of the component specified in the outlet stream i): |
---|
[269] | 44 | |
---|
[354] | 45 | recovery(i) = (Mole Flow of the component specified in the Outlet stream i/ |
---|
| 46 | Mole Flow of the component specified in the inlet stream) |
---|
| 47 | where i = 1, 2,...,Noutlet |
---|
| 48 | "; |
---|
[269] | 49 | |
---|
[175] | 50 | PARAMETERS |
---|
[1] | 51 | |
---|
[176] | 52 | outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); |
---|
[175] | 53 | outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); |
---|
[364] | 54 | NOutlet as Integer (Brief = "Number of Outlet Streams", Lower = 1); |
---|
[175] | 55 | mainComp as Integer (Brief = "Component specified", Default = 1, Lower = 1); |
---|
[1] | 56 | |
---|
[175] | 57 | VARIABLES |
---|
[1] | 58 | |
---|
[364] | 59 | in Inlet as stream (Brief = "Inlet stream", PosX=0, PosY=0.5, Symbol="_{in}"); |
---|
| 60 | out Outlet(NOutlet) as stream (Brief = "Outlet streams", PosX=1, PosY=0.5059, Symbol="_{out}"); |
---|
[175] | 61 | |
---|
[364] | 62 | frac(NOutlet) as fraction (Brief = "Distribution of the Outlet streams", Symbol="\phi"); |
---|
[351] | 63 | recovery(NOutlet) as fraction (Brief = "Recovery of the component specified", Symbol="\eta"); |
---|
[175] | 64 | |
---|
| 65 | EQUATIONS |
---|
[1] | 66 | |
---|
[175] | 67 | "Flow" |
---|
[1] | 68 | sum(Outlet.F) = Inlet.F; |
---|
| 69 | |
---|
| 70 | |
---|
[574] | 71 | for i in [1:NOutlet-1] do |
---|
[175] | 72 | |
---|
| 73 | "Mol fraction normalisation" |
---|
| 74 | sum(Outlet(i).z) = 1; |
---|
| 75 | |
---|
| 76 | end |
---|
[1] | 77 | |
---|
| 78 | |
---|
[574] | 79 | for i in [1:NComp] do |
---|
[1] | 80 | |
---|
[175] | 81 | "Composition" |
---|
| 82 | sum(Outlet.F*Outlet.z(i)) = Inlet.F*Inlet.z(i); |
---|
[1] | 83 | |
---|
[175] | 84 | end |
---|
[1] | 85 | |
---|
| 86 | |
---|
[574] | 87 | for i in [1:NOutlet] do |
---|
[1] | 88 | |
---|
[175] | 89 | "Flow" |
---|
| 90 | Outlet(i).F = Inlet.F*frac(i); |
---|
[1] | 91 | |
---|
[175] | 92 | "Recovery" |
---|
| 93 | recovery(i)*Inlet.z(mainComp) = frac(i)*Outlet(i).z(mainComp); |
---|
| 94 | |
---|
| 95 | "Pressure" |
---|
| 96 | Outlet(i).P = Inlet.P; |
---|
| 97 | |
---|
| 98 | "Enthalpy" |
---|
| 99 | Outlet(i).h = (1-Outlet(i).v)*PP.LiquidEnthalpy(Outlet(i).T, Outlet(i).P, Outlet(i).z) + |
---|
[1] | 100 | Outlet(i).v*PP.VapourEnthalpy(Outlet(i).T, Outlet(i).P, Outlet(i).z); |
---|
| 101 | |
---|
[175] | 102 | "Temperature" |
---|
| 103 | Outlet(i).T = Inlet.T; |
---|
| 104 | |
---|
| 105 | "Vapourization Fraction" |
---|
| 106 | Outlet(i).v = PP.VapourFraction(Outlet(i).T, Outlet(i).P, Outlet(i).z); |
---|
| 107 | |
---|
[1] | 108 | end |
---|
| 109 | |
---|
[175] | 110 | end |
---|
[1] | 111 | |
---|
[175] | 112 | |
---|
[1] | 113 | Model sepComp |
---|
[269] | 114 | ATTRIBUTES |
---|
| 115 | Pallete = true; |
---|
[304] | 116 | Icon = "icon/splitter"; |
---|
[269] | 117 | Brief = "Model of a separator of components"; |
---|
[354] | 118 | Info = |
---|
| 119 | "== Assumptions == |
---|
| 120 | * thermodynamics equilibrium |
---|
| 121 | * adiabatic |
---|
[1] | 122 | |
---|
[354] | 123 | == Specify == |
---|
| 124 | * the inlet stream |
---|
| 125 | * (NComp - 1) molar fractions to 1 of the outlet streams |
---|
| 126 | * the fraction of split of the outlet streams |
---|
| 127 | "; |
---|
[269] | 128 | |
---|
[175] | 129 | PARAMETERS |
---|
| 130 | |
---|
[176] | 131 | outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); |
---|
[175] | 132 | outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); |
---|
| 133 | mainComp as Integer (Brief = "Component specified", Default = 1, Lower = 1); |
---|
[1] | 134 | |
---|
[175] | 135 | VARIABLES |
---|
[1] | 136 | |
---|
[364] | 137 | in Inlet as stream (Brief = "Inlet stream", PosX=0, PosY=0.5001, Symbol="_{in}"); |
---|
| 138 | out Outlet1 as stream (Brief = "Outlet stream 1", PosX=1, PosY=0.3027, Symbol="_{out1}"); |
---|
| 139 | out Outlet2 as stream (Brief = "Outlet stream 2", PosX=1, PosY=0.7141, Symbol="_{out2}"); |
---|
[175] | 140 | |
---|
[351] | 141 | frac as fraction (Brief = "Fraction to Outlet 1", Symbol="\phi"); |
---|
[364] | 142 | recovery as fraction (Brief = "Recovery of the component specified", Symbol="\eta"); |
---|
[175] | 143 | |
---|
[1] | 144 | EQUATIONS |
---|
| 145 | |
---|
[175] | 146 | "Flow" |
---|
[1] | 147 | Outlet1.F = Inlet.F * frac; |
---|
| 148 | Outlet1.F + Outlet2.F = Inlet.F; |
---|
| 149 | |
---|
| 150 | recovery*Inlet.z(mainComp) = frac*Outlet1.z(mainComp); |
---|
| 151 | |
---|
| 152 | sum(Outlet1.z) = 1; |
---|
| 153 | |
---|
[574] | 154 | for i in [1:NComp] do |
---|
[1] | 155 | |
---|
[175] | 156 | "Composition" |
---|
| 157 | Outlet1.F*Outlet1.z(i) + Outlet2.F*Outlet2.z(i) = Inlet.F*Inlet.z(i); |
---|
| 158 | |
---|
| 159 | end |
---|
| 160 | |
---|
| 161 | "Pressure" |
---|
[1] | 162 | Outlet1.P = Inlet.P; |
---|
| 163 | Outlet2.P = Inlet.P; |
---|
| 164 | |
---|
[175] | 165 | "Enthalpy" |
---|
[1] | 166 | Outlet1.h = (1-Outlet1.v)*PP.LiquidEnthalpy(Outlet1.T, Outlet1.P, Outlet1.z) + |
---|
| 167 | Outlet1.v*PP.VapourEnthalpy(Outlet1.T, Outlet1.P, Outlet1.z); |
---|
| 168 | Outlet2.h = (1-Outlet2.v)*PP.LiquidEnthalpy(Outlet2.T, Outlet2.P, Outlet2.z) + |
---|
| 169 | Outlet2.v*PP.VapourEnthalpy(Outlet2.T, Outlet2.P, Outlet2.z); |
---|
| 170 | |
---|
[175] | 171 | "Temperature" |
---|
[1] | 172 | Outlet1.T = Inlet.T; |
---|
| 173 | Outlet2.T = Inlet.T; |
---|
| 174 | |
---|
[175] | 175 | "Vapourization Fraction" |
---|
[1] | 176 | Outlet1.v = PP.VapourFraction(Outlet1.T, Outlet1.P, Outlet1.z); |
---|
| 177 | Outlet2.v = PP.VapourFraction(Outlet2.T, Outlet2.P, Outlet2.z); |
---|
[175] | 178 | |
---|
[1] | 179 | end |
---|
| 180 | |
---|
| 181 | |
---|