Ticket #19: series_reactors.mso

File series_reactors.mso, 12.4 KB (added by Rodolfo Rodrigues, 16 years ago)
Line 
1#*---------------------------------------------------------------------
2* Series of CSTR and PFR
3*----------------------------------------------------------------------
4* Solved problem from Fogler (1999)
5* Problem number: 2-2 at 2-7
6* Page: 38-49 (Brazilian edition, 2002)
7*----------------------------------------------------------------------
8*
9*   Description:
10*      Sample to comparative between volumes to specific outlet molar
11*       conversion of CSTR and PFR by means of several different
12*       configurations
13*
14*   Assumptions:
15*       * steady-state
16*       * isotermic and isobaric system
17*       * gaseous phase
18*
19*       Specify:
20*               * the inlet stream (F,X)
21*               * the expression of rate of reaction
22*       * the initial volume
23*               * the outlet conversion
24*
25*   Configurations:
26*       * only one CSTR
27*       * only one PFR
28*       * 2 CSTRs in series
29*       * 2 PFRs in series
30*       * one PFR followed for one CSTR
31*       * one CSTR followed for one PFR
32*
33*----------------------------------------------------------------------
34* Author: Rodolfo Rodrigues and Argimiro R. Secchi
35* GIMSCOP/UFRGS - Group of Integration, Modeling, Simulation, Control,
36*                               and Optimization of Processes
37* $Id$
38*--------------------------------------------------------------------*#
39
40using "types";
41
42
43#*---------------------------------------------------------------------
44* Model of a stream
45*--------------------------------------------------------------------*#
46
47Model stream
48        PARAMETERS
49        NComp   as Integer      (Brief="Number of components", Default=1);
50        VARIABLES
51        F(NComp)as flow_mol     (Brief="Molar flow", Unit="mol/s");
52        X(NComp)as fraction     (Brief="Molar conversion");
53end
54
55
56#*---------------------------------------------------------------------
57* Model of a steady-state, isotermic, and isobaric CSTR
58*--------------------------------------------------------------------*#
59
60Model cstr     
61        VARIABLES
62in      Inlet   as stream; # Inlet stream
63out     Outlet  as stream; # Outlet stream
64        r               as reaction_mol(Brief="Rate of reaction", Unit="mol/l/s");
65        V       as volume          (Brief="Volume", Unit="l");
66
67        EQUATIONS
68        "Component molar balance"
69        Inlet.F - Outlet.F = (-r)*V;
70       
71        "Outlet molar flow"
72        Outlet.F = Inlet.F*(1 - Outlet.X);
73end
74
75
76#*---------------------------------------------------------------------
77* Model of a steady-state, isotermic, and isobaric PFR
78*--------------------------------------------------------------------*#
79
80Model pfr
81        VARIABLES
82in      Inlet   as stream; # Inlet stream
83out     Outlet  as stream; # Outlet stream
84        V       as volume          (Brief="Volume", Unit="l");
85        r               as reaction_mol(Brief="Rate of reaction", Unit="mol/l/s");
86       
87        EQUATIONS
88        "Molar balance"
89        diff(V) = Inlet.F/(-r)*"1/s";
90
91        "Change time in X"
92        Outlet.X = time*"1/s";
93       
94        "Molar flow"
95        Outlet.F = Inlet.F*(1 - Outlet.X);
96end
97
98
99#*---------------------------------------------------------------------
100* Model of a discreted steady-state, isotermic, and isobaric PFR
101*--------------------------------------------------------------------*#
102
103Model pfr_d
104        PARAMETERS
105        N       as Integer              (Brief="Number of descrete points", Default=200);
106       
107        VARIABLES
108in      Inlet   as stream; # Inlet stream
109out     Outlet  as stream; # Outlet stream
110        V(N)    as volume           (Brief="Volume", Unit="l");
111        X(N)    as fraction             (Brief="Molar conversion");
112        dx      as fraction     (Brief="Conversion increment");
113        r(N)    as reaction_mol (Brief="Rate of reaction", Unit="mol/l/s");
114        F(N)    as flow_mol             (Brief="Molar flow", Unit="mol/s");
115       
116        EQUATIONS
117        "Discrete interval"
118        dx = X(N)/N;
119       
120        for i in [2:N]
121        "Molar balance"
122           V(i) - V(i-1) = Inlet.F*dx/(-r(i));
123        "Discrete molar conversion"
124           X(i-1) = X(i) - dx;
125    end
126       
127        "Molar flow"
128        F = Inlet.F*(1 - X);
129       
130        "Outlet molar flow"
131        Outlet.F = F(N);
132       
133        "Outlet molar conversion"
134        Outlet.X = X(N);
135end
136
137
138#*---------------------------------------------------------------------
139* Example 2-2: Scale-up an isotermic CSTR in gaseous phase
140*--------------------------------------------------------------------*#
141
142FlowSheet cstr_sample
143        PARAMETERS
144        R       as Real                 (Brief="Universal gas constant", Unit="atm*l/mol/K", Default=0.082);
145        T       as temperature  (Brief="Temperatura in the reactor", Unit="K");
146        P       as pressure             (Brief="Pressure in the reactor", Unit="atm");
147        zin     as fraction             (Brief="Inlet molar fraction");
148        v0  as flow_vol         (Brief="Volumetric flow");
149       
150        VARIABLES
151        Vt      as volume               (Brief="Total reactor volume", Unit="l");
152       
153        DEVICES
154        Inlet   as stream; # Inlet stream
155        R1              as cstr;
156
157        CONNECTIONS
158        Inlet   to R1.Inlet;
159       
160        EQUATIONS
161        "Inlet molar flow"
162        Inlet.F = (zin*P/(R*T))*v0;
163       
164        "Rate of reaction"
165        (-R1.r) = (0.0092*R1.Outlet.X^3 - 0.0153*R1.Outlet.X^2 + 0.0013*R1.Outlet.X + 0.0053)*"mol/l/s";
166       
167        "Total reactor volume"
168        Vt = R1.V;
169       
170        SPECIFY
171        "Inlet conversion"
172        Inlet.X = 0.0;
173        "Required conversion"
174        R1.Outlet.X = 0.8;
175       
176        SET
177        v0  = 6.0*"l/s";
178        T       = 422.2*"K";
179        P       = 10*"atm";
180        zin     = 0.5;
181       
182        OPTIONS
183        mode = "steady";
184end
185
186
187#*---------------------------------------------------------------------
188* Example 2-3: Scale-up an isotermic PFR in gaseous phase
189*--------------------------------------------------------------------*#
190
191FlowSheet pfr_sample
192        DEVICES
193        Inlet   as stream; # Inlet stream
194        R1              as pfr;
195       
196        CONNECTIONS
197        Inlet   to R1.Inlet;
198       
199        EQUATIONS
200        "Rate of reaction"
201        (-R1.r) = (0.0092*R1.Outlet.X^3 - 0.0153*R1.Outlet.X^2 + 0.0013*R1.Outlet.X + 0.0053)*"mol/l/s";
202       
203        SPECIFY
204        "Inlet molar flow"
205        Inlet.F = 0.866541*"mol/s";
206        "Inlet conversion"
207        Inlet.X = 0.0;
208       
209        INITIAL
210        "Reactor volume"
211        R1.V    = 0.0*"l";
212       
213        OPTIONS
214        time = [0:0.004:0.8];
215end
216
217
218#*---------------------------------------------------------------------
219* Example 2-3: (discreted)
220*--------------------------------------------------------------------*#
221
222FlowSheet pfr_d_sample
223        VARIABLES
224        Vt              as volume       (Brief="Total reactor volume", Unit="l");
225       
226        DEVICES
227        Inlet   as stream; # Inlet stream
228        R1              as pfr_d;
229
230        CONNECTIONS
231        Inlet   to R1.Inlet;
232       
233        EQUATIONS
234        "Rate of reaction"
235        (-R1.r) = (0.0092*R1.X^3 - 0.0153*R1.X^2 + 0.0013*R1.X + 0.0053)*"mol/l/s";
236       
237        "Total reactor volume"
238        Vt = R1.V(R1.N);
239
240#       SET
241#       R1.N    = 100;
242       
243        SPECIFY
244        "Inlet molar flow"
245        Inlet.F = 0.866541*"mol/s";
246        "Inlet conversion"
247        Inlet.X = 0.0;
248
249        "Required conversion"
250        R1.Outlet.X     = 0.8;
251        "Initial volume"
252        R1.V(1) = 0.0*"l";
253       
254        OPTIONS
255        mode = "steady";
256end
257
258
259#*---------------------------------------------------------------------
260* Example 2-4: Comparing volumes between one CSTR and one PFR
261*--------------------------------------------------------------------*#
262
263FlowSheet comparative
264        VARIABLES
265        V_cstr  as volume       (Brief="CSTR volume", Unit="l");
266        V_pfr   as volume       (Brief="PFR volume", Unit="l");
267       
268        DEVICES
269        Inlet   as stream; # Inlet stream
270        CSTR    as cstr;
271        PFR             as pfr_d;
272
273        CONNECTIONS
274        Inlet   to CSTR.Inlet;
275        Inlet   to PFR.Inlet;
276       
277        EQUATIONS
278        "Rate of reaction in CSTR"
279        (-CSTR.r) = (0.0092*CSTR.Outlet.X^3 - 0.0153*CSTR.Outlet.X^2 + 0.0013*CSTR.Outlet.X + 0.0053)*"mol/l/s";
280        "Rate of reaction in PFR"
281        (-PFR.r) = (0.0092*PFR.X^3 - 0.0153*PFR.X^2 + 0.0013*PFR.X + 0.0053)*"mol/l/s";
282       
283        "CSTR volume"
284        V_cstr = CSTR.V;
285        "PFR volume"
286        V_pfr = PFR.V(PFR.N);
287       
288#       SET
289#       PFR.N   = 100;
290       
291        SPECIFY
292        "Inlet molar flow"
293        Inlet.F = 5.0*"mol/s";
294        "Inlet conversion"
295        Inlet.X = 0.0;
296       
297        "Required CSTR conversion"
298        CSTR.Outlet.X = 0.6;
299        "Required PFR conversion"
300        PFR.Outlet.X = 0.6;
301       
302        "Initial volume in PFR"
303        PFR.V(1) = 0.0*"l";
304       
305        OPTIONS
306        mode = "steady";
307end
308
309
310#*---------------------------------------------------------------------
311* Example 2-5: two CSTRs in serie
312*--------------------------------------------------------------------*#
313
314FlowSheet cstr_cstr
315        VARIABLES
316        V1              as volume       (Brief="1st reactor volume", Unit="l");
317        V2              as volume       (Brief="2nd reactor volume", Unit="l");
318        Vt              as volume       (Brief="Total reactor volumes", Unit="l");
319       
320        DEVICES
321        Inlet   as stream; # Inlet stream
322        R1              as cstr;
323        R2              as cstr;
324
325        CONNECTIONS
326        Inlet           to R1.Inlet;
327        R1.Outlet       to R2.Inlet;
328       
329        EQUATIONS
330        "Rate of reaction in 1st reactor"
331        (-R1.r) = (0.0092*R1.Outlet.X^3 - 0.0153*R1.Outlet.X^2 + 0.0013*R1.Outlet.X + 0.0053)*"mol/l/s";
332        "Rate of reaction in 2nd reactor"
333        (-R2.r) = (0.0092*R2.Outlet.X^3 - 0.0153*R2.Outlet.X^2 + 0.0013*R2.Outlet.X + 0.0053)*"mol/l/s";
334       
335        "1st volume reactor"
336        V1 = R1.V;
337        "1st volume reactor"
338        V2 = R2.V;
339        "Total volume of reactors"
340        Vt = V1 + V2;
341       
342        SPECIFY
343        "Inlet molar flow"
344        Inlet.F = 0.866541*"mol/s";
345        "Inlet conversion"
346        Inlet.X = 0.0;
347       
348        "Required 1st reactor conversion"
349        R1.Outlet.X = 0.4;
350        "Required 2nd reactor conversion"
351        R2.Outlet.X = 0.8;
352       
353        OPTIONS
354        mode = "steady";
355end
356
357
358#*---------------------------------------------------------------------
359* Example 2-6: two PFRs in series (descreted)
360*--------------------------------------------------------------------*#
361
362FlowSheet pfr_pfr
363        VARIABLES
364        V1              as volume       (Brief="1st reactor volume", Unit="l");
365        V2              as volume       (Brief="2nd reactor volume", Unit="l");
366        Vt              as volume       (Brief="Total reactor volumes", Unit="l");
367       
368        DEVICES
369        Inlet   as stream; # Inlet stream
370        R1              as pfr_d;
371        R2              as pfr_d;
372
373        CONNECTIONS
374        Inlet           to      R1.Inlet;
375        R1.Outlet       to      R2.Inlet;
376       
377        EQUATIONS
378        "Rate of reaction in 1st reactor"
379        (-R1.r) = (0.0092*R1.X^3 - 0.0153*R1.X^2 + 0.0013*R1.X + 0.0053)*"mol/l/s";
380        "Rate of reaction in 2nd reactor"
381        (-R2.r) = (0.0092*R2.X^3 - 0.0153*R2.X^2 + 0.0013*R2.X + 0.0053)*"mol/l/s";
382       
383        "1st reactor volume"
384        V1 = R1.V(R1.N);
385        "1st reactor volume"
386        V2 = R2.V(R2.N);
387        "Total reactor volumes"
388        Vt = V1 + V2;
389       
390        SPECIFY
391        "Inlet molar flow"
392        Inlet.F = 0.866541*"mol/s";
393        "Inlet conversion"
394        Inlet.X = 0.0;
395       
396        "Required 1st reactor conversion"
397        R1.Outlet.X = 0.4;
398        "Required 2nd reactor conversion"
399        R2.Outlet.X = 0.8;
400       
401        "Initial 1st reactor volume"
402        R1.V(1) = 0.0*"l";
403        "Initial 2nd reactor volume"
404        R2.V(1) = 0.0*"l";
405       
406        OPTIONS
407        mode = "steady";
408end
409
410
411#*---------------------------------------------------------------------
412* Example 2-7a: one PFR and one CSTR in series
413*--------------------------------------------------------------------*#
414
415FlowSheet pfr_cstr
416        VARIABLES
417        V1              as volume       (Brief="1st reactor volume", Unit="l");
418        V2              as volume       (Brief="2nd reactor volume", Unit="l");
419        Vt              as volume       (Brief="Total reactor volumes", Unit="l");
420       
421        DEVICES
422        Inlet   as stream; # Inlet stream
423        R1              as pfr_d;
424        R2              as cstr;
425
426        CONNECTIONS
427        Inlet           to      R1.Inlet;
428        R1.Outlet       to      R2.Inlet;
429       
430        EQUATIONS
431        "Rate of reaction in 1st reactor"
432        (-R1.r) = (0.0092*R1.X^3 - 0.0153*R1.X^2 + 0.0013*R1.X + 0.0053)*"mol/l/s";
433        "Rate of reaction in 2nd reactor"
434        (-R2.r) = (0.0092*R2.Outlet.X^3 - 0.0153*R2.Outlet.X^2 + 0.0013*R2.Outlet.X + 0.0053)*"mol/l/s";
435       
436        "1st reactor volume"
437        V1 = R1.V(R1.N);
438        "1st reactor volume"
439        V2 = R2.V;
440        "Total reactor volumes"
441        Vt = V1 + V2;
442       
443#       SET
444#       R1.N    = 100;
445       
446        SPECIFY
447        "Inlet molar flow"
448        Inlet.F = 0.866541*"mol/s";
449        "Inlet conversion"
450        Inlet.X = 0.0;
451       
452        "Required 1st reactor conversion"
453        R1.Outlet.X = 0.5;
454        "Required 2nd reactor conversion"
455        R2.Outlet.X = 0.8;
456       
457        "Initial 1st reactor volume"
458        R1.V(1) = 0.0*"l";
459       
460        OPTIONS
461        mode = "steady";
462end
463
464
465#*---------------------------------------------------------------------
466* Example 2-7b: one CSTR and one PFR in series
467*--------------------------------------------------------------------*#
468
469FlowSheet cstr_pfr
470        VARIABLES
471        V1              as volume       (Brief="1st reactor volume", Unit="l");
472        V2              as volume       (Brief="2nd reactor volume", Unit="l");
473        Vt              as volume       (Brief="Total reactor volumes", Unit="l");
474       
475        DEVICES
476        Inlet   as stream; # Inlet stream
477        R1              as cstr;
478        R2              as pfr_d;
479
480        CONNECTIONS
481        Inlet           to      R1.Inlet;
482        R1.Outlet       to      R2.Inlet;
483       
484        EQUATIONS
485        "Rate of reaction in 1st reactor"
486        (-R1.r) = (9.2*R1.Outlet.X^3 - 15.3*R1.Outlet.X^2 + 1.3*R1.Outlet.X + 5.3)*1e-3*"mol/l/s";
487        "Rate of reaction in 2nd reactor"
488        (-R2.r) = (9.2*R2.X^3 - 15.3*R2.X^2 + 1.3*R2.X + 5.3)*1e-3*"mol/l/s";
489       
490        "1st reactor volume"
491        V1 = R1.V;
492        "1st reactor volume"
493        V2 = R2.V(R2.N);
494        "Total reactor volumes"
495        Vt = V1 + V2;
496       
497#       SET
498#       R2.N    = 100;
499       
500        SPECIFY
501        "Inlet molar flow"
502        Inlet.F = 0.866541*"mol/s";
503        "Inlet conversion"
504        Inlet.X = 0.0;
505       
506        "Required 1st reactor conversion"
507        R1.Outlet.X = 0.5;
508        "Required 2nd reactor conversion"
509        R2.Outlet.X = 0.8;
510       
511        "Initial 2nd reactor volume"
512        R2.V(1) = 0.0*"l";
513       
514        OPTIONS
515        mode = "steady";
516end