#*---------------------------------------------- * FlowSheet generated automaticaly by EMSO-GUI *----------------------------------------------*# using "streams"; using "pressure_changers/valve"; using "controllers/PIDs"; using "stage_separators/tank"; FlowSheet Sample_TankVL_PID PARAMETERS PP as Plugin(Brief="Physical Properties", Type="PP", Components = ["n-butane","benzene","n-octane"], LiquidModel = "SRK", VapourModel = "SRK" ); NComp as Integer; SET NComp = PP.NumberOfComponents; DEVICES Feed as simple_source; SET SPECIFY Feed.MolarComposition(1) = 0.3; Feed.MolarComposition(2) = 0.3; Feed.MolarComposition(3) = 0.4; Feed.F = 500 * 'kmol/h'; Feed.T = 338 * 'K'; Feed.P = 5 * 'atm'; INITIAL GUESS DEVICES VaporProduct as sink; SET SPECIFY INITIAL GUESS DEVICES valve_liquid as valve_flow; SET SPECIFY INITIAL GUESS DEVICES valve_Vapour as valve_flow; SET SPECIFY INITIAL GUESS DEVICES PID_LC as PID; SET PID_LC.PID_Select = "Parallel_AWBT"; PID_LC.Action = "Direct"; PID_LC.Mode = "Automatic"; PID_LC.Clip = "Clipped"; PID_LC.alpha = 1; PID_LC.beta = 1; PID_LC.bias = 0.5; PID_LC.derivTime = 19 * 's'; PID_LC.intTime = 76 * 's'; PID_LC.gain = 1.1776; PID_LC.gamma = 1; PID_LC.tau = 1 * 's'; PID_LC.tauSet = 1 * 's'; PID_LC.MinInput = 0; PID_LC.MaxInput = 2; PID_LC.MinOutput = 0; PID_LC.MaxOutput = 1; SPECIFY PID_LC.SetPoint = 0.7; INITIAL GUESS DEVICES PID_PC as PID; SET PID_PC.PID_Select = "Parallel_AWBT"; PID_PC.Action = "Direct"; PID_PC.Mode = "Automatic"; PID_PC.Clip = "Clipped"; PID_PC.alpha = 1; PID_PC.beta = 1; PID_PC.bias = 0.5; PID_PC.derivTime = 18 * 's'; PID_PC.intTime = 72 * 's'; PID_PC.gain = 0.9275; PID_PC.gamma = 1; PID_PC.tau = 1 * 's'; PID_PC.tauSet = 1 * 's'; PID_PC.MinInput = 0; PID_PC.MaxInput = 4; PID_PC.MinOutput = 0; PID_PC.MaxOutput = 1; SPECIFY PID_PC.SetPoint = 0.6; INITIAL GUESS DEVICES LiquidProduct as simple_sink; SET SPECIFY INITIAL GUESS DEVICES Heat_Duty as energy_source2; SET SPECIFY Heat_Duty.OutletQ = 0 * 'kW'; INITIAL GUESS DEVICES V001 as TankVL; SET V001.Orientation = "horizontal"; V001.Heads = "elliptical"; V001.Diameter = 3.1 * 'm'; V001.Lenght = 6 * 'm'; V001.Levelpercent_Initial = 0.5; V001.Temperature_Initial = 300 * 'K'; SPECIFY INITIAL GUESS CONNECTIONS valve_Vapour.Outlet to VaporProduct.Inlet; PID_LC.Output to valve_liquid.FlowFraction; PID_PC.Output to valve_Vapour.FlowFraction; valve_liquid.Outlet to LiquidProduct.Inlet; Feed.Outlet to V001.Inlet; V001.OutletVapour to valve_Vapour.Inlet; V001.PI to PID_PC.Input; V001.LI to PID_LC.Input; Heat_Duty.OutletQ to V001.InletQ; V001.OutletLiquid to valve_liquid.Inlet; OPTIONS Dynamic = true; TimeStep = 0.2; TimeEnd = 12; TimeUnit = 'h'; Integration = "original"; NLASolver( File = "sundials", RelativeAccuracy = 1e-3, AbsoluteAccuracy = 1e-3, MaxIterations = 100 ); DAESolver( File = "sundials", RelativeAccuracy = 1e-2, AbsoluteAccuracy = 1e-6, EventAccuracy = 1e-2 ); end