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