#*---------------------------------------------- * FlowSheet generated automaticaly by EMSO-GUI *----------------------------------------------*# using "streams"; using "stage_separators/flash"; using "controllers/PIDIncr"; using "pressure_changers/valve"; FlowSheet Sample_flash_PIDincr 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 = 1026.32 * 'kW'; INITIAL GUESS DEVICES F101 as flash; SET F101.Orientation = "vertical"; F101.Heads = "flat"; F101.Diameter = 3.1 * 'm'; F101.Lenght = 6 * 'm'; F101.Levelpercent_Initial = 0.70; F101.Temperature_Initial = 383 * 'K'; F101.Composition_Initial(1) = 0.3; F101.Composition_Initial(2) = 0.4; F101.Composition_Initial(3) = 0.3; SPECIFY 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 LiquidProduct as sink; SET SPECIFY INITIAL GUESS DEVICES PIDIncr_PC as PIDIncr; SET PIDIncr_PC.PID_Select = "Parallel_AWBT"; PIDIncr_PC.Action = "Direct"; PIDIncr_PC.Mode = "Automatic"; PIDIncr_PC.Clip = "Clipped"; PIDIncr_PC.alpha = 1; PIDIncr_PC.beta = 1; PIDIncr_PC.bias = 0.5; PIDIncr_PC.derivTime = 18 * 's'; PIDIncr_PC.intTime = 72 * 's'; PIDIncr_PC.gain = 0.9275; PIDIncr_PC.gamma = 1; PIDIncr_PC.tau = 1 * 's'; PIDIncr_PC.tauSet = 1 * 's'; PIDIncr_PC.MinInput = 0; PIDIncr_PC.MaxInput = 3; PIDIncr_PC.MinOutput = 0; PIDIncr_PC.MaxOutput = 1; SPECIFY PIDIncr_PC.SetPoint = 0.6; INITIAL GUESS DEVICES PIDIncr_LC as PIDIncr; SET PIDIncr_LC.PID_Select = "Parallel_AWBT"; PIDIncr_LC.Action = "Direct"; PIDIncr_LC.Mode = "Automatic"; PIDIncr_LC.Clip = "Clipped"; PIDIncr_LC.alpha = 1; PIDIncr_LC.beta = 1; PIDIncr_LC.bias = 0.5; PIDIncr_LC.derivTime = 18 * 's'; PIDIncr_LC.intTime = 72 * 's'; PIDIncr_LC.gain = 0.9275; PIDIncr_LC.gamma = 1; PIDIncr_LC.tau = 1 * 's'; PIDIncr_LC.tauSet = 1 * 's'; PIDIncr_LC.MinInput = 0; PIDIncr_LC.MaxInput = 1; PIDIncr_LC.MinOutput = 0; PIDIncr_LC.MaxOutput = 1; SPECIFY PIDIncr_LC.SetPoint = 0.7; INITIAL GUESS DEVICES valve_liquid as valve_flow; SET valve_liquid.MinFlow = 0 * 'kmol/h'; valve_liquid.MaxFlow = 500 * 'kmol/h'; SPECIFY INITIAL GUESS DEVICES valve_vapour as valve_flow; SET valve_vapour.MinFlow = 0 * 'kmol/h'; valve_vapour.MaxFlow = 500 * 'kmol/h'; SPECIFY INITIAL GUESS CONNECTIONS HeatToFlash.OutletQ to F101.InletQ; Feed.Outlet to F101.Inlet; F101.PI to PIDIncr_PC.Input; F101.LI to PIDIncr_LC.Input; PIDIncr_LC.Output to valve_liquid.FlowFraction; valve_liquid.Outlet to LiquidProduct.Inlet; valve_vapour.Outlet to VaporProduct.Inlet; PIDIncr_PC.Output to valve_vapour.FlowFraction; F101.OutletLiquid to valve_liquid.Inlet; F101.OutletVapour to valve_vapour.Inlet; OPTIONS Dynamic = true; TimeStep = 0.2; TimeEnd = 1; TimeUnit = 'h'; Integration = "original"; NLASolver( File = "sundials", RelativeAccuracy = 1e-2, AbsoluteAccuracy = 1e-3, MaxIterations = 100 ); DAESolver( File = "sundials", RelativeAccuracy = 1e-2, AbsoluteAccuracy = 1e-6, EventAccuracy = 1e-2 ); end