source: trunk/sample/optimization/flash_opt.mso @ 313

Last change on this file since 313 was 313, checked in by Argimiro Resende Secchi, 16 years ago

Change name of outlet energy stream to OutletQ.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.3 KB
Line 
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 313 2007-07-14 16:45:55Z arge $
24*--------------------------------------------------------------------*#
25
26using "stage_separators/flash";
27
28# exemplo baseado nos dados do artigo do Gani 1985.
29FlowSheet FlashSteadyTest
30        PARAMETERS
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");
34        NComp   as Integer;
35
36        VARIABLES
37        Q       as energy_source (Brief="Heat supplied");
38        leves as fraction;
39       
40        SET
41       
42        NComp = PP.NumberOfComponents;
43       
44        DEVICES
45        fl as flash_steady;
46        s1 as source;
47       
48        CONNECTIONS
49        s1.Outlet to fl.Inlet;
50        Q.OutletQ to fl.InletQ;
51       
52        EQUATIONS
53        leves = fl.OutletV.z(1)+fl.OutletV.z(2);
54       
55        SPECIFY
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];
61       
62        fl.OutletL.P = 2.5 * 'atm';
63
64        #Q.OutletQ.Q = 0 * 'kJ/h';
65        fl.OutletL.T = 315.06 * 'K';
66       
67        OPTIONS
68        Dynamic = false;
69end
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 *#
75Optimization FlashOpt1 as FlashSteadyTest
76        MAXIMIZE
77        leves;
78       
79        FREE
80        fl.OutletL.T;
81        #fl.OutletL.P;
82       
83        EQUATIONS
84        fl.OutletL.T < 320 * 'K';
85        fl.OutletL.T > 300 * 'K';
86
87        OPTIONS
88        Dynamic = false;
89        NLPSolveNLA = false;
90        NLPSolver(File = "complex", #"ipopt_emso",
91                          RelativeAccuracy = 1e-6);
92end
93
Note: See TracBrowser for help on using the repository browser.