#*------------------------------------------------------------------- * EMSO Model Library (EML) Copyright (C) 2004 - 2008 ALSOC. * * This LIBRARY is free software; you can distribute it and/or modify * it under the therms of the ALSOC FREE LICENSE as available at * http://www.enq.ufrgs.br/alsoc. * * EMSO Copyright (C) 2004 - 2008 ALSOC, original code * from http://www.rps.eng.br Copyright (C) 2002-2004. * All rights reserved. * * EMSO is distributed under the therms of the ALSOC LICENSE as * available at http://www.enq.ufrgs.br/alsoc. * *-------------------------------------------------------------------- * Flash separator sample file. *-------------------------------------------------------------------- * * This sample file needs VRTherm (www.vrtech.com.br) to run. * *-------------------------------------------------------------------- * Author: Rafael de Pelegrini Soares * $Id: Sample_flash_pid.mso 941 2011-07-15 18:44:52Z mamuller $ *------------------------------------------------------------------*# using "stage_separators/flash"; using "pressure_changers/valve.mso"; using "controllers/PIDIncr"; FlowSheet Flash_Dynamic PARAMETERS PP as Plugin(Brief="Physical Properties",Type="PP", Components = ["n-butane", "benzene", "n-octane"], LiquidModel = "PR", VapourModel = "PR"); NComp as Integer; VARIABLES Q as energy_source (Brief="Heat supplied"); DEVICES pidL as PIDIncr; #Level controller pidP as PIDIncr; #Pressure controller fl as flash; s1 as source; valve_top as valve_flow; valve_bot as valve_flow; SET NComp = PP.NumberOfComponents; pidL.PID_Select = "Parallel_AWBT"; pidP.PID_Select = "Parallel_AWBT"; #Flash model parameters fl.Lenght = 10 * 'm'; fl.Diameter = 1 * 'm'; fl.Orientation = "vertical"; #Maximum and minimum values pidP.MaxInput=2.36; pidP.MinInput=0; pidL.MaxInput=2; pidL.MinInput=0; valve_top.MaxFlow=300*'kmol/h'; valve_top.MinFlow=0*'kmol/h'; valve_bot.MaxFlow=692.7*'kmol/h'; valve_bot.MinFlow=0*'kmol/h'; CONNECTIONS s1.Outlet to fl.Inlet; Q.OutletQ to fl.InletQ; fl.OutletLiquid to valve_bot.Inlet; fl.OutletVapour to valve_top.Inlet; fl.LI to pidL.Input; fl.PI to pidP.Input; pidP.Output to valve_top.FlowFraction; pidL.Output to valve_bot.FlowFraction; SET #Level controller configuration pidL.bias=0.5; pidL.gain=1.1776; pidL.derivTime=19*'s'; pidL.intTime=76*'s'; pidL.tau=1*'s'; pidL.tauSet=1*'s'; pidL.alpha =1; pidL.beta =1; pidL.gamma =1; pidL.Mode = "Automatic"; pidL.Clip = "Clipped"; pidL.Action = "Direct"; #Pressure controller parameters pidP.bias=0.5; pidP.gain=0.9275; pidP.derivTime=18*'s'; pidP.intTime=72*'s'; pidP.tau=1*'s'; pidP.tauSet=1*'s'; pidP.alpha =1; pidP.beta =1; pidP.gamma =1; pidP.Mode = "Automatic"; pidP.Clip = "Clipped"; pidP.Action = "Direct"; #Initial conditions fl.Levelpercent_Initial = 0.5; fl.Temperature_Initial = 340 * 'K'; fl.Composition_Initial = [0.1, 0.1, 0.8]; SPECIFY Q.OutletQ = 1026.32 * 'kJ/s'; #Level controller parameters pidL.SetPoint=0.5; EQUATIONS #Feed stream s1.Composition = [0.3, 0.3, 0.4]; s1.P = 5 * 'atm'; #Disturbance if time < 0.5*'h' then s1.T = 338 * 'K'; s1.F = 496.3 * 'kmol/h'; else s1.T = 360 * 'K'; s1.F = 450 * 'kmol/h'; end #Setpoint change if time < 2*'h' then pidP.SetPoint=1; else pidP.SetPoint=2; end OPTIONS TimeStep = 0.02; TimeEnd = 3; TimeUnit = 'h'; DAESolver(File="dassl"); end