source: branches/newlanguage/sample/reactors/fogler/chap2/series_reactors.mso @ 188

Last change on this file since 188 was 188, checked in by Rodolfo Rodrigues, 16 years ago

Updated reactor samples for the new language

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