source: trunk/sample/stage_separators/sample_columnReact.mso @ 233

Last change on this file since 233 was 213, checked in by Rafael de Pelegrini Soares, 17 years ago

Adapted some samples to the new Plugin mechanism

  • Property svn:keywords set to Id
File size: 6.8 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 reaction column model
17*--------------------------------------------------------------------
18*
19* This sample file needs VRTherm (www.vrtech.com.br) to run.
20*
21*----------------------------------------------------------------------
22* Author: Paula B. Staudt
23* $Id: sample_columnReact.mso 213 2007-03-15 19:40:55Z rafael $
24*--------------------------------------------------------------------*#
25using "controllers/PIDs";
26using "stage_separators/column";
27
28FlowSheet Startup_ReactiveDistillation
29        PARAMETERS
30        PP              as Plugin(Brief="Physical Properties",
31                Type="PP",
32                Components = [ "acetic acid", "ethanol",  "ethyl acetate", "water"],
33                LiquidModel = "UNIFAC",
34                VapourModel = "Ideal",
35                Derivatives = 1
36        );
37        NComp   as Integer;
38       
39        SET
40        NComp = PP.NumberOfComponents;
41       
42        DEVICES
43        col as ReactiveDistillation;
44        feed as source;
45        zero as stream;
46        PIDLreb as PID_Ideal_AW;
47        PIDLcond as PID_Ideal_AW;
48        PIDTreb as PID_Ideal_AW;
49        PIDTcond as PID_Ideal_AW;
50
51        VARIABLES
52        Lreb_ad as Real;
53        Lrebmin as length;
54        Lrebmax as length;
55        Lcond_ad as Real;
56        Lcondmin as length;
57        Lcondmax as length;
58        Treb_ad as Real;
59        Trebmin as temperature;
60        Trebmax as temperature;
61        Tcond_ad as Real;
62        Tcondmin as temperature;
63        Tcondmax as temperature;
64
65        CONNECTIONS
66        feed.Outlet to col.trays(5).Inlet;
67        zero to col.reb.Inlet;
68        zero to col.trays([1:4]).Inlet;
69        zero to col.trays([6:col.NTrays]).Inlet;
70       
71        EQUATIONS
72        "Equações do PID para controle de nível"
73        Lreb_ad*(Lrebmax-Lrebmin)=col.reb.Level-Lrebmin;
74        PIDLreb.Ports.input=Lreb_ad;
75        Lcond_ad*(Lcondmax-Lcondmin)=col.cond.Level-Lcondmin;
76        PIDLcond.Ports.input=Lcond_ad;
77        "Equações do PID para controle de temperatura"
78        Treb_ad*(Trebmax-Trebmin)=col.reb.OutletL.T-Trebmin;
79        PIDTreb.Ports.input=Treb_ad;
80        Tcond_ad*(Tcondmax-Tcondmin)=col.cond.OutletL.T-Tcondmin;
81        PIDTcond.Ports.input=Tcond_ad;
82       
83        col.sp.frac = 0.1;
84
85        col.sp.Outlet1.F = 0.5 * PIDLcond.Ports.output * 'mol/s';
86        col.reb.OutletL.F = 1.736 * PIDLreb.Ports.output * 'mol/s';
87
88        PIDTreb.Ports.setPoint= (367 * 'K' - Trebmin)/(Trebmax-Trebmin);
89        PIDTcond.Ports.setPoint= (344 * 'K' - Trebmin)/(Trebmax-Trebmin);
90        col.cond.Q = 10*'J/s' - (5 * PIDTcond.Ports.output) * 'kJ/s';
91
92#verificando a partida do refervedor
93        if time < 200 * 's' then
94                col.reb.startup = 1;
95        else
96                col.reb.startup = 0;
97        end
98
99        if col.reb.startup then
100                col.reb.Q = 0 * PIDTreb.Ports.output * 'kJ/s';
101        else
102                col.reb.Q = 1e1 * PIDTreb.Ports.output * 'kJ/s';
103        end
104       
105        "Reaction - Trays"
106        col.trays.r = exp(-7150*'K'/col.trays.OutletL.T)*
107        (4.85e4*col.trays.C(1)*col.trays.C(2) - 1.23e4*col.trays.C(3)*col.trays.C(4))*'l/mol/s';
108        "Reaction - Reboiler"
109        col.reb.r = exp(-7150*'K'/col.reb.OutletL.T)*(4.85e4*col.reb.C(1)*col.reb.C(2)
110                        - 1.23e4*col.reb.C(3)*col.reb.C(4)) * 'l/mol/s';
111        "Reaction - Condenser"
112        col.cond.r = exp(-7150*'K'/col.cond.OutletL.T)*(4.85e4*col.cond.C(1)*col.cond.C(2)
113                        - 1.23e4*col.cond.C(3)*col.cond.C(4)) * 'l/mol/s';
114
115
116        SPECIFY
117        feed.Outlet.F = 1.076 * 'mol/s';
118        feed.Outlet.T = 300 * 'K';
119        feed.Outlet.P = 1.0 * 'atm';
120        feed.Outlet.z = [0.4962, 0.4808, 0, 0.0229];
121
122        zero.F = 0 * 'kmol/h';
123        zero.T = 353 * 'K';
124        zero.P = 1 * 'atm';
125        zero.z = [0.4962, 0.4808, 0, 0.0229];
126        zero.v = 0;
127        zero.h = 0 * 'J/mol';
128
129        col.p.dP = 0.95 * 'atm' - col.sp.Outlet2.P;
130        col.trays.Emv = 1;
131       
132# Variáveis dos PID's especificadas
133        PIDLreb.Parameters.tau = 1*'s';
134        PIDLreb.Parameters.tauSet=1*'s';
135        PIDLreb.Parameters.bias = 0;
136        PIDLreb.Parameters.alpha=1;
137        PIDLreb.Parameters.gamma=1;
138        PIDLreb.Parameters.beta=1;
139        PIDLreb.Parameters.gain=1;
140        PIDLreb.Parameters.intTime=100*'s';
141        PIDLreb.Parameters.derivTime=1*'s';
142        PIDLreb.Options.action=-1;
143        PIDLreb.Options.clip=1;
144        PIDLreb.Options.autoMan=0;
145        PIDLreb.Ports.setPoint=(0.5 * 'm' - Lrebmin)/(Lrebmax-Lrebmin);
146
147        PIDLcond.Parameters.tau = 1*'s';       
148        PIDLcond.Parameters.tauSet=1*'s';       
149        PIDLcond.Parameters.bias = 0;
150        PIDLcond.Parameters.alpha=1;
151        PIDLcond.Parameters.gamma=1;
152        PIDLcond.Parameters.beta=1;
153        PIDLcond.Parameters.gain=1;
154        PIDLcond.Parameters.intTime=10*'s';
155        PIDLcond.Parameters.derivTime=1*'s';
156        PIDLcond.Options.action=-1;
157        PIDLcond.Options.clip=1;
158        PIDLcond.Options.autoMan=0;
159        PIDLcond.Ports.setPoint=(0.5 * 'm' - Lcondmin)/(Lcondmax-Lcondmin);
160
161        PIDTreb.Parameters.tau = 1*'s';
162        PIDTreb.Parameters.tauSet=1*'s';       
163        PIDTreb.Parameters.bias = 0.2;
164        PIDTreb.Parameters.alpha=0.2;
165        PIDTreb.Parameters.gamma=1;
166        PIDTreb.Parameters.beta=1;
167        PIDTreb.Parameters.gain=0.9;
168        PIDTreb.Parameters.intTime=10*'s';
169        PIDTreb.Parameters.derivTime=1*'s';
170        PIDTreb.Options.action=1;
171        PIDTreb.Options.clip=1;
172        PIDTreb.Options.autoMan=0;
173
174        PIDTcond.Parameters.tau = 1*'s';
175        PIDTcond.Parameters.tauSet=1*'s';       
176        PIDTcond.Parameters.bias = 0.2;
177        PIDTcond.Parameters.alpha=0.2;
178        PIDTcond.Parameters.gamma=1;
179        PIDTcond.Parameters.beta=1;
180        PIDTcond.Parameters.gain=1;
181        PIDTcond.Parameters.intTime=10*'s';
182        PIDTcond.Parameters.derivTime=1*'s';
183        PIDTcond.Options.action=-1;
184        PIDTcond.Options.clip=1;
185        PIDTcond.Options.autoMan=0;
186       
187        "Valores limites para normalizações"
188        Lrebmax=0.8*'m';
189        Lrebmin=0.1*'m';
190        Lcondmax=0.8*'m';
191        Lcondmin=0.1*'m';
192        Trebmax=400*'K';
193        Trebmin=200*'K';
194        Tcondmax=380*'K';
195        Tcondmin=250*'K';
196       
197        col.cond.OutletV.F = 0 * 'kmol/h';
198       
199        SET
200        col.NTrays = 11;
201       
202        col.trays.stoic = [-1, -1, 1, 1];
203        col.cond.stoic = [-1, -1, 1, 1];
204        col.reb.stoic = [-1, -1, 1, 1];
205        col.cond.V = 6 * 'l';
206        col.cond.Across = 6 * 'l/m';
207       
208        col.trays.V =  0.0961 * 'm^3'; # 0.34* (3.14*0.6*0.6/4)
209        col.trays.Ah = 0.04 * 'm^2';#0.2 * 'm^2';
210        col.trays.lw = 0.457 * 'm';
211        col.trays.hw = 0.05 * 'm';
212        col.trays.Q = 0 * 'kW';
213        col.trays.beta = 0.8;
214        col.trays.alfa = 5;
215        col.trays.Ap = 0.07 * 'm^2'; #0.24 * 'm^2'; # 3.14*0.6*0.6/4 - 15%
216
217        col.trays.Hr = 0 * 'kJ/mol';
218        col.cond.Hr = 0 * 'kJ/mol';
219        col.reb.Hr = 0 * 'kJ/mol';
220        col.reb.V = 20 * 'l';
221        col.reb.Across = 20 * 'l/m';
222
223        col.reb.Pstartup = 1 * 'atm';
224        col.trays.Pstartup = 1 * 'atm';
225        col.cond.Pstartup = 1 * 'atm';
226       
227        INITIAL
228        # condenser
229        col.cond.OutletL.T = 300 *'K';
230        col.cond.Level = 0.1 * 'm';
231        col.cond.OutletL.z([1:3]) = [0.4962, 0.4808, 0];
232
233        # reboiler
234        col.reb.OutletL.T = 300 *'K';
235        col.reb.Level = 0.1 * 'm';
236        col.reb.OutletL.z([1:3]) = [0.4962, 0.4808, 0];
237
238        # column trays
239        col.trays.OutletL.T = 300 * 'K';
240        col.trays.Level = 0.1 * col.trays.hw;
241        col.trays.OutletL.z([1:3]) = [0.4962, 0.4808, 0];
242
243        OPTIONS
244        DAESolver = "dassl";
245        RelativeAccuracy = 1e-2;
246        TimeEnd = 20000;
247        TimeStep = 100;
248        TimeUnit = 's';
249#       time = [0:200, 210:10:2000, 2100:100:20000];
250end
Note: See TracBrowser for help on using the repository browser.