#*------------------------------------------------------------------- * EMSO Model Library (EML) Copyright (C) 2004 - 2007 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 - 2007 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 84 2006-12-08 20:37:22Z paula $ *------------------------------------------------------------------*# using "stage_separators/flash"; using "controllers/PIDIncr"; FlowSheet Flash_Dynamic PARAMETERS PP as CalcObject(Brief="Physical Properties",File="vrpp"); NComp as Integer; #Valores utilizados na normalização do nível e da pressão do flash #Vazões mínimas e máximas das correntes de vapor e líquido FVMin as flow_mol; FVMax as flow_mol; FLMax as flow_mol; FLMin as flow_mol; #Pressão máxima e mínima PMin as pressure; PMax as pressure; #Nível máximo e mínimo LMax as length; LMin as length; VARIABLES #Nível e Pressão normalizados L_ad as Real; P_ad as Real; Q as heat_rate (Brief="Heat supplied"); DEVICES #Controlador para o nível pidL as PIDIncr_Parallel_AWBT; #Controlador para a pressão pidP as PIDIncr_Parallel_AWBT; fl as flash; s1 as streamTP; SET PP.Components = ["n-butane", "benzene", "n-octane"]; PP.LiquidModel = "PR"; PP.VapourModel = "PR"; NComp = PP.NumberOfComponents; #Parâmetros do modelo de flash fl.V = 1 * "m^3"; fl.Across = 0.5* "m^2"; #Valores máximos e mínimos para as normalizações PMax=2.36 *"atm"; PMin=0 *"atm"; LMax=2 *"m"; LMin=0 *"m"; FVMax=300*"kmol/h"; FVMin=0*"kmol/h"; FLMax=692.7*"kmol/h"; FLMin=0*"kmol/h"; CONNECTIONS s1 to fl.Inlet; Q to fl.Q; SPECIFY Q = 1026.32 * "kJ/s"; #Parâmetros do controlador de nível pidL.Parameters.bias=0.5; pidL.Parameters.gain=1.1776; pidL.Parameters.derivTime=19*"s"; pidL.Parameters.intTime=76*"s"; pidL.Parameters.tau=1*"s"; pidL.Parameters.tauSet=1*"s"; pidL.Parameters.alpha =1; pidL.Parameters.beta =1; pidL.Parameters.gamma =1; #Opções do controlador de nível pidL.Options.autoMan=0; pidL.Options.clip=1; pidL.Ports.setPoint=0.5; pidL.Options.action =-1; #Parâmetros do controlador de pressão pidP.Parameters.bias=0.5; pidP.Parameters.gain=0.9275; pidP.Parameters.derivTime=18*"s"; pidP.Parameters.intTime=72*"s"; pidP.Parameters.tau=1*"s"; pidP.Parameters.tauSet=1*"s"; pidP.Parameters.alpha =1; pidP.Parameters.beta =1; pidP.Parameters.gamma =1; #Opções do controlador de pressão pidP.Options.autoMan=0; pidP.Options.clip=1; pidP.Options.action =-1; EQUATIONS #Corrente de entrada do flash s1.z = [0.3, 0.3, 0.4]; s1.P = 5 * "atm"; #Distúrbio regulatório if time<2000 then s1.T = 338 * "K"; s1.F = 496.3 * "kmol/h"; else s1.T = 360 * "K"; s1.F = 450 * "kmol/h"; end #Normalização das variáveis controladas #Variáveis controladas: fl.Level e fl.OutletV.P L_ad*(LMax-LMin)=fl.Level-LMin; P_ad*(PMax-PMin)=fl.OutletV.P-PMin; #Conexão das entradas dos pid´s pidL.Ports.input=L_ad; pidP.Ports.input=P_ad; #Distúrbio servo if time<7200 then pidP.Ports.setPoint=0.501822; else pidP.Ports.setPoint=0.8474576; end #Conexão entre os controladores e o flash #Variáveis manipuladas: fl.OutletV.F(controle de pressão) e fl.OutletL.F(nível) fl.OutletV.F = pidP.Ports.output*(FVMax-FVMin)+FVMin; fl.OutletL.F = pidL.Ports.output*(FLMax-FLMin)+FLMin; INITIAL fl.OutletL.T = 340 *"K"; fl.Level = 1* "m"; fl.OutletL.z(1) = 0.1; fl.OutletL.z(2) = 0.1; OPTIONS relativeAccuracy = 1e-6; #time = [0:100:7000 7000:0.10:8150 8150:100:10000]; time = [0:100:10000]; end