Changeset 890
- Timestamp:
- Nov 13, 2009, 5:04:29 PM (14 years ago)
- Location:
- branches/new_gui/eml
- Files:
-
- 36 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_gui/eml/stage_separators/column.mso
r889 r890 974 974 end 975 975 976 977 # Models to be revised978 #*979 Model ColumnBasic980 981 ATTRIBUTES982 Pallete = false;983 Brief = "Model of a basic column.";984 Info =985 "Model of a basic column containing a vetor of TRAYS numbered from the top-down.";986 987 PARAMETERS988 outer PP as Plugin (Brief="External Physical Properties", Type="PP");989 outer NComp as Integer (Brief="Number of components");990 991 NumberOfFeeds as Integer (Brief="Number of Feed Trays",Default=3,Protected=true);992 FeedTrayLocation(NumberOfFeeds) as Integer (Brief="Feed tray Location",Default=2);993 NumberOfTrays as Integer (Brief="Number of trays", Default=8);994 LiqSideTrayIndex(NumberOfTrays) as Integer (Brief="Liquid Side Tray Index", Default=0,Hidden=true);995 VapSideTrayIndex(NumberOfTrays) as Integer (Brief="Vapour Side Tray Index", Default=0,Hidden=true);996 LiquidSideStreamLocation as Integer (Brief="Liquid Side Stream Location", Default=2);997 VapourSideStreamLocation as Integer (Brief="Vapour Side Stream Location", Default=2);998 g as acceleration (Brief="Gravity Acceleration",Default=9.81,Hidden=true);999 Mw(NComp) as molweight (Brief="Component Mol Weight",Hidden=true);1000 1001 VapourFlowModel as Switcher (Valid = ["Reepmeyer", "Feehery_Fv", "Roffel_Fv", "Klingberg", "Wang_Fv", "Elgue"], Default = "Reepmeyer");1002 LiquidFlowModel as Switcher (Valid = ["default", "Wang_Fl", "Olsen", "Feehery_Fl", "Roffel_Fl"], Default = "default");1003 1004 TrayDiameter as length (Brief="Tray Diameter",Default=1.600);1005 TraySpacing as length (Brief="Tray Spacing",Default=0.600);1006 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);1007 Fraction_DowncomerArea as fraction (Brief="Fraction of the downcomer area with respect to the total tray area",Default=0.20);1008 WeirLength as length (Brief="Weir length", Default = 1);1009 WeirHeight as length (Brief="Weir height", Default= 0.05);1010 TrayLiquidPasses as positive (Brief="Number of liquid passes in the tray", Lower = 1,Default=1);1011 HeatSupply as heat_rate (Brief="Rate of heat supply",Default = 0);1012 AerationFraction as Real (Brief="Aeration fraction", Default = 1);1013 DryPdropCoeff as Real (Brief="Dry pressure drop coefficient", Default= 0.60);1014 1015 PlateArea as area (Brief="Plate area = Atray - Adowncomer",Protected=true);1016 TrayVolume as volume (Brief="Total Volume of the tray",Protected=true);1017 HolesArea as area (Brief="Total holes area",Protected=true);1018 1019 FeeheryCoeff as Real (Brief="Feeherys correlation coefficient", Unit='1/m^4', Default=1,Hidden=true);1020 ElgueCoeff as Real (Brief="Elgues correlation coefficient", Unit='kg/m/mol^2', Default=1,Hidden=true);1021 OlsenCoeff as Real (Brief="Olsens correlation coefficient", Default=1,Hidden=true);1022 1023 Pi as constant (Brief="Pi Number",Default=3.14159265, Symbol = "\pi",Hidden=true);1024 zero_flow as flow_mol (Brief = "Stream Flow closed",Default = 0, Hidden=true);1025 low_flow as flow_mol (Brief = "Low stream Flow",Default = 1E-6, Hidden=true);1026 VapourFlow as Switcher (Valid = ["on", "off"], Default = "on",Hidden=true);1027 LiquidFlow as Switcher (Valid = ["on", "off"], Default = "on",Hidden=true);1028 1029 SET1030 VapSideTrayIndex(VapourSideStreamLocation) =1;1031 LiqSideTrayIndex(LiquidSideStreamLocation) =1;1032 Mw = PP.MolecularWeight();1033 zero_flow = 0 * 'kmol/h';1034 low_flow = 1E-6 * 'kmol/h';1035 1036 PlateArea = 0.25*Pi*(TrayDiameter^2)*(1-Fraction_DowncomerArea);1037 TrayVolume = 0.25*Pi*(TrayDiameter^2)*TraySpacing;1038 HolesArea = 0.25*Pi*(TrayDiameter^2)*Fraction_HoleArea;1039 1040 VARIABLES1041 1042 INITIALIZATION as InitializeSection (Brief = "Column Model Initialization");1043 CONTROL as ControlSection (Brief = "Control");1044 1045 out TCI as control_signal (Brief="Temperature Indicator", Protected = true, PosX=1, PosY=0.55);1046 out PCI as control_signal (Brief="Pressure Indicator", Protected = true, PosX=0, PosY=0.23);1047 1048 TRAYS(NumberOfTrays) as tray (Brief="Number of trays in the Column Section");1049 VapourDrawOffFlow as flow_mol (Brief="Vapour Draw Off Stream Molar Flow Rate");1050 LiquidDrawOffFlow as flow_mol (Brief="Vapour Draw Off Stream Molar Flow Rate");1051 MurphreeEff as Real (Brief="Murphree efficiency for All Trays",Lower=0.01,Upper=1);1052 1053 out VapourDrawOff as vapour_stream (Brief="Vapour Outlet in the section", PosX=1, PosY=0.388,Protected = true);1054 out LiquidDrawOff as liquid_stream (Brief="Liquid Outlet in the section", PosX=1, PosY=0.47,Protected = true);1055 1056 CONNECTIONS1057 1058 #Connecting Intermediate Trays1059 TRAYS([2:NumberOfTrays]).OutletVapour to TRAYS([1:NumberOfTrays-1]).InletVapour;1060 TRAYS([1:NumberOfTrays-1]).OutletLiquid to TRAYS([2:NumberOfTrays]).InletLiquid;1061 1062 INITIAL1063 1064 for i in 1:NumberOfTrays do1065 1066 "The initial temperature of the TRAYS"1067 TRAYS(i).OutletLiquid.T = INITIALIZATION.TopTemperature+(INITIALIZATION.BottomTemperature-INITIALIZATION.TopTemperature)*((i-1)/(NumberOfTrays-1));1068 1069 "The initial Level of the TRAYS"1070 TRAYS(i).Level = INITIALIZATION.LevelFraction*WeirHeight;1071 end1072 1073 for i in 1:NComp-1 do1074 1075 for j in 1:NumberOfTrays do1076 1077 "The initial composition of the TRAYS - Normalized"1078 TRAYS(j).OutletLiquid.z(i) = INITIALIZATION.TopComposition(i)/sum(INITIALIZATION.TopComposition) +(INITIALIZATION.BottomComposition(i)/sum(INITIALIZATION.BottomComposition)-INITIALIZATION.TopComposition(i)/sum(INITIALIZATION.TopComposition) )*((j-1)/(NumberOfTrays-1));1079 end1080 1081 end1082 1083 EQUATIONS1084 1085 VapourDrawOff.F*VapSideTrayIndex= TRAYS.VapourSideStream.F;1086 VapourDrawOff.T = TRAYS(VapourSideStreamLocation).VapourSideStream.T;1087 VapourDrawOff.P = TRAYS(VapourSideStreamLocation).VapourSideStream.P;1088 VapourDrawOff.z = TRAYS(VapourSideStreamLocation).VapourSideStream.z;1089 1090 LiquidDrawOff.F*LiqSideTrayIndex= TRAYS.LiquidSideStream.F;1091 LiquidDrawOff.T = TRAYS(LiquidSideStreamLocation).LiquidSideStream.T;1092 LiquidDrawOff.P = TRAYS(LiquidSideStreamLocation).LiquidSideStream.P;1093 LiquidDrawOff.z = TRAYS(LiquidSideStreamLocation).LiquidSideStream.z;1094 1095 VapourDrawOffFlow = VapourDrawOff.F;1096 LiquidDrawOffFlow = LiquidDrawOff.F;1097 1098 "Tray Temperature Indicator"1099 #TCI*'K' = TRAYS(min([NumberOfTrays, CONTROL.Tindicator_TrayNumber])).OutletVapour.T;1100 TCI*'K' = TRAYS(CONTROL.Tindicator_TrayNumber).OutletVapour.T;1101 1102 "Tray Pressure Indicator"1103 #PCI*'atm' = TRAYS(min([NumberOfTrays, CONTROL.Pindicator_TrayNumber])).OutletVapour.P;1104 PCI*'atm' = TRAYS(CONTROL.Pindicator_TrayNumber).OutletVapour.P;1105 1106 for i in [1:NumberOfTrays] do1107 1108 "Murphree Efficiency"1109 TRAYS(i).OutletVapour.z = MurphreeEff * (TRAYS(i).yideal - TRAYS(i).InletVapour.z) + TRAYS(i).InletVapour.z;1110 1111 "Level of clear liquid over the weir"1112 TRAYS(i).Level = TRAYS(i).ML*TRAYS(i).vL/PlateArea;1113 1114 "Geometry Constraint"1115 TrayVolume = TRAYS(i).ML* TRAYS(i).vL + TRAYS(i).MV*TRAYS(i).vV;1116 1117 "Energy Holdup"1118 TRAYS(i).E = TRAYS(i).ML*TRAYS(i).OutletLiquid.h + TRAYS(i).MV*TRAYS(i).OutletVapour.h - TRAYS(i).OutletLiquid.P*TrayVolume;1119 1120 "Energy Balance"1121 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.h1122 -TRAYS(i).VapourSideStream.F*TRAYS(i).VapourSideStream.h - TRAYS(i).LiquidSideStream.F*TRAYS(i).LiquidSideStream.h + HeatSupply );1123 1124 switch LiquidFlow1125 case "on":1126 switch LiquidFlowModel1127 case "default":1128 "Francis Equation"1129 TRAYS(i).OutletLiquid.F*TRAYS(i).vL = 1.84*'1/s'*WeirLength*((TRAYS(i).Level-(AerationFraction*WeirHeight))/(AerationFraction))^2;1130 1131 case "Wang_Fl":1132 TRAYS(i).OutletLiquid.F*TRAYS(i).vL = 1.84*'m^0.5/s'*WeirLength*((TRAYS(i).Level-(AerationFraction*WeirHeight))/(AerationFraction))^1.5;1133 1134 case "Olsen":1135 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';1136 1137 case "Feehery_Fl":1138 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';1139 1140 case "Roffel_Fl":1141 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*g/1142 (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';1143 end1144 when TRAYS(i).Level < (AerationFraction *WeirHeight) switchto "off";1145 1146 case "off":1147 "Low level"1148 TRAYS(i).OutletLiquid.F = 0 * 'mol/h';1149 when TRAYS(i).Level > (AerationFraction * WeirHeight) switchto "on";1150 end1151 1152 switch VapourFlow1153 case "on":1154 switch VapourFlowModel1155 case "Reepmeyer":1156 TRAYS(i).InletVapour.F*TRAYS(i).vV = sqrt((TRAYS(i).InletVapour.P - TRAYS(i).OutletVapour.P)/(TRAYS(i).rhoV*DryPdropCoeff))*HolesArea;1157 1158 case "Feehery_Fv":1159 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*g*TRAYS(i).ML*TRAYS(i).vL/PlateArea))/TRAYS(i).rhoV);1160 1161 case "Roffel_Fv":1162 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)*g*1e5) * (TRAYS(i).rhoV*HolesArea/sum(Mw*TRAYS(i).OutletVapour.z))^1.08 * 'm^1.08/mol^1.08';1163 1164 case "Klingberg":1165 TRAYS(i).InletVapour.F * TRAYS(i).vV = PlateArea * sqrt(((TRAYS(i).InletVapour.P - TRAYS(i).OutletVapour.P)-TRAYS(i).rhoL*g*TRAYS(i).Level)/TRAYS(i).rhoV);1166 1167 case "Wang_Fv":1168 TRAYS(i).InletVapour.F * TRAYS(i).vV = PlateArea * sqrt(((TRAYS(i).InletVapour.P - TRAYS(i).OutletVapour.P)-TRAYS(i).rhoL*g*TRAYS(i).Level)/TRAYS(i).rhoV*DryPdropCoeff);1169 1170 case "Elgue":1171 TRAYS(i).InletVapour.F = sqrt((TRAYS(i).InletVapour.P - TRAYS(i).OutletVapour.P)/ElgueCoeff);1172 end1173 when TRAYS(i).InletVapour.F < 1e-6 * 'kmol/h' switchto "off";1174 1175 case "off":1176 TRAYS(i).InletVapour.F = 0 * 'mol/s';1177 when TRAYS(i).InletVapour.P > TRAYS(i).OutletVapour.P switchto "on";1178 end1179 1180 end1181 1182 end1183 1184 Model Distillation_kettle_cond as ColumnBasic1185 1186 ATTRIBUTES1187 Pallete = true;1188 Icon = "icon/DistillationKettleCond";1189 Brief = "Model of a distillation column with dynamic condenser and dynamic reboiler.";1190 Info =1191 "== Specify ==1192 * the feed stream of each tray (Inlet);1193 * the Murphree eficiency for each tray Emv;1194 * the pump pressure difference;1195 * the heat supllied in reboiler and condenser;1196 * the condenser vapor outlet flow (OutletVapour.F);1197 * the reboiler liquid outlet flow (OutletLiquid.F);1198 * both splitter outlet flows OR one of the splitter outlet flows and the splitter frac.1199 1200 == Initial Conditions ==1201 * the TRAYS temperature (OutletLiquid.T);1202 * the TRAYS liquid level (Level) OR the TRAYS liquid flow (OutletLiquid.F);1203 * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions for each tray;1204 1205 * the condenser temperature (OutletLiquid.T);1206 * the condenser liquid level (Level);1207 * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions;1208 1209 * the reboiler temperature (OutletLiquid.T);1210 * the reboiler liquid level (Level);1211 * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions.1212 ";1213 1214 SET1215 NumberOfFeeds = 1;1216 1217 VARIABLES1218 1219 CONDENSER as condenser;1220 REBOILER as reboiler;1221 SPLITTER as splitter_column (Brief="splitter which separate reflux and distillate",Protected=true);1222 PUMP as pump;1223 RefluxRatio as positive (Brief="Reflux Ratio",Default=10, Lower = 0.5);1224 1225 out TI_reb as control_signal (Brief="Temperature Indicator of Reboiler ",Protected = true, PosX=0.515, PosY=1);1226 out LI_reb as control_signal (Brief="Level Indicator of Reboiler", Protected = true, PosX=1, PosY=0.935);1227 out PI_reb as control_signal (Brief="Pressure Indicator of Reboiler", Protected = true, PosX=0.41, PosY=1);1228 1229 out TI_cond as control_signal (Brief="Temperature Indicator of Condenser ", Protected = true, PosX=0.52, PosY=0);1230 out LI_cond as control_signal (Brief="Level Indicator of Condenser", Protected = true, PosX=1, PosY=0.084);1231 out PI_cond as control_signal (Brief="Pressure Indicator of Condenser", Protected = true, PosX=0.42, PosY=0);1232 1233 in FeedTray as stream (Brief="Feed stream", PosX=0, PosY=0.55);1234 1235 1236 1237 in HeatToReboiler as power (Brief="Heat supplied to Reboiler",Protected = true, PosX=1, PosY=0.855);1238 in HeatToCondenser as power (Brief="Heat supplied to Condenser", Protected = true, PosX=1, PosY=0.01);1239 1240 1241 ConnectorHeatReboiler as power (Brief="Heat supplied to Reboiler", Hidden=true);1242 ConnectorHeatCondenser as power (Brief="Heat supplied to Condenser", Hidden=true);1243 1244 in ConnectorCondenserVout as stream (Brief="Connector for Vapour outlet stream From Condenser", Hidden=true);1245 in ConnectorReboilerLout as stream (Brief="Connector for Liquid outlet stream From Reboiler", Hidden=true);1246 in ConnectorSplitterOut as stream (Brief="Connector for Liquid outlet stream From Top Splitter", Hidden=true);1247 1248 out VapourDistillate as vapour_stream (Brief="Vapour outlet stream From Condenser", PosX=0.615, PosY=0);1249 out LiquidDistillate as liquid_stream (Brief="Liquid outlet stream From Top Splitter", PosX=1, PosY=0.235);1250 out BottomProduct as liquid_stream (Brief="Liquid outlet stream From Reboiler", PosX=0.62, PosY=1);1251 1252 EQUATIONS1253 1254 SPLITTER.RefluxRatio = RefluxRatio;1255 1256 TI_reb = REBOILER.TI ;1257 LI_reb = REBOILER.LI;1258 PI_reb = REBOILER.PI;1259 1260 TI_cond = CONDENSER.TI;1261 LI_cond = CONDENSER.LI;1262 PI_cond = CONDENSER.PI;1263 1264 for i in 1:NumberOfTrays do1265 1266 if i equal FeedTrayLocation(1) then1267 1268 "FeedTrayTop Inlet Flow"1269 FeedTray.F= TRAYS(i).Inlet.F;1270 1271 "FeedTrayTop Inlet Temperature"1272 FeedTray.T = TRAYS(i).Inlet.T;1273 1274 "FeedTrayTop Inlet Pressure"1275 FeedTray.P = TRAYS(i).Inlet.P;1276 1277 "FeedTrayTop Inlet Composition"1278 FeedTray.z = TRAYS(i).Inlet.z;1279 1280 "FeedTrayTop Inlet Vapour Fraction"1281 FeedTray.v = TRAYS(i).Inlet.v;1282 1283 "FeedTrayTop Inlet Enthalpy"1284 FeedTray.h = TRAYS(i).Inlet.h;1285 1286 else1287 1288 "Inlet Tray - Flow Sealed"1289 0*'mol/h'= TRAYS(i).Inlet.F;1290 1291 "Inlet Tray - Temperature"1292 300*'K' = TRAYS(i).Inlet.T;1293 1294 "Inlet Tray - Pressure"1295 1*'atm' = TRAYS(i).Inlet.P;1296 1297 "Inlet Tray - Composition"1298 0.1 = TRAYS(i).Inlet.z;1299 1300 "Inlet Tray - Vapour Fraction"1301 0 = TRAYS(i).Inlet.v;1302 1303 "Inlet Tray - Enthalpy"1304 0*'J/mol' = TRAYS(i).Inlet.h;1305 1306 end1307 1308 end1309 1310 # Condenser Connector Equations1311 ConnectorCondenserVout.T = VapourDistillate.T;1312 ConnectorCondenserVout.P = VapourDistillate.P;1313 ConnectorCondenserVout.F = VapourDistillate.F;1314 ConnectorCondenserVout.z = VapourDistillate.z;1315 1316 # Splitter Connector Equations1317 ConnectorSplitterOut.T = LiquidDistillate.T;1318 ConnectorSplitterOut.P = LiquidDistillate.P;1319 ConnectorSplitterOut.F = LiquidDistillate.F;1320 ConnectorSplitterOut.z = LiquidDistillate.z;1321 1322 # Reboiler Connector Equations1323 ConnectorReboilerLout.T = BottomProduct.T;1324 ConnectorReboilerLout.P = BottomProduct.P;1325 ConnectorReboilerLout.F = BottomProduct.F;1326 ConnectorReboilerLout.z = BottomProduct.z;1327 1328 HeatToReboiler = ConnectorHeatReboiler;1329 HeatToCondenser = ConnectorHeatCondenser;1330 1331 CONNECTIONS1332 #vapor1333 REBOILER.OutletVapour to TRAYS(NumberOfTrays).InletVapour;1334 TRAYS(1).OutletVapour to CONDENSER.InletVapour;1335 1336 #liquid1337 CONDENSER.OutletLiquid to SPLITTER.Inlet;1338 SPLITTER.Reflux to PUMP.Inlet;1339 PUMP.Outlet to TRAYS(1).InletLiquid;1340 TRAYS(NumberOfTrays).OutletLiquid to REBOILER.InletLiquid;1341 1342 #Connectors1343 CONDENSER.OutletVapour to ConnectorCondenserVout;1344 SPLITTER.Distillate to ConnectorSplitterOut;1345 REBOILER.OutletLiquid to ConnectorReboilerLout;1346 1347 ConnectorHeatReboiler to REBOILER.InletQ;1348 ConnectorHeatCondenser to CONDENSER.InletQ;1349 1350 end1351 1352 Model Distillation_thermosyphon_subcooling as ColumnBasic1353 ATTRIBUTES1354 Pallete = true;1355 Icon = "icon/DistillationThermosyphonSubcooling";1356 Brief = "Model of a distillation column with steady condenser and steady reboiler.";1357 Info =1358 "== Specify ==1359 * the feed stream of each tray (Inlet);1360 * the Murphree eficiency for each tray Emv;1361 * the pump head;1362 * the condenser pressure drop;1363 * the heat supllied in top and bottom tanks;1364 * the heat supllied in condenser and reboiler;1365 * the Outlet1 flow in the bottom splitter (spbottom.Outlet1.F) that corresponds to the bottom product;1366 * both top splitter outlet flows OR one of the splitter outlet flows and the splitter frac.1367 1368 == Initial Conditions ==1369 * the TRAYS temperature (OutletLiquid.T);1370 * the TRAYS liquid level (Level) OR the TRAYS liquid flow (OutletLiquid.F);1371 * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions for each tray;1372 1373 * the top tank temperature (OutletLiquid.T);1374 * the top tank liquid level (Level);1375 * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions;1376 1377 * the bottom tank temperature (OutletLiquid.T);1378 * the bottom tank liquid level (Level);1379 * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions.1380 ";1381 1382 SET1383 1384 NumberOfFeeds = 1;1385 1386 VARIABLES1387 CONDENSER as condenserSteady (Brief="steady state condenser with subcooling");1388 REFLUX_DRUM as TankL (Brief="Reflux Drum");1389 SPLITTER_TOP as splitter_column (Brief="splitter which separate reflux and distillate",Protected=true);1390 PUMP as pump (Brief="pump in reflux stream");1391 REBOILER as reboilerSteady (Brief="steady state reboiler (thermosyphon)");1392 SUMP as SumpTank (Brief="vessel in the bottom of column");1393 SPLITTER_BOTTOM as splitter2 (Brief="splitter to separate the bottom product and the stream to reboiler");1394 1395 in FeedTray as stream (Brief="Feed stream", PosX=0, PosY=0.55);1396 1397 RefluxRatio as positive (Brief="Reflux Ratio",Default=10, Lower = 0.5);1398 1399 in Q_cond as power (Brief="Heat supplied to Condenser",PosX=1, PosY=0, Protected=true);1400 in Q_reb as power (Brief="Heat supplied to Reboiler", PosX=1, PosY=0.96,Protected=true);1401 in Q_drum as power (Brief="Heat supplied to Reflux Drum", PosX=1, PosY=0.30,Protected=true);1402 1403 out TI_reb as control_signal (Brief="Temperature Indicator of Reboiler ",Protected = true, PosX=1, PosY=0.92);1404 out PI_reb as control_signal (Brief="Pressure Indicator of Reboiler", Protected = true, PosX=1, PosY=0.875);1405 1406 out TI_cond as control_signal (Brief="Temperature Indicator of Condenser ", Protected = true, PosX=0.52, PosY=0);1407 out PI_cond as control_signal (Brief="Pressure Indicator of Condenser", Protected = true, PosX=0.42, PosY=0);1408 1409 out TI_drum as control_signal (Brief="Temperature Indicator of Reflux Drum ", Protected = true, PosX=1, PosY=0.20);1410 out PI_drum as control_signal (Brief="Pressure Indicator of Reflux Drum", Protected = true, PosX=1, PosY=0.155);1411 out LI_drum as control_signal (Brief="Level Indicator of Reflux Drum", Protected = true, PosX=1, PosY=0.24);1412 1413 out LI_sump as control_signal (Brief="Level Indicator of Column Sump", Protected = true, PosX=1, PosY=0.765);1414 out TI_sump as control_signal (Brief="Temperature Indicator of Column Sump ",Protected = true, PosX=1, PosY=0.71);1415 1416 out LiquidDistillate as liquid_stream (Brief="Liquid outlet stream From Top Splitter", PosX=1, PosY=0.33);1417 out BottomProduct as liquid_stream (Brief="Liquid outlet stream From Bottom Splitter", PosX=0.06, PosY=1);1418 1419 in ConnectorSplitterBottom as stream (Brief="Connector for Liquid outlet stream From Reboiler", Hidden=true);1420 in ConnectorSplitterTop as stream (Brief="Connector for Liquid outlet stream From Top Splitter", Hidden=true);1421 1422 ConnectorHeatReboiler as power (Brief="Connector for Heat supplied to Reboiler", Hidden=true);1423 ConnectorHeatCondenser as power (Brief="Connector for Heat supplied to Condenser", Hidden=true);1424 ConnectorHeatRefluxDrum as power (Brief="Connector for Heat supplied to Reflux Drum", Hidden=true);1425 1426 EQUATIONS1427 1428 SPLITTER_TOP.RefluxRatio = RefluxRatio;1429 TI_reb = REBOILER.TI ;1430 PI_reb = REBOILER.PI;1431 1432 TI_cond = CONDENSER.TI;1433 PI_cond = CONDENSER.PI;1434 1435 TI_drum = REFLUX_DRUM.TI;1436 PI_drum = REFLUX_DRUM.PI;1437 LI_drum = REFLUX_DRUM.LI;1438 1439 TI_sump = SUMP.TI;1440 LI_sump = SUMP.LI;1441 1442 for i in 1:NumberOfTrays do1443 1444 if i equal FeedTrayLocation(1) then1445 1446 "FeedTrayTop Inlet Flow"1447 FeedTray.F= TRAYS(i).Inlet.F;1448 1449 "FeedTrayTop Inlet Temperature"1450 FeedTray.T = TRAYS(i).Inlet.T;1451 1452 "FeedTrayTop Inlet Pressure"1453 FeedTray.P = TRAYS(i).Inlet.P;1454 1455 "FeedTrayTop Inlet Composition"1456 FeedTray.z = TRAYS(i).Inlet.z;1457 1458 "FeedTrayTop Inlet Vapour Fraction"1459 FeedTray.v = TRAYS(i).Inlet.v;1460 1461 "FeedTrayTop Inlet Enthalpy"1462 FeedTray.h = TRAYS(i).Inlet.h;1463 1464 else1465 1466 "Inlet Tray - Flow Sealed"1467 0*'mol/h'= TRAYS(i).Inlet.F;1468 1469 "Inlet Tray - Temperature"1470 300*'K' = TRAYS(i).Inlet.T;1471 1472 "Inlet Tray - Pressure"1473 1*'atm' = TRAYS(i).Inlet.P;1474 1475 "Inlet Tray - Composition"1476 0.1 = TRAYS(i).Inlet.z;1477 1478 "Inlet Tray - Vapour Fraction"1479 0 = TRAYS(i).Inlet.v;1480 1481 "Inlet Tray - Enthalpy"1482 0*'J/mol' = TRAYS(i).Inlet.h;1483 1484 end1485 1486 end1487 1488 # Heat Connector Equations1489 Q_cond = ConnectorHeatCondenser;1490 Q_reb = ConnectorHeatReboiler;1491 Q_drum = ConnectorHeatRefluxDrum;1492 1493 # Top Splitter Connector Equations1494 ConnectorSplitterTop.T = LiquidDistillate.T;1495 ConnectorSplitterTop.P = LiquidDistillate.P;1496 ConnectorSplitterTop.F = LiquidDistillate.F;1497 ConnectorSplitterTop.z = LiquidDistillate.z;1498 1499 # Bottom Splitter Connector Equations1500 ConnectorSplitterBottom.T = BottomProduct.T;1501 ConnectorSplitterBottom.P = BottomProduct.P;1502 ConnectorSplitterBottom.F = BottomProduct.F;1503 ConnectorSplitterBottom.z = BottomProduct.z;1504 1505 CONNECTIONS1506 #vapor1507 REBOILER.OutletVapour to SUMP.InletVapour;1508 SUMP.OutletVapour to TRAYS(NumberOfTrays).InletVapour;1509 TRAYS(1).OutletVapour to CONDENSER.InletVapour;1510 1511 #liquid1512 CONDENSER.OutletLiquid to REFLUX_DRUM.Inlet;1513 REFLUX_DRUM.OutletLiquid to SPLITTER_TOP.Inlet;1514 SPLITTER_TOP.Reflux to PUMP.Inlet;1515 PUMP.Outlet to TRAYS(1).InletLiquid;1516 TRAYS(NumberOfTrays).OutletLiquid to SUMP.InletLiquid;1517 SUMP.OutletLiquid to SPLITTER_BOTTOM.Inlet;1518 SPLITTER_BOTTOM.Outlet2 to REBOILER.InletLiquid;1519 1520 #Connectors1521 ConnectorHeatCondenser to CONDENSER.InletQ;1522 ConnectorHeatReboiler to REBOILER.InletQ;1523 ConnectorHeatRefluxDrum to REFLUX_DRUM.InletQ;1524 SPLITTER_TOP.Distillate to ConnectorSplitterTop;1525 SPLITTER_BOTTOM.Outlet1 to ConnectorSplitterBottom;1526 1527 end1528 1529 Model Distillation_thermosyphon_cond as ColumnBasic1530 ATTRIBUTES1531 Pallete = true;1532 Icon = "icon/DistillationThermosyphonCond";1533 Brief = "Model of a distillation column with dynamic condenser and steady reboiler.";1534 Info =1535 "== Specify ==1536 * the feed stream of each tray (Inlet);1537 * the Murphree eficiency for each tray Emv;1538 * the pump head;1539 * the condenser vapor outlet flow (OutletVapour.F);1540 * the heat supllied in bottom tank;1541 * the heat supllied in condenser and reboiler;1542 * the Outlet1 flow in the bottom splitter (spbottom.Outlet1.F) that corresponds to the bottom product;1543 1544 == Initial Conditions ==1545 * the TRAYS temperature (OutletLiquid.T);1546 * the TRAYS liquid level (Level) OR the TRAYS liquid flow (OutletLiquid.F);1547 * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions for each tray;1548 1549 * the condenser temperature (OutletLiquid.T);1550 * the condenser liquid level (Level);1551 * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions;1552 1553 * the bottom tank temperature (OutletLiquid.T);1554 * the bottom tank liquid level (Level);1555 * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions.1556 ";1557 1558 SET1559 1560 NumberOfFeeds = 1;1561 1562 VARIABLES1563 CONDENSER as condenser (Brief="dynamic condenser without subcooling");1564 SPLITTER_TOP as splitter_column (Brief="splitter which separate reflux and distillate",Protected=true);1565 PUMP as pump (Brief="pump in reflux stream");1566 SUMP as SumpTank (Brief="vessel in the bottom of column");1567 SPLITTER_BOTTOM as splitter2 (Brief="splitter who separate the bottom product and the stream to reboiler");1568 REBOILER as reboilerSteady (Brief="steady state reboiler (thermosyphon)");1569 RefluxRatio as positive (Brief="Reflux Ratio",Default=10, Lower = 0.5);1570 1571 in FeedTray as stream (Brief="Feed stream", PosX=0, PosY=0.55);1572 1573 in Q_cond as power (Brief="Heat supplied to Condenser",PosX=1, PosY=0, Protected=true);1574 in Q_reb as power (Brief="Heat supplied to Reboiler", PosX=1, PosY=0.96,Protected=true);1575 1576 out TI_cond as control_signal (Brief="Temperature Indicator of Condenser ", Protected = true, PosX=0.48, PosY=0);1577 out LI_cond as control_signal (Brief="Level Indicator of Condenser", Protected = true, PosX=1, PosY=0.084);1578 out PI_cond as control_signal (Brief="Pressure Indicator of Condenser", Protected = true, PosX=0.40, PosY=0);1579 1580 out TI_reb as control_signal (Brief="Temperature Indicator of Reboiler ",Protected = true, PosX=1, PosY=0.92);1581 out PI_reb as control_signal (Brief="Pressure Indicator of Reboiler", Protected = true, PosX=1, PosY=0.878);1582 1583 out LI_sump as control_signal (Brief="Level Indicator of Column Sump", Protected = true, PosX=1, PosY=0.76);1584 out TI_sump as control_signal (Brief="Temperature Indicator of Column Sump ",Protected = true, PosX=1, PosY=0.71);1585 1586 out VapourDistillate as vapour_stream (Brief="Vapour outlet stream From Top Condenser", PosX=0.62, PosY=0);1587 out LiquidDistillate as liquid_stream (Brief="Liquid outlet stream From Top Splitter", PosX=1, PosY=0.185);1588 out BottomProduct as liquid_stream (Brief="Liquid outlet stream From Bottom Splitter", PosX=0.06, PosY=1);1589 1590 in ConnectorSplitterBottom as stream (Brief="Connector for Liquid outlet stream From Reboiler", Hidden=true);1591 in ConnectorSplitterTop as stream (Brief="Connector for Liquid outlet stream From Top Splitter", Hidden=true);1592 in ConnectorCondenserVout as stream (Brief="Connector for Vapour outlet stream From Top Condenser", Hidden=true);1593 1594 ConnectorHeatReboiler as power (Brief="Connector for Heat supplied to Reboiler", Hidden=true);1595 ConnectorHeatCondenser as power (Brief="Connector for Heat supplied to Condenser", Hidden=true);1596 1597 EQUATIONS1598 1599 for i in 1:NumberOfTrays do1600 1601 if i equal FeedTrayLocation(1) then1602 1603 "FeedTrayTop Inlet Flow"1604 FeedTray.F= TRAYS(i).Inlet.F;1605 1606 "FeedTrayTop Inlet Temperature"1607 FeedTray.T = TRAYS(i).Inlet.T;1608 1609 "FeedTrayTop Inlet Pressure"1610 FeedTray.P = TRAYS(i).Inlet.P;1611 1612 "FeedTrayTop Inlet Composition"1613 FeedTray.z = TRAYS(i).Inlet.z;1614 1615 "FeedTrayTop Inlet Vapour Fraction"1616 FeedTray.v = TRAYS(i).Inlet.v;1617 1618 "FeedTrayTop Inlet Enthalpy"1619 FeedTray.h = TRAYS(i).Inlet.h;1620 1621 else1622 1623 "Inlet Tray - Flow Sealed"1624 0*'mol/h'= TRAYS(i).Inlet.F;1625 1626 "Inlet Tray - Temperature"1627 300*'K' = TRAYS(i).Inlet.T;1628 1629 "Inlet Tray - Pressure"1630 1*'atm' = TRAYS(i).Inlet.P;1631 1632 "Inlet Tray - Composition"1633 0.1 = TRAYS(i).Inlet.z;1634 1635 "Inlet Tray - Vapour Fraction"1636 0 = TRAYS(i).Inlet.v;1637 1638 "Inlet Tray - Enthalpy"1639 0*'J/mol' = TRAYS(i).Inlet.h;1640 1641 end1642 1643 end1644 1645 SPLITTER_TOP.RefluxRatio = RefluxRatio;1646 1647 TI_reb = REBOILER.TI ;1648 PI_reb = REBOILER.PI;1649 1650 TI_cond = CONDENSER.TI;1651 PI_cond = CONDENSER.PI;1652 LI_cond = CONDENSER.LI;1653 1654 TI_sump = SUMP.TI;1655 LI_sump = SUMP.LI;1656 1657 # Heat Connector Equations1658 Q_cond = ConnectorHeatCondenser;1659 Q_reb = ConnectorHeatReboiler;1660 1661 # Condenser Connector Equations1662 ConnectorCondenserVout.T = VapourDistillate.T;1663 ConnectorCondenserVout.P = VapourDistillate.P;1664 ConnectorCondenserVout.F = VapourDistillate.F;1665 ConnectorCondenserVout.z = VapourDistillate.z;1666 1667 # Top Splitter Connector Equations1668 ConnectorSplitterTop.T = LiquidDistillate.T;1669 ConnectorSplitterTop.P = LiquidDistillate.P;1670 ConnectorSplitterTop.F = LiquidDistillate.F;1671 ConnectorSplitterTop.z = LiquidDistillate.z;1672 1673 # Bottom Splitter Connector Equations1674 ConnectorSplitterBottom.T = BottomProduct.T;1675 ConnectorSplitterBottom.P = BottomProduct.P;1676 ConnectorSplitterBottom.F = BottomProduct.F;1677 ConnectorSplitterBottom.z = BottomProduct.z;1678 1679 CONNECTIONS1680 #vapor1681 SUMP.OutletVapour to TRAYS(NumberOfTrays).InletVapour;1682 REBOILER.OutletVapour to SUMP.InletVapour;1683 TRAYS(1).OutletVapour to CONDENSER.InletVapour;1684 1685 #liquid1686 CONDENSER.OutletLiquid to SPLITTER_TOP.Inlet;1687 SPLITTER_TOP.Reflux to PUMP.Inlet;1688 PUMP.Outlet to TRAYS(1).InletLiquid;1689 TRAYS(NumberOfTrays).OutletLiquid to SUMP.InletLiquid;1690 SUMP.OutletLiquid to SPLITTER_BOTTOM.Inlet;1691 SPLITTER_BOTTOM.Outlet2 to REBOILER.InletLiquid;1692 1693 #Connectors1694 ConnectorHeatCondenser to CONDENSER.InletQ;1695 ConnectorHeatReboiler to REBOILER.InletQ;1696 CONDENSER.OutletVapour to ConnectorCondenserVout;1697 SPLITTER_TOP.Distillate to ConnectorSplitterTop;1698 SPLITTER_BOTTOM.Outlet1 to ConnectorSplitterBottom;1699 1700 end1701 1702 Model Distillation_kettle_subcooling as ColumnBasic1703 1704 ATTRIBUTES1705 Pallete = true;1706 Icon = "icon/DistillationKettleSubcooling";1707 Brief = "Model of a distillation column with steady condenser and dynamic reboiler.";1708 Info =1709 "== Specify ==1710 * the feed stream of each tray (Inlet);1711 * the Murphree eficiency for each tray (Emv);1712 * the pump pressure difference;1713 * the heat supllied in reboiler and condenser;1714 * the heat supllied in the top tank;1715 * the condenser pressure drop;1716 * the reboiler liquid outlet flow (OutletLiquid.F);1717 * both splitter outlet flows OR one of the splitter outlet flows and the splitter frac.1718 1719 == Initial Conditions ==1720 * the TRAYS temperature (OutletLiquid.T);1721 * the TRAYS liquid level (Level) OR the TRAYS liquid flow (OutletLiquid.F);1722 * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions for each tray;1723 1724 * the top tank temperature (OutletLiquid.T);1725 * the top tank liquid level (Level);1726 * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions;1727 1728 * the reboiler temperature (OutletLiquid.T);1729 * the reboiler liquid level (Level);1730 * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions.1731 ";1732 1733 SET1734 1735 NumberOfFeeds = 1;1736 1737 VARIABLES1738 CONDENSER as condenserSteady (Brief="steady state condenser with subcooling");1739 REFLUX_DRUM as TankL (Brief="reflux drum");1740 SPLITTER as splitter_column (Brief="splitter to separate reflux and distillate",Protected=true);1741 PUMP as pump (Brief="pump in reflux stream");1742 REBOILER as reboiler (Brief="kettle reboiler");1743 1744 RefluxRatio as positive (Brief="Reflux Ratio",Default=10, Lower = 0.5);1745 1746 in Q_cond as power (Brief="Heat supplied to Condenser", PosX=1, PosY=0.065, Protected=true);1747 in Q_reb as power (Brief="Heat supplied to Reboiler", PosX=1, PosY=0.905, Protected=true);1748 in Q_drum as power (Brief="Heat supplied to Top Vessel", PosX=1, PosY=0.30, Protected=true);1749 1750 in FeedTray as stream (Brief="Feed stream", PosX=0, PosY=0.55);1751 1752 out TI_reb as control_signal (Brief="Temperature Indicator of Reboiler ",Protected = true, PosX=0.515, PosY=1);1753 out LI_reb as control_signal (Brief="Level Indicator of Reboiler", Protected = true, PosX=1, PosY=0.935);1754 out PI_reb as control_signal (Brief="Pressure Indicator of Reboiler", Protected = true, PosX=0.41, PosY=1);1755 1756 out TI_cond as control_signal (Brief="Temperature Indicator of Condenser ", Protected = true, PosX=0.52, PosY=0);1757 out PI_cond as control_signal (Brief="Pressure Indicator of Condenser", Protected = true, PosX=0.42, PosY=0);1758 1759 out TI_drum as control_signal (Brief="Temperature Indicator of Reflux Drum ", Protected = true, PosX=1, PosY=0.20);1760 out PI_drum as control_signal (Brief="Pressure Indicator of Reflux Drum", Protected = true, PosX=1, PosY=0.155);1761 out LI_drum as control_signal (Brief="Level Indicator of Reflux Drum", Protected = true, PosX=1, PosY=0.24);1762 1763 1764 in ConnectorSplitterOut as stream (Brief="Connector for Liquid outlet stream From Top Splitter", Hidden=true);1765 in ConnectorReboilerLout as stream (Brief="Connector for Liquid outlet stream From Reboiler", Hidden=true);1766 ConnectorHeatReboiler as power (Brief="Connector for Heat supplied to Reboiler", Hidden=true);1767 ConnectorHeatCondenser as power (Brief="Connector for Heat supplied to Condenser", Hidden=true);1768 ConnectorHeatAccumulator as power (Brief="Connector for Heat supplied to TopVessel", Hidden=true);1769 1770 out LiquidDistillate as liquid_stream (Brief="Liquid outlet stream From Top Splitter", PosX=1, PosY=0.33);1771 out BottomProduct as liquid_stream (Brief="Liquid outlet stream From Reboiler", PosX=0.67, PosY=1);1772 1773 EQUATIONS1774 1775 SPLITTER.RefluxRatio = RefluxRatio;1776 1777 TI_reb = REBOILER.TI ;1778 PI_reb = REBOILER.PI;1779 LI_reb = REBOILER.LI;1780 1781 TI_cond = CONDENSER.TI;1782 PI_cond = CONDENSER.PI;1783 1784 TI_drum = REFLUX_DRUM.TI;1785 PI_drum = REFLUX_DRUM.PI;1786 LI_drum = REFLUX_DRUM.LI;1787 1788 for i in 1:NumberOfTrays do1789 1790 if i equal FeedTrayLocation(1) then1791 1792 "FeedTrayTop Inlet Flow"1793 FeedTray.F= TRAYS(i).Inlet.F;1794 1795 "FeedTrayTop Inlet Temperature"1796 FeedTray.T = TRAYS(i).Inlet.T;1797 1798 "FeedTrayTop Inlet Pressure"1799 FeedTray.P = TRAYS(i).Inlet.P;1800 1801 "FeedTrayTop Inlet Composition"1802 FeedTray.z = TRAYS(i).Inlet.z;1803 1804 "FeedTrayTop Inlet Vapour Fraction"1805 FeedTray.v = TRAYS(i).Inlet.v;1806 1807 "FeedTrayTop Inlet Enthalpy"1808 FeedTray.h = TRAYS(i).Inlet.h;1809 1810 else1811 1812 "Inlet Tray - Flow Sealed"1813 0*'mol/h'= TRAYS(i).Inlet.F;1814 1815 "Inlet Tray - Temperature"1816 300*'K' = TRAYS(i).Inlet.T;1817 1818 "Inlet Tray - Pressure"1819 1*'atm' = TRAYS(i).Inlet.P;1820 1821 "Inlet Tray - Composition"1822 0.1 = TRAYS(i).Inlet.z;1823 1824 "Inlet Tray - Vapour Fraction"1825 0 = TRAYS(i).Inlet.v;1826 1827 "Inlet Tray - Enthalpy"1828 0*'J/mol' = TRAYS(i).Inlet.h;1829 1830 end1831 1832 end1833 1834 #Heat Connectors1835 Q_cond = ConnectorHeatCondenser;1836 Q_reb = ConnectorHeatReboiler;1837 Q_drum = ConnectorHeatAccumulator;1838 1839 # Splitter Connector Equations1840 ConnectorSplitterOut.T = LiquidDistillate.T;1841 ConnectorSplitterOut.P = LiquidDistillate.P;1842 ConnectorSplitterOut.F = LiquidDistillate.F;1843 ConnectorSplitterOut.z = LiquidDistillate.z;1844 1845 # Reboiler Connector Equations1846 ConnectorReboilerLout.T = BottomProduct.T;1847 ConnectorReboilerLout.P = BottomProduct.P;1848 ConnectorReboilerLout.F = BottomProduct.F;1849 ConnectorReboilerLout.z = BottomProduct.z;1850 1851 CONNECTIONS1852 #vapor1853 REBOILER.OutletVapour to TRAYS(NumberOfTrays).InletVapour;1854 TRAYS(1).OutletVapour to CONDENSER.InletVapour;1855 1856 #liquid1857 CONDENSER.OutletLiquid to REFLUX_DRUM.Inlet;1858 REFLUX_DRUM.OutletLiquid to SPLITTER.Inlet;1859 SPLITTER.Reflux to PUMP.Inlet;1860 PUMP.Outlet to TRAYS(1).InletLiquid;1861 TRAYS(NumberOfTrays).OutletLiquid to REBOILER.InletLiquid;1862 1863 #Connectors1864 ConnectorHeatCondenser to CONDENSER.InletQ;1865 ConnectorHeatReboiler to REBOILER.InletQ;1866 ConnectorHeatAccumulator to REFLUX_DRUM.InletQ;1867 1868 SPLITTER.Distillate to ConnectorSplitterOut;1869 REBOILER.OutletLiquid to ConnectorReboilerLout;1870 1871 end1872 1873 Model Rectifier as ColumnBasic1874 1875 ATTRIBUTES1876 Pallete = true;1877 Icon = "icon/RefluxedCond";1878 Brief = "Model of a rectifier column with dynamic condenser.";1879 Info =1880 "== Specify ==1881 * the feed stream of each tray (Inlet);1882 * the Murphree eficiency for each tray Emv;1883 * the InletVapour stream of the bottom tray unless its flow;1884 * the pump pressure difference;1885 * the heat supllied in the condenser;1886 * the condenser vapor outlet flow (OutletVapour.F);1887 * both splitter outlet flows OR one of the splitter outlet flows and the splitter frac.1888 1889 == Initial Conditions ==1890 * the TRAYS temperature (OutletLiquid.T);1891 * the TRAYS liquid level (Level) OR the TRAYS liquid flow (OutletLiquid.F);1892 * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions for each tray;1893 1894 * the condenser temperature (OutletLiquid.T);1895 * the condenser liquid level (Level);1896 * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions;1897 ";1898 1899 SET1900 NumberOfFeeds = 1;1901 1902 VARIABLES1903 CONDENSER as condenser (Brief="dymamic condenser without subcooling");1904 SPLITTER as splitter2 (Brief="splitter which separate reflux and distillate");1905 PUMP as pump (Brief="pump in reflux stream");1906 1907 out TI_cond as control_signal (Brief="Temperature Indicator of Condenser ", Protected = true, PosX=0.52, PosY=0);1908 out LI_cond as control_signal (Brief="Level Indicator of Condenser", Protected = true, PosX=1, PosY=0.084);1909 out PI_cond as control_signal (Brief="Pressure Indicator of Condenser", Protected = true, PosX=0.42, PosY=0);1910 1911 in FeedTray as stream (Brief="Feed stream", PosX=0, PosY=0.55);1912 1913 out VapourDistillate as vapour_stream (Brief="Vapour outlet stream From Top Condenser", PosX=0.66, PosY=0);1914 out LiquidDistillate as liquid_stream (Brief="Liquid outlet stream From Top Splitter", PosX=1, PosY=0.24);1915 1916 in Q_cond as power (Brief="Heat supplied to Condenser",PosX=1, PosY=0.04, Protected = true);1917 1918 in VapourInlet as stream (Brief="Vapour Inlet in the section", PosX=0.07, PosY=1);1919 out LiquidOutlet as liquid_stream (Brief="Liquid Outlet in the section", PosX=0.32, PosY=1);1920 1921 in ConnectorSplitterOut as stream (Brief="Connector for Liquid outlet stream From Top Splitter", Hidden=true);1922 in ConnectorCondenserVout as stream (Brief="Connector for Vapour outlet stream From Top Condenser", Hidden=true);1923 VapourConnector as stream (Brief="Vapour connection at the middle TRAYS", PosX=0.55, PosY=0,Hidden=true);1924 ConnectorHeatCondenser as power (Brief="Connector for Heat supplied to Condenser", Hidden=true);1925 1926 EQUATIONS1927 1928 TI_cond = CONDENSER.TI;1929 LI_cond = CONDENSER.LI;1930 PI_cond = CONDENSER.PI;1931 1932 for i in 1:NumberOfTrays do1933 1934 if i equal FeedTrayLocation(1) then1935 1936 "FeedTrayTop Inlet Flow"1937 FeedTray.F= TRAYS(i).Inlet.F;1938 1939 "FeedTrayTop Inlet Temperature"1940 FeedTray.T = TRAYS(i).Inlet.T;1941 1942 "FeedTrayTop Inlet Pressure"1943 FeedTray.P = TRAYS(i).Inlet.P;1944 1945 "FeedTrayTop Inlet Composition"1946 FeedTray.z = TRAYS(i).Inlet.z;1947 1948 "FeedTrayTop Inlet Vapour Fraction"1949 FeedTray.v = TRAYS(i).Inlet.v;1950 1951 "FeedTrayTop Inlet Enthalpy"1952 FeedTray.h = TRAYS(i).Inlet.h;1953 1954 else1955 1956 "Inlet Tray - Flow Sealed"1957 0*'mol/h'= TRAYS(i).Inlet.F;1958 1959 "Inlet Tray - Temperature"1960 300*'K' = TRAYS(i).Inlet.T;1961 1962 "Inlet Tray - Pressure"1963 1*'atm' = TRAYS(i).Inlet.P;1964 1965 "Inlet Tray - Composition"1966 0.1 = TRAYS(i).Inlet.z;1967 1968 "Inlet Tray - Vapour Fraction"1969 0 = TRAYS(i).Inlet.v;1970 1971 "Inlet Tray - Enthalpy"1972 0*'J/mol' = TRAYS(i).Inlet.h;1973 1974 end1975 1976 end1977 1978 Q_cond = ConnectorHeatCondenser;1979 1980 # Condenser Connector Equations1981 ConnectorCondenserVout.T = VapourDistillate.T;1982 ConnectorCondenserVout.P = VapourDistillate.P;1983 ConnectorCondenserVout.F = VapourDistillate.F;1984 ConnectorCondenserVout.z = VapourDistillate.z;1985 1986 # Splitter Connector Equations1987 ConnectorSplitterOut.T = LiquidDistillate.T;1988 ConnectorSplitterOut.P = LiquidDistillate.P;1989 ConnectorSplitterOut.F = LiquidDistillate.F;1990 ConnectorSplitterOut.z = LiquidDistillate.z;1991 1992 LiquidOutlet.F= TRAYS(NumberOfTrays).OutletLiquid.F;1993 LiquidOutlet.T = TRAYS(NumberOfTrays).OutletLiquid.T;1994 LiquidOutlet.P = TRAYS(NumberOfTrays).OutletLiquid.P;1995 LiquidOutlet.z = TRAYS(NumberOfTrays).OutletLiquid.z;1996 1997 VapourConnector.F= VapourInlet.F;1998 VapourConnector.T = VapourInlet.T;1999 VapourConnector.P = VapourInlet.P;2000 VapourConnector.z = VapourInlet.z;2001 VapourConnector.v = VapourInlet.v;2002 VapourConnector.h = VapourInlet.h;2003 2004 CONNECTIONS2005 #vapor2006 TRAYS(1).OutletVapour to CONDENSER.InletVapour;2007 2008 #liquid2009 CONDENSER.OutletLiquid to SPLITTER.Inlet;2010 SPLITTER.Outlet2 to PUMP.Inlet;2011 PUMP.Outlet to TRAYS(1).InletLiquid;2012 2013 #Connectors2014 ConnectorHeatCondenser to CONDENSER.InletQ;2015 VapourConnector to TRAYS(NumberOfTrays).InletVapour;2016 SPLITTER.Outlet1 to ConnectorSplitterOut;2017 CONDENSER.OutletVapour to ConnectorCondenserVout;2018 2019 end2020 2021 Model PackedDistillation_kettle_cond as Packed_Section_ColumnBasic2022 ATTRIBUTES2023 Pallete = true;2024 Icon = "icon/PackedDistillationKettleCond";2025 Brief = "Model of a distillation column with dynamic condenser and dynamic reboiler.";2026 Info =2027 "== Specify ==2028 * the feed stream of each tray (Inlet);2029 * the pump pressure difference;2030 * the total pressure drop (dP) of the packing;2031 * the heat supllied in reboiler and condenser;2032 * the condenser vapor outlet flow (OutletVapour.F);2033 * the reboiler liquid outlet flow (OutletLiquid.F);2034 * both splitter outlet flows OR one of the splitter outlet flows and the splitter frac.2035 2036 == Initial Conditions ==2037 * the stages temperature (OutletLiquid.T);2038 * the stages initial molar holdup;2039 * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions for each stage;2040 2041 * the condenser temperature (OutletLiquid.T);2042 * the condenser liquid level (Level);2043 * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions;2044 2045 * the reboiler temperature (OutletLiquid.T);2046 * the reboiler liquid level (Level);2047 * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions.2048 ";2049 2050 PARAMETERS2051 2052 #VapourFlow as Switcher (Valid = ["on", "off"], Hidden = true ,Default = "on");2053 2054 VARIABLES2055 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2056 # Column Devices2057 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2058 CONDENSER as condenser (Brief="dymamic condenser");2059 REBOILER as reboiler (Brief="kettle reboiler");2060 SPLITTER as splitter2 (Brief="splitter which separate reflux and distillate");2061 PUMP as pump (Brief="pump in reflux stream");2062 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2063 # Heat Ports2064 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2065 in HeatToReboiler as power (Brief="Heat supplied to Reboiler",Protected = true, PosX=1, PosY=0.885);2066 in HeatToCondenser as power (Brief="Heat supplied to Condenser", Protected = true, PosX=1, PosY=0.034);2067 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2068 # Column Products2069 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2070 out VapourDistillate as vapour_stream (Brief="Vapour outlet stream From Top Condenser", PosX=0.66, PosY=0);2071 out LiquidDistillate as liquid_stream (Brief="Liquid outlet stream From Top Splitter", PosX=1, PosY=0.20);2072 out BottomProduct as liquid_stream (Brief="Liquid outlet stream From Reboiler", PosX=0.68, PosY=1);2073 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2074 # Column Connectors2075 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2076 in ConnectorCondenserVout as stream (Brief="Connector for Vapour outlet stream From Top Condenser", Hidden=true);2077 in ConnectorSplitterOut as stream (Brief="Connector for Liquid outlet stream From Top Splitter", Hidden=true);2078 in ConnectorReboilerLout as stream (Brief="Connector for Liquid outlet stream From Reboiler", Hidden=true);2079 ConnectorHeatReboiler as power (Brief="Heat supplied to Reboiler", Hidden=true);2080 ConnectorHeatCondenser as power (Brief="Heat supplied to Condenser", Hidden=true);2081 2082 CONNECTIONS2083 2084 #vapor2085 #REBOILER.OutletVapour to STAGES(NumberOfStages).VapourConnector;2086 STAGES(1).OutletVapour to CONDENSER.InletVapour;2087 2088 #liquid2089 CONDENSER.OutletLiquid to SPLITTER.Inlet;2090 SPLITTER.Outlet2 to PUMP.Inlet;2091 #PUMP.Outlet to STAGES(1).InletLiquid;2092 STAGES(NumberOfStages).OutletLiquid to REBOILER.InletLiquid;2093 2094 #Connectors2095 ConnectorHeatReboiler to REBOILER.InletQ;2096 ConnectorHeatCondenser to CONDENSER.InletQ;2097 2098 CONDENSER.OutletVapour to ConnectorCondenserVout;2099 SPLITTER.Outlet1 to ConnectorSplitterOut;2100 REBOILER.OutletLiquid to ConnectorReboilerLout;2101 2102 EQUATIONS2103 HeatToReboiler = ConnectorHeatReboiler;2104 HeatToCondenser = ConnectorHeatCondenser;2105 2106 # Condenser Connector Equations2107 ConnectorCondenserVout.T = VapourDistillate.T;2108 ConnectorCondenserVout.P = VapourDistillate.P;2109 ConnectorCondenserVout.F = VapourDistillate.F;2110 ConnectorCondenserVout.z = VapourDistillate.z;2111 2112 # Splitter Connector Equations2113 ConnectorSplitterOut.T = LiquidDistillate.T;2114 ConnectorSplitterOut.P = LiquidDistillate.P;2115 ConnectorSplitterOut.F = LiquidDistillate.F;2116 ConnectorSplitterOut.z = LiquidDistillate.z;2117 2118 # Reboiler Connector Equations2119 ConnectorReboilerLout.T = BottomProduct.T;2120 ConnectorReboilerLout.P = BottomProduct.P;2121 ConnectorReboilerLout.F = BottomProduct.F;2122 ConnectorReboilerLout.z = BottomProduct.z;2123 2124 end2125 2126 Model Rectifier_subcooling as Section_ColumnBasicX2127 2128 ATTRIBUTES2129 Pallete = true;2130 Icon = "icon/RefluxedSubcooling";2131 Brief = "Model of a rectifier column with steady condenser.";2132 Info =2133 "== Specify ==2134 * the feed stream of each tray (Inlet);2135 * the Murphree eficiency for each tray Emv;2136 * the InletVapour stream of the bottom tray unless its flow;2137 * the pump head;2138 * the condenser pressure drop;2139 * the heat supllied in the top tank;2140 * the heat supllied in condenser;2141 * both top splitter outlet flows OR one of the splitter outlet flows and the splitter frac.2142 2143 == Initial Conditions ==2144 * the TRAYS temperature (OutletLiquid.T);2145 * the TRAYS liquid level (Level) OR the TRAYS liquid flow (OutletLiquid.F);2146 * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions for each tray;2147 2148 * the top tank temperature (OutletLiquid.T);2149 * the top tank liquid level (Level);2150 * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions;2151 ";2152 2153 PARAMETERS2154 CondenserVapourFlow as Switcher (Valid = ["on", "off"], Default = "on",Hidden=true);2155 2156 VARIABLES2157 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2158 # Column Vapour and Liquid Draw Sides2159 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2160 out VapourDrawOff as vapour_stream (Brief="Vapour Outlet in the section", PosX=1, PosY=0.485,Protected = true);2161 out LiquidDrawOff as liquid_stream (Brief="Liquid Outlet in the section", PosX=1, PosY=0.535,Protected = true);2162 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2163 # Column Devices2164 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2165 CONDENSER as condenserSteady (Brief="steady state condenser with subcooling");2166 ACCUMULATOR as tank_cylindrical (Brief="vessel drum (layed cilinder)");2167 SPLITTER as splitter2 (Brief="plitter which separate reflux and distillate");2168 PUMP as pump (Brief="pump in reflux stream");2169 alfaTopo as Real;2170 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2171 # Column Bottom outlets2172 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2173 in VapourInlet as stream (Brief="Vapour Inlet in the section", PosX=0.07, PosY=1);2174 out LiquidOutlet as liquid_stream (Brief="Liquid Outlet in the section", PosX=0.32, PosY=1);2175 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2176 # Heat Ports2177 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2178 in HeatToCondenser as power (Brief="Heat supplied to Condenser", PosX=1, PosY=0.070, Protected=true);2179 in HeatToAccumulator as power (Brief="Heat supplied to Top Accumulator", PosX=1, PosY=0.23, Protected=true);2180 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2181 # Column Top Product2182 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2183 out LiquidDistillate as liquid_stream (Brief="Liquid outlet stream From Top Splitter", PosX=1, PosY=0.285);2184 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2185 # Column Connectors2186 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2187 in ConnectorSplitterTop as stream (Brief="Connector for Liquid outlet stream From Top Splitter", Hidden=true);2188 VapourConnector as stream (Brief="Vapour connection at the middle TRAYS", PosX=0.55, PosY=0,Hidden=true);2189 ConnectorHeatCondenser as power (Brief="Connector for Heat supplied to Condenser", Hidden=true);2190 ConnectorHeatAccumulator as power (Brief="Connector for Heat supplied to Top Accumulator", Hidden=true);2191 2192 EQUATIONS2193 #Heat Connectors2194 HeatToCondenser = ConnectorHeatCondenser;2195 HeatToAccumulator = ConnectorHeatAccumulator;2196 2197 LiquidOutlet.F= TRAYS(NumberOfTrays).OutletLiquid.F;2198 LiquidOutlet.T = TRAYS(NumberOfTrays).OutletLiquid.T;2199 LiquidOutlet.P = TRAYS(NumberOfTrays).OutletLiquid.P;2200 LiquidOutlet.z = TRAYS(NumberOfTrays).OutletLiquid.z;2201 2202 VapourConnector.F= VapourInlet.F;2203 VapourConnector.T = VapourInlet.T;2204 VapourConnector.P = VapourInlet.P;2205 VapourConnector.z = VapourInlet.z;2206 VapourConnector.v = VapourInlet.v;2207 VapourConnector.h = VapourInlet.h;2208 2209 # Splitter Connector Equations2210 ConnectorSplitterTop.T = LiquidDistillate.T;2211 ConnectorSplitterTop.P = LiquidDistillate.P;2212 ConnectorSplitterTop.F = LiquidDistillate.F;2213 ConnectorSplitterTop.z = LiquidDistillate.z;2214 2215 VapourDrawOff.F*VapSideTrayIndex= TRAYS.VapourSideStream.F;2216 VapourDrawOff.T = TRAYS(VapourSideStreamLocation).VapourSideStream.T;2217 VapourDrawOff.P = TRAYS(VapourSideStreamLocation).VapourSideStream.P;2218 VapourDrawOff.z = TRAYS(VapourSideStreamLocation).VapourSideStream.z;2219 2220 LiquidDrawOff.F*LiqSideTrayIndex= TRAYS.LiquidSideStream.F;2221 LiquidDrawOff.T = TRAYS(LiquidSideStreamLocation).LiquidSideStream.T;2222 LiquidDrawOff.P = TRAYS(LiquidSideStreamLocation).LiquidSideStream.P;2223 LiquidDrawOff.z = TRAYS(LiquidSideStreamLocation).LiquidSideStream.z;2224 2225 VapourDrawOffFlow = VapourDrawOff.F;2226 LiquidDrawOffFlow = LiquidDrawOff.F;2227 2228 switch CondenserVapourFlow2229 2230 case "on":2231 CONDENSER.InletVapour.F*TRAYS(1).vV = alfaTopo *Ah * sqrt(2*(TRAYS(1).OutletVapour.P -2232 CONDENSER.OutletLiquid.P + 1e-8 * 'atm') / (alfa*TRAYS(1).rhoV));2233 when CONDENSER.InletVapour.F < 1e-6 * 'kmol/h' switchto "off";2234 2235 case "off":2236 CONDENSER.InletVapour.F = 0 * 'mol/s';2237 when TRAYS(1).OutletVapour.P > CONDENSER.OutletLiquid.P + 1e-1 * 'atm' switchto "on";2238 2239 end2240 2241 CONNECTIONS2242 #vapor2243 TRAYS(1).OutletVapour to CONDENSER.InletVapour;2244 2245 #liquid2246 CONDENSER.OutletLiquid to ACCUMULATOR.Inlet;2247 ACCUMULATOR.Outlet to SPLITTER.Inlet;2248 SPLITTER.Outlet2 to PUMP.Inlet;2249 PUMP.Outlet to TRAYS(1).InletLiquid;2250 2251 #Connectors2252 VapourConnector to TRAYS(NumberOfTrays).InletVapour;2253 ConnectorHeatCondenser to CONDENSER.InletQ;2254 SPLITTER.Outlet1 to ConnectorSplitterTop;2255 ConnectorHeatAccumulator to ACCUMULATOR.InletQ;2256 2257 end2258 2259 Model Reboiled_Stripping_kettle as Section_ColumnBasicX2260 2261 ATTRIBUTES2262 Pallete = true;2263 Icon = "icon/ReboiledKettle";2264 Brief = "Model of a reboiled stripping column with dynamic reboiler.";2265 Info =2266 "== Specify ==2267 * the feed stream of each tray (Inlet);2268 * the Murphree eficiency for each tray Emv;2269 * the vapour flow leaving the top of the column;2270 * the InletLiquidiquid stream of the top tray;2271 * the heat supllied in the reboiler;2272 * the reboiler liquid outlet flow (OutletLiquid.F);2273 2274 == Initial Conditions ==2275 * the TRAYS temperature (OutletLiquid.T);2276 * the TRAYS liquid level (Level) OR the TRAYS liquid flow (OutletLiquid.F);2277 * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions for each tray;2278 2279 * the reboiler temperature (OutletLiquid.T);2280 * the reboiler liquid level (Level);2281 * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions.2282 ";2283 2284 VARIABLES2285 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2286 # Column Vapour and Liquid Draw Sides2287 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2288 out VapourDrawOff as vapour_stream (Brief="Vapour Outlet in the section", PosX=1, PosY=0.28,Protected = true);2289 out LiquidDrawOff as liquid_stream (Brief="Liquid Outlet in the section", PosX=1, PosY=0.33,Protected = true);2290 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2291 # Column Devices2292 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2293 REBOILER as reboiler (Brief="Kettle Reboiler");2294 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2295 # Heat Port2296 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2297 in HeatToReboiler as power (Brief="Heat supplied to Reboiler",PosX=1, PosY=0.865,Protected=true);2298 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2299 # Column Top Outlets2300 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2301 in LiquidInlet as stream (Brief="Liquid Inlet in the section", PosX=0.30, PosY=0);2302 out VapourOutlet as vapour_stream (Brief="Vapour Outlet in the section", PosX=0.07, PosY=0);2303 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2304 # Column Bottom Product2305 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2306 out BottomProduct as liquid_stream (Brief="Liquid outlet stream From Reboiler", PosX=0.68, PosY=1);2307 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2308 # Column Connectors2309 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2310 in ConnectorReboilerLout as stream (Brief="Connector for Liquid outlet stream From Reboiler", Hidden=true);2311 LiquidConnector as stream (Brief="Liquid connection at the middle TRAYS", PosX=0.75, PosY=1,Hidden=true);2312 ConnectorHeatReboiler as power (Brief="Connector for Heat supplied to Reboiler", Hidden=true);2313 2314 CONNECTIONS2315 #vapor2316 REBOILER.OutletVapour to TRAYS(NumberOfTrays).InletVapour;2317 2318 #liquid2319 TRAYS(NumberOfTrays).OutletLiquid to REBOILER.InletLiquid;2320 2321 #Connectors2322 REBOILER.OutletLiquid to ConnectorReboilerLout;2323 LiquidConnector to TRAYS(1).InletLiquid;2324 ConnectorHeatReboiler to REBOILER.InletQ;2325 2326 EQUATIONS2327 #Heat Connectors2328 HeatToReboiler = ConnectorHeatReboiler;2329 2330 LiquidConnector.F= LiquidInlet.F;2331 LiquidConnector.T = LiquidInlet.T;2332 LiquidConnector.P = LiquidInlet.P;2333 LiquidConnector.z = LiquidInlet.z;2334 LiquidConnector.v = LiquidInlet.v;2335 LiquidConnector.h = LiquidInlet.h;2336 2337 VapourOutlet.F= TRAYS(1).OutletVapour.F;2338 VapourOutlet.T = TRAYS(1).OutletVapour.T;2339 VapourOutlet.P = TRAYS(1).OutletVapour.P;2340 VapourOutlet.z = TRAYS(1).OutletVapour.z;2341 2342 # Reboiler Connector Equations2343 ConnectorReboilerLout.T = BottomProduct.T;2344 ConnectorReboilerLout.P = BottomProduct.P;2345 ConnectorReboilerLout.F = BottomProduct.F;2346 ConnectorReboilerLout.z = BottomProduct.z;2347 2348 VapourDrawOff.F*VapSideTrayIndex= TRAYS.VapourSideStream.F;2349 VapourDrawOff.T = TRAYS(VapourSideStreamLocation).VapourSideStream.T;2350 VapourDrawOff.P = TRAYS(VapourSideStreamLocation).VapourSideStream.P;2351 VapourDrawOff.z = TRAYS(VapourSideStreamLocation).VapourSideStream.z;2352 2353 LiquidDrawOff.F*LiqSideTrayIndex= TRAYS.LiquidSideStream.F;2354 LiquidDrawOff.T = TRAYS(LiquidSideStreamLocation).LiquidSideStream.T;2355 LiquidDrawOff.P = TRAYS(LiquidSideStreamLocation).LiquidSideStream.P;2356 LiquidDrawOff.z = TRAYS(LiquidSideStreamLocation).LiquidSideStream.z;2357 2358 VapourDrawOffFlow = VapourDrawOff.F;2359 LiquidDrawOffFlow = LiquidDrawOff.F;2360 2361 end2362 2363 Model Reboiled_Stripping_thermosyphon as Section_ColumnBasicX2364 2365 ATTRIBUTES2366 Pallete = true;2367 Icon = "icon/ReboiledThermosyphon";2368 Brief = "Model of a reboiled stripping column with steady reboiler.";2369 Info =2370 "== Specify ==2371 * the feed stream of each tray (Inlet);2372 * the Murphree eficiency for each tray (Emv);2373 * the vapour flow leaving the top of the column;2374 * the InletLiquidiquid stream of the top tray;2375 * the heat supllied in bottom tank;2376 * the heat supllied in the reboiler;2377 * the Outlet1 flow in the bottom splitter (spbottom.Outlet1.F) that corresponds to the bottom product;2378 2379 == Initial Conditions ==2380 * the TRAYS temperature (OutletLiquid.T);2381 * the TRAYS liquid level (Level) OR the TRAYS liquid flow (OutletLiquid.F);2382 * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions for each tray;2383 2384 * the bottom tank temperature (OutletLiquid.T);2385 * the bottom tank liquid level (Level);2386 * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions.2387 ";2388 2389 VARIABLES2390 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2391 # Column Vapour and Liquid Draw Sides2392 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2393 out VapourDrawOff as vapour_stream (Brief="Vapour Outlet in the section", PosX=1, PosY=0.28,Protected = true);2394 out LiquidDrawOff as liquid_stream (Brief="Liquid Outlet in the section", PosX=1, PosY=0.33,Protected = true);2395 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2396 # Column Devices2397 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2398 REBOILER as reboilerSteady (Brief="steady state reboiler (thermosyphon)");2399 SPLITTER as splitter2 (Brief="splitter which separate the bottom product and the stream to reboiler");2400 ACCUMULATOR as tank (Brief="vessel in the bottom of column");2401 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2402 # Heat Ports2403 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2404 in HeatToReboiler as power (Brief="Heat supplied to Reboiler",PosX=1, PosY=0.84,Protected=true);2405 in HeatToAccumulator as power (Brief="Heat supplied to Bottom Vessel",PosX=0, PosY=0.91,Protected=true);2406 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2407 # Column Top Outlets2408 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2409 in LiquidInlet as stream (Brief="Liquid Inlet in the section", PosX=0.32, PosY=0);2410 out VapourOutlet as vapour_stream (Brief="Vapour Outlet in the section", PosX=0.07, PosY=0);2411 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2412 # Column Bottom Product2413 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2414 out BottomProduct as liquid_stream (Brief="Liquid outlet stream From Reboiler", PosX=0.19, PosY=1);2415 LiquidConnector as stream (Brief="Liquid connection at the middle TRAYS", PosX=0.75, PosY=1,Hidden=true);2416 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2417 # Column Connectors2418 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2419 in ConnectorSplitterBottom as stream (Brief="Connector for Liquid outlet stream From Reboiler", Hidden=true);2420 ConnectorHeatReboiler as power (Brief="Connector for Heat supplied to Reboiler", Hidden=true);2421 ConnectorHeatAccumulator as power (Brief="Connector for Heat supplied to Bottom Accumulator", Hidden=true);2422 2423 CONNECTIONS2424 #vapor2425 REBOILER.OutletVapour to TRAYS(NumberOfTrays).InletVapour;2426 2427 #liquid2428 TRAYS(NumberOfTrays).OutletLiquid to ACCUMULATOR.Inlet;2429 ACCUMULATOR.Outlet to SPLITTER.Inlet;2430 SPLITTER.Outlet2 to REBOILER.InletLiquid;2431 2432 #Connectors2433 LiquidConnector to TRAYS(1).InletLiquid;2434 ConnectorHeatReboiler to REBOILER.InletQ;2435 ConnectorHeatAccumulator to ACCUMULATOR.InletQ;2436 SPLITTER.Outlet1 to ConnectorSplitterBottom;2437 2438 EQUATIONS2439 #Heat Connectors2440 HeatToReboiler = ConnectorHeatReboiler;2441 HeatToAccumulator = ConnectorHeatAccumulator;2442 2443 ConnectorSplitterBottom.T = BottomProduct.T;2444 ConnectorSplitterBottom.P = BottomProduct.P;2445 ConnectorSplitterBottom.F = BottomProduct.F;2446 ConnectorSplitterBottom.z = BottomProduct.z;2447 2448 LiquidConnector.F= LiquidInlet.F;2449 LiquidConnector.T = LiquidInlet.T;2450 LiquidConnector.P = LiquidInlet.P;2451 LiquidConnector.z = LiquidInlet.z;2452 LiquidConnector.v = LiquidInlet.v;2453 LiquidConnector.h = LiquidInlet.h;2454 2455 VapourOutlet.F= TRAYS(1).OutletVapour.F;2456 VapourOutlet.T = TRAYS(1).OutletVapour.T;2457 VapourOutlet.P = TRAYS(1).OutletVapour.P;2458 VapourOutlet.z = TRAYS(1).OutletVapour.z;2459 2460 VapourDrawOff.F*VapSideTrayIndex= TRAYS.VapourSideStream.F;2461 VapourDrawOff.T = TRAYS(VapourSideStreamLocation).VapourSideStream.T;2462 VapourDrawOff.P = TRAYS(VapourSideStreamLocation).VapourSideStream.P;2463 VapourDrawOff.z = TRAYS(VapourSideStreamLocation).VapourSideStream.z;2464 2465 LiquidDrawOff.F*LiqSideTrayIndex= TRAYS.LiquidSideStream.F;2466 LiquidDrawOff.T = TRAYS(LiquidSideStreamLocation).LiquidSideStream.T;2467 LiquidDrawOff.P = TRAYS(LiquidSideStreamLocation).LiquidSideStream.P;2468 LiquidDrawOff.z = TRAYS(LiquidSideStreamLocation).LiquidSideStream.z;2469 2470 VapourDrawOffFlow = VapourDrawOff.F;2471 LiquidDrawOffFlow = LiquidDrawOff.F;2472 2473 end2474 2475 Model ReactiveDistillation2476 2477 ATTRIBUTES2478 Pallete = true;2479 Icon = "icon/DistillationReac";2480 Brief = "Model of a reactive distillation column with dynamic condenser and reboiler.";2481 Info =2482 "== Specify ==2483 * the reaction related variables for each tray, condenser and reboiler;2484 * the feed stream of each tray (Inlet);2485 * the Murphree eficiency for each tray Emv;2486 * the pump pressure difference;2487 * the heat supllied in reboiler and condenser;2488 * the condenser vapor outlet flow (OutletVapour.F);2489 * the reboiler liquid outlet flow (OutletLiquid.F);2490 * both splitter outlet flows OR one of the splitter outlet flows and the splitter frac.2491 2492 == Initial Conditions ==2493 * the TRAYS temperature (OutletLiquid.T);2494 * the TRAYS liquid level (Level) OR the TRAYS liquid flow (OutletLiquid.F);2495 * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions for each tray;2496 2497 * the condenser temperature (OutletLiquid.T);2498 * the condenser liquid level (Level);2499 * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions;2500 2501 * the reboiler temperature (OutletLiquid.T);2502 * the reboiler liquid level (Level);2503 * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions.2504 ";2505 2506 PARAMETERS2507 outer PP as Plugin (Type="PP");2508 outer NComp as Integer (Brief="Number of Components");2509 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2510 # Section Column Feed Tray - Side Streams Location and Numbering2511 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2512 NumberOfTrays as Integer (Brief="Number of TRAYS", Default=2);2513 FeedTrayIndex(NumberOfTrays) as Integer (Brief="Feed Tray Index", Default=0,Hidden=true);2514 LiqSideTrayIndex(NumberOfTrays) as Integer (Brief="Liquid Side Tray Index", Default=0,Hidden=true);2515 VapSideTrayIndex(NumberOfTrays) as Integer (Brief="Vapour Side Tray Index", Default=0,Hidden=true);2516 FeedTrayLocation as Integer (Brief="Feed tray Location", Default=2);2517 LiquidSideStreamLocation as Integer (Brief="Liquid Side Stream Location", Default=2);2518 VapourSideStreamLocation as Integer (Brief="Vapour Side Stream Location", Default=2);2519 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2520 # Section Column Flow Model for Liquid and Vapour2521 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2522 VapourFlow as Switcher (Valid = ["on", "off"], Default = "off",Hidden=true);2523 TrayVapourFlow as Switcher (Valid = ["on", "off"], Default = "off",Hidden=true);2524 TrayLiquidFlow as Switcher (Valid = ["on", "off"], Default = "off",Hidden=true);2525 alfacond as Real;2526 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2527 # Section Column Tray Geometry and Auxiliar Parameters2528 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2529 V as volume (Brief="Total Volume of the tray",Hidden=true);2530 Q as power (Brief="Rate of heat supply",Hidden=true);2531 Ap as area (Brief="Plate area = Atray - Adowncomer",Hidden=true);2532 Ah as area (Brief="Total holes area",Hidden=true);2533 lw as length (Brief="Weir length",Hidden=true);2534 g as acceleration (Brief="Gravity Acceleration",Default=9.81,Hidden=true);2535 hw as length (Brief="Weir height",Hidden=true);2536 beta as fraction (Brief="Aeration fraction");2537 alfa as fraction (Brief="Dry pressure drop coefficient");2538 2539 VolumeOfTray as volume (Brief="Total Volume of the tray");2540 HeatSupply as heat_rate (Brief="Rate of heat supply");2541 PlateArea as area (Brief="Plate area = Atray - Adowncomer");2542 HolesArea as area (Brief="Total holes area");2543 WeirLength as length (Brief="Weir length");2544 WeirHeight as length (Brief="Weir height");2545 2546 stoic(NComp) as Real(Brief="Stoichiometric matrix");2547 Hr as energy_mol;2548 2549 SET2550 2551 FeedTrayIndex(FeedTrayLocation) =1;2552 VapSideTrayIndex(FeedTrayLocation) =1;2553 LiqSideTrayIndex(FeedTrayLocation) =1;2554 2555 V=VolumeOfTray;2556 Q=HeatSupply;2557 Ap=PlateArea;2558 Ah=HolesArea;2559 lw=WeirLength;2560 hw=WeirHeight ;2561 2562 VARIABLES2563 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2564 # Tray Initialization For the Whole Column Section2565 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2566 INITIALIZATION as InitializeSection (Brief = "Column Model Initialization");2567 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2568 # Column Feed - Side Stream Flow and Murphree Efficiency2569 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2570 in FeedTray as stream (Brief="Feed stream", PosX=0, PosY=0.55);2571 VapourDrawOffFlow as flow_mol (Brief = "Stream Molar Flow Rate");2572 LiquidDrawOffFlow as flow_mol (Brief = "Stream Molar Flow Rate");2573 MurphreeEff as Real (Brief = "Murphree efficiency");2574 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2575 # Column Vapour and Liquid Draw Sides2576 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2577 out VapourDrawOff as vapour_stream (Brief="Vapour Outlet in the section", PosX=1, PosY=0.395,Protected = true);2578 out LiquidDrawOff as liquid_stream (Brief="Liquid Outlet in the section", PosX=1, PosY=0.44,Protected = true);2579 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2580 # Heat Ports2581 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2582 in HeatToReboiler as power (Brief="Heat supplied to Reboiler", PosX=1, PosY=0.89);2583 in HeatToCondenser as power (Brief="Heat supplied to Condenser", PosX=1, PosY=0.07);2584 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2585 # Column Devices2586 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2587 TRAYS(NumberOfTrays) as trayReac;2588 CONDENSER as condenserReact;2589 REBOILER as reboilerReact;2590 SPLITTER as splitter2;2591 PUMP as pump;2592 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2593 # Column Outlets2594 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2595 out VapourDistillate as vapour_stream (Brief="Vapour outlet stream From Condenser", PosX=0.59, PosY=0);2596 out LiquidDistillate as liquid_stream (Brief="Liquid outlet stream From Splitter", PosX=1, PosY=0.23);2597 out BottomProduct as liquid_stream (Brief="Liquid outlet stream From Reboiler", PosX=0.67, PosY=1);2598 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2599 # Column Connectors2600 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2601 in ConnectorCondenserVout as stream (Brief="Connector for Vapour outlet stream From Top Condenser", Hidden=true);2602 in ConnectorSplitterOut as stream (Brief="Connector for Liquid outlet stream From Top Splitter", Hidden=true);2603 in ConnectorReboilerLout as stream (Brief="Connector for Liquid outlet stream From Reboiler", Hidden=true);2604 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2605 # Column Control Ports2606 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2607 out TRI as control_signal (Brief="Temperature of Reboiler Indicator", PosX=1, PosY=0.83);2608 out LRI as control_signal (Brief="Level of Reboiler Indicator", PosX=1, PosY=0.855);2609 out TCI as control_signal (Brief="Temperature of Condenser Indicator", PosX=1, PosY=0.01);2610 out LCI as control_signal (Brief="Level of Condenser Indicator", PosX=1, PosY=0.04);2611 2612 CONNECTIONS2613 #vapor2614 REBOILER.OutletVapour to TRAYS(NumberOfTrays).InletVapour;2615 TRAYS(1).OutletVapour to CONDENSER.InletVapour;2616 TRAYS([2:NumberOfTrays]).OutletVapour to TRAYS([1:NumberOfTrays-1]).InletVapour;2617 2618 #liquid2619 CONDENSER.OutletLiquid to SPLITTER.Inlet;2620 SPLITTER.Outlet2 to PUMP.Inlet;2621 PUMP.Outlet to TRAYS(1).InletLiquid;2622 TRAYS([1:NumberOfTrays-1]).OutletLiquid to TRAYS([2:NumberOfTrays]).InletLiquid;2623 TRAYS(NumberOfTrays).OutletLiquid to REBOILER.InletLiquid;2624 2625 #Connectors2626 CONDENSER.OutletVapour to ConnectorCondenserVout;2627 SPLITTER.Outlet1 to ConnectorSplitterOut;2628 REBOILER.OutletLiquid to ConnectorReboilerLout;2629 2630 INITIAL2631 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2632 # Tray Initialization2633 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2634 for i in 1:NumberOfTrays do2635 2636 "The initial temperature of the TRAYS"2637 TRAYS(i).OutletLiquid.T = INITIALIZATION.TopTemperature+(INITIALIZATION.BottomTemperature-INITIALIZATION.TopTemperature)*((i-1)/(NumberOfTrays-1));2638 2639 "The initial Level of the TRAYS"2640 TRAYS(i).Level = INITIALIZATION.LevelFraction*hw;2641 end2642 2643 for i in 1:NComp-1 do2644 2645 for j in 1:NumberOfTrays do2646 2647 "The initial composition of the TRAYS - Normalized"2648 TRAYS(j).OutletLiquid.z(i) = INITIALIZATION.TopComposition(i)/sum(INITIALIZATION.TopComposition) +(INITIALIZATION.BottomComposition(i)/sum(INITIALIZATION.BottomComposition)-INITIALIZATION.TopComposition(i)/sum(INITIALIZATION.TopComposition) )*((j-1)/(NumberOfTrays-1));2649 end2650 2651 end2652 2653 EQUATIONS2654 2655 for i in [1:NumberOfTrays] do2656 2657 "Murphree Efficiency"2658 TRAYS(i).OutletVapour.z = MurphreeEff * (TRAYS(i).yideal - TRAYS(i).InletVapour.z) + TRAYS(i).InletVapour.z;2659 2660 "Energy Holdup"2661 TRAYS(i).E = TRAYS(i).ML*TRAYS(i).OutletLiquid.h + TRAYS(i).MV*TRAYS(i).OutletVapour.h - TRAYS(i).OutletLiquid.P*V;2662 2663 "Component Molar Balance"2664 diff(TRAYS(i).M)=TRAYS(i).Inlet.F*TRAYS(i).Inlet.z + TRAYS(i).InletLiquid.F*TRAYS(i).InletLiquid.z + TRAYS(i).InletVapour.F*TRAYS(i).InletVapour.z- TRAYS(i).OutletLiquid.F*TRAYS(i).OutletLiquid.z - TRAYS(i).OutletVapour.F*TRAYS(i).OutletVapour.z-2665 TRAYS(i).LiquidSideStream.F*TRAYS(i).LiquidSideStream.z-TRAYS(i).VapourSideStream.F*TRAYS(i).VapourSideStream.z + stoic*TRAYS(i).r3*TRAYS(i).ML*TRAYS(i).vL;2666 2667 "Energy Balance"2668 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.h2669 -TRAYS(i).VapourSideStream.F*TRAYS(i).VapourSideStream.h - TRAYS(i).LiquidSideStream.F*TRAYS(i).LiquidSideStream.h + Q ) + Hr * TRAYS(i).r3 *TRAYS(i). vL*TRAYS(i).ML;2670 2671 "Level of clear liquid over the weir"2672 TRAYS(i).Level = TRAYS(i).ML*TRAYS(i).vL/Ap;2673 2674 "Geometry Constraint"2675 V = TRAYS(i).ML* TRAYS(i).vL + TRAYS(i).MV*TRAYS(i).vV;2676 2677 end2678 2679 switch VapourFlow2680 case "on":2681 "Pressure Drop through the condenser"2682 CONDENSER.InletVapour.F*TRAYS(1).vV / 'm^2' =2683 sqrt((TRAYS(1).OutletVapour.P - CONDENSER.OutletLiquid.P + 1e-8 * 'atm')/(TRAYS(1).rhoV*alfacond));2684 when TRAYS(1).OutletVapour.P < CONDENSER.OutletLiquid.P switchto "off";2685 2686 case "off":2687 "Prato selado"2688 CONDENSER.InletVapour.F = 0.0 * 'mol/s';2689 when TRAYS(1).OutletVapour.P > CONDENSER.OutletLiquid.P + 1e-3 * 'atm' switchto "on";2690 end2691 2692 for i in [1:NumberOfTrays] do2693 2694 switch TrayLiquidFlow2695 case "on":2696 "Francis Equation"2697 TRAYS(i).OutletLiquid.F*TRAYS(i).vL = 1.84*'1/s'*lw*((TRAYS(i).Level-(beta*hw)+1e-6*'m')/(beta))^2;2698 when TRAYS(i).Level < (beta * hw) switchto "off";2699 2700 case "off":2701 "Low level"2702 TRAYS(i).OutletLiquid.F = 0 * 'mol/h';2703 when TRAYS(i).Level > (beta * hw) + 1e-6*'m' switchto "on";2704 end2705 2706 switch TrayVapourFlow2707 case "on":2708 TRAYS(i).InletVapour.F*TRAYS(i).vV = sqrt((TRAYS(i).InletVapour.P - TRAYS(i).OutletVapour.P - TRAYS(i).Level*g*TRAYS(i).rhoL + 1e-8 * 'atm')/(TRAYS(i).rhoV*alfa))*Ah;2709 when TRAYS(i).InletVapour.P < TRAYS(i).OutletVapour.P + TRAYS(i).Level*g*TRAYS(i).rhoL switchto "off";2710 2711 case "off":2712 TRAYS(i).InletVapour.F = 0 * 'mol/s';2713 when TRAYS(i).InletVapour.P > TRAYS(i).OutletVapour.P + TRAYS(i).Level*g*TRAYS(i).rhoL + 3e-2 * 'atm' switchto "on";2714 end2715 2716 end2717 2718 # Connecting Trays2719 FeedTray.F*FeedTrayIndex= TRAYS.Inlet.F;2720 FeedTray.T = TRAYS.Inlet.T;2721 FeedTray.P = TRAYS.Inlet.P;2722 FeedTray.z = TRAYS.Inlet.z;2723 FeedTray.v = TRAYS.Inlet.v;2724 FeedTray.h = TRAYS.Inlet.h;2725 2726 HeatToReboiler = REBOILER.InletQ;2727 HeatToCondenser = CONDENSER.InletQ;2728 2729 "Reboiler Temperature indicator"2730 TRI * 'K' = REBOILER.OutletLiquid.T;2731 2732 "Reboiler Level indicator"2733 LRI*REBOILER.V = REBOILER.Level*REBOILER.Across;2734 2735 "Condenser Temperature indicator"2736 TCI * 'K' = CONDENSER.OutletLiquid.T;2737 2738 "Condenser Level indicator"2739 LCI*CONDENSER.V = CONDENSER.Level*CONDENSER.Across;2740 2741 # Condenser Connector Equations2742 ConnectorCondenserVout.T = VapourDistillate.T;2743 ConnectorCondenserVout.P = VapourDistillate.P;2744 ConnectorCondenserVout.F = VapourDistillate.F;2745 ConnectorCondenserVout.z = VapourDistillate.z;2746 2747 # Splitter Connector Equations2748 ConnectorSplitterOut.T = LiquidDistillate.T;2749 ConnectorSplitterOut.P = LiquidDistillate.P;2750 ConnectorSplitterOut.F = LiquidDistillate.F;2751 ConnectorSplitterOut.z = LiquidDistillate.z;2752 2753 # Reboiler Connector Equations2754 ConnectorReboilerLout.T = BottomProduct.T;2755 ConnectorReboilerLout.P = BottomProduct.P;2756 ConnectorReboilerLout.F = BottomProduct.F;2757 ConnectorReboilerLout.z = BottomProduct.z;2758 2759 VapourDrawOff.F*VapSideTrayIndex= TRAYS.VapourSideStream.F;2760 VapourDrawOff.T = TRAYS(VapourSideStreamLocation).VapourSideStream.T;2761 VapourDrawOff.P = TRAYS(VapourSideStreamLocation).VapourSideStream.P;2762 VapourDrawOff.z = TRAYS(VapourSideStreamLocation).VapourSideStream.z;2763 2764 LiquidDrawOff.F*LiqSideTrayIndex= TRAYS.LiquidSideStream.F;2765 LiquidDrawOff.T = TRAYS(LiquidSideStreamLocation).LiquidSideStream.T;2766 LiquidDrawOff.P = TRAYS(LiquidSideStreamLocation).LiquidSideStream.P;2767 LiquidDrawOff.z = TRAYS(LiquidSideStreamLocation).LiquidSideStream.z;2768 2769 VapourDrawOffFlow = VapourDrawOff.F;2770 LiquidDrawOffFlow = LiquidDrawOff.F;2771 2772 end2773 2774 *# -
branches/new_gui/eml/stage_separators/condenser.mso
r889 r890 162 162 163 163 Model condenserReact 164 ATTRIBUTES 164 165 ATTRIBUTES 165 166 Pallete = false; 166 167 Icon = "icon/Condenser"; … … 463 464 464 465 Pdrop as press_delta (Brief="Pressure Drop in the condenser",Default=0, Symbol="\Delta _P"); 465 #Fake_Temperature as temperature (Brief="Fake temperature", Symbol = "T_{fake}");466 466 467 467 … … 469 469 in InletVapour as stream (Brief="Vapour inlet stream", PosX=0.16, PosY=0, Symbol="_{in}^{Vapour}"); 470 470 out OutletLiquid as stream (Brief="Liquid outlet stream", PosX=0.53, PosY=1, Symbol="_{out}^{Liquid}"); 471 #in InletQ as power (Brief="Heat Duty", PosX=1, PosY=0.08, Symbol="Q_{in}",Protected=true);472 471 T_sub as temperature (Brief="Condensate temperature (subcooled)", Symbol = "T_{sub}"); 473 472 SubcoolingDegree as temp_delta (Brief="Subcooling Degree", Symbol = "\Delta _{sub}"); … … 485 484 InletVapour.z = OutletLiquid.z; 486 485 487 #"Energy Balance"488 #InletVapour.F*InletVapour.h + InletQ = OutletLiquid.F*OutletLiquid.h;489 490 486 "Pressure Drop" 491 487 OutletLiquid.P = InletVapour.P - Pdrop; -
branches/new_gui/eml/stage_separators/tray.mso
r889 r890 272 272 end 273 273 274 #*-------------------------------------------------------------------275 * Model of a tray with reaction276 *-------------------------------------------------------------------*#277 274 Model trayReac 278 275 ATTRIBUTES … … 393 390 end 394 391 395 #*-------------------------------------396 * Model of a packed column stage397 -------------------------------------*#398 392 Model packedStage 399 393 … … 558 552 end 559 553 560 #*-------------------------------------561 * Nonequilibrium Model562 -------------------------------------*563 Model interfaceTeste564 565 ATTRIBUTES566 Pallete = false;567 Icon = "icon/Tray";568 Brief = "Descrition of variables of the equilibrium interface.";569 Info =570 "This model contains only the variables of the equilibrium interface.";571 572 PARAMETERS573 outer PP as Plugin(Brief = "External Physical Properties", Type="PP");574 outer NComp as Integer;575 outer NC1 as Integer;576 577 VARIABLES578 NL(NComp) as flow_mol_delta (Brief = "Stream Molar Rate on Liquid Phase");579 NV(NComp) as flow_mol_delta (Brief = "Stream Molar Rate on Vapour Phase");580 T as temperature (Brief = "Stream Temperature");581 P as pressure (Brief = "Stream Pressure");582 x(NComp) as fraction (Brief = "Stream Molar Fraction on Liquid Phase");583 y(NComp) as fraction (Brief = "Stream Molar Fraction on Vapour Phase");584 a as area (Brief = "Interface Area");585 htL as heat_trans_coeff (Brief = "Heat Transference Coefficient on Liquid Phase");586 htV as heat_trans_coeff (Brief = "Heat Transference Coefficient on Vapour Phase");587 E_liq as heat_rate (Brief = "Liquid Energy Rate at interface");588 E_vap as heat_rate (Brief = "Vapour Energy Rate at interface");589 hL as enth_mol (Brief = "Liquid Molar Enthalpy");590 hV as enth_mol (Brief = "Vapour Molar Enthalpy");591 kL(NC1,NC1) as velocity (Brief = "Mass Transfer Coefficients");592 kV(NC1,NC1) as velocity (Brief = "Mass Transfer Coefficients");593 594 EQUATIONS595 "Liquid Enthalpy"596 hL = PP.LiquidEnthalpy(T, P, x);597 598 "Vapour Enthalpy"599 hV = PP.VapourEnthalpy(T, P, y);600 601 end602 603 Model trayRateBasicTeste604 ATTRIBUTES605 Pallete = false;606 Icon = "icon/Tray";607 Brief = "Basic equations of a tray rate column model.";608 Info =609 "This model contains only the main equations of a column tray nonequilibrium model without610 the hidraulic equations.611 612 == Assumptions ==613 * both phases (liquid and vapour) exists all the time;614 * no entrainment of liquid or vapour phase;615 * no weeping;616 * the dymanics in the downcomer are neglected.617 ";618 619 PARAMETERS620 outer PP as Plugin(Brief = "External Physical Properties", Type="PP");621 outer NComp as Integer;622 NC1 as Integer;623 V as volume(Brief="Total Volume of the tray");624 Q as heat_rate (Brief="Rate of heat supply");625 Ap as area (Brief="Plate area = Atray - Adowncomer");626 627 VARIABLES628 in Inlet as stream (Brief="Feed stream", PosX=0, PosY=0.4932, Symbol="_{in}");629 in InletFV as stream (Brief="Feed stream", PosX=0, PosY=0.4932, Symbol="_{in}");630 in InletLiquid as stream (Brief="Inlet liquid stream", PosX=0.5195, PosY=0, Symbol="_{inL}");631 in InletVapour as stream (Brief="Inlet vapour stream", PosX=0.4994, PosY=1, Symbol="_{inV}");632 out OutletLiquid as liquid_stream (Brief="Outlet liquid stream", PosX=0.8277, PosY=1, Symbol="_{outL}");633 out OutletVapour as vapour_stream (Brief="Outlet vapour stream", PosX=0.8043, PosY=0, Symbol="_{outV}");634 635 M_liq(NComp) as mol (Brief="Liquid Molar Holdup in the tray");636 M_vap(NComp) as mol (Brief="Vapour Molar Holdup in the tray");637 ML as mol (Brief="Molar liquid holdup");638 MV as mol (Brief="Molar vapour holdup");639 E_liq as energy (Brief="Total Liquid Energy Holdup on tray");640 E_vap as energy (Brief="Total Vapour Energy Holdup on tray");641 vL as volume_mol (Brief="Liquid Molar Volume");642 vV as volume_mol (Brief="Vapour Molar volume");643 Level as length (Brief="Height of clear liquid on plate");644 interf as interfaceTeste;645 646 SET647 NC1=NComp-1;648 649 EQUATIONS650 "Component Molar Balance"651 diff(M_liq)=Inlet.F*Inlet.z + InletLiquid.F*InletLiquid.z652 - OutletLiquid.F*OutletLiquid.z + interf.NL;653 654 diff(M_vap)=InletFV.F*InletFV.z + InletVapour.F*InletVapour.z655 - OutletVapour.F*OutletVapour.z - interf.NV;656 657 "Energy Balance"658 diff(E_liq) = Inlet.F*Inlet.h + InletLiquid.F*InletLiquid.h659 - OutletLiquid.F*OutletLiquid.h + Q + interf.E_liq;660 661 diff(E_vap) = InletFV.F*InletFV.h + InletVapour.F*InletVapour.h662 - OutletVapour.F*OutletVapour.h - interf.E_vap;663 664 "Molar Holdup"665 M_liq = ML*OutletLiquid.z;666 667 M_vap = MV*OutletVapour.z;668 669 "Energy Holdup"670 E_liq = ML*(OutletLiquid.h - OutletLiquid.P*vL);671 672 E_vap = MV*(OutletVapour.h - OutletVapour.P*vV);673 674 "Energy Rate through the interface"675 interf.E_liq = interf.htL*interf.a*(interf.T-OutletLiquid.T)+sum(interf.NL)*interf.hL;676 677 interf.E_vap = interf.htV*interf.a*(OutletVapour.T-interf.T)+sum(interf.NV)*interf.hV;678 679 "Mass Conservation"680 interf.NL = interf.NV;681 682 "Energy Conservation"683 interf.E_liq = interf.E_vap;684 685 "Mol fraction normalisation"686 sum(OutletLiquid.z)= 1.0;687 sum(OutletLiquid.z)= sum(OutletVapour.z);688 sum(interf.x)=1.0;689 sum(interf.x)=sum(interf.y);690 691 "Liquid Volume"692 vL = PP.LiquidVolume(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z);693 "Vapour Volume"694 vV = PP.VapourVolume(OutletVapour.T, OutletVapour.P, OutletVapour.z);695 696 "Chemical Equilibrium"697 PP.LiquidFugacityCoefficient(interf.T, interf.P, interf.x)*interf.x =698 PP.VapourFugacityCoefficient(interf.T, interf.P, interf.y)*interf.y;699 700 "Geometry Constraint"701 V = ML*vL + MV*vV;702 703 "Level of clear liquid over the weir"704 Level = ML*vL/Ap;705 706 "Total Mass Transfer Rates"707 interf.NL(1:NC1)=interf.a*sumt(interf.kL*(interf.x(1:NC1)-OutletLiquid.z(1:NC1)))/vL+708 OutletLiquid.z(1:NC1)*sum(interf.NL);709 710 # interf.NL(1:NC1)=0.01*'kmol/s';711 712 interf.NV(1:NC1)=interf.a*sumt(interf.kV*(OutletVapour.z(1:NC1)-interf.y(1:NC1)))/vV+713 OutletVapour.z(1:NC1)*sum(interf.NV);714 715 "Mechanical Equilibrium"716 OutletVapour.P = OutletLiquid.P;717 interf.P=OutletLiquid.P;718 end719 720 Model trayRateTeste as trayRateBasicTeste721 ATTRIBUTES722 Pallete = false;723 Icon = "icon/Tray";724 Brief = "Complete rate model of a column tray.";725 Info =726 "== Specify ==727 * the Feed stream728 * the Liquid inlet stream729 * the Vapour inlet stream730 * the Vapour outlet flow (OutletVapour.F)731 732 == Initial ==733 * the plate temperature of both phases (OutletLiquid.T and OutletVapour.T)734 * the liquid height (Level) OR the liquid flow holdup (ML)735 * the vapor holdup (MV)736 * (NoComps - 1) OutletLiquid compositions737 ";738 739 PARAMETERS740 Ah as area (Brief="Total holes area");741 lw as length (Brief="Weir length");742 g as acceleration (Default=9.81);743 hw as length (Brief="Weir height");744 beta as fraction (Brief="Aeration fraction");745 alfa as fraction (Brief="Dry pressure drop coefficient");746 747 VapourFlow as Switcher(Valid = ["on", "off"], Default = "on");748 LiquidFlow as Switcher(Valid = ["on", "off"], Default = "on");749 750 VARIABLES751 rhoL as dens_mass;752 rhoV as dens_mass;753 754 EQUATIONS755 "Liquid Density"756 rhoL = PP.LiquidDensity(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z);757 "Vapour Density"758 rhoV = PP.VapourDensity(InletVapour.T, InletVapour.P, InletVapour.z);759 760 switch LiquidFlow761 case "on":762 "Francis Equation"763 # OutletLiquid.F*vL = 1.84*'m^0.5/s'*lw*((Level-(beta*hw))/(beta))^1.5;764 OutletLiquid.F*vL = 1.84*'1/s'*lw*((Level-(beta*hw))/(beta))^2;765 when Level < (beta * hw) switchto "off";766 767 case "off":768 "Low level"769 OutletLiquid.F = 0 * 'mol/h';770 when Level > (beta * hw) + 1e-6*'m' switchto "on";771 end772 773 switch VapourFlow774 case "on":775 InletVapour.F*vV = sqrt((InletVapour.P - OutletVapour.P)/(rhoV*alfa))*Ah;776 when InletVapour.F < 1e-6 * 'kmol/h' switchto "off";777 778 case "off":779 InletVapour.F = 0 * 'mol/s';780 when InletVapour.P > OutletVapour.P + Level*g*rhoL + 1e-1 * 'atm' switchto "on";781 end782 end783 784 *# -
branches/new_gui/eml/streams/streams.mso
r889 r890 23 23 24 24 Model stream 25 ATTRIBUTES 25 26 ATTRIBUTES 26 27 Pallete = false; 27 28 Brief = "General Material Stream"; … … 31 32 from this model."; 32 33 33 34 PARAMETERS 34 35 outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); 35 36 36 37 VARIABLES 37 38 F as flow_mol (Brief = "Stream Molar Flow Rate"); 38 39 T as temperature (Brief = "Stream Temperature"); … … 44 45 45 46 Model liquid_stream as stream 46 ATTRIBUTES 47 48 ATTRIBUTES 47 49 Pallete = false; 48 50 Brief = "Liquid Material Stream"; … … 52 54 is known ''a priori''."; 53 55 54 56 PARAMETERS 55 57 outer PP as Plugin(Brief = "External Physical Properties", Type="PP"); 56 58 57 58 59 EQUATIONS 60 "Liquid Enthalpy" 59 61 h = PP.LiquidEnthalpy(T, P, z); 60 "Liquid stream" 62 63 "Liquid stream" 61 64 v = 0; 62 65 end 63 66 64 67 Model vapour_stream as stream 65 ATTRIBUTES 68 69 ATTRIBUTES 66 70 Pallete = false; 67 71 Brief = "Vapour Material Stream"; … … 71 75 is known ''a priori''."; 72 76 73 77 PARAMETERS 74 78 outer PP as Plugin(Brief = "External Physical Properties", Type="PP"); 75 79 76 77 80 EQUATIONS 81 "Vapour Enthalpy" 78 82 h = PP.VapourEnthalpy(T, P, z); 79 "Vapour stream" 83 84 "Vapour stream" 80 85 v = 1; 81 86 end 82 87 83 Model streamPH as stream 84 ATTRIBUTES 88 Model streamPH as stream 89 90 ATTRIBUTES 85 91 Brief = "Stream with built-in flash calculation"; 86 92 Info = " … … 97 103 Pallete = false; 98 104 99 105 PARAMETERS 100 106 outer PP as Plugin(Brief = "External Physical Properties", Type="PP"); 101 107 102 108 VARIABLES 103 109 x(NComp) as fraction (Brief = "Liquid Molar Fraction",Hidden=true); 104 110 y(NComp) as fraction (Brief = "Vapour Molar Fraction",Hidden=true); 105 111 106 107 112 EQUATIONS 113 "Flash Calculation" 108 114 [v, x, y] = PP.FlashPH(P, h, z); 109 115 110 116 "Enthalpy" 111 117 h = (1-v)*PP.LiquidEnthalpy(T, P, x) + v*PP.VapourEnthalpy(T, P, y); 112 118 113 119 end 114 120 115 Model streamPHS as streamPH 116 ATTRIBUTES 121 Model streamPHS as streamPH 122 123 ATTRIBUTES 117 124 Brief = "Stream with built-in flash calculation"; 118 125 Info = " -
branches/new_gui/eml/types.mso
r889 r890 26 26 *----------------------------------------------------------------------------------*# 27 27 28 # Constants29 coefficient as Real (Brief = "General Coefficient", Default=1, Lower=-50, Upper=50);30 constant as Real (Brief = "General Constant", Default=10, Lower=-5000, Upper=5000);31 positive as Real (Brief = "Positive General Constant", Default=1.0, Lower=-1e-6);32 negative as Real (Brief = "Negative General Constant", Default=-1.0, Upper=1e-6);33 fraction as Real (Brief = "Fraction" , Default=0.5, Lower=-1e-6, Upper=1.00001);34 percent as Real (Brief = "Percent", Default=50, final Lower=0, final Upper=100);35 control_signal as Real (Brief = "Control Signal", Default=1, Lower=-1e9, Upper=1e9);36 efficiency as Real (Brief = "Efficiency", Default=0.5, final Lower=0, final Upper=1);28 #-------------------------Constants---------------------------------------------------- 29 coefficient as Real (Brief = "General Coefficient", Default=1, Lower=-50, Upper=50); 30 constant as Real (Brief = "General Constant", Default=10, Lower=-5000, Upper=5000); 31 positive as Real (Brief = "Positive General Constant", Default=1.0, Lower=-1e-6); 32 negative as Real (Brief = "Negative General Constant", Default=-1.0, Upper=1e-6); 33 fraction as Real (Brief = "Fraction" , Default=0.5, Lower=-1e-6, Upper=1.00001); 34 percent as Real (Brief = "Percent", Default=50, final Lower=0, final Upper=100); 35 control_signal as Real (Brief = "Control Signal", Default=1, Lower=-1e9, Upper=1e9); 36 efficiency as Real (Brief = "Efficiency", Default=0.5, final Lower=0, final Upper=1); 37 37 38 # Pressure39 pressure as Real(Brief = "Pressure", Default=1, Lower=1e-30, Upper=5e7, final Unit = 'atm');40 press_delta as pressure (Brief = "Pressure Difference", Default=0.01, Lower=-5e6);41 head_mass as Real(Brief = "Head", Default=50, Lower=-1e6, Upper=1e6, final Unit = 'kJ/kg');42 head as Real(Brief = "Head", Default=50, Lower=-1e6, Upper=1e6, final Unit = 'kJ/kmol');38 #-------------------------Pressure---------------------------------------------------- 39 pressure as Real (Brief = "Pressure", Default=1, Lower=1e-30, Upper=5e7, final Unit = 'atm'); 40 press_delta as pressure (Brief = "Pressure Difference", Default=0.01, Lower=-5e6); 41 head_mass as Real (Brief = "Head", Default=50, Lower=-1e6, Upper=1e6, final Unit = 'kJ/kg'); 42 head as Real (Brief = "Head", Default=50, Lower=-1e6, Upper=1e6, final Unit = 'kJ/kmol'); 43 43 44 # Temperature45 temperature as Real (Brief = "Temperature", Default=300, Lower=27, Upper=5273, final Unit = 'K');46 temp_delta as temperature(Brief = "Temperature Difference", Default=30, Lower=-1000, Upper=1000);44 #-------------------------Temperature---------------------------------------------------- 45 temperature as Real (Brief = "Temperature", Default=300, Lower=27, Upper=5273, final Unit = 'K'); 46 temp_delta as temperature (Brief = "Temperature Difference", Default=30, Lower=-1000, Upper=1000); 47 47 48 # Time49 time_h as positive (Brief = "Time in hours", Default=1, Upper=1e4, final Unit = 'h');50 time_min as time_h(Brief = "Time in minutes", DisplayUnit ='min');51 time_sec as time_h(Brief = "Time in seconds", DisplayUnit = 's');52 frequency as positive(Brief = "Frequency", Default=1, Upper=100, final Unit='1/s');48 #-------------------------Time---------------------------------------------------- 49 time_h as positive (Brief = "Time in hours", Default=1, Upper=1e4, final Unit = 'h'); 50 time_min as time_h (Brief = "Time in minutes", DisplayUnit ='min'); 51 time_sec as time_h (Brief = "Time in seconds", DisplayUnit = 's'); 52 frequency as positive (Brief = "Frequency", Default=1, Upper=100, final Unit='1/s'); 53 53 54 # Size related55 angle as Real(Brief = "Angle", Default=0, Lower=-7, Upper=7, final Unit ='rad');56 area as positive(Brief = "Area", Default=1, Upper=1E6, final Unit ='m^2');57 length as positive(Brief = "Length", Default=1, Upper=5e6, final Unit = 'm');58 length_delta as length(Brief = "Difference of Length", Lower=-1000);59 volume as positive(Brief = "Volume", Default=10, Upper=1000, final Unit = 'm^3');60 volume_mol as positive(Brief = "Molar Volume", Default=10, Upper=1E6, final Unit = 'm^3/mol');61 volume_mass as positive(Brief = "Specific Volume", Default=10, Upper=1E30, final Unit = 'm^3/kg');54 #-------------------------Size related---------------------------------------------------- 55 angle as Real (Brief = "Angle", Default=0, Lower=-7, Upper=7, final Unit ='rad'); 56 area as positive (Brief = "Area", Default=1, Upper=1E6, final Unit ='m^2'); 57 length as positive (Brief = "Length", Default=1, Upper=5e6, final Unit = 'm'); 58 length_delta as length (Brief = "Difference of Length", Lower=-1000); 59 volume as positive (Brief = "Volume", Default=10, Upper=1000, final Unit = 'm^3'); 60 volume_mol as positive (Brief = "Molar Volume", Default=10, Upper=1E6, final Unit = 'm^3/mol'); 61 volume_mass as positive (Brief = "Specific Volume", Default=10, Upper=1E30, final Unit = 'm^3/kg'); 62 62 63 # Eletric63 #-------------------------Eletric---------------------------------------------------- 64 64 current as positive (Brief = "Electrical Current", Default=10, Upper=1e12, final Unit ='A'); 65 charge as Real (Brief = "Electrical Charge", Default=10, Lower=-1e12, Upper=1e12, final Unit ='C');65 charge as Real (Brief = "Electrical Charge", Default=10, Lower=-1e12, Upper=1e12, final Unit ='C'); 66 66 capacitance as positive (Brief = "Electrical Capacitance", Default=10, Upper=1e12, final Unit ='F'); 67 67 indutance as positive (Brief = "Electrical Indutance", Default=10, Upper=1e12, final Unit ='V*s/A'); 68 68 voltage as positive (Brief = "Electrical Voltage", Default=100, Upper=1e9, final Unit = 'V'); 69 69 resistance as positive (Brief = "Eletrical Resistance", Default=50, Upper=800, final Unit = 'ohm'); 70 potency as Real (Brief = "Potency", Default = 10, Lower=-1e3, Upper=1e3, final Unit = 'kW');70 potency as Real (Brief = "Potency", Default = 10, Lower=-1e3, Upper=1e3, final Unit = 'kW'); 71 71 72 # Currency72 #-------------------------Currency---------------------------------------------------- 73 73 currency as Real (Brief = "Currency", Default = 0, final Unit = 'US$'); 74 74 … … 79 79 *----------------------------------------------------------------------------------*# 80 80 81 # elementary 82 mass as positive (Brief = "Mass", Default=2.5, Upper=1e6, final Unit = 'kg'); 83 #mol as positive (Brief = "Moles", Default=2500, Upper=1e9, final Unit = 'mol'); 84 mol as positive (Brief = "Moles", Default=2500, Upper=1e9, final Unit = 'kmol'); 85 kmol as positive (Brief = "Moles", Default=2.5, Upper=1e6, final Unit = 'kmol'); 86 molweight as Real (Brief = "Molar Weight", Default=75, Lower=1, Upper=1e8, final Unit = 'kg/kmol'); 87 molweight_inv as Real (Brief = "Moles Per Mass", Default=1, Lower=0, Upper=1e30, final Unit = 'kmol/kg'); 81 #-------------------------elementary---------------------------------------------------- 82 mass as positive (Brief = "Mass", Default=2.5, Upper=1e6, final Unit = 'kg'); 83 mol as positive (Brief = "Moles", Default=2500, Upper=1e9, final Unit = 'mol'); 84 kmol as positive (Brief = "Moles", Default=2.5, Upper=1e6, final Unit = 'kmol'); 85 molweight as Real (Brief = "Molar Weight", Default=75, Lower=1, Upper=1e8, final Unit = 'kg/kmol'); 86 molweight_inv as Real (Brief = "Moles Per Mass", Default=1, Lower=0, Upper=1e30, final Unit = 'kmol/kg'); 88 87 89 # densities90 dens_mol as Real (Brief = "Molar Density", Default=1, Lower=-1e-20, Upper=5e5, final Unit = 'kmol/m^3');91 dens_mass as Real (Brief = "Mass Density", Default=1000, Lower=-1e-20, Upper=5e8, final Unit ='kg/m^3');88 #-------------------------densities---------------------------------------------------- 89 dens_mol as Real (Brief = "Molar Density", Default=1, Lower=-1e-20, Upper=5e5, final Unit = 'kmol/m^3'); 90 dens_mass as Real (Brief = "Mass Density", Default=1000, Lower=-1e-20, Upper=5e8, final Unit ='kg/m^3'); 92 91 93 # Concentration94 conc_mol as dens_mol(Brief = "Molar Concentration", Default=1e-3);95 inv_conc_mol as Real(Brief = "Inverse of Molar Concentration", Default=0.05, Lower=2e-4, Upper=1e30, final Unit = 'm^3/kmol');96 conc_mass as dens_mass(Brief = "Mass Concentration");97 inv_conc_mass as Real(Brief = "Inverse of Mass Concentration", Default=0.001, Lower=2e-6, Upper=1e30, final Unit = 'm^3/kg');92 #-------------------------Concentration---------------------------------------------------- 93 conc_mol as dens_mol (Brief = "Molar Concentration", Default=1e-3); 94 inv_conc_mol as Real (Brief = "Inverse of Molar Concentration", Default=0.05, Lower=2e-4, Upper=1e30, final Unit = 'm^3/kmol'); 95 conc_mass as dens_mass (Brief = "Mass Concentration"); 96 inv_conc_mass as Real (Brief = "Inverse of Mass Concentration", Default=0.001, Lower=2e-6, Upper=1e30, final Unit = 'm^3/kg'); 98 97 99 # reaction100 reaction_mol as Real (Brief = "Molar Reaction Rate", Default=0, Lower=-1e6, Upper=1e6, final Unit = 'kmol/h/m^3');101 reaction_mass as Real (Brief = "Mass Reaction Rate", Default=0,Lower=-1e3, Upper=1e9, final Unit = 'kg/h/m^3');98 #-------------------------reaction---------------------------------------------------- 99 reaction_mol as Real (Brief = "Molar Reaction Rate", Default=0, Lower=-1e6, Upper=1e6, final Unit = 'kmol/h/m^3'); 100 reaction_mass as Real (Brief = "Mass Reaction Rate", Default=0,Lower=-1e3, Upper=1e9, final Unit = 'kg/h/m^3'); 102 101 103 102 … … 108 107 *----------------------------------------------------------------------------------*# 109 108 110 # Heat Capacity109 #-------------------------Heat Capacity---------------------------------------------------- 111 110 cp_mass as Real (Brief = "Mass Heat Capacity", Default=1.0, Lower=0.1, Upper=1e3, final Unit = 'kJ/kg/K'); 112 cp_mol as Real (Brief = "Molar Heat Capacity", Default=100, Lower=1, Upper=1e4, final Unit = 'kJ/kmol/K');113 cv_mol as Real (Brief = "Molar Heat Capacity", Default=100, Lower=1, Upper=1e4, final Unit ='kJ/kmol/K');111 cp_mol as Real (Brief = "Molar Heat Capacity", Default=100, Lower=1, Upper=1e4, final Unit = 'kJ/kmol/K'); 112 cv_mol as Real (Brief = "Molar Heat Capacity", Default=100, Lower=1, Upper=1e4, final Unit ='kJ/kmol/K'); 114 113 115 # Enthalpy116 enth_mass as Real (Brief = "Mass Enthalpy", Default=500, Lower=-10000, Upper=10000, final Unit = 'kJ/kg');117 enth_mol as Real (Brief = "Molar Enthalpy", Default=500, Lower=-1e9, Upper=1e9, final Unit = 'kJ/kmol');114 #-------------------------Enthalpy---------------------------------------------------- 115 enth_mass as Real (Brief = "Mass Enthalpy", Default=500, Lower=-10000, Upper=10000, final Unit = 'kJ/kg'); 116 enth_mol as Real (Brief = "Molar Enthalpy", Default=500, Lower=-1e9, Upper=1e9, final Unit = 'kJ/kmol'); 118 117 119 # Entropy120 entr_mol as Real (Brief = "Molar Entropy", Default=0, Lower=-1e4, Upper=1e4, final Unit = 'kJ/kmol/K');121 entr_mass as Real (Brief = "Mass Entropy", Default=0, Lower=-1e4, Upper=1e4, final Unit = 'kJ/kg/K');118 #-------------------------Entropy---------------------------------------------------- 119 entr_mol as Real (Brief = "Molar Entropy", Default=0, Lower=-1e4, Upper=1e4, final Unit = 'kJ/kmol/K'); 120 entr_mass as Real (Brief = "Mass Entropy", Default=0, Lower=-1e4, Upper=1e4, final Unit = 'kJ/kg/K'); 122 121 123 # Heat124 heat_reaction as Real(Brief = "Heat Of Reaction", Default=1000, Lower=-1e8, Upper=1e8, final Unit = 'kJ/kmol');125 heat_rate as Real(Brief = "Heat Rate", Default=1000, Lower=-1e9, Upper=1e9, final Unit = 'kW');126 heat_flux as Real(Brief = "Heat Flux", Default=1, Lower=-1e5, Upper=1e5, final Unit = 'kW/m^2');127 heat_trans_coeff as positive (Brief = "Heat Transference Coefficient", Default=1, Upper=1e3, final Unit = 'kW/m^2/K');122 #-------------------------Heat---------------------------------------------------- 123 heat_reaction as Real (Brief = "Heat Of Reaction", Default=1000, Lower=-1e8, Upper=1e8, final Unit = 'kJ/kmol'); 124 heat_rate as Real (Brief = "Heat Rate", Default=1000, Lower=-1e9, Upper=1e9, final Unit = 'kW'); 125 heat_flux as Real (Brief = "Heat Flux", Default=1, Lower=-1e5, Upper=1e5, final Unit = 'kW/m^2'); 126 heat_trans_coeff as positive (Brief = "Heat Transference Coefficient", Default=1, Upper=1e3, final Unit = 'kW/m^2/K'); 128 127 129 # Energy130 energy as Real (Brief = "Energy", Default=10000, Lower=-1e11, Upper=1e11, final Unit = 'kJ');128 #-------------------------Energy---------------------------------------------------- 129 energy as Real (Brief = "Energy", Default=10000, Lower=-1e11, Upper=1e11, final Unit = 'kJ'); 131 130 energy_mass as Real (Brief = "Energy per mass", Default=10000, Lower=-1e15, Upper=1e15, final Unit = 'kJ/kg'); 132 energy_mol as Real (Brief = "Energy per mol", Default=10000, Lower=-1e15, Upper=1e15, final Unit = 'kJ/kmol'); 133 power as Real (Brief = "Power", Default=10, Lower=-1e8, Upper=1e8, final Unit = 'kW'); 134 135 131 energy_mol as Real (Brief = "Energy per mol", Default=10000, Lower=-1e15, Upper=1e15, final Unit = 'kJ/kmol'); 132 power as Real (Brief = "Power", Default=10, Lower=-1e8, Upper=1e8, final Unit = 'kW'); 136 133 137 134 #*----------------------------------------------------------------------------------* … … 141 138 *----------------------------------------------------------------------------------*# 142 139 143 # Flow144 flow_mass as positive(Brief = "Mass Flow", Default=1000, Upper=1e10, final Unit = 'kg/h');145 flow_mass_delta as flow_mass (Brief = "Difference of Flow Mass", Lower=-1e10);146 flow_vol as positive(Brief = "Volumetric Flow", Default=1, Upper=1e12, final Unit = 'm^3/h');147 flow_vol_delta as flow_vol(Brief = "Difference of Volumetric Flow", Lower=-1e12);148 flow_mol as positive(Brief = "Mole Flow", Default=10, Upper=1e8, final Unit = 'kmol/h');149 flow_mol_delta as flow_mol(Brief = "Difference of Mole Flow", Lower=-1e8);140 #-------------------------Flow---------------------------------------------------- 141 flow_mass as positive (Brief = "Mass Flow", Default=1000, Upper=1e10, final Unit = 'kg/h'); 142 flow_mass_delta as flow_mass (Brief = "Difference of Flow Mass", Lower=-1e10); 143 flow_vol as positive (Brief = "Volumetric Flow", Default=1, Upper=1e12, final Unit = 'm^3/h'); 144 flow_vol_delta as flow_vol (Brief = "Difference of Volumetric Flow", Lower=-1e12); 145 flow_mol as positive (Brief = "Mole Flow", Default=10, Upper=1e8, final Unit = 'kmol/h'); 146 flow_mol_delta as flow_mol (Brief = "Difference of Mole Flow", Lower=-1e8); 150 147 151 # Flux152 flux_mol as positive(Brief = "Molar Flux", Default=1, Upper=1e4, final Unit = 'kmol/s/m^2');153 flux_mol_delta as flux_mol(Brief = "Difference of Molar Flux", Lower=-1e4);154 flux_mass as positive(Brief = "Mass Flux", Default=1, Upper=1e6, final Unit = 'kg/s/m^2');155 flux_mass_delta as flux_mass (Brief = "Difference of Mass Flux", Lower=-1e6);156 flux_vol as positive(Brief = "Volumetric Flux", Default=1, Upper=1e4, final Unit = 'm^3/s/m^2');157 flux_vol_delta as flux_vol(Brief = "Difference of Volumetric Flux", Lower=-1e4);148 #-------------------------Flux---------------------------------------------------- 149 flux_mol as positive (Brief = "Molar Flux", Default=1, Upper=1e4, final Unit = 'kmol/s/m^2'); 150 flux_mol_delta as flux_mol (Brief = "Difference of Molar Flux", Lower=-1e4); 151 flux_mass as positive (Brief = "Mass Flux", Default=1, Upper=1e6, final Unit = 'kg/s/m^2'); 152 flux_mass_delta as flux_mass (Brief = "Difference of Mass Flux", Lower=-1e6); 153 flux_vol as positive (Brief = "Volumetric Flux", Default=1, Upper=1e4, final Unit = 'm^3/s/m^2'); 154 flux_vol_delta as flux_vol (Brief = "Difference of Volumetric Flux", Lower=-1e4); 158 155 159 # Velocity160 vel_angular as Real(Brief = "Angular Velocity RPM", Default=1000, Lower=-100000, Upper=100000, final Unit = 'rpm');161 rotation as Real(Brief = "Angular Velocity", Default=500, Lower=-10000, Upper=10000, final Unit = 'rad/s');162 velocity as Real(Brief = "Velocity", Default=1, Lower=-1E5, Upper=1e5, final Unit = 'm/s');163 velocity_delta as velocity (Brief = "Difference of Velocity", Default=0, Lower=-1E3, Upper=-1E3);164 acceleration as Real(Brief = "General Acceleration", Default=9.81, Lower=-1e3, Upper=1e3, final Unit = 'm/s^2');156 #-------------------------Velocity---------------------------------------------------- 157 vel_angular as Real (Brief = "Angular Velocity RPM", Default=1000, Lower=-100000, Upper=100000, final Unit = 'rpm'); 158 rotation as Real (Brief = "Angular Velocity", Default=500, Lower=-10000, Upper=10000, final Unit = 'rad/s'); 159 velocity as Real (Brief = "Velocity", Default=1, Lower=-1E5, Upper=1e5, final Unit = 'm/s'); 160 velocity_delta as velocity (Brief = "Difference of Velocity", Default=0, Lower=-1E3, Upper=-1E3); 161 acceleration as Real (Brief = "General Acceleration", Default=9.81, Lower=-1e3, Upper=1e3, final Unit = 'm/s^2'); 165 162 166 # Others167 fricfactor as Real (Brief = "Friction Factor", Default=0.05, Lower=1e-5, Upper=2000);168 moment_inertia as Real (Brief = "Moment Of Inertia", Default=100, Lower=1E-3, Upper=1E4, final Unit = 'kg*m^2');169 hookes_const as Real (Brief = "Hookes Constant", Default=1e5, Lower=1, Upper=1e10, final Unit = 'N/m');163 #-------------------------Others---------------------------------------------------- 164 fricfactor as Real (Brief = "Friction Factor", Default=0.05, Lower=1e-5, Upper=2000); 165 moment_inertia as Real (Brief = "Moment Of Inertia", Default=100, Lower=1E-3, Upper=1E4, final Unit = 'kg*m^2'); 166 hookes_const as Real (Brief = "Hookes Constant", Default=1e5, Lower=1, Upper=1e10, final Unit = 'N/m'); 170 167 171 168 … … 177 174 *----------------------------------------------------------------------------------*# 178 175 179 # Conductivity176 #-------------------------Conductivity---------------------------------------------------- 180 177 conductivity as Real (Brief = "Thermal Conductivity", Default=1.0, Lower=0.001, Upper=500, final Unit = 'W/m/K'); 181 178 182 # Difusivity179 #-------------------------Difusivity---------------------------------------------------- 183 180 diffusivity as positive (Brief = "Diffusivity", Default=1e-3, Upper=1, final Unit ='cm^2/s'); 184 181 185 # Fugacity182 #-------------------------Fugacity---------------------------------------------------- 186 183 fugacity as positive (Brief = "Fugacity Coefficient", Default=0.5, Upper=10); 187 184 188 # Viscosity185 #-------------------------Viscosity---------------------------------------------------- 189 186 viscosity as Real (Brief = "Viscosity", Default=1, Lower=1e-30, Upper=1e5, final Unit = 'cP'); 190 187 191 # Molar and Specific Volume192 vol_mol as volume_mol(Brief = "Molar Volume");193 vol_mass as volume_mass(Brief = "Specific Volume");188 #-------------------------Molar and Specific Volume---------------------------------------------------- 189 vol_mol as volume_mol (Brief = "Molar Volume"); 190 vol_mass as volume_mass (Brief = "Specific Volume"); 194 191 195 # Others196 spec_surface_vol as positive (Brief = "Specific Surface Volume", Default=1e5, Upper=1e15, final Unit = 'm^2/m^3');197 spec_surface_mass as positive (Brief = "Specific Surface Mass", Default=100, Upper=1e12, final Unit = 'm^2/kg');198 surf_tens as positive (Brief = "Surface Tension", Default=0.05, Upper=1, final Unit = 'N/m');199 act_coeff as positive (Brief = "Activity Coefficient for Liquid", Default=1, Upper=30);200 ph as Real(Brief = "pH", Default=7, Lower=-5, Upper=20);192 #-------------------------Others---------------------------------------------------- 193 spec_surface_vol as positive (Brief = "Specific Surface Volume", Default=1e5, Upper=1e15, final Unit = 'm^2/m^3'); 194 spec_surface_mass as positive (Brief = "Specific Surface Mass", Default=100, Upper=1e12, final Unit = 'm^2/kg'); 195 surf_tens as positive (Brief = "Surface Tension", Default=0.05, Upper=1, final Unit = 'N/m'); 196 act_coeff as positive (Brief = "Activity Coefficient for Liquid", Default=1, Upper=30); 197 ph as Real (Brief = "pH", Default=7, Lower=-5, Upper=20); 201 198 202 199 203
Note: See TracChangeset
for help on using the changeset viewer.