#*---------------------------------------------------------------------- * File containg models of columns: distillation, stripping, absorbers * rectifier, .... * * The default nomenclature is: * Type_Column_reboilertype_condensertyper * * where: * Type = refluxed or reboiled or section * Column = Stripping, Absorption, Rectifier, Distillation * Reboiler type (if exists) = kettle or thermosyphon * Condenser type (if exists) = with subccoling or without subcooling * *----------------------------------------------------------------------- * Author: Paula B. Staudt * $Id: column.mso 46 2006-11-07 16:47:55Z paula $ *---------------------------------------------------------------------*# using "tray"; using "reboiler"; using "condenser"; using "mixers_splitters/splitter"; using "mixers_splitters/mixer"; using "tank"; using "pressure_changers/pump"; #*---------------------------------------------------------------------- * Model of a column section with: * - NTrays=number of trays trays. * *---------------------------------------------------------------------*# Model Section_Column PARAMETERS ext PP as CalcObject; ext 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"); SET top = (NTrays-1)*(1-topdown)/2+1; bot = NTrays/top; VARIABLES trays(NTrays) as tray; EQUATIONS "Pressure Drop through the tray" trays([top:topdown:bot]).OutletV.F = (1 + tanh(1 * (trays([top:topdown:bot]).OutletV.P - trays([top:topdown:bot]).InletL.P)/"Pa"))/2 * trays([top:topdown:bot]).Ah/trays([top:topdown:bot]).vV * sqrt(2*(trays([top:topdown:bot]).OutletV.P - trays([top:topdown:bot]).InletL.P + 1e-8 * "atm") / (trays([top:topdown:bot]).alfa*trays([top:topdown:bot]).rhoV)); 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; end #*---------------------------------------------------------------------- * Model of a distillation column containing: * - NTrays like tray; * - a kettle reboiler; * - dymamic condenser; * - a splitter which separate reflux and distillate; * - a pump in reflux stream; *---------------------------------------------------------------------*# Model Distillation_kettle_cond PARAMETERS ext PP as CalcObject; ext 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"); SET top = (NTrays-1)*(1-topdown)/2+1; bot = NTrays/top; VARIABLES trays(NTrays) as tray; cond as condenser; reb as reboiler; sptop as splitter; pump1 as pump; EQUATIONS if (reb.OutletV.P > reb.InletL.P) then "Pressure Drop through the reboiler" reb.OutletV.F = trays(bot).Ah/reb.vV * sqrt((reb.OutletV.P - trays(bot).OutletL.P) / (trays(bot).beta*reb.rhoV) ); else "No flow in reboiler" reb.OutletV.F = 0.0 * "mol/s"; end "Pressure Drop through the tray" trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/"Pa"))/2 * trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P - cond.OutletL.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV)); trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 * (trays([top+topdown:topdown:bot]).OutletV.P - trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 * trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV * sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P - trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * "atm") / (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV)); 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; end #* ------------------------------------------------------------------- * Distillation Column model with: * * - NTrays like tray; * - a vessel in the bottom of column; * - a splitter who separate the bottom product and the stream to reboiler; * - steady state reboiler (thermosyphon); * - a steady state condenser with subcooling; * - a vessel drum (layed cilinder); * - a splitter which separate reflux and distillate; * - a pump in reflux stream. * * ------------------------------------------------------------------*# Model Distillation_thermosyphon_subcooling PARAMETERS ext PP as CalcObject; ext 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"); SET top = (NTrays-1)*(1-topdown)/2+1; bot = NTrays/top; VARIABLES trays(NTrays) as tray; cond as condenserSteady; reb as reboilerSteady; tbottom as tank; ttop as tank_cylindrical; spbottom as splitter; sptop as splitter; pump1 as pump; EQUATIONS "Pressure Drop through the tray" trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/"Pa"))/2 * trays(top).Ah/trays(top).vV /2* sqrt(2*(trays(top).OutletV.P - ttop.Outlet.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV)); trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 * (trays([top+topdown:topdown:bot]).OutletV.P - trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 * trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV /2* sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P - trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * "atm") / (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV)); 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 ttop.Inlet; ttop.Outlet 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 tbottom.Inlet; tbottom.Outlet to spbottom.Inlet; spbottom.Outlet2 to reb.InletL; end #* ------------------------------------------------------------------- * Distillation Column model with: * * - NTrays like tray; * - a vessel in the bottom of column; * - a splitter who separate the bottom product and the stream to reboiler; * - steady state reboiler (thermosyphon); * - a dynamic condenser without subcooling; * - a splitter which separate reflux and distillate; * - a pump in reflux stream. * * ------------------------------------------------------------------*# Model Distillation_thermosyphon_cond PARAMETERS ext PP as CalcObject; ext 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"); SET top = (NTrays-1)*(1-topdown)/2+1; bot = NTrays/top; VARIABLES trays(NTrays) as tray; cond as condenser; reb as reboilerSteady; tbottom as tank; spbottom as splitter; sptop as splitter; pump1 as pump; EQUATIONS if (reb.OutletV.P > reb.InletL.P) then "Pressure Drop through the reboiler" reb.OutletV.F = trays(bot).Ah/reb.vV * sqrt((reb.OutletV.P - trays(bot).OutletL.P) / (trays(bot).beta*reb.rhoV) ); else "No flow in reboiler" reb.OutletV.F = 0.0 * "mol/s"; end "Pressure Drop through the tray" trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/"Pa"))/2 * trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P - cond.OutletL.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV)); trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 * (trays([top+topdown:topdown:bot]).OutletV.P - trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 * trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV * sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P - trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * "atm") / (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV)); 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 tbottom.Inlet; tbottom.Outlet to spbottom.Inlet; spbottom.Outlet2 to reb.InletL; end #* ------------------------------------------------------------------- * Distillation Column model with: * * - NTrays like tray; * - a kettle reboiler; * - a steady state condenser with subcooling; * - a vessel drum (layed cilinder); * - a splitter which separate reflux and distillate; * - a pump in reflux stream. * * ------------------------------------------------------------------*# Model Distillation_kettle_subcooling PARAMETERS ext PP as CalcObject; ext 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"); SET top = (NTrays-1)*(1-topdown)/2+1; bot = NTrays/top; VARIABLES trays(NTrays) as tray; cond as condenserSteady; reb as reboiler; ttop as tank_cylindrical; sptop as splitter; pump1 as pump; EQUATIONS if (reb.OutletV.P > reb.InletL.P) then "Pressure Drop through the reboiler" reb.OutletV.F = trays(bot).Ah/reb.vV * sqrt((reb.OutletV.P - trays(bot).OutletL.P) / (trays(bot).beta*reb.rhoV) ); else "No flow in reboiler" reb.OutletV.F = 0.0 * "mol/s"; end "Pressure Drop through the tray" trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/"Pa"))/2 * trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P - ttop.Outlet.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV)); trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 * (trays([top+topdown:topdown:bot]).OutletV.P - trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 * trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV * sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P - trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * "atm") / (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV)); 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 ttop.Inlet; ttop.Outlet 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; end #*---------------------------------------------------------------------- * Model of a rectifier containing: * - NTrays like tray; * - dymamic condenser without subcooling; * - a splitter which separate reflux and distillate; * - a pump in reflux stream; *---------------------------------------------------------------------*# Model Rectifier PARAMETERS ext PP as CalcObject; ext 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"); SET top = (NTrays-1)*(1-topdown)/2+1; bot = NTrays/top; VARIABLES trays(NTrays) as tray; cond as condenser; sptop as splitter; pump1 as pump; EQUATIONS "Pressure Drop through the tray" trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/"Pa"))/2 * trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P - cond.OutletL.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV)); trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 * (trays([top+topdown:topdown:bot]).OutletV.P - trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 * trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV * sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P - trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * "atm") / (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV)); CONNECTIONS #vapor 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; end #* ------------------------------------------------------------------- * Rectifier Column with: * * - NTrays like tray; * - a steady state condenser with subcooling; * - a vessel drum (layed cilinder); * - a splitter which separate reflux and distillate; * - a pump in reflux stream. * * ------------------------------------------------------------------*# Model Rectifier_subcooling PARAMETERS ext PP as CalcObject; ext 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"); SET top = (NTrays-1)*(1-topdown)/2+1; bot = NTrays/top; VARIABLES trays(NTrays) as tray; cond as condenserSteady; ttop as tank_cylindrical; sptop as splitter; pump1 as pump; EQUATIONS "Pressure Drop through the tray" trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/"Pa"))/2 * trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P - ttop.Outlet.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV)); trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 * (trays([top+topdown:topdown:bot]).OutletV.P - trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 * trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV * sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P - trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * "atm") / (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV)); CONNECTIONS #vapor trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV; trays(top).OutletV to cond.InletV; #liquid cond.OutletL to ttop.Inlet; ttop.Outlet 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; end #*---------------------------------------------------------------------- * Model of a Refluxed Stripping column containing: * - NTrays like tray; * - dymamic condenser without subcooling; * - a splitter which separate reflux and distillate; * - a pump in reflux stream; *---------------------------------------------------------------------*# Model Refluxed_Stripping PARAMETERS ext PP as CalcObject; ext 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"); SET top = (NTrays-1)*(1-topdown)/2+1; bot = NTrays/top; VARIABLES trays(NTrays) as tray; cond as condenser; sptop as splitter; pump1 as pump; EQUATIONS "Pressure Drop through the tray" trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/"Pa"))/2 * trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P - cond.OutletL.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV)); trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 * (trays([top+topdown:topdown:bot]).OutletV.P - trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 * trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV * sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P - trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * "atm") / (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV)); CONNECTIONS #vapor 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; end #* ------------------------------------------------------------------- * Refluxed Stripping Column with: * * - NTrays like tray; * - a steady state condenser (with subcooling); * - a vessel drum (layed cilinder); * - a splitter which separate reflux and distillate; * - a pump in reflux stream. * * ------------------------------------------------------------------*# Model Refluxed_Stripping_subcooling PARAMETERS ext PP as CalcObject; ext 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"); SET top = (NTrays-1)*(1-topdown)/2+1; bot = NTrays/top; VARIABLES trays(NTrays) as tray; cond as condenserSteady; ttop as tank_cylindrical; sptop as splitter; pump1 as pump; EQUATIONS "Pressure Drop through the tray" trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/"Pa"))/2 * trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P - ttop.Outlet.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV)); trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 * (trays([top+topdown:topdown:bot]).OutletV.P - trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 * trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV * sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P - trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * "atm") / (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV)); CONNECTIONS #vapor trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV; trays(top).OutletV to cond.InletV; #liquid cond.OutletL to ttop.Inlet; ttop.Outlet 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; end #*---------------------------------------------------------------------- * Model of a Refluxed Absorption column containing: * - NTrays like tray; * - dymamic condenser without subcooling; * - a splitter which separate reflux and distillate; * - a pump in reflux stream; *---------------------------------------------------------------------*# Model Refluxed_Absorption PARAMETERS ext PP as CalcObject; ext 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"); SET top = (NTrays-1)*(1-topdown)/2+1; bot = NTrays/top; VARIABLES trays(NTrays) as tray; cond as condenser; sptop as splitter; pump1 as pump; EQUATIONS "Pressure Drop through the tray" trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/"Pa"))/2 * trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P - cond.OutletL.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV)); trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 * (trays([top+topdown:topdown:bot]).OutletV.P - trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 * trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV * sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P - trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * "atm") / (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV)); CONNECTIONS #vapor trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV; trays(top).OutletV to cond.InletV; #liquid cond.OutletL to cond.InletV; 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; end #* ------------------------------------------------------------------- * Refluxed Absorption Column with: * * - NTrays like tray; * - a steady state condenser (with subcooling); * - a vessel drum (layed cilinder); * - a splitter which separate reflux and distillate; * - a pump in reflux stream. * * ------------------------------------------------------------------*# Model Refluxed_Absorption_subcooling PARAMETERS ext PP as CalcObject; ext 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"); SET top = (NTrays-1)*(1-topdown)/2+1; bot = NTrays/top; VARIABLES trays(NTrays) as tray; cond as condenserSteady; ttop as tank_cylindrical; sptop as splitter; pump1 as pump; EQUATIONS "Pressure Drop through the tray" trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/"Pa"))/2 * trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P - ttop.Outlet.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV)); trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 * (trays([top+topdown:topdown:bot]).OutletV.P - trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 * trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV * sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P - trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * "atm") / (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV)); CONNECTIONS #vapor trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV; trays(top).OutletV to cond.InletV; #liquid cond.OutletL to ttop.Inlet; ttop.Outlet 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; end #* ------------------------------------------------------------------- * Reboiled Stripping Column model with: * * - NTrays like tray; * - a kettle reboiler; * * ------------------------------------------------------------------*# Model Reboiled_Stripping_kettle PARAMETERS ext PP as CalcObject; ext 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"); SET top = (NTrays-1)*(1-topdown)/2+1; bot = NTrays/top; VARIABLES trays(NTrays) as tray; reb as reboiler; EQUATIONS if (reb.OutletV.P > reb.InletL.P) then "Pressure Drop through the tray" reb.OutletV.F = trays(bot).Ah/reb.vV * sqrt((reb.OutletV.P - trays(bot).OutletL.P) / (trays(bot).beta*reb.rhoV) ); else "Prato selado" reb.OutletV.F = 0.0 * "mol/s"; end "Pressure Drop through the tray" trays([top:topdown:bot]).OutletV.F = (1 + tanh(1 * (trays([top:topdown:bot]).OutletV.P - trays([top:topdown:bot]).InletL.P)/"Pa"))/2 * trays([top:topdown:bot]).Ah/trays([top:topdown:bot]).vV * sqrt(2*(trays([top:topdown:bot]).OutletV.P - trays([top:topdown:bot]).InletL.P + 1e-8 * "atm") / (trays([top:topdown:bot]).alfa*trays([top:topdown:bot]).rhoV)); CONNECTIONS #vapor reb.OutletV to trays(bot).InletV; trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV; #liquid trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL; trays(bot).OutletL to reb.InletL; end #* ------------------------------------------------------------------- * Reboiled Stripping Column model with: * * - NTrays like tray; * - a vessel in the bottom of column; * - a splitter which separate the bottom product and the stream to reboiler; * - steady state reboiler (thermosyphon); * * ------------------------------------------------------------------*# Model Reboiled_Stripping_thermosyphon PARAMETERS ext PP as CalcObject; ext 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"); SET top = (NTrays-1)*(1-topdown)/2+1; bot = NTrays/top; VARIABLES trays(NTrays) as tray; reb as reboilerSteady; spbottom as splitter; tbottom as tank; EQUATIONS if (reb.OutletV.P > reb.InletL.P) then "Pressure Drop through the tray" reb.OutletV.F = trays(bot).Ah/reb.vV * sqrt((reb.OutletV.P - trays(bot).OutletL.P) / (trays(bot).beta*reb.rhoV) ); else "Prato selado" reb.OutletV.F = 0.0 * "mol/s"; end "Pressure Drop through the tray" trays([top:topdown:bot]).OutletV.F = (1 + tanh(1 * (trays([top:topdown:bot]).OutletV.P - trays([top:topdown:bot]).InletL.P)/"Pa"))/2 * trays([top:topdown:bot]).Ah/trays([top:topdown:bot]).vV * sqrt(2*(trays([top:topdown:bot]).OutletV.P - trays([top:topdown:bot]).InletL.P + 1e-8 * "atm") / (trays([top:topdown:bot]).alfa*trays([top:topdown:bot]).rhoV)); CONNECTIONS #vapor reb.OutletV to trays(bot).InletV; trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV; #liquid trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL; trays(bot).OutletL to tbottom.Inlet; tbottom.Outlet to spbottom.Inlet; spbottom.Outlet2 to reb.InletL; end #* ------------------------------------------------------------------- * Reboiled Absorption Column model with: * * - NTrays like tray; * - a kettle reboiler; * * ------------------------------------------------------------------*# Model Reboiled_Absorption_kettle PARAMETERS ext PP as CalcObject; ext 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"); SET top = (NTrays-1)*(1-topdown)/2+1; bot = NTrays/top; VARIABLES trays(NTrays) as tray; reb as reboiler; EQUATIONS if (reb.OutletV.P > reb.InletL.P) then "Pressure Drop through the tray" reb.OutletV.F = trays(bot).Ah/reb.vV * sqrt((reb.OutletV.P - trays(bot).OutletL.P) / (trays(bot).beta*reb.rhoV) ); else "Prato selado" reb.OutletV.F = 0.0 * "mol/s"; end "Pressure Drop through the tray" trays([top:topdown:bot]).OutletV.F = (1 + tanh(1 * (trays([top:topdown:bot]).OutletV.P - trays([top:topdown:bot]).InletL.P)/"Pa"))/2 * trays([top:topdown:bot]).Ah/trays([top:topdown:bot]).vV * sqrt(2*(trays([top:topdown:bot]).OutletV.P - trays([top:topdown:bot]).InletL.P + 1e-8 * "atm") / (trays([top:topdown:bot]).alfa*trays([top:topdown:bot]).rhoV)); CONNECTIONS #vapor reb.OutletV to trays(bot).InletV; trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV; #liquid trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL; trays(bot).OutletL to reb.InletL; end #* ------------------------------------------------------------------- * Reboiled Absorption Column model with: * * - NTrays like tray; * - a vessel in the bottom of column; * - a splitter which separate the bottom product and the stream to reboiler; * - steady state reboiler (thermosyphon); * * ------------------------------------------------------------------*# Model Reboiled_Absorption_thermosyphon PARAMETERS ext PP as CalcObject; ext 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"); SET top = (NTrays-1)*(1-topdown)/2+1; bot = NTrays/top; VARIABLES trays(NTrays) as tray; reb as reboilerSteady; spbottom as splitter; tbottom as tank; EQUATIONS if (reb.OutletV.P > reb.InletL.P) then "Pressure Drop through the tray" reb.OutletV.F = trays(bot).Ah/reb.vV * sqrt((reb.OutletV.P - trays(bot).OutletL.P) / (trays(bot).beta*reb.rhoV) ); else "Prato selado" reb.OutletV.F = 0.0 * "mol/s"; end "Pressure Drop through the tray" trays([top:topdown:bot]).OutletV.F = (1 + tanh(1 * (trays([top:topdown:bot]).OutletV.P - trays([top:topdown:bot]).InletL.P)/"Pa"))/2 * trays([top:topdown:bot]).Ah/trays([top:topdown:bot]).vV * sqrt(2*(trays([top:topdown:bot]).OutletV.P - trays([top:topdown:bot]).InletL.P + 1e-8 * "atm") / (trays([top:topdown:bot]).alfa*trays([top:topdown:bot]).rhoV)); CONNECTIONS #vapor reb.OutletV to trays(bot).InletV; trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV; #liquid trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL; trays(bot).OutletL to tbottom.Inlet; tbottom.Outlet to spbottom.Inlet; spbottom.Outlet2 to reb.InletL; end # Reactive Distillation!! Model ReactiveDistillation PARAMETERS ext PP as CalcObject; ext NComp as Integer; NTrays as Integer(Brief="Number of trays", Default=2); VARIABLES trays(NTrays) as trayReact; cond as condenserReact; reb as reboilerReact; sp as splitter; p as pump; EQUATIONS if ( reb.OutletV.P > 1 * "atm" ) then "Pressure Drop through the tray" reb.OutletV.F = trays(1).Ah/reb.vV * sqrt((reb.OutletV.P - 1*"atm") / (0.15*reb.rhoV) ); else "Prato selado" reb.OutletV.F = 0.0 * "mol/s"; end CONNECTIONS #vapor reb.OutletV to trays([NTrays]).InletV; trays([2:NTrays]).OutletV to trays([1:NTrays-1]).InletV; trays(1).OutletV to cond.InletV; #liquid cond.OutletL to sp.Inlet; sp.Outlet2 to p.Inlet; p.Outlet to trays(1).InletL; trays([1:NTrays-1]).OutletL to trays([2:NTrays]).InletL; trays(NTrays).OutletL to reb.InletL; end