Changeset 878 for branches/gui/eml
- Timestamp:
- Nov 5, 2009, 3:59:14 PM (13 years ago)
- Location:
- branches/gui/eml/stage_separators
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/eml/stage_separators/column.mso
r875 r878 109 109 LiquidSideStreamLocation as Integer (Brief="Liquid Side Stream Location", Default=2); 110 110 VapourSideStreamLocation as Integer (Brief="Vapour Side Stream Location", Default=2); 111 Pi as constant (Brief="Pi Number",Default=3.14159265, Symbol = "\pi",Hidden=true);112 Gconst as acceleration (Brief="Gravity Acceleration",Default=9.81,Hidden=true);113 Mw(NComp) as molweight (Brief="Component Mol Weight",Hidden=true);114 zero_flow as flow_mol (Brief = "Stream Flow closed",Default = 0, Hidden=true);115 low_flow as flow_mol (Brief = "Low stream Flow",Default = 1E-6, Hidden=true);116 111 117 112 VapourFlowModel as Switcher (Valid = ["Reepmeyer", "Feehery_Fv", "Roffel_Fv", "Klingberg", "Wang_Fv", "Elgue"], Default = "Reepmeyer"); … … 128 123 AerationFraction as Real (Brief="Aeration fraction", Default = 1); 129 124 DryPdropCoeff as Real (Brief="Dry pressure drop coefficient", Default= 0.60); 130 131 PlateArea as area (Brief="Plate area = Atray - Adowncomer",Protected=true); 132 TrayVolume as volume (Brief="Total Volume of the tray",Protected=true); 133 HolesArea as area (Brief="Total holes area",Protected=true); 134 135 FeeheryCoeff as Real (Brief="Feeherys correlation coefficient", Unit='1/m^4', Default=1,Hidden=true); 136 ElgueCoeff as Real (Brief="Elgues correlation coefficient", Unit='kg/m/mol^2', Default=1,Hidden=true); 137 OlsenCoeff as Real (Brief="Olsens correlation coefficient", Default=1,Hidden=true); 138 139 VapourFlow as Switcher (Brief="Flag for Vapour Flow condition",Valid = ["on", "off"], Default = "off",Hidden=true); 140 LiquidFlow as Switcher (Brief="Flag for Liquid Flow condition",Valid = ["on", "off"], Default = "off",Hidden=true); 125 MurphreeEff as Real (Brief="Murphree efficiency for All Trays", Default= 1); 126 127 VARIABLES 128 129 INITIALIZATION as InitializeSection (Brief="Column Model Initialization"); 130 CONTROL as ControlSection (Brief="Column Model Control"); 131 132 out TCI as control_signal (Brief="Temperature Indicator", Protected = true, PosX=1, PosY=0.73); 133 out PCI as control_signal (Brief="Pressure Indicator", Protected = true, PosX=0, PosY=0.24); 134 135 in LiquidInlet as stream (Brief="Liquid Inlet in the section", PosX=0.70, PosY=0); 136 out VapourOutlet as vapour_stream (Brief="Vapour Outlet in the section", PosX=0.30, PosY=0); 137 138 out VapourDrawOff as vapour_stream (Brief="Vapour Draw Off Port in the section", PosX=1, PosY=0.35,Protected = true); 139 out LiquidDrawOff as liquid_stream (Brief="Liquid Draw Off Port in the section", PosX=1, PosY=0.65,Protected = true); 140 141 TRAYS(NumberOfTrays) as tray (Brief="Number of trays in the Column Section",Protected=true); 142 VapourDrawOffFlow as flow_mol (Brief="Vapour Draw Off Stream Molar Flow Rate"); 143 LiquidDrawOffFlow as flow_mol (Brief="Vapour Draw Off Stream Molar Flow Rate"); 144 145 in VapourInlet as stream (Brief="Vapour Inlet in the section", PosX=0.30, PosY=1); 146 out LiquidOutlet as liquid_stream (Brief="Liquid Outlet in the section", PosX=0.70, PosY=1); 147 148 LiquidConnector as stream (Brief="Liquid connection in the middle TRAYS", PosX=0.75, PosY=1,Hidden=true); 149 VapourConnector as stream (Brief="Vapour connection in the middle TRAYS", PosX=0.55, PosY=0,Hidden=true); 141 150 142 151 SET 143 152 VapSideTrayIndex(VapourSideStreamLocation) =1; 144 153 LiqSideTrayIndex(LiquidSideStreamLocation) =1; 145 Mw = PP.MolecularWeight(); 146 zero_flow = 0 * 'kmol/h'; 147 low_flow = 1E-6 * 'kmol/h'; 148 149 PlateArea = 0.25*Pi*(TrayDiameter^2)*(1-Fraction_DowncomerArea); 150 TrayVolume = 0.25*Pi*(TrayDiameter^2)*TraySpacing; 151 HolesArea = 0.25*Pi*(TrayDiameter^2)*Fraction_HoleArea; 152 153 VARIABLES 154 155 INITIALIZATION as InitializeSection (Brief="Column Model Initialization"); 156 CONTROL as ControlSection (Brief="Column Model Control"); 157 158 out TCI as control_signal (Brief="Temperature Indicator", Protected = true, PosX=1, PosY=0.73); 159 out PCI as control_signal (Brief="Pressure Indicator", Protected = true, PosX=0, PosY=0.24); 160 161 in LiquidInlet as stream (Brief="Liquid Inlet in the section", PosX=0.70, PosY=0); 162 out VapourOutlet as vapour_stream (Brief="Vapour Outlet in the section", PosX=0.30, PosY=0); 163 164 out VapourDrawOff as vapour_stream (Brief="Vapour Draw Off Port in the section", PosX=1, PosY=0.35,Protected = true); 165 out LiquidDrawOff as liquid_stream (Brief="Liquid Draw Off Port in the section", PosX=1, PosY=0.65,Protected = true); 166 167 TRAYS(NumberOfTrays) as tray (Brief="Number of trays in the Column Section",Protected=true); 168 VapourDrawOffFlow as flow_mol (Brief="Vapour Draw Off Stream Molar Flow Rate"); 169 LiquidDrawOffFlow as flow_mol (Brief="Vapour Draw Off Stream Molar Flow Rate"); 170 MurphreeEff as Real (Brief="Murphree efficiency for All Trays",Lower=0.01,Upper=1); 171 172 in VapourInlet as stream (Brief="Vapour Inlet in the section", PosX=0.30, PosY=1); 173 out LiquidOutlet as liquid_stream (Brief="Liquid Outlet in the section", PosX=0.70, PosY=1); 174 175 LiquidConnector as stream (Brief="Liquid connection in the middle TRAYS", PosX=0.75, PosY=1,Hidden=true); 176 VapourConnector as stream (Brief="Vapour connection in the middle TRAYS", PosX=0.55, PosY=0,Hidden=true); 177 154 155 TRAYS.TrayDiameter_ = TrayDiameter; 156 TRAYS.TraySpacing_ = TraySpacing; 157 TRAYS.Fraction_HoleArea_ = Fraction_HoleArea; 158 TRAYS.Fraction_DowncomerArea_ = Fraction_DowncomerArea; 159 TRAYS.WeirLength_ = WeirLength; 160 TRAYS.WeirHeight_ = WeirHeight; 161 TRAYS.TrayLiquidPasses_ = TrayLiquidPasses; 162 TRAYS.HeatSupply_ = HeatSupply; 163 TRAYS.AerationFraction_ = AerationFraction; 164 TRAYS.DryPdropCoeff_ = DryPdropCoeff; 165 TRAYS.MurphreeEff_ = MurphreeEff; 166 178 167 CONNECTIONS 179 168 TRAYS([2:NumberOfTrays]).OutletVapour to TRAYS([1:NumberOfTrays-1]).InletVapour; 180 169 TRAYS([1:NumberOfTrays-1]).OutletLiquid to TRAYS([2:NumberOfTrays]).InletLiquid; 181 170 182 171 LiquidConnector to TRAYS(1).InletLiquid; 183 172 VapourConnector to TRAYS(NumberOfTrays).InletVapour; 184 173 185 174 INITIAL 186 175 … … 214 203 PCI*'atm' = TRAYS(CONTROL.Pindicator_TrayNumber).OutletVapour.P; 215 204 216 for i in [1:NumberOfTrays] do 217 218 "Murphree Efficiency" 219 TRAYS(i).OutletVapour.z = MurphreeEff * (TRAYS(i).yideal - TRAYS(i).InletVapour.z) + TRAYS(i).InletVapour.z; 220 221 "Level of clear liquid over the weir" 222 TRAYS(i).Level = TRAYS(i).ML*TRAYS(i).vL/PlateArea; 223 224 "Geometry Constraint" 225 TrayVolume = TRAYS(i).ML* TRAYS(i).vL + TRAYS(i).MV*TRAYS(i).vV; 226 227 "Energy Holdup" 228 TRAYS(i).E = TRAYS(i).ML*TRAYS(i).OutletLiquid.h + TRAYS(i).MV*TRAYS(i).OutletVapour.h - TRAYS(i).OutletLiquid.P*TrayVolume; 229 230 "Energy Balance" 231 diff(TRAYS(i).E) = ( TRAYS(i).Inlet.F*TRAYS(i).Inlet.h + TRAYS(i).InletLiquid.F*TRAYS(i).InletLiquid.h + TRAYS(i).InletVapour.F*TRAYS(i).InletVapour.h- TRAYS(i).OutletLiquid.F*TRAYS(i).OutletLiquid.h - TRAYS(i).OutletVapour.F*TRAYS(i).OutletVapour.h 232 -TRAYS(i).VapourSideStream.F*TRAYS(i).VapourSideStream.h - TRAYS(i).LiquidSideStream.F*TRAYS(i).LiquidSideStream.h + HeatSupply ); 233 234 switch LiquidFlow 235 case "on": 236 switch LiquidFlowModel 237 case "Francis": 238 "Francis Equation" 239 TRAYS(i).OutletLiquid.F*TRAYS(i).vL = 1.84*'1/s'*WeirLength*((TRAYS(i).Level-(AerationFraction*WeirHeight))/(AerationFraction))^2; 240 241 case "Wang_Fl": 242 TRAYS(i).OutletLiquid.F*TRAYS(i).vL = 1.84*'m^0.5/s'*WeirLength*((TRAYS(i).Level-(AerationFraction*WeirHeight))/(AerationFraction))^1.5; 243 244 case "Olsen": 245 TRAYS(i).OutletLiquid.F / 'mol/s'= WeirLength*TrayLiquidPasses*TRAYS(i).rhoL/sum(Mw*TRAYS(i).OutletVapour.z)/(0.665*OlsenCoeff)^1.5 * ((TRAYS(i).ML*sum(Mw*TRAYS(i).OutletLiquid.z)/TRAYS(i).rhoL/PlateArea)-WeirHeight)^1.5 * 'm^0.5/mol'; 246 247 case "Feehery_Fl": 248 TRAYS(i).OutletLiquid.F = WeirLength*TRAYS(i).rhoL/sum(Mw*TRAYS(i).OutletLiquid.z) * ((TRAYS(i).Level-WeirHeight)/750/'mm')^1.5 * 'm^2/s'; 249 250 case "Roffel_Fl": 251 TRAYS(i).OutletLiquid.F = 2/3*TRAYS(i).rhoL/sum(Mw*TRAYS(i).OutletLiquid.z)*WeirLength*(TRAYS(i).ML*sum(Mw*TRAYS(i).OutletLiquid.z)/(PlateArea*1.3)/TRAYS(i).rhoL)^1.5*sqrt(2*Gconst/ 252 (2*(1 - 0.3593/'Pa^0.0888545'*abs(TRAYS(i).OutletVapour.F*sum(Mw*TRAYS(i).OutletVapour.z)/(PlateArea*1.3)/sqrt(TRAYS(i).rhoV))^0.177709)-1)); #/'(kg/m)^0.0888545/s^0.177709'; 253 end 254 when TRAYS(i).Level < (AerationFraction *WeirHeight) switchto "off"; 255 256 case "off": 257 258 "Low level" 259 TRAYS(i).OutletLiquid.F = zero_flow; 260 261 when TRAYS(i).Level > (AerationFraction * WeirHeight) switchto "on"; 262 263 end 264 265 switch VapourFlow 266 case "on": 267 switch VapourFlowModel 268 case "Reepmeyer": 269 TRAYS(i).InletVapour.F*TRAYS(i).vV = sqrt((TRAYS(i).InletVapour.P - TRAYS(i).OutletVapour.P)/(TRAYS(i).rhoV*DryPdropCoeff))*HolesArea; 270 271 case "Feehery_Fv": 272 TRAYS(i).InletVapour.F = TRAYS(i).rhoV/PlateArea/FeeheryCoeff/sum(Mw*TRAYS(i).OutletVapour.z) * sqrt(((TRAYS(i).InletVapour.P - TRAYS(i).OutletVapour.P)-(TRAYS(i).rhoV*Gconst*TRAYS(i).ML*TRAYS(i).vL/PlateArea))/TRAYS(i).rhoV); 273 274 case "Roffel_Fv": 275 TRAYS(i).InletVapour.F^1.08 * 0.0013 * 'kg/m/mol^1.08/s^0.92*1e5' = (TRAYS(i).InletVapour.P - TRAYS(i).OutletVapour.P)*1e5 - (AerationFraction*sum(TRAYS(i).M*Mw)/(PlateArea*1.3)*Gconst*1e5) * (TRAYS(i).rhoV*HolesArea/sum(Mw*TRAYS(i).OutletVapour.z))^1.08 * 'm^1.08/mol^1.08'; 276 277 case "Klingberg": 278 TRAYS(i).InletVapour.F * TRAYS(i).vV = PlateArea * sqrt(((TRAYS(i).InletVapour.P - TRAYS(i).OutletVapour.P)-TRAYS(i).rhoL*Gconst*TRAYS(i).Level)/TRAYS(i).rhoV); 279 280 case "Wang_Fv": 281 TRAYS(i).InletVapour.F * TRAYS(i).vV = PlateArea * sqrt(((TRAYS(i).InletVapour.P - TRAYS(i).OutletVapour.P)-TRAYS(i).rhoL*Gconst*TRAYS(i).Level)/TRAYS(i).rhoV*DryPdropCoeff); 282 283 case "Elgue": 284 TRAYS(i).InletVapour.F = sqrt((TRAYS(i).InletVapour.P - TRAYS(i).OutletVapour.P)/ElgueCoeff); 285 end 286 when TRAYS(i).InletVapour.F < low_flow switchto "off"; 287 288 case "off": 289 TRAYS(i).InletVapour.F = zero_flow; 290 291 when TRAYS(i).InletVapour.P > TRAYS(i).OutletVapour.P switchto "on"; 292 293 end 205 switch LiquidFlowModel 206 207 case "Francis": 208 TRAYS.LFlowModel = 1; 209 case "Wang_Fl": 210 TRAYS.LFlowModel = 2; 211 212 case "Olsen": 213 TRAYS.LFlowModel = 3; 214 215 case "Feehery_Fl": 216 TRAYS.LFlowModel = 4; 217 218 case "Roffel_Fl": 219 TRAYS.LFlowModel = 5; 220 221 end 222 223 switch VapourFlowModel 224 225 case "Reepmeyer": 226 TRAYS.VFlowModel = 1; 227 228 case "Feehery_Fv": 229 TRAYS.VFlowModel = 2; 230 231 case "Roffel_Fv": 232 TRAYS.VFlowModel = 3; 233 234 case "Klingberg": 235 TRAYS.VFlowModel = 4; 236 237 case "Wang_Fv": 238 TRAYS.VFlowModel = 5; 239 240 case "Elgue": 241 TRAYS.VFlowModel = 6; 294 242 295 243 end -
branches/gui/eml/stage_separators/tray.mso
r875 r878 20 20 using "streams"; 21 21 22 Model trayBasic 23 ATTRIBUTES 22 Model tray 23 24 ATTRIBUTES 24 25 Pallete = false; 25 26 Icon = "icon/Tray"; 26 Brief = " Basic equations of a tray column model.";27 Brief = "Complete model of a column tray."; 27 28 Info = 28 "This model contains only the main equations of a column tray equilibrium model without 29 the hidraulic equations. 30 31 == Assumptions == 29 "== Assumptions == 32 30 * both phases (liquid and vapour) exists all the time; 33 31 * thermodymanic equilibrium with Murphree plate efficiency; … … 35 33 * no weeping; 36 34 * the dymanics in the downcomer are neglected. 37 ";38 39 PARAMETERS40 outer PP as Plugin (Brief = "External Physical Properties", Type="PP");41 outer NComp as Integer;42 43 VARIABLES44 45 Inlet as stream (Brief="Feed stream", Hidden=true, PosX=0, PosY=0.4932, Symbol="_{in}");46 LiquidSideStream as liquid_stream (Brief="liquid Sidestream", Hidden=true, Symbol="_{outL}");47 VapourSideStream as vapour_stream (Brief="vapour Sidestream", Hidden=true, Symbol="_{outV}");48 49 in InletLiquid as stream (Brief="Inlet liquid stream", PosX=0.5195, PosY=0, Symbol="_{inL}");50 in InletVapour as stream (Brief="Inlet vapour stream", PosX=0.4994, PosY=1, Symbol="_{inV}");51 out OutletLiquid as liquid_stream (Brief="Outlet liquid stream", PosX=0.8277, PosY=1, Symbol="_{outL}");52 out OutletVapour as vapour_stream (Brief="Outlet vapour stream", PosX=0.8043, PosY=0, Symbol="_{outV}");53 54 55 M(NComp) as mol (Brief="Molar Holdup in the tray");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 tray");59 vL as volume_mol (Brief="Liquid Molar Volume");60 vV as volume_mol (Brief="Vapour Molar volume");61 Level as length (Brief="Height of clear liquid on plate");62 yideal(NComp) as fraction;63 64 65 EQUATIONS66 "Component Molar Balance"67 diff(M)=Inlet.F*Inlet.z + InletLiquid.F*InletLiquid.z + InletVapour.F*InletVapour.z- OutletLiquid.F*OutletLiquid.z - OutletVapour.F*OutletVapour.z-68 LiquidSideStream.F*LiquidSideStream.z-VapourSideStream.F*VapourSideStream.z;69 70 "Molar Holdup"71 M = ML*OutletLiquid.z + MV*OutletVapour.z;72 73 "Mol fraction normalisation"74 sum(OutletLiquid.z)= 1.0;75 sum(OutletLiquid.z)= sum(OutletVapour.z);76 77 "Liquid Volume"78 vL = PP.LiquidVolume(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z);79 80 "Vapour Volume"81 vV = PP.VapourVolume(OutletVapour.T, OutletVapour.P, OutletVapour.z);82 83 "Chemical Equilibrium"84 PP.LiquidFugacityCoefficient(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z)*OutletLiquid.z = PP.VapourFugacityCoefficient(OutletVapour.T, OutletVapour.P, yideal)*yideal;85 86 "Thermal Equilibrium"87 OutletVapour.T = OutletLiquid.T;88 89 "Mechanical Equilibrium"90 OutletVapour.P = OutletLiquid.P;91 92 "Thermal Equilibrium Vapour Side Stream"93 OutletVapour.T = VapourSideStream.T;94 95 "Thermal Equilibrium Liquid Side Stream"96 OutletLiquid.T = LiquidSideStream.T;97 98 "Mechanical Equilibrium Vapour Side Stream"99 OutletVapour.P= VapourSideStream.P;100 101 "Mechanical Equilibrium Liquid Side Stream"102 OutletLiquid.P = LiquidSideStream.P;103 104 "Composition Liquid Side Stream"105 OutletLiquid.z= LiquidSideStream.z;106 107 "Composition Vapour Side Stream"108 OutletVapour.z= VapourSideStream.z;109 110 end111 112 Model tray as trayBasic113 ATTRIBUTES114 Pallete = false;115 Icon = "icon/Tray";116 Brief = "Complete model of a column tray.";117 Info =118 "== Specify ==119 * the Feed stream120 * the Liquid inlet stream121 * the Vapour inlet stream122 * the Vapour outlet flow (OutletVapour.F)123 124 == Initial ==125 * the plate temperature (OutletLiquid.T)126 * the liquid height (Level) OR the liquid flow OutletLiquid.F127 * (NoComps - 1) OutletLiquid compositions128 35 129 36 == Options == … … 141 48 * WANG, L.; LI, P.; WOZNY, G.; WANG, S. A start-up model for simulation of batch distillation starting from a cold state. Computers and Chemical Engineering, v. 27, p.1485-1497, 2003. 142 49 "; 143 50 51 PARAMETERS 52 outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); 53 outer NComp as Integer (Brief="Number of components"); 54 55 Mw(NComp) as molweight (Brief="Component Mol Weight",Hidden=true); 56 Gconst as acceleration (Brief="Gravity Acceleration",Default=9.81,Hidden=true); 57 zero_flow as flow_mol (Brief = "Stream Flow closed",Default = 0, Hidden=true); 58 low_flow as flow_mol (Brief = "Low stream Flow",Default = 1E-6, Hidden=true); 59 Pi as constant (Brief="Pi Number",Default=3.14159265, Symbol = "\pi",Hidden=true); 60 61 TrayDiameter_ as length (Brief="Tray Diameter",Default=1.600); 62 TraySpacing_ as length (Brief="Tray Spacing",Default=0.600); 63 Fraction_HoleArea_ as fraction (Brief="Fraction of the active area that is occupied by the holes with respect to the total tray area",Default=0.10); 64 Fraction_DowncomerArea_ as fraction (Brief="Fraction of the downcomer area with respect to the total tray area",Default=0.20); 65 WeirLength_ as length (Brief="Weir length", Default = 1); 66 WeirHeight_ as length (Brief="Weir height", Default= 0.05); 67 TrayLiquidPasses_ as positive (Brief="Number of liquid passes in the tray", Lower = 1,Default=1); 68 HeatSupply_ as heat_rate (Brief="Rate of heat supply",Default = 0); 69 AerationFraction_ as Real (Brief="Aeration fraction", Default = 1); 70 DryPdropCoeff_ as Real (Brief="Dry pressure drop coefficient", Default= 0.60); 71 MurphreeEff_ as Real (Brief="Murphree efficiency for All Trays",Lower=0.01,Upper=1); 72 73 PlateArea_ as area (Brief="Plate area = Atray - Adowncomer",Protected=true); 74 TrayVolume_ as volume (Brief="Total Volume of the tray",Protected=true); 75 HolesArea_ as area (Brief="Total holes area",Protected=true); 76 77 FeeheryCoeff as Real (Brief="Feeherys correlation coefficient", Unit='1/m^4', Default=1,Hidden=true); 78 ElgueCoeff as Real (Brief="Elgues correlation coefficient", Unit='kg/m/mol^2', Default=1,Hidden=true); 79 OlsenCoeff as Real (Brief="Olsens correlation coefficient", Default=1,Hidden=true); 80 81 VapourFlow as Switcher (Brief="Flag for Vapour Flow condition",Valid = ["on", "off"], Default = "off",Hidden=true); 82 LiquidFlow as Switcher (Brief="Flag for Liquid Flow condition",Valid = ["on", "off"], Default = "off",Hidden=true); 83 144 84 VARIABLES 145 rhoL as dens_mass; 146 rhoV as dens_mass; 85 86 Inlet as stream (Brief="Feed stream", Hidden=true, PosX=0, PosY=0.4932, Symbol="_{in}"); 87 LiquidSideStream as liquid_stream (Brief="liquid Sidestream", Hidden=true, Symbol="_{outL}"); 88 VapourSideStream as vapour_stream (Brief="vapour Sidestream", Hidden=true, Symbol="_{outV}"); 89 90 in InletLiquid as stream (Brief="Inlet liquid stream", PosX=0.5195, PosY=0, Symbol="_{inL}"); 91 in InletVapour as stream (Brief="Inlet vapour stream", PosX=0.4994, PosY=1, Symbol="_{inV}"); 92 out OutletLiquid as liquid_stream (Brief="Outlet liquid stream", PosX=0.8277, PosY=1, Symbol="_{outL}"); 93 out OutletVapour as vapour_stream (Brief="Outlet vapour stream", PosX=0.8043, PosY=0, Symbol="_{outV}"); 94 95 LFlowModel as positive (Brief="Flag for Liquid Flow Model",Lower = 1, Default = 1 , Hidden=true); 96 VFlowModel as positive (Brief="Flag for Vapour Flow Model",Lower = 1, Default = 1 , Hidden=true); 97 98 M(NComp) as mol (Brief="Molar Holdup in the tray"); 99 ML as mol (Brief="Molar liquid holdup"); 100 MV as mol (Brief="Molar vapour holdup"); 101 E as energy (Brief="Total Energy Holdup on tray"); 102 vL as volume_mol (Brief="Liquid Molar Volume"); 103 vV as volume_mol (Brief="Vapour Molar volume"); 104 Level as length (Brief="Height of clear liquid on plate"); 105 yideal(NComp) as fraction; 106 rhoL as dens_mass (Brief="Mass Density of liquid phase"); 107 rhoV as dens_mass (Brief="Mass Density of vapour phase"); 108 109 SET 110 111 Mw = PP.MolecularWeight(); 112 zero_flow = 0 * 'kmol/h'; 113 low_flow = 1E-6 * 'kmol/h'; 114 115 PlateArea_ = 0.25*Pi*(TrayDiameter_^2)*(1-Fraction_DowncomerArea_); 116 TrayVolume_ = 0.25*Pi*(TrayDiameter_^2)*TraySpacing_; 117 HolesArea_ = 0.25*Pi*(TrayDiameter_^2)*Fraction_HoleArea_; 147 118 148 119 EQUATIONS 120 121 # LiquidFlow and VapourFlow equations need to be linerized to avoid indetermination ! 122 switch LiquidFlow 123 124 case "on": 125 126 if LFlowModel equal 1 then 127 "Francis Equation" 128 OutletLiquid.F*vL = 1.84*'1/s'*WeirLength_*((Level-(AerationFraction_*WeirHeight_))/(AerationFraction_))^2; 129 130 else if LFlowModel equal 2 then 131 "Wang_Fl" 132 OutletLiquid.F*vL = 1.84*'m^0.5/s'*WeirLength_*((Level-(AerationFraction_*WeirHeight_))/(AerationFraction_))^1.5; 133 134 else if LFlowModel equal 3 then 135 "Olsen" 136 OutletLiquid.F / 'mol/s'= WeirLength_*TrayLiquidPasses_*rhoL/sum(Mw*OutletVapour.z)/(0.665*OlsenCoeff)^1.5 * ((ML*sum(Mw*OutletLiquid.z)/rhoL/PlateArea_)-WeirHeight_)^1.5 * 'm^0.5/mol'; 137 138 else if LFlowModel equal 4 then 139 "Feehery_Fl" 140 OutletLiquid.F = WeirLength_*rhoL/sum(Mw*OutletLiquid.z) * ((Level-WeirHeight_)/750/'mm')^1.5 * 'm^2/s'; 141 142 else 143 "Roffel_Fl" 144 OutletLiquid.F = 2/3*rhoL/sum(Mw*OutletLiquid.z)*WeirLength_*(ML*sum(Mw*OutletLiquid.z)/(PlateArea_*1.3)/rhoL)^1.5*sqrt(2*Gconst/ 145 (2*(1 - 0.3593/'Pa^0.0888545'*abs(OutletVapour.F*sum(Mw*OutletVapour.z)/(PlateArea_*1.3)/sqrt(rhoV))^0.177709)-1)); #/'(kg/m)^0.0888545/s^0.177709'; 146 end 147 end 148 end 149 end 150 151 when Level < (AerationFraction_ *WeirHeight_) switchto "off"; 152 153 case "off": 154 155 "Low level" 156 OutletLiquid.F = zero_flow; 157 158 when Level > (AerationFraction_ * WeirHeight_) switchto "on"; 159 160 end 161 162 switch VapourFlow 163 164 case "on": 165 166 if VFlowModel equal 1 then 167 "Reepmeyer" 168 InletVapour.F*vV = sqrt((InletVapour.P - OutletVapour.P)/(rhoV*DryPdropCoeff_))*HolesArea_; 169 170 else if VFlowModel equal 2 then 171 "Feehery_Fv" 172 InletVapour.F = rhoV/PlateArea_/FeeheryCoeff/sum(Mw*OutletVapour.z) * sqrt(((InletVapour.P - OutletVapour.P)-(rhoV*Gconst*ML*vL/PlateArea_))/rhoV); 173 174 else if VFlowModel equal 3 then 175 "Roffel_Fv" 176 InletVapour.F^1.08 * 0.0013 * 'kg/m/mol^1.08/s^0.92*1e5' = (InletVapour.P - OutletVapour.P)*1e5 - (AerationFraction_*sum(M*Mw)/(PlateArea_*1.3)*Gconst*1e5) * (rhoV*HolesArea_/sum(Mw*OutletVapour.z))^1.08 * 'm^1.08/mol^1.08'; 177 178 else if VFlowModel equal 4 then 179 "Klingberg" 180 InletVapour.F * vV = PlateArea_ * sqrt(((InletVapour.P - OutletVapour.P)-rhoL*Gconst*Level)/rhoV); 181 182 else if VFlowModel equal 5 then 183 "Wang_Fv" 184 InletVapour.F * vV = PlateArea_ * sqrt(((InletVapour.P - OutletVapour.P)-rhoL*Gconst*Level)/rhoV*DryPdropCoeff_); 185 186 else 187 "Elgue" 188 InletVapour.F = sqrt((InletVapour.P - OutletVapour.P)/ElgueCoeff); 189 end 190 end 191 end 192 end 193 end 194 195 when InletVapour.F < low_flow switchto "off"; 196 197 case "off": 198 InletVapour.F = zero_flow; 199 200 when InletVapour.P > OutletVapour.P switchto "on"; 201 202 end 203 204 "Murphree Efficiency" 205 OutletVapour.z = MurphreeEff_ * (yideal - InletVapour.z) + InletVapour.z; 206 207 "Energy Balance" 208 diff(E) = ( Inlet.F*Inlet.h + InletLiquid.F*InletLiquid.h + InletVapour.F*InletVapour.h- OutletLiquid.F*OutletLiquid.h - OutletVapour.F*OutletVapour.h 209 - VapourSideStream.F*VapourSideStream.h - LiquidSideStream.F*LiquidSideStream.h + HeatSupply_ ); 210 211 "Energy Holdup" 212 E = ML*OutletLiquid.h + MV*OutletVapour.h - OutletLiquid.P*TrayVolume_; 213 214 "Geometry Constraint" 215 TrayVolume_ = ML* vL + MV*vV; 216 217 "Level of clear liquid over the weir" 218 Level = ML*vL/PlateArea_; 219 220 "Component Molar Balance" 221 diff(M)=Inlet.F*Inlet.z + InletLiquid.F*InletLiquid.z + InletVapour.F*InletVapour.z- OutletLiquid.F*OutletLiquid.z - OutletVapour.F*OutletVapour.z- 222 LiquidSideStream.F*LiquidSideStream.z-VapourSideStream.F*VapourSideStream.z; 223 224 "Molar Holdup" 225 M = ML*OutletLiquid.z + MV*OutletVapour.z; 226 227 "Mol fraction normalisation" 228 sum(OutletLiquid.z)= 1.0; 229 230 "Mol fraction constraint" 231 sum(OutletLiquid.z)= sum(OutletVapour.z); 232 233 "Liquid Volume" 234 vL = PP.LiquidVolume(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z); 235 236 "Vapour Volume" 237 vV = PP.VapourVolume(OutletVapour.T, OutletVapour.P, OutletVapour.z); 149 238 150 239 "Liquid Density" … … 153 242 "Vapour Density" 154 243 rhoV = PP.VapourDensity(InletVapour.T, InletVapour.P, InletVapour.z); 244 245 "Chemical Equilibrium" 246 PP.LiquidFugacityCoefficient(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z)*OutletLiquid.z = PP.VapourFugacityCoefficient(OutletVapour.T, OutletVapour.P, yideal)*yideal; 247 248 "Thermal Equilibrium" 249 OutletVapour.T = OutletLiquid.T; 250 251 "Mechanical Equilibrium" 252 OutletVapour.P = OutletLiquid.P; 253 254 "Thermal Equilibrium Vapour Side Stream" 255 OutletVapour.T = VapourSideStream.T; 256 257 "Thermal Equilibrium Liquid Side Stream" 258 OutletLiquid.T = LiquidSideStream.T; 259 260 "Mechanical Equilibrium Vapour Side Stream" 261 OutletVapour.P= VapourSideStream.P; 262 263 "Mechanical Equilibrium Liquid Side Stream" 264 OutletLiquid.P = LiquidSideStream.P; 265 266 "Composition Liquid Side Stream" 267 OutletLiquid.z= LiquidSideStream.z; 268 269 "Composition Vapour Side Stream" 270 OutletVapour.z= VapourSideStream.z; 155 271 156 272 end
Note: See TracChangeset
for help on using the changeset viewer.