#*------------------------------------------------------------------- * 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. * *-------------------------------------------------------------------- * Sample file for optimization *-------------------------------------------------------------------- * * This sample file needs VRTherm (www.vrtech.com.br) to run. * *---------------------------------------------------------------------- * Author: Rafael de Pelegrini Soares * $Id: flash_opt.mso 425 2007-12-08 17:56:30Z arge $ *--------------------------------------------------------------------*# using "stage_separators/flash"; # exemplo baseado nos dados do artigo do Gani 1985. FlowSheet FlashSteadyTest PARAMETERS PP as Plugin(Brief="Physical Properties",Type="PP",Components = ["1,3-butadiene", "isobutene", "n-pentane", "1-pentene", "1-hexene", "benzene"], LiquidModel = "PR", VapourModel = "PR"); NComp as Integer; VARIABLES Q as energy_source (Brief="Heat supplied"); leves as fraction; SET NComp = PP.NumberOfComponents; DEVICES fl as flash_steady; s1 as source; CONNECTIONS s1.Outlet to fl.Inlet; Q.OutletQ to fl.InletQ; EQUATIONS leves = fl.OutletV.z(1)+fl.OutletV.z(2); SPECIFY s1.Outlet.F = 496.3 * 'kmol/h'; s1.Outlet.T = 338 * 'K'; s1.Outlet.P = 507.1 * 'kPa'; #s1.Outlet.v = 0.1380; s1.Outlet.z = [0.2379,0.3082,0.09959,0.1373,0.08872,0.1283]; fl.OutletL.P = 2.5 * 'atm'; #Q.OutletQ.Q = 0 * 'kJ/h'; fl.OutletL.T = 315.06 * 'K'; OPTIONS Dynamic = false; end #* * Maximização da pureza dos leves no topo do flash. * Achou : 0.83 frente a 0.79 da simulação do FlowSheet *# Optimization FlashOpt1 as FlashSteadyTest MAXIMIZE leves; FREE fl.OutletL.T; #fl.OutletL.P; EQUATIONS fl.OutletL.T < 320 * 'K'; fl.OutletL.T > 300 * 'K'; OPTIONS Dynamic = false; NLPSolveNLA = false; NLPSolver(#File = "complex", #File = "optpp_emso", File = "ipopt_emso", RelativeAccuracy = 1e-6); end