[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 425 2007-12-08 17:56:30Z 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 |
---|
| 53 | leves = fl.OutletV.z(1)+fl.OutletV.z(2); |
---|
| 54 | |
---|
| 55 | SPECIFY |
---|
[184] | 56 | s1.Outlet.F = 496.3 * 'kmol/h'; |
---|
| 57 | s1.Outlet.T = 338 * 'K'; |
---|
| 58 | s1.Outlet.P = 507.1 * 'kPa'; |
---|
| 59 | #s1.Outlet.v = 0.1380; |
---|
| 60 | s1.Outlet.z = [0.2379,0.3082,0.09959,0.1373,0.08872,0.1283]; |
---|
[22] | 61 | |
---|
[184] | 62 | fl.OutletL.P = 2.5 * 'atm'; |
---|
[22] | 63 | |
---|
[313] | 64 | #Q.OutletQ.Q = 0 * 'kJ/h'; |
---|
[184] | 65 | fl.OutletL.T = 315.06 * 'K'; |
---|
[22] | 66 | |
---|
| 67 | OPTIONS |
---|
[184] | 68 | Dynamic = false; |
---|
[22] | 69 | end |
---|
| 70 | |
---|
| 71 | #* |
---|
| 72 | * Maximização da pureza dos leves no topo do flash. |
---|
| 73 | * Achou : 0.83 frente a 0.79 da simulação do FlowSheet |
---|
| 74 | *# |
---|
| 75 | Optimization FlashOpt1 as FlashSteadyTest |
---|
| 76 | MAXIMIZE |
---|
| 77 | leves; |
---|
| 78 | |
---|
| 79 | FREE |
---|
| 80 | fl.OutletL.T; |
---|
[71] | 81 | #fl.OutletL.P; |
---|
[22] | 82 | |
---|
| 83 | EQUATIONS |
---|
[184] | 84 | fl.OutletL.T < 320 * 'K'; |
---|
| 85 | fl.OutletL.T > 300 * 'K'; |
---|
[22] | 86 | |
---|
| 87 | OPTIONS |
---|
[184] | 88 | Dynamic = false; |
---|
| 89 | NLPSolveNLA = false; |
---|
[425] | 90 | NLPSolver(#File = "complex", |
---|
| 91 | #File = "optpp_emso", |
---|
| 92 | File = "ipopt_emso", |
---|
[258] | 93 | RelativeAccuracy = 1e-6); |
---|
[22] | 94 | end |
---|
| 95 | |
---|