#*---------------------------------------------- * FlowSheet generated automaticaly by EMSO-GUI *----------------------------------------------*# using "streams.mso"; using "pressure_changers/valve.mso"; using "controllers/PIDs.mso"; using "stage_separators/tank.mso"; FlowSheet Sample_TankL_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; valve_liquid as valve_flow; PID_LC as PID; LiquidProduct as simple_sink; Heat_Duty as energy_source2; TankL_1 as TankL; CONNECTIONS PID_LC.Output to valve_liquid.FlowFraction; valve_liquid.Outlet to LiquidProduct.Inlet; Feed.Outlet to TankL_1.Inlet; Heat_Duty.OutletQ to TankL_1.InletQ; TankL_1.OutletLiquid to valve_liquid.Inlet; TankL_1.LI to PID_LC.Input; 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 ; TankL_1.Levelpercent_Initial = 0.80 ; 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' ; PID_LC.SetPoint = 0.7 ; Heat_Duty.OutletQ = 0 * 'kW' ; INITIAL GUESS 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