#*---------------------------------------------- * FlowSheet generated automaticaly by EMSO-GUI *----------------------------------------------*# using "streams"; using "pressure_changers/valve"; using "controllers/PIDs"; using "stage_separators/flash"; FlowSheet Sample_flash_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 HeatToFlash as energy_source; SET SPECIFY HeatToFlash.OutletQ = 1027 * 'kW'; INITIAL GUESS 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 = 1; 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 F101_1 as flash; SET F101_1.Orientation = "vertical"; F101_1.Heads = "flat"; F101_1.Diameter = 3.1 * 'm'; F101_1.Lenght = 6 * 'm'; F101_1.Levelpercent_Initial = 0.80; F101_1.Temperature_Initial = 373 * 'K'; F101_1.Composition_Initial(1) = 0.30; F101_1.Composition_Initial(2) = 0.40; F101_1.Composition_Initial(3) = 0.30; 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 F101_1.Inlet; F101_1.OutletVapour to valve_Vapour.Inlet; HeatToFlash.OutletQ to F101_1.InletQ; F101_1.OutletLiquid to valve_liquid.Inlet; F101_1.LI to PID_LC.Input; F101_1.PI to PID_PC.Input; 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