[890] | 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: sepComp.mso 744 2009-03-06 22:56:26Z bicca $ |
---|
| 18 | *--------------------------------------------------------------------*# |
---|
| 19 | |
---|
| 20 | using "streams/streams"; |
---|
| 21 | |
---|
| 22 | Model sepComp_n |
---|
| 23 | ATTRIBUTES |
---|
| 24 | Pallete = false; |
---|
| 25 | Icon = "icon/splitter_n"; |
---|
| 26 | Brief = "Model of a separator of components (NOT Handled by the GUI)"; |
---|
| 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 |
---|
| 40 | |
---|
| 41 | or |
---|
| 42 | |
---|
| 43 | * (Noutlet - 1) recovery (Recovery of the component specified in the outlet stream i): |
---|
| 44 | |
---|
| 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 | "; |
---|
| 49 | |
---|
| 50 | PARAMETERS |
---|
| 51 | |
---|
| 52 | outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); |
---|
| 53 | outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); |
---|
| 54 | NOutlet as Integer (Brief = "Number of Outlet Streams", Lower = 1); |
---|
| 55 | mainComp as Integer (Brief = "Component specified", Default = 1, Lower = 1); |
---|
| 56 | |
---|
| 57 | VARIABLES |
---|
| 58 | |
---|
| 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}"); |
---|
| 61 | |
---|
| 62 | frac(NOutlet) as fraction (Brief = "Distribution of the Outlet streams", Symbol="\phi"); |
---|
| 63 | recovery(NOutlet) as fraction (Brief = "Recovery of the component specified", Symbol="\eta"); |
---|
| 64 | |
---|
| 65 | EQUATIONS |
---|
| 66 | |
---|
| 67 | "Flow" |
---|
| 68 | sum(Outlet.F) = Inlet.F; |
---|
| 69 | |
---|
| 70 | |
---|
| 71 | for i in [1:NOutlet-1] do |
---|
| 72 | |
---|
| 73 | "Mol fraction normalisation" |
---|
| 74 | sum(Outlet(i).z) = 1; |
---|
| 75 | |
---|
| 76 | end |
---|
| 77 | |
---|
| 78 | |
---|
| 79 | for i in [1:NComp] do |
---|
| 80 | |
---|
| 81 | "Composition" |
---|
| 82 | sum(Outlet.F*Outlet.z(i)) = Inlet.F*Inlet.z(i); |
---|
| 83 | |
---|
| 84 | end |
---|
| 85 | |
---|
| 86 | |
---|
| 87 | for i in [1:NOutlet] do |
---|
| 88 | |
---|
| 89 | "Flow" |
---|
| 90 | Outlet(i).F = Inlet.F*frac(i); |
---|
| 91 | |
---|
| 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) + |
---|
| 100 | Outlet(i).v*PP.VapourEnthalpy(Outlet(i).T, Outlet(i).P, Outlet(i).z); |
---|
| 101 | |
---|
| 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 | |
---|
| 108 | end |
---|
| 109 | |
---|
| 110 | end |
---|
| 111 | |
---|
| 112 | Model sepComp |
---|
| 113 | ATTRIBUTES |
---|
| 114 | Pallete = true; |
---|
| 115 | Icon = "icon/SepComp"; |
---|
| 116 | Brief = "Model of a separator of components"; |
---|
| 117 | Info = |
---|
| 118 | "== Assumptions == |
---|
| 119 | * thermodynamics equilibrium |
---|
| 120 | |
---|
| 121 | == Specify == |
---|
| 122 | * the inlet stream |
---|
| 123 | * (NComp) Overhead_Splits or (NComp) Bottom_Splits |
---|
| 124 | * the Pressure and Temperature of the outlet streams |
---|
| 125 | "; |
---|
| 126 | |
---|
| 127 | PARAMETERS |
---|
| 128 | |
---|
| 129 | outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); |
---|
| 130 | outer NComp as Integer (Brief = "Number of chemical components"); |
---|
| 131 | |
---|
| 132 | VARIABLES |
---|
| 133 | |
---|
| 134 | in Inlet as stream (Brief = "Inlet stream", PosX=0, PosY=0.5001, Symbol="_{Inlet}"); |
---|
| 135 | out Overhead_Outlet as streamPH (Brief = "Overhead_Outlet stream", PosX=0.5, PosY=0, Symbol="_{Overhead}"); |
---|
| 136 | out Bottom_Outlet as streamPH (Brief = "Bottom_Outlet stream", PosX=0.5, PosY=1, Symbol="_{Bottom}"); |
---|
| 137 | in InletQ as power (Brief="Rate of heat supply", PosX=1, PosY=0.7559, Symbol="_{in}"); |
---|
| 138 | |
---|
| 139 | Overhead_Splits(NComp) as fraction (Brief = "Fraction to Overhead_Outlet", Symbol="\phi_{overhead}"); |
---|
| 140 | Bottom_Splits(NComp) as fraction (Brief = "Fraction to Bottom_Outlet", Symbol="\phi_{bottom}"); |
---|
| 141 | |
---|
| 142 | EQUATIONS |
---|
| 143 | |
---|
| 144 | "Composition Overhead" |
---|
| 145 | Overhead_Outlet.F*Overhead_Outlet.z = Inlet.F * Inlet.z*Overhead_Splits; |
---|
| 146 | |
---|
| 147 | "Bottom Composition Constraints" |
---|
| 148 | sum(Bottom_Outlet.z) = 1; |
---|
| 149 | |
---|
| 150 | "Sum Of Splits" |
---|
| 151 | Overhead_Splits+Bottom_Splits = 1; |
---|
| 152 | |
---|
| 153 | "Overhead Composition Constraints" |
---|
| 154 | sum(Overhead_Outlet.z) = 1; |
---|
| 155 | |
---|
| 156 | "Global Composition" |
---|
| 157 | Overhead_Outlet.F*Overhead_Outlet.z + Bottom_Outlet.F*Bottom_Outlet.z = Inlet.F*Inlet.z; |
---|
| 158 | |
---|
| 159 | "Energy Balance" |
---|
| 160 | Inlet.F*Inlet.h = Overhead_Outlet.F*Overhead_Outlet.h + Bottom_Outlet.F*Bottom_Outlet.h - InletQ; |
---|
| 161 | |
---|
| 162 | #"Overhead Pressure" |
---|
| 163 | # Overhead_Outlet.P = Inlet.P; |
---|
| 164 | |
---|
| 165 | #"Bottom Pressure" |
---|
| 166 | # Bottom_Outlet.P = Inlet.P; |
---|
| 167 | |
---|
| 168 | #"Overhead Temperature" |
---|
| 169 | # Overhead_Outlet.T = Inlet.T; |
---|
| 170 | |
---|
| 171 | #"Bottom Temperature" |
---|
| 172 | # Bottom_Outlet.T = Inlet.T; |
---|
| 173 | |
---|
| 174 | end |
---|
| 175 | |
---|
| 176 | |
---|