Changeset 698 for branches/gui/eml/stage_separators/column.mso
- Timestamp:
- Dec 11, 2008, 7:30:42 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/eml/stage_separators/column.mso
r694 r698 1317 1317 * Reactive Distillation Column 1318 1318 * 1319 * ------------------------------------------------------------------* 1319 * ------------------------------------------------------------------*# 1320 1320 Model ReactiveDistillation 1321 1321 1322 1322 ATTRIBUTES 1323 1323 Pallete = true; 1324 Icon = "icon/Distillation KettleCond";1324 Icon = "icon/DistillationReac"; 1325 1325 Brief = "Model of a reactive distillation column with dynamic condenser and reboiler."; 1326 1326 Info = … … 1349 1349 "; 1350 1350 1351 PARAMETERS 1351 PARAMETERS 1352 1352 1353 outer PP as Plugin(Type="PP"); 1353 1354 outer NComp as Integer; 1355 1354 1356 NumberOfTrays as Integer(Brief="Number of TRAYS", Default=2); 1355 topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1); 1356 top as Integer(Brief="Number of top tray"); 1357 bot as Integer(Brief="Number of bottom tray"); 1357 1358 FeedTrayIndex(NumberOfTrays) as Integer (Brief="Number of trays", Default=0,Hidden=true); 1359 LiqSideTrayIndex(NumberOfTrays) as Integer (Brief="Number of trays", Default=0,Hidden=true); 1360 VapSideTrayIndex(NumberOfTrays) as Integer (Brief="Number of trays", Default=0,Hidden=true); 1361 FeedTrayLocation as Integer (Brief="Feed tray Location", Default=2); 1362 LiquidSideStreamLocation as Integer (Brief="Liquid Side Stream Location", Default=2); 1363 VapourSideStreamLocation as Integer (Brief="Vapour Side Stream Location", Default=2); 1364 1358 1365 alfacond as Real; 1359 1366 1360 VapourFlow as Switcher(Valid = ["on", "off"], Default = "off"); 1361 1362 SET 1363 top = (NumberOfTrays-1)*(1-topdown)/2+1; 1364 bot = NumberOfTrays/top; 1365 1366 VARIABLES 1367 TRAYS(NumberOfTrays) as trayReactTeste; 1368 cond as condenserReact; 1369 reb as reboilerReact; 1370 sp as splitter; 1371 p as pump; 1372 1373 EQUATIONS 1374 1375 switch VapourFlow 1367 VapourFlow as Switcher (Valid = ["on", "off"], Default = "off",Hidden=true); 1368 TrayVapourFlow as Switcher (Valid = ["on", "off"], Default = "off",Hidden=true); 1369 TrayLiquidFlow as Switcher (Valid = ["on", "off"], Default = "off",Hidden=true); 1370 1371 V as volume (Brief="Total Volume of the tray",Hidden=true); 1372 Q as power (Brief="Rate of heat supply",Hidden=true); 1373 Ap as area (Brief="Plate area = Atray - Adowncomer",Hidden=true); 1374 Ah as area (Brief="Total holes area",Hidden=true); 1375 lw as length (Brief="Weir length",Hidden=true); 1376 g as acceleration (Brief="Gravity Acceleration",Default=9.81,Hidden=true); 1377 hw as length (Brief="Weir height",Hidden=true); 1378 beta as fraction (Brief="Aeration fraction"); 1379 alfa as fraction (Brief="Dry pressure drop coefficient"); 1380 1381 VolumeOfTray as volume (Brief="Total Volume of the tray"); 1382 HeatSupply as heat_rate (Brief="Rate of heat supply"); 1383 PlateArea as area (Brief="Plate area = Atray - Adowncomer"); 1384 HolesArea as area (Brief="Total holes area"); 1385 WeirLength as length (Brief="Weir length"); 1386 WeirHeight as length (Brief="Weir height"); 1387 1388 SET 1389 1390 FeedTrayIndex(FeedTrayLocation) =1; 1391 VapSideTrayIndex(FeedTrayLocation) =1; 1392 LiqSideTrayIndex(FeedTrayLocation) =1; 1393 1394 V=VolumeOfTray; 1395 Q=HeatSupply; 1396 Ap=PlateArea; 1397 Ah=HolesArea; 1398 lw=WeirLength; 1399 hw=WeirHeight ; 1400 1401 VARIABLES 1402 1403 in FeedTray as stream (Brief="Feed stream", PosX=0, PosY=0.55); 1404 1405 VapourDrawOffFlow as flow_mol (Brief = "Stream Molar Flow Rate"); 1406 LiquidDrawOffFlow as flow_mol (Brief = "Stream Molar Flow Rate"); 1407 1408 out VapourDrawOff as vapour_stream (Brief="Vapour Outlet in the section", PosX=1, PosY=0.46,Protected = true); 1409 out LiquidDrawOff as liquid_stream (Brief="Liquid Outlet in the section", PosX=1, PosY=0.58,Protected = true); 1410 1411 RebNoFlow as sourceNoFlow (Brief="No Inlet Flow to Reboiler",Hidden=true); 1412 1413 in HeatToReboiler as power (Brief="Heat supplied to Reboiler", PosX=1, PosY=0.93); 1414 in HeatToCondenser as power (Brief="Heat supplied to Condenser", PosX=1, PosY=0.10); 1415 1416 TRAYS(NumberOfTrays) as trayReac; 1417 CONDENSER as condenserReact; 1418 REBOILER as reboilerReact; 1419 SPLITTER as splitter; 1420 PUMP as pump; 1421 1422 out VapourDistillate as vapour_stream (Brief="Vapour outlet stream From Top Condenser", PosX=0.67, PosY=0); 1423 in ConnectorCondenserVout as stream (Brief="Connector for Vapour outlet stream From Top Condenser", Hidden=true); 1424 1425 out LiquidDistillate as liquid_stream (Brief="Liquid outlet stream From Top Splitter", PosX=1, PosY=0.33); 1426 in ConnectorSplitterOut as stream (Brief="Connector for Liquid outlet stream From Top Splitter", Hidden=true); 1427 1428 out BottomProduct as liquid_stream (Brief="Liquid outlet stream From Reboiler", PosX=1, PosY=0.99); 1429 in ConnectorReboilerLout as stream (Brief="Connector for Liquid outlet stream From Reboiler", Hidden=true); 1430 1431 1432 CONNECTIONS 1433 #vapor 1434 REBOILER.OutletV to TRAYS(NumberOfTrays).InletV; 1435 TRAYS(1).OutletV to CONDENSER.InletV; 1436 TRAYS([2:NumberOfTrays]).OutletV to TRAYS([1:NumberOfTrays-1]).InletV; 1437 1438 #liquid 1439 CONDENSER.OutletL to SPLITTER.Inlet; 1440 SPLITTER.Outlet2 to PUMP.Inlet; 1441 PUMP.Outlet to TRAYS(1).InletL; 1442 TRAYS([1:NumberOfTrays-1]).OutletL to TRAYS([2:NumberOfTrays]).InletL; 1443 TRAYS(NumberOfTrays).OutletL to REBOILER.InletL; 1444 1445 #Connectors 1446 RebNoFlow.Outlet to REBOILER.Inlet; 1447 1448 CONDENSER.OutletV to ConnectorCondenserVout; 1449 SPLITTER.Outlet1 to ConnectorSplitterOut; 1450 REBOILER.OutletL to ConnectorReboilerLout; 1451 1452 EQUATIONS 1453 1454 for i in [1:NumberOfTrays] do 1455 1456 "Energy Holdup" 1457 TRAYS(i).E = TRAYS(i).ML*TRAYS(i).OutletL.h + TRAYS(i).MV*TRAYS(i).OutletV.h - TRAYS(i).OutletL.P*V; 1458 1459 "Energy Balance" 1460 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 1461 -TRAYS(i).VapourSideStream.F*TRAYS(i).VapourSideStream.h - TRAYS(i).LiquidSideStream.F*TRAYS(i).LiquidSideStream.h + Q ) + TRAYS(i).Hr * TRAYS(i).r3 *TRAYS(i). vL*TRAYS(i).ML; 1462 1463 "Level of clear liquid over the weir" 1464 TRAYS(i).Level = TRAYS(i).ML*TRAYS(i).vL/Ap; 1465 1466 "Geometry Constraint" 1467 V = TRAYS(i).ML* TRAYS(i).vL + TRAYS(i).MV*TRAYS(i).vV; 1468 1469 end 1470 1471 switch VapourFlow 1376 1472 case "on": 1377 1473 "Pressure Drop through the condenser" 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";1474 CONDENSER.InletV.F*TRAYS(1).vV / 'm^2' = 1475 sqrt((TRAYS(1).OutletV.P - CONDENSER.OutletL.P + 1e-8 * 'atm')/(TRAYS(1).rhoV*alfacond)); 1476 when TRAYS(1).OutletV.P < CONDENSER.OutletL.P switchto "off"; 1381 1477 1382 1478 case "off": 1383 1479 "Prato selado" 1384 cond.InletV.F = 0.0 * 'mol/s';1385 when TRAYS( top).OutletV.P > cond.OutletL.P + 1e-3 * 'atm' switchto "on";1480 CONDENSER.InletV.F = 0.0 * 'mol/s'; 1481 when TRAYS(1).OutletV.P > CONDENSER.OutletL.P + 1e-3 * 'atm' switchto "on"; 1386 1482 end 1387 1483 1388 CONNECTIONS 1389 #vapor 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; 1393 1394 #liquid 1395 cond.OutletL to sp.Inlet; 1396 sp.Outlet2 to p.Inlet; 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; 1400 1484 for i in [1:NumberOfTrays] do 1485 1486 switch TrayLiquidFlow 1487 case "on": 1488 "Francis Equation" 1489 TRAYS(i).OutletL.F*TRAYS(i).vL = 1.84*'1/s'*lw*((TRAYS(i).Level-(beta*hw)+1e-6*'m')/(beta))^2; 1490 when TRAYS(i).Level < (beta * hw) switchto "off"; 1491 1492 case "off": 1493 "Low level" 1494 TRAYS(i).OutletL.F = 0 * 'mol/h'; 1495 when TRAYS(i).Level > (beta * hw) + 1e-6*'m' switchto "on"; 1496 end 1497 1498 switch TrayVapourFlow 1499 case "on": 1500 TRAYS(i).InletV.F*TRAYS(i).vV = sqrt((TRAYS(i).InletV.P - TRAYS(i).OutletV.P - TRAYS(i).Level*g*TRAYS(i).rhoL + 1e-8 * 'atm')/(TRAYS(i).rhoV*alfa))*Ah; 1501 when TRAYS(i).InletV.P < TRAYS(i).OutletV.P + TRAYS(i).Level*g*TRAYS(i).rhoL switchto "off"; 1502 1503 case "off": 1504 TRAYS(i).InletV.F = 0 * 'mol/s'; 1505 when TRAYS(i).InletV.P > TRAYS(i).OutletV.P + TRAYS(i).Level*g*TRAYS(i).rhoL + 3e-2 * 'atm' switchto "on"; 1506 end 1507 1508 end 1509 1510 # Connecting Trays 1511 FeedTray.F*FeedTrayIndex= TRAYS.Inlet.F; 1512 FeedTray.T = TRAYS.Inlet.T; 1513 FeedTray.P = TRAYS.Inlet.P; 1514 FeedTray.z = TRAYS.Inlet.z; 1515 FeedTray.v = TRAYS.Inlet.v; 1516 FeedTray.h = TRAYS.Inlet.h; 1517 1518 HeatToReboiler = REBOILER.InletQ; 1519 HeatToCondenser = CONDENSER.InletQ; 1520 1401 1521 end 1402 1522
Note: See TracChangeset
for help on using the changeset viewer.