Changeset 694 for branches/gui/eml/stage_separators/column.mso
- Timestamp:
- Nov 23, 2008, 10:39:38 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/eml/stage_separators/column.mso
r693 r694 40 40 #*---------------------------------------------------------------------- 41 41 * Model of a column section with: 42 * - NumberOfTrays =number of trays.42 * - NumberOfTrays = number of trays. 43 43 * 44 44 *---------------------------------------------------------------------*# … … 138 138 in FeedTray as stream (Brief="Feed stream", PosX=0, PosY=0.55); 139 139 140 trays(NumberOfTrays) as tray (Brief="Number of trays");140 TRAYS(NumberOfTrays) as tray (Brief="Number of trays"); 141 141 142 142 VapourDrawOffFlow as flow_mol (Brief = "Stream Molar Flow Rate"); … … 147 147 CONNECTIONS 148 148 149 trays([2:NumberOfTrays]).OutletV to trays([1:NumberOfTrays-1]).InletV;150 trays([1:NumberOfTrays-1]).OutletL to trays([2:NumberOfTrays]).InletL;149 TRAYS([2:NumberOfTrays]).OutletV to TRAYS([1:NumberOfTrays-1]).InletV; 150 TRAYS([1:NumberOfTrays-1]).OutletL to TRAYS([2:NumberOfTrays]).InletL; 151 151 152 152 153 153 EQUATIONS 154 154 # Connecting Trays 155 FeedTray.F*FeedTrayIndex= trays.Inlet.F;156 FeedTray.T = trays.Inlet.T;157 FeedTray.P = trays.Inlet.P;158 FeedTray.z = trays.Inlet.z;159 FeedTray.v = trays.Inlet.v;160 FeedTray.h = trays.Inlet.h;155 FeedTray.F*FeedTrayIndex= TRAYS.Inlet.F; 156 FeedTray.T = TRAYS.Inlet.T; 157 FeedTray.P = TRAYS.Inlet.P; 158 FeedTray.z = TRAYS.Inlet.z; 159 FeedTray.v = TRAYS.Inlet.v; 160 FeedTray.h = TRAYS.Inlet.h; 161 161 162 162 for i in [1:NumberOfTrays] do 163 163 164 164 "Murphree Efficiency" 165 trays(i).OutletV.z = MurphreeEff * (trays(i).yideal - trays(i).InletV.z) + trays(i).InletV.z;165 TRAYS(i).OutletV.z = MurphreeEff * (TRAYS(i).yideal - TRAYS(i).InletV.z) + TRAYS(i).InletV.z; 166 166 167 167 "Level of clear liquid over the weir" 168 trays(i).Level = trays(i).ML*trays(i).vL/Ap;168 TRAYS(i).Level = TRAYS(i).ML*TRAYS(i).vL/Ap; 169 169 170 170 "Geometry Constraint" 171 V = trays(i).ML* trays(i).vL + trays(i).MV*trays(i).vV;171 V = TRAYS(i).ML* TRAYS(i).vL + TRAYS(i).MV*TRAYS(i).vV; 172 172 173 173 "Energy Holdup" 174 trays(i).E = trays(i).ML*trays(i).OutletL.h + trays(i).MV*trays(i).OutletV.h - trays(i).OutletL.P*V;174 TRAYS(i).E = TRAYS(i).ML*TRAYS(i).OutletL.h + TRAYS(i).MV*TRAYS(i).OutletV.h - TRAYS(i).OutletL.P*V; 175 175 176 176 "Energy Balance" 177 diff( trays(i).E) = ( trays(i).Inlet.F*trays(i).Inlet.h + trays(i).InletL.F*trays(i).InletL.h + trays(i).InletV.F*trays(i).InletV.h- trays(i).OutletL.F*trays(i).OutletL.h - trays(i).OutletV.F*trays(i).OutletV.h178 - trays(i).VapourSideStream.F*trays(i).VapourSideStream.h - trays(i).LiquidSideStream.F*trays(i).LiquidSideStream.h + Q );177 diff(TRAYS(i).E) = ( TRAYS(i).Inlet.F*TRAYS(i).Inlet.h + TRAYS(i).InletL.F*TRAYS(i).InletL.h + TRAYS(i).InletV.F*TRAYS(i).InletV.h- TRAYS(i).OutletL.F*TRAYS(i).OutletL.h - TRAYS(i).OutletV.F*TRAYS(i).OutletV.h 178 -TRAYS(i).VapourSideStream.F*TRAYS(i).VapourSideStream.h - TRAYS(i).LiquidSideStream.F*TRAYS(i).LiquidSideStream.h + Q ); 179 179 180 180 switch LiquidFlow … … 183 183 case "default": 184 184 "Francis Equation" 185 trays(i).OutletL.F*trays(i).vL = 1.84*'1/s'*lw*((trays(i).Level-(beta*hw))/(beta))^2;185 TRAYS(i).OutletL.F*TRAYS(i).vL = 1.84*'1/s'*lw*((TRAYS(i).Level-(beta*hw))/(beta))^2; 186 186 187 187 case "Wang_Fl": 188 trays(i).OutletL.F*trays(i).vL = 1.84*'m^0.5/s'*lw*((trays(i).Level-(beta*hw))/(beta))^1.5;188 TRAYS(i).OutletL.F*TRAYS(i).vL = 1.84*'m^0.5/s'*lw*((TRAYS(i).Level-(beta*hw))/(beta))^1.5; 189 189 190 190 case "Olsen": 191 trays(i).OutletL.F / 'mol/s'= lw*Np*trays(i).rhoL/sum(Mw*trays(i).OutletV.z)/(0.665*fw)^1.5 * ((trays(i).ML*sum(Mw*trays(i).OutletL.z)/trays(i).rhoL/Ap)-hw)^1.5 * 'm^0.5/mol';191 TRAYS(i).OutletL.F / 'mol/s'= lw*Np*TRAYS(i).rhoL/sum(Mw*TRAYS(i).OutletV.z)/(0.665*fw)^1.5 * ((TRAYS(i).ML*sum(Mw*TRAYS(i).OutletL.z)/TRAYS(i).rhoL/Ap)-hw)^1.5 * 'm^0.5/mol'; 192 192 193 193 case "Feehery_Fl": 194 trays(i).OutletL.F = lw*trays(i).rhoL/sum(Mw*trays(i).OutletL.z) * ((trays(i).Level-hw)/750/'mm')^1.5 * 'm^2/s';194 TRAYS(i).OutletL.F = lw*TRAYS(i).rhoL/sum(Mw*TRAYS(i).OutletL.z) * ((TRAYS(i).Level-hw)/750/'mm')^1.5 * 'm^2/s'; 195 195 196 196 case "Roffel_Fl": 197 trays(i).OutletL.F = 2/3*sqrt(2*g)*trays(i).rhoL/sum(Mw*trays(i).OutletL.z)*lw*(2*trays(i).btemp-1)*(trays(i).ML*sum(Mw*trays(i).OutletL.z)/(Ap*1.3)/trays(i).rhoL/(2*trays(i).btemp-1))^1.5;197 TRAYS(i).OutletL.F = 2/3*sqrt(2*g)*TRAYS(i).rhoL/sum(Mw*TRAYS(i).OutletL.z)*lw*(2*TRAYS(i).btemp-1)*(TRAYS(i).ML*sum(Mw*TRAYS(i).OutletL.z)/(Ap*1.3)/TRAYS(i).rhoL/(2*TRAYS(i).btemp-1))^1.5; 198 198 end 199 when trays(i).Level < (beta *hw) switchto "off";199 when TRAYS(i).Level < (beta *hw) switchto "off"; 200 200 201 201 case "off": 202 202 "Low level" 203 trays(i).OutletL.F = 0 * 'mol/h';204 when trays(i).Level > (beta * hw) + 1e-6*'m' switchto "on";203 TRAYS(i).OutletL.F = 0 * 'mol/h'; 204 when TRAYS(i).Level > (beta * hw) + 1e-6*'m' switchto "on"; 205 205 end 206 206 207 trays(i).btemp = 1 - 0.3593/'Pa^0.0888545'*abs(trays(i).OutletV.F*sum(Mw*trays(i).OutletV.z)/(Ap*1.3)/sqrt(trays(i).rhoV))^0.177709; #/'(kg/m)^0.0888545/s^0.177709';207 TRAYS(i).btemp = 1 - 0.3593/'Pa^0.0888545'*abs(TRAYS(i).OutletV.F*sum(Mw*TRAYS(i).OutletV.z)/(Ap*1.3)/sqrt(TRAYS(i).rhoV))^0.177709; #/'(kg/m)^0.0888545/s^0.177709'; 208 208 209 209 switch VapourFlow … … 211 211 switch VapourFlowModel 212 212 case "Reepmeyer": 213 trays(i).InletV.F*trays(i).vV = sqrt((trays(i).InletV.P - trays(i).OutletV.P)/(trays(i).rhoV*alfa))*Ah;213 TRAYS(i).InletV.F*TRAYS(i).vV = sqrt((TRAYS(i).InletV.P - TRAYS(i).OutletV.P)/(TRAYS(i).rhoV*alfa))*Ah; 214 214 215 215 case "Feehery_Fv": 216 trays(i).InletV.F = trays(i).rhoV/Ap/w/sum(Mw*trays(i).OutletV.z) * sqrt(((trays(i).InletV.P - trays(i).OutletV.P)-(trays(i).rhoV*g*trays(i).ML*trays(i).vL/Ap))/trays(i).rhoV);216 TRAYS(i).InletV.F = TRAYS(i).rhoV/Ap/w/sum(Mw*TRAYS(i).OutletV.z) * sqrt(((TRAYS(i).InletV.P - TRAYS(i).OutletV.P)-(TRAYS(i).rhoV*g*TRAYS(i).ML*TRAYS(i).vL/Ap))/TRAYS(i).rhoV); 217 217 218 218 case "Roffel_Fv": 219 trays(i).InletV.F^1.08 * 0.0013 * 'kg/m/mol^1.08/s^0.92*1e5' = (trays(i).InletV.P - trays(i).OutletV.P)*1e5 - (beta*sum(trays(i).M*Mw)/(Ap*1.3)*g*1e5) * (trays(i).rhoV*Ah/sum(Mw*trays(i).OutletV.z))^1.08 * 'm^1.08/mol^1.08';219 TRAYS(i).InletV.F^1.08 * 0.0013 * 'kg/m/mol^1.08/s^0.92*1e5' = (TRAYS(i).InletV.P - TRAYS(i).OutletV.P)*1e5 - (beta*sum(TRAYS(i).M*Mw)/(Ap*1.3)*g*1e5) * (TRAYS(i).rhoV*Ah/sum(Mw*TRAYS(i).OutletV.z))^1.08 * 'm^1.08/mol^1.08'; 220 220 221 221 case "Klingberg": 222 trays(i).InletV.F * trays(i).vV = Ap * sqrt(((trays(i).InletV.P - trays(i).OutletV.P)-trays(i).rhoL*g*trays(i).Level)/trays(i).rhoV);222 TRAYS(i).InletV.F * TRAYS(i).vV = Ap * sqrt(((TRAYS(i).InletV.P - TRAYS(i).OutletV.P)-TRAYS(i).rhoL*g*TRAYS(i).Level)/TRAYS(i).rhoV); 223 223 224 224 case "Wang_Fv": 225 trays(i).InletV.F * trays(i).vV = Ap * sqrt(((trays(i).InletV.P - trays(i).OutletV.P)-trays(i).rhoL*g*trays(i).Level)/trays(i).rhoV*alfa);225 TRAYS(i).InletV.F * TRAYS(i).vV = Ap * sqrt(((TRAYS(i).InletV.P - TRAYS(i).OutletV.P)-TRAYS(i).rhoL*g*TRAYS(i).Level)/TRAYS(i).rhoV*alfa); 226 226 227 227 case "Elgue": 228 trays(i).InletV.F = sqrt((trays(i).InletV.P - trays(i).OutletV.P)/btray);228 TRAYS(i).InletV.F = sqrt((TRAYS(i).InletV.P - TRAYS(i).OutletV.P)/btray); 229 229 end 230 when trays(i).InletV.F < 1e-6 * 'kmol/h' switchto "off";230 when TRAYS(i).InletV.F < 1e-6 * 'kmol/h' switchto "off"; 231 231 232 232 case "off": 233 trays(i).InletV.F = 0 * 'mol/s';234 when trays(i).InletV.P > trays(i).OutletV.P + trays(i).Level*g*trays(i).rhoL + 1e-1 * 'atm' switchto "on";233 TRAYS(i).InletV.F = 0 * 'mol/s'; 234 when TRAYS(i).InletV.P > TRAYS(i).OutletV.P + TRAYS(i).Level*g*TRAYS(i).rhoL + 1e-1 * 'atm' switchto "on"; 235 235 end 236 236 … … 241 241 for i in 1:NumberOfTrays do 242 242 243 "The initial temperature of the trays"244 trays(i).OutletL.T = TopTemperature+(TbottomTemperature-TopTemperature)*((i-1)/(NumberOfTrays-1));245 246 "The initial Level of the trays"247 trays(i).Level = LevelFraction*hw;243 "The initial temperature of the TRAYS" 244 TRAYS(i).OutletL.T = TopTemperature+(TbottomTemperature-TopTemperature)*((i-1)/(NumberOfTrays-1)); 245 246 "The initial Level of the TRAYS" 247 TRAYS(i).Level = LevelFraction*hw; 248 248 249 249 end … … 253 253 for j in 1:NumberOfTrays do 254 254 255 "The initial composition of the trays"256 trays(j).OutletL.z(i) = TopComposition(i) +(BottomComposition(i)-TopComposition(i) )*((j-1)/(NumberOfTrays-1));255 "The initial composition of the TRAYS" 256 TRAYS(j).OutletL.z(i) = TopComposition(i) +(BottomComposition(i)-TopComposition(i) )*((j-1)/(NumberOfTrays-1)); 257 257 258 258 end … … 270 270 Info = 271 271 "== Model of a column section containing == 272 * NumberOfTrays trays.272 * NumberOfTrays TRAYS. 273 273 274 274 == Specify == … … 279 279 280 280 == Initial Conditions == 281 * the traystemperature (OutletL.T);282 * the trays liquid level (Level) OR the traysliquid flow (OutletL.F);281 * the TRAYS temperature (OutletL.T); 282 * the TRAYS liquid level (Level) OR the TRAYS liquid flow (OutletL.F); 283 283 * (NoComps - 1) OutletL (OR OutletV) compositions for each tray. 284 284 "; … … 295 295 out LiquidOutlet as liquid_stream (Brief="Liquid Outlet in the section", PosX=0.70, PosY=1); 296 296 297 LiquidConnector as stream (Brief="Liquid connection at the middle trays", PosX=0.75, PosY=1,Hidden=true);298 VapourConnector as stream (Brief="Vapour connection at the middle trays", PosX=0.55, PosY=0,Hidden=true);297 LiquidConnector as stream (Brief="Liquid connection at the middle TRAYS", PosX=0.75, PosY=1,Hidden=true); 298 VapourConnector as stream (Brief="Vapour connection at the middle TRAYS", PosX=0.55, PosY=0,Hidden=true); 299 299 300 300 CONNECTIONS 301 301 302 LiquidConnector to trays(1).InletL;303 VapourConnector to trays(NumberOfTrays).InletV;302 LiquidConnector to TRAYS(1).InletL; 303 VapourConnector to TRAYS(NumberOfTrays).InletV; 304 304 305 305 EQUATIONS … … 319 319 VapourConnector.h = VapourInlet.h; 320 320 321 LiquidOutlet.F= trays(NumberOfTrays).OutletL.F;322 LiquidOutlet.T = trays(NumberOfTrays).OutletL.T;323 LiquidOutlet.P = trays(NumberOfTrays).OutletL.P;324 LiquidOutlet.z = trays(NumberOfTrays).OutletL.z;325 326 VapourOutlet.F= trays(1).OutletV.F;327 VapourOutlet.T = trays(1).OutletV.T;328 VapourOutlet.P = trays(1).OutletV.P;329 VapourOutlet.z = trays(1).OutletV.z;330 331 VapourDrawOff.F*VapSideTrayIndex= trays.VapourSideStream.F;332 VapourDrawOff.T = trays(VapourSideStreamLocation).VapourSideStream.T;333 VapourDrawOff.P = trays(VapourSideStreamLocation).VapourSideStream.P;334 VapourDrawOff.z = trays(VapourSideStreamLocation).VapourSideStream.z;335 336 LiquidDrawOff.F*LiqSideTrayIndex= trays.LiquidSideStream.F;337 LiquidDrawOff.T = trays(LiquidSideStreamLocation).LiquidSideStream.T;338 LiquidDrawOff.P = trays(LiquidSideStreamLocation).LiquidSideStream.P;339 LiquidDrawOff.z = trays(LiquidSideStreamLocation).LiquidSideStream.z;321 LiquidOutlet.F= TRAYS(NumberOfTrays).OutletL.F; 322 LiquidOutlet.T = TRAYS(NumberOfTrays).OutletL.T; 323 LiquidOutlet.P = TRAYS(NumberOfTrays).OutletL.P; 324 LiquidOutlet.z = TRAYS(NumberOfTrays).OutletL.z; 325 326 VapourOutlet.F= TRAYS(1).OutletV.F; 327 VapourOutlet.T = TRAYS(1).OutletV.T; 328 VapourOutlet.P = TRAYS(1).OutletV.P; 329 VapourOutlet.z = TRAYS(1).OutletV.z; 330 331 VapourDrawOff.F*VapSideTrayIndex= TRAYS.VapourSideStream.F; 332 VapourDrawOff.T = TRAYS(VapourSideStreamLocation).VapourSideStream.T; 333 VapourDrawOff.P = TRAYS(VapourSideStreamLocation).VapourSideStream.P; 334 VapourDrawOff.z = TRAYS(VapourSideStreamLocation).VapourSideStream.z; 335 336 LiquidDrawOff.F*LiqSideTrayIndex= TRAYS.LiquidSideStream.F; 337 LiquidDrawOff.T = TRAYS(LiquidSideStreamLocation).LiquidSideStream.T; 338 LiquidDrawOff.P = TRAYS(LiquidSideStreamLocation).LiquidSideStream.P; 339 LiquidDrawOff.z = TRAYS(LiquidSideStreamLocation).LiquidSideStream.z; 340 340 341 341 VapourDrawOffFlow = VapourDrawOff.F; … … 368 368 369 369 == Initial Conditions == 370 * the traystemperature (OutletL.T);371 * the trays liquid level (Level) OR the traysliquid flow (OutletL.F);370 * the TRAYS temperature (OutletL.T); 371 * the TRAYS liquid level (Level) OR the TRAYS liquid flow (OutletL.F); 372 372 * (NoComps - 1) OutletL (OR OutletV) compositions for each tray; 373 373 … … 388 388 out LiquidDrawOff as liquid_stream (Brief="Liquid Outlet in the section", PosX=1, PosY=0.58,Protected = true); 389 389 390 C ondenserUnityas condenser;391 R eboilerUnityas reboiler;392 S plitterTopas splitter;393 P umpUnityas pump;390 CONDENSER as condenser; 391 REBOILER as reboiler; 392 SPLITTERtop as splitter; 393 PUMP as pump; 394 394 alfaTopo as Real; 395 395 … … 413 413 414 414 case "on": 415 C ondenserUnity.InletV.F*trays(1).vV = alfaTopo *Ah * sqrt(2*(trays(1).OutletV.P -416 C ondenserUnity.OutletL.P + 1e-8 * 'atm') / (alfa*trays(1).rhoV));417 when C ondenserUnity.InletV.F < 1e-6 * 'kmol/h' switchto "off";415 CONDENSER.InletV.F*TRAYS(1).vV = alfaTopo *Ah * sqrt(2*(TRAYS(1).OutletV.P - 416 CONDENSER.OutletL.P + 1e-8 * 'atm') / (alfa*TRAYS(1).rhoV)); 417 when CONDENSER.InletV.F < 1e-6 * 'kmol/h' switchto "off"; 418 418 419 419 case "off": 420 C ondenserUnity.InletV.F = 0 * 'mol/s';421 when trays(1).OutletV.P > CondenserUnity.OutletL.P + 1e-1 * 'atm' switchto "on";420 CONDENSER.InletV.F = 0 * 'mol/s'; 421 when TRAYS(1).OutletV.P > CONDENSER.OutletL.P + 1e-1 * 'atm' switchto "on"; 422 422 423 423 end … … 441 441 ConnectorReboilerLout.z = BottomProduct.z; 442 442 443 VapourDrawOff.F*VapSideTrayIndex= trays.VapourSideStream.F;444 VapourDrawOff.T = trays(VapourSideStreamLocation).VapourSideStream.T;445 VapourDrawOff.P = trays(VapourSideStreamLocation).VapourSideStream.P;446 VapourDrawOff.z = trays(VapourSideStreamLocation).VapourSideStream.z;447 448 LiquidDrawOff.F*LiqSideTrayIndex= trays.LiquidSideStream.F;449 LiquidDrawOff.T = trays(LiquidSideStreamLocation).LiquidSideStream.T;450 LiquidDrawOff.P = trays(LiquidSideStreamLocation).LiquidSideStream.P;451 LiquidDrawOff.z = trays(LiquidSideStreamLocation).LiquidSideStream.z;443 VapourDrawOff.F*VapSideTrayIndex= TRAYS.VapourSideStream.F; 444 VapourDrawOff.T = TRAYS(VapourSideStreamLocation).VapourSideStream.T; 445 VapourDrawOff.P = TRAYS(VapourSideStreamLocation).VapourSideStream.P; 446 VapourDrawOff.z = TRAYS(VapourSideStreamLocation).VapourSideStream.z; 447 448 LiquidDrawOff.F*LiqSideTrayIndex= TRAYS.LiquidSideStream.F; 449 LiquidDrawOff.T = TRAYS(LiquidSideStreamLocation).LiquidSideStream.T; 450 LiquidDrawOff.P = TRAYS(LiquidSideStreamLocation).LiquidSideStream.P; 451 LiquidDrawOff.z = TRAYS(LiquidSideStreamLocation).LiquidSideStream.z; 452 452 453 453 VapourDrawOffFlow = VapourDrawOff.F; … … 456 456 CONNECTIONS 457 457 #vapor 458 R eboilerUnity.OutletV to trays(NumberOfTrays).InletV;459 trays(1).OutletV to CondenserUnity.InletV;458 REBOILER.OutletV to TRAYS(NumberOfTrays).InletV; 459 TRAYS(1).OutletV to CONDENSER.InletV; 460 460 461 461 #liquid 462 C ondenserUnity.OutletL to SplitterTop.Inlet;463 S plitterTop.Outlet2 to PumpUnity.Inlet;464 P umpUnity.Outlet to trays(1).InletL;465 trays(NumberOfTrays).OutletL to ReboilerUnity.InletL;462 CONDENSER.OutletL to SPLITTERtop.Inlet; 463 SPLITTERtop.Outlet2 to PUMP.Inlet; 464 PUMP.Outlet to TRAYS(1).InletL; 465 TRAYS(NumberOfTrays).OutletL to REBOILER.InletL; 466 466 467 467 #Connectors 468 HeatToReboiler to R eboilerUnity.InletQ;469 HeatToCondenser to C ondenserUnity.InletQ;470 RebNoFlow.Outlet to R eboilerUnity.Inlet;471 472 C ondenserUnity.OutletV to ConnectorCondenserVout;473 S plitterTop.Outlet1 to ConnectorSplitterOut;474 R eboilerUnity.OutletL to ConnectorReboilerLout;468 HeatToReboiler to REBOILER.InletQ; 469 HeatToCondenser to CONDENSER.InletQ; 470 RebNoFlow.Outlet to REBOILER.Inlet; 471 472 CONDENSER.OutletV to ConnectorCondenserVout; 473 SPLITTERtop.Outlet1 to ConnectorSplitterOut; 474 REBOILER.OutletL to ConnectorReboilerLout; 475 475 476 476 end … … 507 507 508 508 == Initial Conditions == 509 * the traystemperature (OutletL.T);510 * the trays liquid level (Level) OR the traysliquid flow (OutletL.F);509 * the TRAYS temperature (OutletL.T); 510 * the TRAYS liquid level (Level) OR the TRAYS liquid flow (OutletL.F); 511 511 * (NoComps - 1) OutletL (OR OutletV) compositions for each tray; 512 512 … … 519 519 * (NoComps - 1) OutletL (OR OutletV) compositions. 520 520 "; 521 521 522 522 PARAMETERS 523 523 … … 528 528 out VapourDrawOff as vapour_stream (Brief="Vapour Outlet in the section", PosX=1, PosY=0.41,Protected = true); 529 529 out LiquidDrawOff as liquid_stream (Brief="Liquid Outlet in the section", PosX=1, PosY=0.515,Protected = true); 530 531 CondenserUnity as condenserSteady; 532 TopVessel as tank_cylindrical; 533 TopSplitter as splitter; 534 PumpUnity as pump; 535 ReboilerUnity as reboilerSteady; 536 BottomVessel as tank; 537 BottomSplitter as splitter; 538 539 540 alfaTopo as Real; 530 531 CONDENSER as condenserSteady; 532 TANKtop as tank_cylindrical; 533 SPLITTERtop as splitter; 534 PUMP as pump; 535 REBOILER as reboilerSteady; 536 TANKbottom as tank; 537 SPLITTERbottom as splitter; 538 alfaTopo as Real; 541 539 542 540 out HeatToCondenser as power (Brief="Heat supplied to Condenser",Hidden=true); 543 out HeatToReboiler as power (Brief="Heat supplied to Reboiler",Hidden=true);541 out HeatToReboiler as power (Brief="Heat supplied to Reboiler",Hidden=true); 544 542 out HeatToBottomVessel as power (Brief="Heat supplied to Bottom Vessel",Hidden=true); 545 543 out HeatToTopVessel as power (Brief="Heat supplied to Top Vessel",Hidden=true); … … 565 563 ConnectorSplitterBottom.z = BottomProduct.z; 566 564 567 VapourDrawOff.F*VapSideTrayIndex= trays.VapourSideStream.F;568 VapourDrawOff.T = trays(VapourSideStreamLocation).VapourSideStream.T;569 VapourDrawOff.P = trays(VapourSideStreamLocation).VapourSideStream.P;570 VapourDrawOff.z = trays(VapourSideStreamLocation).VapourSideStream.z;571 572 LiquidDrawOff.F*LiqSideTrayIndex= trays.LiquidSideStream.F;573 LiquidDrawOff.T = trays(LiquidSideStreamLocation).LiquidSideStream.T;574 LiquidDrawOff.P = trays(LiquidSideStreamLocation).LiquidSideStream.P;575 LiquidDrawOff.z = trays(LiquidSideStreamLocation).LiquidSideStream.z;565 VapourDrawOff.F*VapSideTrayIndex= TRAYS.VapourSideStream.F; 566 VapourDrawOff.T = TRAYS(VapourSideStreamLocation).VapourSideStream.T; 567 VapourDrawOff.P = TRAYS(VapourSideStreamLocation).VapourSideStream.P; 568 VapourDrawOff.z = TRAYS(VapourSideStreamLocation).VapourSideStream.z; 569 570 LiquidDrawOff.F*LiqSideTrayIndex= TRAYS.LiquidSideStream.F; 571 LiquidDrawOff.T = TRAYS(LiquidSideStreamLocation).LiquidSideStream.T; 572 LiquidDrawOff.P = TRAYS(LiquidSideStreamLocation).LiquidSideStream.P; 573 LiquidDrawOff.z = TRAYS(LiquidSideStreamLocation).LiquidSideStream.z; 576 574 577 575 VapourDrawOffFlow = VapourDrawOff.F; 578 576 LiquidDrawOffFlow = LiquidDrawOff.F; 579 577 580 578 switch CondenserVapourFlow 581 579 582 580 case "on": 583 C ondenserUnity.InletV.F*trays(1).vV = alfaTopo * Ah * sqrt(2*(trays(1).OutletV.P -584 C ondenserUnity.OutletL.P + 1e-8 * 'atm') / (alfa*trays(1).rhoV));585 when C ondenserUnity.InletV.F < 1e-6 * 'kmol/h' switchto "off";581 CONDENSER.InletV.F*TRAYS(1).vV = alfaTopo * Ah * sqrt(2*(TRAYS(1).OutletV.P - 582 CONDENSER.OutletL.P + 1e-8 * 'atm') / (alfa*TRAYS(1).rhoV)); 583 when CONDENSER.InletV.F < 1e-6 * 'kmol/h' switchto "off"; 586 584 587 585 case "off": 588 C ondenserUnity.InletV.F = 0 * 'mol/s';589 when trays(1).OutletV.P > CondenserUnity.OutletL.P + 1e-1 * 'atm' switchto "on";586 CONDENSER.InletV.F = 0 * 'mol/s'; 587 when TRAYS(1).OutletV.P > CONDENSER.OutletL.P + 1e-1 * 'atm' switchto "on"; 590 588 591 589 end 592 590 593 591 CONNECTIONS 594 592 #vapor 595 R eboilerUnity.OutletV to trays(NumberOfTrays).InletV;596 trays(1).OutletV to CondenserUnity.InletV;593 REBOILER.OutletV to TRAYS(NumberOfTrays).InletV; 594 TRAYS(1).OutletV to CONDENSER.InletV; 597 595 598 596 #liquid 599 C ondenserUnity.OutletL to TopVessel.Inlet;600 T opVessel.Outlet to TopSplitter.Inlet;601 TopSplitter.Outlet2 to PumpUnity.Inlet;602 P umpUnity.Outlet to trays(1).InletL;603 trays(NumberOfTrays).OutletL to BottomVessel.Inlet;604 BottomVessel.Outlet to BottomSplitter.Inlet;605 BottomSplitter.Outlet2 to ReboilerUnity.InletL;597 CONDENSER.OutletL to TANKtop.Inlet; 598 TANKtop.Outlet to SPLITTERtop.Inlet; 599 SPLITTERtop.Outlet2 to PUMP.Inlet; 600 PUMP.Outlet to TRAYS(1).InletL; 601 TRAYS(NumberOfTrays).OutletL to TANKbottom.Inlet; 602 TANKbottom.Outlet to SPLITTERbottom.Inlet; 603 SPLITTERbottom.Outlet2 to REBOILER.InletL; 606 604 607 605 #Connectors 608 HeatToCondenser to C ondenserUnity.InletQ;609 HeatToReboiler to ReboilerUnity.InletQ;610 HeatToBottomVessel to BottomVessel.InletQ;611 HeatToTopVessel to T opVessel.InletQ;612 TopSplitter.Outlet1to ConnectorSplitterTop;613 BottomSplitter.Outlet1 to ConnectorSplitterBottom;606 HeatToCondenser to CONDENSER.InletQ; 607 HeatToReboiler to REBOILER.InletQ; 608 HeatToBottomVessel to TANKbottom.InletQ; 609 HeatToTopVessel to TANKtop.InletQ; 610 SPLITTERtop.Outlet1 to ConnectorSplitterTop; 611 SPLITTERbottom.Outlet1 to ConnectorSplitterBottom; 614 612 615 613 end … … 644 642 645 643 == Initial Conditions == 646 * the traystemperature (OutletL.T);647 * the trays liquid level (Level) OR the traysliquid flow (OutletL.F);644 * the TRAYS temperature (OutletL.T); 645 * the TRAYS liquid level (Level) OR the TRAYS liquid flow (OutletL.F); 648 646 * (NoComps - 1) OutletL (OR OutletV) compositions for each tray; 649 647 … … 665 663 out LiquidDrawOff as liquid_stream (Brief="Liquid Outlet in the section", PosX=1, PosY=0.515,Protected = true); 666 664 667 C ondenserUnityas condenser;668 S plitterTop as splitter;669 P umpUnityas pump;670 BottomVesselas tank;671 S plitterBottom as splitter;672 R eboilerUnityas reboilerSteady;665 CONDENSER as condenser; 666 SPLITTERtop as splitter; 667 PUMP as pump; 668 TANKbottom as tank; 669 SPLITTERbottom as splitter; 670 REBOILER as reboilerSteady; 673 671 alfaTopo as Real; 674 672 … … 706 704 ConnectorSplitterBottom.z = BottomProduct.z; 707 705 708 VapourDrawOff.F*VapSideTrayIndex= trays.VapourSideStream.F;709 VapourDrawOff.T = trays(VapourSideStreamLocation).VapourSideStream.T;710 VapourDrawOff.P = trays(VapourSideStreamLocation).VapourSideStream.P;711 VapourDrawOff.z = trays(VapourSideStreamLocation).VapourSideStream.z;712 713 LiquidDrawOff.F*LiqSideTrayIndex= trays.LiquidSideStream.F;714 LiquidDrawOff.T = trays(LiquidSideStreamLocation).LiquidSideStream.T;715 LiquidDrawOff.P = trays(LiquidSideStreamLocation).LiquidSideStream.P;716 LiquidDrawOff.z = trays(LiquidSideStreamLocation).LiquidSideStream.z;706 VapourDrawOff.F*VapSideTrayIndex= TRAYS.VapourSideStream.F; 707 VapourDrawOff.T = TRAYS(VapourSideStreamLocation).VapourSideStream.T; 708 VapourDrawOff.P = TRAYS(VapourSideStreamLocation).VapourSideStream.P; 709 VapourDrawOff.z = TRAYS(VapourSideStreamLocation).VapourSideStream.z; 710 711 LiquidDrawOff.F*LiqSideTrayIndex= TRAYS.LiquidSideStream.F; 712 LiquidDrawOff.T = TRAYS(LiquidSideStreamLocation).LiquidSideStream.T; 713 LiquidDrawOff.P = TRAYS(LiquidSideStreamLocation).LiquidSideStream.P; 714 LiquidDrawOff.z = TRAYS(LiquidSideStreamLocation).LiquidSideStream.z; 717 715 718 716 VapourDrawOffFlow = VapourDrawOff.F; … … 721 719 switch CondenserVapourFlow 722 720 case "on": 723 C ondenserUnity.InletV.F*trays(1).vV = alfaTopo * Ah * sqrt(2*(trays(1).OutletV.P -724 C ondenserUnity.OutletL.P + 1e-8 * 'atm') / (alfa*trays(1).rhoV));725 when C ondenserUnity.InletV.F < 1e-6 * 'kmol/h' switchto "off";721 CONDENSER.InletV.F*TRAYS(1).vV = alfaTopo * Ah * sqrt(2*(TRAYS(1).OutletV.P - 722 CONDENSER.OutletL.P + 1e-8 * 'atm') / (alfa*TRAYS(1).rhoV)); 723 when CONDENSER.InletV.F < 1e-6 * 'kmol/h' switchto "off"; 726 724 727 725 case "off": 728 C ondenserUnity.InletV.F = 0 * 'mol/s';729 when trays(1).OutletV.P > CondenserUnity.OutletL.P + 1e-1 * 'atm' switchto "on";726 CONDENSER.InletV.F = 0 * 'mol/s'; 727 when TRAYS(1).OutletV.P > CONDENSER.OutletL.P + 1e-1 * 'atm' switchto "on"; 730 728 end 731 729 732 730 CONNECTIONS 733 731 #vapor 734 R eboilerUnity.OutletV to trays(NumberOfTrays).InletV;735 trays(1).OutletV to CondenserUnity.InletV;732 REBOILER.OutletV to TRAYS(NumberOfTrays).InletV; 733 TRAYS(1).OutletV to CONDENSER.InletV; 736 734 737 735 #liquid 738 C ondenserUnity.OutletL to SplitterTop.Inlet;739 S plitterTop.Outlet2 to PumpUnity.Inlet;740 P umpUnity.Outlet to trays(1).InletL;741 trays(NumberOfTrays).OutletL to BottomVessel.Inlet;742 BottomVessel.Outlet to SplitterBottom.Inlet;743 S plitterBottom.Outlet2 to ReboilerUnity.InletL;736 CONDENSER.OutletL to SPLITTERtop.Inlet; 737 SPLITTERtop.Outlet2 to PUMP.Inlet; 738 PUMP.Outlet to TRAYS(1).InletL; 739 TRAYS(NumberOfTrays).OutletL to TANKbottom.Inlet; 740 TANKbottom.Outlet to SPLITTERbottom.Inlet; 741 SPLITTERbottom.Outlet2 to REBOILER.InletL; 744 742 745 743 #Connectors 746 HeatToCondenser to C ondenserUnity.InletQ;747 HeatToReboiler to R eboilerUnity.InletQ;748 HeatToBottomVessel to BottomVessel.InletQ;749 C ondenserUnity.OutletV to ConnectorCondenserVout;750 S plitterTop.Outlet1 to ConnectorSplitterTop;751 S plitterBottom.Outlet1 to ConnectorSplitterBottom;744 HeatToCondenser to CONDENSER.InletQ; 745 HeatToReboiler to REBOILER.InletQ; 746 HeatToBottomVessel to TANKbottom.InletQ; 747 CONDENSER.OutletV to ConnectorCondenserVout; 748 SPLITTERtop.Outlet1 to ConnectorSplitterTop; 749 SPLITTERbottom.Outlet1 to ConnectorSplitterBottom; 752 750 753 751 end … … 782 780 783 781 == Initial Conditions == 784 * the traystemperature (OutletL.T);785 * the trays liquid level (Level) OR the traysliquid flow (OutletL.F);782 * the TRAYS temperature (OutletL.T); 783 * the TRAYS liquid level (Level) OR the TRAYS liquid flow (OutletL.F); 786 784 * (NoComps - 1) OutletL (OR OutletV) compositions for each tray; 787 785 … … 801 799 out VapourDrawOff as vapour_stream (Brief="Vapour Outlet in the section", PosX=1, PosY=0.46,Protected = true); 802 800 out LiquidDrawOff as liquid_stream (Brief="Liquid Outlet in the section", PosX=1, PosY=0.58,Protected = true); 803 CondenserUnity as condenserSteady; 804 TopVessel as tank_cylindrical; 805 SplitterTop as splitter; 806 PumpUnity as pump; 807 ReboilerUnity as reboiler; 801 802 CONDENSER as condenserSteady; 803 TANKtop as tank_cylindrical; 804 SPLITTERtop as splitter; 805 PUMP as pump; 806 REBOILER as reboiler; 808 807 alfaTopo as Real; 809 808 … … 834 833 ConnectorReboilerLout.z = BottomProduct.z; 835 834 836 VapourDrawOff.F*VapSideTrayIndex= trays.VapourSideStream.F;837 VapourDrawOff.T = trays(VapourSideStreamLocation).VapourSideStream.T;838 VapourDrawOff.P = trays(VapourSideStreamLocation).VapourSideStream.P;839 VapourDrawOff.z = trays(VapourSideStreamLocation).VapourSideStream.z;840 841 LiquidDrawOff.F*LiqSideTrayIndex= trays.LiquidSideStream.F;842 LiquidDrawOff.T = trays(LiquidSideStreamLocation).LiquidSideStream.T;843 LiquidDrawOff.P = trays(LiquidSideStreamLocation).LiquidSideStream.P;844 LiquidDrawOff.z = trays(LiquidSideStreamLocation).LiquidSideStream.z;835 VapourDrawOff.F*VapSideTrayIndex= TRAYS.VapourSideStream.F; 836 VapourDrawOff.T = TRAYS(VapourSideStreamLocation).VapourSideStream.T; 837 VapourDrawOff.P = TRAYS(VapourSideStreamLocation).VapourSideStream.P; 838 VapourDrawOff.z = TRAYS(VapourSideStreamLocation).VapourSideStream.z; 839 840 LiquidDrawOff.F*LiqSideTrayIndex= TRAYS.LiquidSideStream.F; 841 LiquidDrawOff.T = TRAYS(LiquidSideStreamLocation).LiquidSideStream.T; 842 LiquidDrawOff.P = TRAYS(LiquidSideStreamLocation).LiquidSideStream.P; 843 LiquidDrawOff.z = TRAYS(LiquidSideStreamLocation).LiquidSideStream.z; 845 844 846 845 VapourDrawOffFlow = VapourDrawOff.F; … … 849 848 switch CondenserVapourFlow 850 849 case "on": 851 C ondenserUnity.InletV.F*trays(1).vV = alfaTopo * Ah * sqrt(2*(trays(1).OutletV.P -852 C ondenserUnity.OutletL.P + 1e-8 * 'atm') / (alfa*trays(1).rhoV));853 when C ondenserUnity.InletV.F < 1e-6 * 'kmol/h' switchto "off";850 CONDENSER.InletV.F*TRAYS(1).vV = alfaTopo * Ah * sqrt(2*(TRAYS(1).OutletV.P - 851 CONDENSER.OutletL.P + 1e-8 * 'atm') / (alfa*TRAYS(1).rhoV)); 852 when CONDENSER.InletV.F < 1e-6 * 'kmol/h' switchto "off"; 854 853 855 854 case "off": 856 C ondenserUnity.InletV.F = 0 * 'mol/s';857 when trays(1).OutletV.P > CondenserUnity.OutletL.P + 1e-1 * 'atm' switchto "on";855 CONDENSER.InletV.F = 0 * 'mol/s'; 856 when TRAYS(1).OutletV.P > CONDENSER.OutletL.P + 1e-1 * 'atm' switchto "on"; 858 857 end 859 858 860 859 CONNECTIONS 861 860 #vapor 862 R eboilerUnity.OutletV to trays(NumberOfTrays).InletV;863 trays(1).OutletV to CondenserUnity.InletV;861 REBOILER.OutletV to TRAYS(NumberOfTrays).InletV; 862 TRAYS(1).OutletV to CONDENSER.InletV; 864 863 865 864 #liquid 866 C ondenserUnity.OutletL to TopVessel.Inlet;867 T opVessel.Outlet to SplitterTop.Inlet;868 S plitterTop.Outlet2 to PumpUnity.Inlet;869 P umpUnity.Outlet to trays(1).InletL;870 trays(NumberOfTrays).OutletL to ReboilerUnity.InletL;865 CONDENSER.OutletL to TANKtop.Inlet; 866 TANKtop.Outlet to SPLITTERtop.Inlet; 867 SPLITTERtop.Outlet2 to PUMP.Inlet; 868 PUMP.Outlet to TRAYS(1).InletL; 869 TRAYS(NumberOfTrays).OutletL to REBOILER.InletL; 871 870 872 871 #Connectors 873 HeatToCondenser to C ondenserUnity.InletQ;874 HeatToReboiler to R eboilerUnity.InletQ;875 HeatToTopVessel to T opVessel.InletQ;876 RebNoFlow.Outlet to R eboilerUnity.Inlet;877 878 S plitterTop.Outlet1 to ConnectorSplitterOut;879 R eboilerUnity.OutletL to ConnectorReboilerLout;872 HeatToCondenser to CONDENSER.InletQ; 873 HeatToReboiler to REBOILER.InletQ; 874 HeatToTopVessel to TANKtop.InletQ; 875 RebNoFlow.Outlet to REBOILER.Inlet; 876 877 SPLITTERtop.Outlet1 to ConnectorSplitterOut; 878 REBOILER.OutletL to ConnectorReboilerLout; 880 879 881 880 end … … 906 905 907 906 == Initial Conditions == 908 * the traystemperature (OutletL.T);909 * the trays liquid level (Level) OR the traysliquid flow (OutletL.F);907 * the TRAYS temperature (OutletL.T); 908 * the TRAYS liquid level (Level) OR the TRAYS liquid flow (OutletL.F); 910 909 * (NoComps - 1) OutletL (OR OutletV) compositions for each tray; 911 910 … … 923 922 out LiquidDrawOff as liquid_stream (Brief="Liquid Outlet in the section", PosX=1, PosY=0.58,Protected = true); 924 923 925 C ondenserUnityas condenser;926 S plitterTop as splitter;927 P umpUnityas pump;924 CONDENSER as condenser; 925 SPLITTERtop as splitter; 926 PUMP as pump; 928 927 alfaTopo as Real; 929 928 … … 936 935 out HeatToCondenser as power (Brief="Heat supplied to Condenser",Hidden=true); 937 936 in ConnectorSplitterOut as stream (Brief="Connector for Liquid outlet stream From Top Splitter", Hidden=true); 938 VapourConnector as stream (Brief="Vapour connection at the middle trays", PosX=0.55, PosY=0,Hidden=true);937 VapourConnector as stream (Brief="Vapour connection at the middle TRAYS", PosX=0.55, PosY=0,Hidden=true); 939 938 940 939 EQUATIONS … … 943 942 944 943 case "on": 945 C ondenserUnity.InletV.F*trays(1).vV = alfaTopo * Ah * sqrt(2*(trays(1).OutletV.P -946 C ondenserUnity.OutletL.P + 1e-8 * 'atm') / (alfa*trays(1).rhoV));947 when C ondenserUnity.InletV.F < 1e-6 * 'kmol/h' switchto "off";944 CONDENSER.InletV.F*TRAYS(1).vV = alfaTopo * Ah * sqrt(2*(TRAYS(1).OutletV.P - 945 CONDENSER.OutletL.P + 1e-8 * 'atm') / (alfa*TRAYS(1).rhoV)); 946 when CONDENSER.InletV.F < 1e-6 * 'kmol/h' switchto "off"; 948 947 949 948 case "off": 950 C ondenserUnity.InletV.F = 0 * 'mol/s';951 when trays(1).OutletV.P > CondenserUnity.OutletL.P + 1e-1 * 'atm' switchto "on";949 CONDENSER.InletV.F = 0 * 'mol/s'; 950 when TRAYS(1).OutletV.P > CONDENSER.OutletL.P + 1e-1 * 'atm' switchto "on"; 952 951 953 952 end … … 965 964 ConnectorSplitterOut.z = LiquidDistillate.z; 966 965 967 LiquidOutlet.F= trays(NumberOfTrays).OutletL.F;968 LiquidOutlet.T = trays(NumberOfTrays).OutletL.T;969 LiquidOutlet.P = trays(NumberOfTrays).OutletL.P;970 LiquidOutlet.z = trays(NumberOfTrays).OutletL.z;966 LiquidOutlet.F= TRAYS(NumberOfTrays).OutletL.F; 967 LiquidOutlet.T = TRAYS(NumberOfTrays).OutletL.T; 968 LiquidOutlet.P = TRAYS(NumberOfTrays).OutletL.P; 969 LiquidOutlet.z = TRAYS(NumberOfTrays).OutletL.z; 971 970 972 971 VapourConnector.F= VapourInlet.F; … … 977 976 VapourConnector.h = VapourInlet.h; 978 977 979 VapourDrawOff.F*VapSideTrayIndex= trays.VapourSideStream.F;980 VapourDrawOff.T = trays(VapourSideStreamLocation).VapourSideStream.T;981 VapourDrawOff.P = trays(VapourSideStreamLocation).VapourSideStream.P;982 VapourDrawOff.z = trays(VapourSideStreamLocation).VapourSideStream.z;983 984 LiquidDrawOff.F*LiqSideTrayIndex= trays.LiquidSideStream.F;985 LiquidDrawOff.T = trays(LiquidSideStreamLocation).LiquidSideStream.T;986 LiquidDrawOff.P = trays(LiquidSideStreamLocation).LiquidSideStream.P;987 LiquidDrawOff.z = trays(LiquidSideStreamLocation).LiquidSideStream.z;978 VapourDrawOff.F*VapSideTrayIndex= TRAYS.VapourSideStream.F; 979 VapourDrawOff.T = TRAYS(VapourSideStreamLocation).VapourSideStream.T; 980 VapourDrawOff.P = TRAYS(VapourSideStreamLocation).VapourSideStream.P; 981 VapourDrawOff.z = TRAYS(VapourSideStreamLocation).VapourSideStream.z; 982 983 LiquidDrawOff.F*LiqSideTrayIndex= TRAYS.LiquidSideStream.F; 984 LiquidDrawOff.T = TRAYS(LiquidSideStreamLocation).LiquidSideStream.T; 985 LiquidDrawOff.P = TRAYS(LiquidSideStreamLocation).LiquidSideStream.P; 986 LiquidDrawOff.z = TRAYS(LiquidSideStreamLocation).LiquidSideStream.z; 988 987 989 988 VapourDrawOffFlow = VapourDrawOff.F; … … 992 991 CONNECTIONS 993 992 #vapor 994 trays(1).OutletV to CondenserUnity.InletV;993 TRAYS(1).OutletV to CONDENSER.InletV; 995 994 996 995 #liquid 997 C ondenserUnity.OutletL to SplitterTop.Inlet;998 S plitterTop.Outlet2 to PumpUnity.Inlet;999 P umpUnity.Outlet to trays(1).InletL;996 CONDENSER.OutletL to SPLITTERtop.Inlet; 997 SPLITTERtop.Outlet2 to PUMP.Inlet; 998 PUMP.Outlet to TRAYS(1).InletL; 1000 999 1001 1000 #Connectors 1002 HeatToCondenser to C ondenserUnity.InletQ;1003 VapourConnector to trays(NumberOfTrays).InletV;1004 S plitterTop.Outlet1 to ConnectorSplitterOut;1005 C ondenserUnity.OutletV to ConnectorCondenserVout;1001 HeatToCondenser to CONDENSER.InletQ; 1002 VapourConnector to TRAYS(NumberOfTrays).InletV; 1003 SPLITTERtop.Outlet1 to ConnectorSplitterOut; 1004 CONDENSER.OutletV to ConnectorCondenserVout; 1006 1005 1007 1006 end … … 1037 1036 1038 1037 == Initial Conditions == 1039 * the traystemperature (OutletL.T);1040 * the trays liquid level (Level) OR the traysliquid flow (OutletL.F);1038 * the TRAYS temperature (OutletL.T); 1039 * the TRAYS liquid level (Level) OR the TRAYS liquid flow (OutletL.F); 1041 1040 * (NoComps - 1) OutletL (OR OutletV) compositions for each tray; 1042 1041 … … 1050 1049 1051 1050 VARIABLES 1052 C ondenserUnityas condenserSteady;1053 T opVesselas tank_cylindrical;1054 S plitterTop as splitter;1055 P umpUnityas pump;1051 CONDENSER as condenserSteady; 1052 TANKtop as tank_cylindrical; 1053 SPLITTERtop as splitter; 1054 PUMP as pump; 1056 1055 alfaTopo as Real; 1057 1056 … … 1064 1063 out HeatToTopVessel as power (Brief="Heat supplied to Top Vessel",Hidden=true); 1065 1064 1066 VapourConnector as stream (Brief="Vapour connection at the middle trays", PosX=0.55, PosY=0,Hidden=true);1065 VapourConnector as stream (Brief="Vapour connection at the middle TRAYS", PosX=0.55, PosY=0,Hidden=true); 1067 1066 1068 1067 EQUATIONS 1069 1068 1070 LiquidOutlet.F= trays(NumberOfTrays).OutletL.F;1071 LiquidOutlet.T = trays(NumberOfTrays).OutletL.T;1072 LiquidOutlet.P = trays(NumberOfTrays).OutletL.P;1073 LiquidOutlet.z = trays(NumberOfTrays).OutletL.z;1069 LiquidOutlet.F= TRAYS(NumberOfTrays).OutletL.F; 1070 LiquidOutlet.T = TRAYS(NumberOfTrays).OutletL.T; 1071 LiquidOutlet.P = TRAYS(NumberOfTrays).OutletL.P; 1072 LiquidOutlet.z = TRAYS(NumberOfTrays).OutletL.z; 1074 1073 1075 1074 VapourConnector.F= VapourInlet.F; … … 1089 1088 1090 1089 case "on": 1091 C ondenserUnity.InletV.F*trays(1).vV = alfaTopo *Ah * sqrt(2*(trays(1).OutletV.P -1092 C ondenserUnity.OutletL.P + 1e-8 * 'atm') / (alfa*trays(1).rhoV));1093 when C ondenserUnity.InletV.F < 1e-6 * 'kmol/h' switchto "off";1090 CONDENSER.InletV.F*TRAYS(1).vV = alfaTopo *Ah * sqrt(2*(TRAYS(1).OutletV.P - 1091 CONDENSER.OutletL.P + 1e-8 * 'atm') / (alfa*TRAYS(1).rhoV)); 1092 when CONDENSER.InletV.F < 1e-6 * 'kmol/h' switchto "off"; 1094 1093 1095 1094 case "off": 1096 C ondenserUnity.InletV.F = 0 * 'mol/s';1097 when trays(1).OutletV.P > CondenserUnity.OutletL.P + 1e-1 * 'atm' switchto "on";1095 CONDENSER.InletV.F = 0 * 'mol/s'; 1096 when TRAYS(1).OutletV.P > CONDENSER.OutletL.P + 1e-1 * 'atm' switchto "on"; 1098 1097 1099 1098 end 1100 1099 1101 1100 CONNECTIONS 1102 1101 #vapor 1103 trays(1).OutletV to CondenserUnity.InletV;1104 1102 TRAYS(1).OutletV to CONDENSER.InletV; 1103 1105 1104 #liquid 1106 C ondenserUnity.OutletL to TopVessel.Inlet;1107 T opVessel.Outlet to SplitterTop.Inlet;1108 S plitterTop.Outlet2 to PumpUnity.Inlet;1109 P umpUnity.Outlet to trays(1).InletL;1105 CONDENSER.OutletL to TANKtop.Inlet; 1106 TANKtop.Outlet to SPLITTERtop.Inlet; 1107 SPLITTERtop.Outlet2 to PUMP.Inlet; 1108 PUMP.Outlet to TRAYS(1).InletL; 1110 1109 1111 1110 #Connectors 1112 VapourConnector to trays(NumberOfTrays).InletV;1113 HeatToCondenser to CondenserUnity.InletQ;1114 S plitterTop.Outlet1 to ConnectorSplitterTop;1115 HeatToTopVessel to TopVessel.InletQ;1116 1111 VapourConnector to TRAYS(NumberOfTrays).InletV; 1112 HeatToCondenser to CONDENSER.InletQ; 1113 SPLITTERtop.Outlet1 to ConnectorSplitterTop; 1114 HeatToTopVessel to TANKtop.InletQ; 1115 1117 1116 end 1118 1117 … … 1126 1125 * ------------------------------------------------------------------*# 1127 1126 Model Reboiled_Stripping_kettle as Section_ColumnBasic 1128 1129 # calculo da vazao de vapor ?????1130 1127 1131 1128 ATTRIBUTES … … 1143 1140 1144 1141 == Initial Conditions == 1145 * the traystemperature (OutletL.T);1146 * the trays liquid level (Level) OR the traysliquid flow (OutletL.F);1142 * the TRAYS temperature (OutletL.T); 1143 * the TRAYS liquid level (Level) OR the TRAYS liquid flow (OutletL.F); 1147 1144 * (NoComps - 1) OutletL (OR OutletV) compositions for each tray; 1148 1145 … … 1163 1160 out HeatToReboiler as power (Brief="Heat supplied to Reboiler",Hidden=true); 1164 1161 1165 LiquidConnector as stream (Brief="Liquid connection at the middle trays", PosX=0.75, PosY=1,Hidden=true);1162 LiquidConnector as stream (Brief="Liquid connection at the middle TRAYS", PosX=0.75, PosY=1,Hidden=true); 1166 1163 RebNoFlow as sourceNoFlow (Brief="No Inlet Flow to Reboiler",Hidden=true); 1167 1164 … … 1170 1167 CONNECTIONS 1171 1168 #vapor 1172 REBOILER.OutletV to trays(NumberOfTrays).InletV;1169 REBOILER.OutletV to TRAYS(NumberOfTrays).InletV; 1173 1170 1174 1171 #liquid 1175 trays(NumberOfTrays).OutletL to REBOILER.InletL;1172 TRAYS(NumberOfTrays).OutletL to REBOILER.InletL; 1176 1173 1177 1174 #Connectors 1178 1175 REBOILER.OutletL to ConnectorReboilerLout; 1179 LiquidConnector to trays(1).InletL;1176 LiquidConnector to TRAYS(1).InletL; 1180 1177 RebNoFlow.Outlet to REBOILER.Inlet; 1181 1178 HeatToReboiler to REBOILER.InletQ; … … 1190 1187 LiquidConnector.h = LiquidInlet.h; 1191 1188 1192 VapourOutlet.F= trays(1).OutletV.F;1193 VapourOutlet.T = trays(1).OutletV.T;1194 VapourOutlet.P = trays(1).OutletV.P;1195 VapourOutlet.z = trays(1).OutletV.z;1189 VapourOutlet.F= TRAYS(1).OutletV.F; 1190 VapourOutlet.T = TRAYS(1).OutletV.T; 1191 VapourOutlet.P = TRAYS(1).OutletV.P; 1192 VapourOutlet.z = TRAYS(1).OutletV.z; 1196 1193 1197 1194 # Reboiler Connector Equations … … 1201 1198 ConnectorReboilerLout.z = BottomProduct.z; 1202 1199 1203 VapourDrawOff.F*VapSideTrayIndex= trays.VapourSideStream.F;1204 VapourDrawOff.T = trays(VapourSideStreamLocation).VapourSideStream.T;1205 VapourDrawOff.P = trays(VapourSideStreamLocation).VapourSideStream.P;1206 VapourDrawOff.z = trays(VapourSideStreamLocation).VapourSideStream.z;1207 1208 LiquidDrawOff.F*LiqSideTrayIndex= trays.LiquidSideStream.F;1209 LiquidDrawOff.T = trays(LiquidSideStreamLocation).LiquidSideStream.T;1210 LiquidDrawOff.P = trays(LiquidSideStreamLocation).LiquidSideStream.P;1211 LiquidDrawOff.z = trays(LiquidSideStreamLocation).LiquidSideStream.z;1200 VapourDrawOff.F*VapSideTrayIndex= TRAYS.VapourSideStream.F; 1201 VapourDrawOff.T = TRAYS(VapourSideStreamLocation).VapourSideStream.T; 1202 VapourDrawOff.P = TRAYS(VapourSideStreamLocation).VapourSideStream.P; 1203 VapourDrawOff.z = TRAYS(VapourSideStreamLocation).VapourSideStream.z; 1204 1205 LiquidDrawOff.F*LiqSideTrayIndex= TRAYS.LiquidSideStream.F; 1206 LiquidDrawOff.T = TRAYS(LiquidSideStreamLocation).LiquidSideStream.T; 1207 LiquidDrawOff.P = TRAYS(LiquidSideStreamLocation).LiquidSideStream.P; 1208 LiquidDrawOff.z = TRAYS(LiquidSideStreamLocation).LiquidSideStream.z; 1212 1209 1213 1210 VapourDrawOffFlow = VapourDrawOff.F; … … 1225 1222 * - steady state reboiler (thermosyphon); 1226 1223 * 1227 * ------------------------------------------------------------------* 1228 Model Reboiled_Stripping_thermosyphon 1229 ATTRIBUTES 1224 * ------------------------------------------------------------------*# 1225 Model Reboiled_Stripping_thermosyphon as Section_ColumnBasic 1226 1227 ATTRIBUTES 1230 1228 Pallete = true; 1231 1229 Icon = "icon/ReboiledThermosyphon"; … … 1242 1240 1243 1241 == Initial Conditions == 1244 * the traystemperature (OutletL.T);1245 * the trays liquid level (Level) OR the traysliquid flow (OutletL.F);1242 * the TRAYS temperature (OutletL.T); 1243 * the TRAYS liquid level (Level) OR the TRAYS liquid flow (OutletL.F); 1246 1244 * (NoComps - 1) OutletL (OR OutletV) compositions for each tray; 1247 1245 … … 1251 1249 "; 1252 1250 1253 PARAMETERS 1254 outer PP as Plugin(Brief = "External Physical Properties", Type="PP"); 1255 outer NComp as Integer; 1256 NumberOfTrays as Integer(Brief="Number of trays", Default=2); 1257 topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1); 1258 top as Integer(Brief="Number of top tray"); 1259 bot as Integer(Brief="Number of bottom tray"); 1260 1261 SET 1262 top = (NumberOfTrays-1)*(1-topdown)/2+1; 1263 bot = NumberOfTrays/top; 1264 1265 VARIABLES 1266 trays(NumberOfTrays) as trayTeste; 1267 reb as reboilerSteady; 1268 spbottom as splitter; 1269 tbottom as tank; 1270 1271 CONNECTIONS 1272 #vapor 1273 reb.OutletV to trays(bot).InletV; 1274 trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV; 1275 1276 #liquid 1277 trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL; 1278 trays(bot).OutletL to tbottom.Inlet; 1279 tbottom.Outlet to spbottom.Inlet; 1280 spbottom.Outlet2 to reb.InletL; 1251 VARIABLES 1252 out VapourDrawOff as vapour_stream (Brief="Vapour Outlet in the section", PosX=1, PosY=0.32,Protected = true); 1253 out LiquidDrawOff as liquid_stream (Brief="Liquid Outlet in the section", PosX=1, PosY=0.44,Protected = true); 1254 1255 in LiquidInlet as stream (Brief="Liquid Inlet in the section", PosX=0.32, PosY=0); 1256 out VapourOutlet as vapour_stream (Brief="Vapour Outlet in the section", PosX=0.20, PosY=0); 1257 out BottomProduct as liquid_stream (Brief="Liquid outlet stream From Reboiler", PosX=1, PosY=1); 1258 LiquidConnector as stream (Brief="Liquid connection at the middle TRAYS", PosX=0.75, PosY=1,Hidden=true); 1259 out HeatToReboiler as power (Brief="Heat supplied to Reboiler",Hidden=true); 1260 out HeatToTANKbottom as power (Brief="Heat supplied to Bottom Vessel",Hidden=true); 1261 in ConnectorSplitterBottom as stream (Brief="Connector for Liquid outlet stream From Reboiler", Hidden=true); 1262 1263 REBOILER as reboilerSteady; 1264 SPLITTERbottom as splitter; 1265 TANKbottom as tank; 1266 1267 CONNECTIONS 1268 #vapor 1269 REBOILER.OutletV to TRAYS(NumberOfTrays).InletV; 1270 1271 #liquid 1272 TRAYS(NumberOfTrays).OutletL to TANKbottom.Inlet; 1273 TANKbottom.Outlet to SPLITTERbottom.Inlet; 1274 SPLITTERbottom.Outlet2 to REBOILER.InletL; 1275 1276 #Connectors 1277 LiquidConnector to TRAYS(1).InletL; 1278 HeatToReboiler to REBOILER.InletQ; 1279 HeatToTANKbottom to TANKbottom.InletQ; 1280 SPLITTERbottom.Outlet1 to ConnectorSplitterBottom; 1281 1282 EQUATIONS 1283 1284 ConnectorSplitterBottom.T = BottomProduct.T; 1285 ConnectorSplitterBottom.P = BottomProduct.P; 1286 ConnectorSplitterBottom.F = BottomProduct.F; 1287 ConnectorSplitterBottom.z = BottomProduct.z; 1288 1289 LiquidConnector.F= LiquidInlet.F; 1290 LiquidConnector.T = LiquidInlet.T; 1291 LiquidConnector.P = LiquidInlet.P; 1292 LiquidConnector.z = LiquidInlet.z; 1293 LiquidConnector.v = LiquidInlet.v; 1294 LiquidConnector.h = LiquidInlet.h; 1295 1296 VapourOutlet.F= TRAYS(1).OutletV.F; 1297 VapourOutlet.T = TRAYS(1).OutletV.T; 1298 VapourOutlet.P = TRAYS(1).OutletV.P; 1299 VapourOutlet.z = TRAYS(1).OutletV.z; 1300 1301 VapourDrawOff.F*VapSideTrayIndex= TRAYS.VapourSideStream.F; 1302 VapourDrawOff.T = TRAYS(VapourSideStreamLocation).VapourSideStream.T; 1303 VapourDrawOff.P = TRAYS(VapourSideStreamLocation).VapourSideStream.P; 1304 VapourDrawOff.z = TRAYS(VapourSideStreamLocation).VapourSideStream.z; 1305 1306 LiquidDrawOff.F*LiqSideTrayIndex= TRAYS.LiquidSideStream.F; 1307 LiquidDrawOff.T = TRAYS(LiquidSideStreamLocation).LiquidSideStream.T; 1308 LiquidDrawOff.P = TRAYS(LiquidSideStreamLocation).LiquidSideStream.P; 1309 LiquidDrawOff.z = TRAYS(LiquidSideStreamLocation).LiquidSideStream.z; 1310 1311 VapourDrawOffFlow = VapourDrawOff.F; 1312 LiquidDrawOffFlow = LiquidDrawOff.F; 1313 1281 1314 end 1282 1315 … … 1285 1318 * 1286 1319 * ------------------------------------------------------------------* 1287 Model ReactiveDistillationTeste 1288 ATTRIBUTES 1320 Model ReactiveDistillation 1321 1322 ATTRIBUTES 1289 1323 Pallete = true; 1290 1324 Icon = "icon/DistillationKettleCond"; … … 1302 1336 1303 1337 == Initial Conditions == 1304 * the traystemperature (OutletL.T);1305 * the trays liquid level (Level) OR the traysliquid flow (OutletL.F);1338 * the TRAYS temperature (OutletL.T); 1339 * the TRAYS liquid level (Level) OR the TRAYS liquid flow (OutletL.F); 1306 1340 * (NoComps - 1) OutletL (OR OutletV) compositions for each tray; 1307 1341 … … 1318 1352 outer PP as Plugin(Type="PP"); 1319 1353 outer NComp as Integer; 1320 NumberOfTrays as Integer(Brief="Number of trays", Default=2);1354 NumberOfTrays as Integer(Brief="Number of TRAYS", Default=2); 1321 1355 topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1); 1322 1356 top as Integer(Brief="Number of top tray"); … … 1331 1365 1332 1366 VARIABLES 1333 trays(NumberOfTrays) as trayReactTeste;1367 TRAYS(NumberOfTrays) as trayReactTeste; 1334 1368 cond as condenserReact; 1335 1369 reb as reboilerReact; … … 1342 1376 case "on": 1343 1377 "Pressure Drop through the condenser" 1344 cond.InletV.F* trays(top).vV / 'm^2' =1345 sqrt(( trays(top).OutletV.P - cond.OutletL.P + 1e-8 * 'atm')/(trays(top).rhoV*alfacond));1346 when trays(top).OutletV.P < cond.OutletL.P switchto "off";1378 cond.InletV.F*TRAYS(top).vV / 'm^2' = 1379 sqrt((TRAYS(top).OutletV.P - cond.OutletL.P + 1e-8 * 'atm')/(TRAYS(top).rhoV*alfacond)); 1380 when TRAYS(top).OutletV.P < cond.OutletL.P switchto "off"; 1347 1381 1348 1382 case "off": 1349 1383 "Prato selado" 1350 1384 cond.InletV.F = 0.0 * 'mol/s'; 1351 when trays(top).OutletV.P > cond.OutletL.P + 1e-3 * 'atm' switchto "on";1385 when TRAYS(top).OutletV.P > cond.OutletL.P + 1e-3 * 'atm' switchto "on"; 1352 1386 end 1353 1387 1354 1388 CONNECTIONS 1355 1389 #vapor 1356 reb.OutletV to trays(bot).InletV;1357 trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;1358 trays(top).OutletV to cond.InletV;1390 reb.OutletV to TRAYS(bot).InletV; 1391 TRAYS([top+topdown:topdown:bot]).OutletV to TRAYS([top:topdown:bot-topdown]).InletV; 1392 TRAYS(top).OutletV to cond.InletV; 1359 1393 1360 1394 #liquid 1361 1395 cond.OutletL to sp.Inlet; 1362 1396 sp.Outlet2 to p.Inlet; 1363 p.Outlet to trays(top).InletL;1364 trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;1365 trays(bot).OutletL to reb.InletL;1397 p.Outlet to TRAYS(top).InletL; 1398 TRAYS([top:topdown:bot-topdown]).OutletL to TRAYS([top+topdown:topdown:bot]).InletL; 1399 TRAYS(bot).OutletL to reb.InletL; 1366 1400 1367 1401 end … … 1396 1430 outer PP as Plugin(Brief = "External Physical Properties", Type="PP"); 1397 1431 outer NComp as Integer; 1398 NStages as Integer(Brief="Number of trays", Default=2);1432 NStages as Integer(Brief="Number of TRAYS", Default=2); 1399 1433 topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1); 1400 1434 top as Integer(Brief="Number of top tray");
Note: See TracChangeset
for help on using the changeset viewer.