source: branches/newlanguage/sample/stage_separators/sample_columnReact.mso @ 180

Last change on this file since 180 was 86, checked in by Paula Bettio Staudt, 17 years ago

Updated stage_separators sample files header

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