#*------------------------------------------------------------------- * Models of Column Section with Tray Efficiency Prediction * Author: Josias J. Junges *-------------------------------------------------------------------*# using "tray_Eff"; using "reboiler"; using "condenser"; using "mixers_splitters/splitter"; using "tank"; using "pressure_changers/pump"; Model Section_Column_EffEmp ATTRIBUTES Pallete = true; Icon = "icon/SectionColumn"; Brief = "Model of a column section - Tray Efficiency Prediction"; Info = "== Model of a column section containing == * NTrays trays. == Specify == * the feed stream of each tray (Inlet); * the InletL stream of the top tray; * the InletV stream of the bottom tray. == Initial Conditions == * the trays temperature (OutletL.T); * the trays liquid level (Level) OR the trays liquid flow (OutletL.F); * (NoComps - 1) OutletL (OR OutletV) compositions for each tray. "; PARAMETERS outer PP as Plugin(Brief = "External Physical Properties", Type="PP"); outer NComp as Integer; NTrays as Integer(Brief="Number of trays", Default=2); topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1); top as Integer(Brief="Number of top tray"); bot as Integer(Brief="Number of bottom tray"); xas as Integer(Brief="Adjacent above stage vapour composition"); SET top = (NTrays-1)*(1-topdown)/2+1; bot = NTrays/top; VARIABLES trays(NTrays) as trayEffEmp; CONNECTIONS trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV; trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL; EQUATIONS if NComp > 2 then (trays(top).LoutLk-trays(top).LinLK)*trays(top).m=(trays(top).VoutLk-xas); for i in [(top+1):NTrays] (trays(i).LoutLk-trays(i).LinLK)*trays(i).m=(trays(i).VoutLk-trays(i-1).VoutLk); end else (trays(top).OutletL.z(1)-trays(top).InletL.z(1))*trays(top).m=(trays(top).OutletV.z(1)-xas); for i in [(top+1):NTrays] (trays(i).OutletL.z(1)-trays(i).InletL.z(1))*trays(i).m=(trays(i).OutletV.z(1)-trays(i-1).OutletV.z(1)); end end end Model Section_Column_EffFund ATTRIBUTES Pallete = true; Icon = "icon/SectionColumn"; Brief = "Model of a column section - Tray Efficiency Prediction"; Info = "== Model of a column section containing == * NTrays trays. == Specify == * the feed stream of each tray (Inlet); * the InletL stream of the top tray; * the InletV stream of the bottom tray. == Initial Conditions == * the trays temperature (OutletL.T); * the trays liquid level (Level) OR the trays liquid flow (OutletL.F); * (NoComps - 1) OutletL (OR OutletV) compositions for each tray. "; PARAMETERS outer PP as Plugin(Brief = "External Physical Properties", Type="PP"); outer NComp as Integer; NTrays as Integer(Brief="Number of trays", Default=2); topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1); top as Integer(Brief="Number of top tray"); bot as Integer(Brief="Number of bottom tray"); xas as Real(Brief="Adjacent above stage vapour composition"); SET top = (NTrays-1)*(1-topdown)/2+1; bot = NTrays/top; VARIABLES trays(NTrays) as trayEffFund; CONNECTIONS trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV; trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL; EQUATIONS if NComp > 2 then (trays(top).LoutLk-trays(top).LinLK)*trays(top).m=(trays(top).VoutLk-xas); for i in [(top+1):NTrays] (trays(i).LoutLk-trays(i).LinLK)*trays(i).m=(trays(i).VoutLk-trays(i-1).VoutLk); end else (trays(top).OutletL.z(1)-trays(top).InletL.z(1))*trays(top).m=(trays(top).OutletV.z(1)-xas); for i in [(top+1):NTrays] (trays(i).OutletL.z(1)-trays(i).InletL.z(1))*trays(i).m=(trays(i).OutletV.z(1)-trays(i-1).OutletV.z(1)); end end end #*---------------------------------------------------------------------- * Models of Column with Tray Efficiency Prediction * Author: Josias J. Junges *---------------------------------------------------------------------*# Model Distillation_kettle_cond_EffEmp ATTRIBUTES Pallete = true; Icon = "icon/DistillationKettleCond"; Brief = "Model of a distillation column with dynamic condenser and dynamic reboiler-Tray Efficiency Prediction"; Info = "== Specify == * the feed stream of each tray (Inlet); * the pump pressure difference; * the heat supllied in reboiler and condenser; * the condenser vapor outlet flow (OutletV.F); * the reboiler liquid outlet flow (OutletL.F); * both splitter outlet flows OR one of the splitter outlet flows and the splitter frac. == Initial Conditions == * the trays temperature (OutletL.T); * the trays liquid level (Level) OR the trays liquid flow (OutletL.F); * (NoComps - 1) OutletL (OR OutletV) compositions for each tray; * the condenser temperature (OutletL.T); * the condenser liquid level (Level); * (NoComps - 1) OutletL (OR OutletV) compositions; * the reboiler temperature (OutletL.T); * the reboiler liquid level (Level); * (NoComps - 1) OutletL (OR OutletV) compositions. "; PARAMETERS outer PP as Plugin(Brief = "External Physical Properties", Type="PP"); outer NComp as Integer; NTrays as Integer(Brief="Number of trays", Default=2); topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1); top as Integer(Brief="Number of top tray"); bot as Integer(Brief="Number of bottom tray"); VapourFlow as Switcher(Valid = ["on", "off"], Default = "on"); outer iLK as Integer (Brief="Pseudo-binary ligth key index"); outer iHK as Integer (Brief="Pseudo-binary heavy key index"); SET top = (NTrays-1)*(1-topdown)/2+1; bot = NTrays/top; VARIABLES trays(NTrays) as trayEffEmp; cond as condenser; reb as reboiler; sptop as splitter; pump1 as pump; alfaTopo as Real; condVoutLk as positive (Brief="Pseudo-binary approach"); EQUATIONS switch VapourFlow case "on": cond.InletV.F*trays(top).vV = alfaTopo * trays(top).Ah * sqrt(2*(trays(top).OutletV.P - cond.OutletL.P + 1e-8 * 'atm') / (trays(top).alfa*trays(top).rhoV)); when cond.InletV.F < 1e-6 * 'kmol/h' switchto "off"; case "off": cond.InletV.F = 0 * 'mol/s'; when trays(top).OutletV.P > cond.OutletL.P + 1e-1 * 'atm' switchto "on"; end "Condenser pseudo-binary approach" condVoutLk=cond.OutletV.z(iLK)/(cond.OutletV.z(iLK)+cond.OutletV.z(iHK)); CONNECTIONS #vapor reb.OutletV to trays(bot).InletV; trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV; trays(top).OutletV to cond.InletV; #liquid cond.OutletL to sptop.Inlet; sptop.Outlet2 to pump1.Inlet; pump1.Outlet to trays(top).InletL; trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL; trays(bot).OutletL to reb.InletL; EQUATIONS if NComp > 2 then (trays(top).LoutLk-trays(top).LinLK)*trays(top).m=(trays(top).VoutLk-condVoutLk); for i in [(top+1):NTrays] (trays(i).LoutLk-trays(i).LinLK)*trays(i).m=(trays(i).VoutLk-trays(i-1).VoutLk); end else (trays(top).OutletL.z(1)-trays(top).InletL.z(1))*trays(top).m=(trays(top).OutletV.z(1)-cond.OutletV.z(1)); for i in [(top+1):NTrays] (trays(i).OutletL.z(1)-trays(i).InletL.z(1))*trays(i).m=(trays(i).OutletV.z(1)-trays(i-1).OutletV.z(1)); end end end Model Distillation_kettle_cond_EffFund ATTRIBUTES Pallete = true; Icon = "icon/DistillationKettleCond"; Brief = "Model of a distillation column with dynamic condenser and dynamic reboiler-Tray Efficiency Prediction"; Info = "== Specify == * the feed stream of each tray (Inlet); * the pump pressure difference; * the heat supllied in reboiler and condenser; * the condenser vapor outlet flow (OutletV.F); * the reboiler liquid outlet flow (OutletL.F); * both splitter outlet flows OR one of the splitter outlet flows and the splitter frac. == Initial Conditions == * the trays temperature (OutletL.T); * the trays liquid level (Level) OR the trays liquid flow (OutletL.F); * (NoComps - 1) OutletL (OR OutletV) compositions for each tray; * the condenser temperature (OutletL.T); * the condenser liquid level (Level); * (NoComps - 1) OutletL (OR OutletV) compositions; * the reboiler temperature (OutletL.T); * the reboiler liquid level (Level); * (NoComps - 1) OutletL (OR OutletV) compositions. "; PARAMETERS outer PP as Plugin(Brief = "External Physical Properties", Type="PP"); outer NComp as Integer; NTrays as Integer(Brief="Number of trays", Default=2); topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1); top as Integer(Brief="Number of top tray"); bot as Integer(Brief="Number of bottom tray"); VapourFlow as Switcher(Valid = ["on", "off"], Default = "on"); outer iLK as Integer (Brief="Pseudo-binary ligth key index"); outer iHK as Integer (Brief="Pseudo-binary heavy key index"); SET top = (NTrays-1)*(1-topdown)/2+1; bot = NTrays/top; VARIABLES trays(NTrays) as trayEffFund; cond as condenser; reb as reboiler; sptop as splitter; pump1 as pump; alfaTopo as Real; condVoutLk as positive (Brief="Pseudo-binary approach"); EQUATIONS switch VapourFlow case "on": cond.InletV.F*trays(top).vV = alfaTopo * trays(top).Ah * sqrt(2*(trays(top).OutletV.P - cond.OutletL.P + 1e-8 * 'atm') / (trays(top).alfa*trays(top).rhoV)); when cond.InletV.F < 1e-6 * 'kmol/h' switchto "off"; case "off": cond.InletV.F = 0 * 'mol/s'; when trays(top).OutletV.P > cond.OutletL.P + 1e-1 * 'atm' switchto "on"; end "Condenser pseudo-binary approach" condVoutLk=cond.OutletV.z(iLK)/(cond.OutletV.z(iLK)+cond.OutletV.z(iHK)); CONNECTIONS #vapor reb.OutletV to trays(bot).InletV; trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV; trays(top).OutletV to cond.InletV; #liquid cond.OutletL to sptop.Inlet; sptop.Outlet2 to pump1.Inlet; pump1.Outlet to trays(top).InletL; trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL; trays(bot).OutletL to reb.InletL; EQUATIONS if NComp > 2 then (trays(top).LoutLk-trays(top).LinLK)*trays(top).m=(trays(top).VoutLk-condVoutLk); for i in [(top+1):NTrays] (trays(i).LoutLk-trays(i).LinLK)*trays(i).m=(trays(i).VoutLk-trays(i-1).VoutLk); end else (trays(top).OutletL.z(1)-trays(top).InletL.z(1))*trays(top).m=(trays(top).OutletV.z(1)-cond.OutletV.z(1)); for i in [(top+1):NTrays] (trays(i).OutletL.z(1)-trays(i).InletL.z(1))*trays(i).m=(trays(i).OutletV.z(1)-trays(i-1).OutletV.z(1)); end end end