[85] | 1 | #*------------------------------------------------------------------- |
---|
| 2 | * EMSO Model Library (EML) Copyright (C) 2004 - 2007 ALSOC. |
---|
| 3 | * |
---|
| 4 | * This LIBRARY is free software; you can distribute it and/or modify |
---|
| 5 | * it under the therms of the ALSOC FREE LICENSE as available at |
---|
| 6 | * http://www.enq.ufrgs.br/alsoc. |
---|
| 7 | * |
---|
| 8 | * EMSO Copyright (C) 2004 - 2007 ALSOC, original code |
---|
| 9 | * from http://www.rps.eng.br Copyright (C) 2002-2004. |
---|
| 10 | * All rights reserved. |
---|
| 11 | * |
---|
| 12 | * EMSO is distributed under the therms of the ALSOC LICENSE as |
---|
| 13 | * available at http://www.enq.ufrgs.br/alsoc. |
---|
| 14 | * |
---|
| 15 | *-------------------------------------------------------------------- |
---|
| 16 | * Sample file for optimization |
---|
| 17 | *-------------------------------------------------------------------- |
---|
| 18 | * |
---|
| 19 | * This sample file needs VRTherm (www.vrtech.com.br) to run. |
---|
| 20 | * |
---|
| 21 | *---------------------------------------------------------------------- |
---|
| 22 | * Author: Rafael de Pelegrini Soares |
---|
| 23 | * $Id: flash_opt.mso 921 2010-02-28 05:06:16Z arge $ |
---|
| 24 | *--------------------------------------------------------------------*# |
---|
| 25 | |
---|
[22] | 26 | using "stage_separators/flash"; |
---|
| 27 | |
---|
| 28 | # exemplo baseado nos dados do artigo do Gani 1985. |
---|
| 29 | FlowSheet FlashSteadyTest |
---|
| 30 | PARAMETERS |
---|
[215] | 31 | PP as Plugin(Brief="Physical Properties",Type="PP",Components = ["1,3-butadiene", "isobutene", "n-pentane", "1-pentene", "1-hexene", "benzene"], |
---|
| 32 | LiquidModel = "PR", |
---|
| 33 | VapourModel = "PR"); |
---|
[22] | 34 | NComp as Integer; |
---|
| 35 | |
---|
| 36 | VARIABLES |
---|
[312] | 37 | Q as energy_source (Brief="Heat supplied"); |
---|
[22] | 38 | leves as fraction; |
---|
| 39 | |
---|
| 40 | SET |
---|
[215] | 41 | |
---|
[22] | 42 | NComp = PP.NumberOfComponents; |
---|
| 43 | |
---|
| 44 | DEVICES |
---|
[184] | 45 | fl as flash_steady; |
---|
| 46 | s1 as source; |
---|
[22] | 47 | |
---|
| 48 | CONNECTIONS |
---|
[184] | 49 | s1.Outlet to fl.Inlet; |
---|
[313] | 50 | Q.OutletQ to fl.InletQ; |
---|
[22] | 51 | |
---|
| 52 | EQUATIONS |
---|
[921] | 53 | leves = fl.OutletVapour.z(1)+fl.OutletVapour.z(2); |
---|
[22] | 54 | |
---|
| 55 | SPECIFY |
---|
[578] | 56 | s1.F = 496.3 * 'kmol/h'; |
---|
| 57 | s1.T = 338 * 'K'; |
---|
| 58 | s1.P = 507.1 * 'kPa'; |
---|
| 59 | s1.Composition = [0.2379,0.3082,0.09959,0.1373,0.08872,0.1283]; |
---|
[22] | 60 | |
---|
[921] | 61 | fl.OutletLiquid.P = 2.5 * 'atm'; |
---|
[22] | 62 | |
---|
[921] | 63 | #Q.OutletQ = 0 * 'kJ/h'; |
---|
| 64 | fl.OutletLiquid.T = 315.06 * 'K'; |
---|
[22] | 65 | |
---|
| 66 | OPTIONS |
---|
[184] | 67 | Dynamic = false; |
---|
[22] | 68 | end |
---|
| 69 | |
---|
| 70 | #* |
---|
| 71 | * Maximização da pureza dos leves no topo do flash. |
---|
| 72 | * Achou : 0.83 frente a 0.79 da simulação do FlowSheet |
---|
| 73 | *# |
---|
| 74 | Optimization FlashOpt1 as FlashSteadyTest |
---|
| 75 | MAXIMIZE |
---|
| 76 | leves; |
---|
| 77 | |
---|
| 78 | FREE |
---|
[921] | 79 | fl.OutletLiquid.T; |
---|
| 80 | #fl.OutletLiquid.P; |
---|
[22] | 81 | |
---|
| 82 | EQUATIONS |
---|
[921] | 83 | fl.OutletLiquid.T < 320 * 'K'; |
---|
| 84 | fl.OutletLiquid.T > 300 * 'K'; |
---|
[22] | 85 | |
---|
| 86 | OPTIONS |
---|
[184] | 87 | Dynamic = false; |
---|
[921] | 88 | NLPSolveNLA = true; |
---|
[425] | 89 | NLPSolver(#File = "complex", |
---|
| 90 | #File = "optpp_emso", |
---|
| 91 | File = "ipopt_emso", |
---|
[921] | 92 | MaxIterations = 1000, |
---|
[258] | 93 | RelativeAccuracy = 1e-6); |
---|
[22] | 94 | end |
---|
| 95 | |
---|