source: mso/sample/reactors/fogler/chap2/series_reactors.mso @ 82

Last change on this file since 82 was 82, checked in by Paula Bettio Staudt, 16 years ago

Updated reactors sample files header

  • Property svn:keywords set to Id
File size: 12.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* 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 82 2006-12-08 20:11:44Z paula $
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", Unit="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", Unit="mol/l/s");
77        V       as volume          (Brief="Volume", Unit="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", Unit="l", Upper=2e3);
97        r               as reaction_mol(Brief="Rate of reaction", Unit="mol/l/s");
98       
99        EQUATIONS
100        "Molar balance"
101        diff(V) = Inlet.F/(-r)*"1/s";
102
103        "Change time in X"
104        Outlet.X = time*"1/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", Unit="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", Unit="mol/l/s");
126        F(N)    as flow_mol             (Brief="Molar flow", Unit="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", Unit="K");
158        P       as pressure             (Brief="Pressure in the reactor", Unit="atm");
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", Unit="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        mode = "steady";
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        time = [0:0.004:0.8];
227end
228
229
230#*---------------------------------------------------------------------
231* Example 2-3: (discreted)
232*--------------------------------------------------------------------*#
233
234FlowSheet pfr_d_sample
235        VARIABLES
236        Vt              as volume       (Brief="Total reactor volume", Unit="l");
237       
238        DEVICES
239        Inlet   as stream; # Inlet stream
240        R1              as pfr_d;
241
242        CONNECTIONS
243        Inlet   to R1.Inlet;
244       
245        EQUATIONS
246        "Rate of reaction"
247        (-R1.r) = (0.0092*R1.X^3 - 0.0153*R1.X^2 + 0.0013*R1.X + 0.0053)*"mol/l/s";
248       
249        "Total reactor volume"
250        Vt = R1.V(R1.N);
251
252#       SET
253#       R1.N    = 100;
254       
255        SPECIFY
256        "Inlet molar flow"
257        Inlet.F = 0.866541*"mol/s";
258        "Inlet conversion"
259        Inlet.X = 0.0;
260
261        "Required conversion"
262        R1.Outlet.X     = 0.8;
263        "Initial volume"
264        R1.V(1) = 0.0*"l";
265       
266        OPTIONS
267        mode = "steady";
268end
269
270
271#*---------------------------------------------------------------------
272* Example 2-4: Comparing volumes between one CSTR and one PFR
273*--------------------------------------------------------------------*#
274
275FlowSheet comparative
276        VARIABLES
277        V_cstr  as volume       (Brief="CSTR volume", Unit="l");
278        V_pfr   as volume       (Brief="PFR volume", Unit="l");
279       
280        DEVICES
281        Inlet   as stream; # Inlet stream
282        CSTR    as cstr;
283        PFR             as pfr_d;
284
285        CONNECTIONS
286        Inlet   to CSTR.Inlet;
287        Inlet   to PFR.Inlet;
288       
289        EQUATIONS
290        "Rate of reaction in CSTR"
291        (-CSTR.r) = (0.0092*CSTR.Outlet.X^3 - 0.0153*CSTR.Outlet.X^2 + 0.0013*CSTR.Outlet.X + 0.0053)*"mol/l/s";
292        "Rate of reaction in PFR"
293        (-PFR.r) = (0.0092*PFR.X^3 - 0.0153*PFR.X^2 + 0.0013*PFR.X + 0.0053)*"mol/l/s";
294       
295        "CSTR volume"
296        V_cstr = CSTR.V;
297        "PFR volume"
298        V_pfr = PFR.V(PFR.N);
299       
300#       SET
301#       PFR.N   = 100;
302       
303        SPECIFY
304        "Inlet molar flow"
305        Inlet.F = 5.0*"mol/s";
306        "Inlet conversion"
307        Inlet.X = 0.0;
308       
309        "Required CSTR conversion"
310        CSTR.Outlet.X = 0.6;
311        "Required PFR conversion"
312        PFR.Outlet.X = 0.6;
313       
314        "Initial volume in PFR"
315        PFR.V(1) = 0.0*"l";
316       
317        OPTIONS
318        mode = "steady";
319end
320
321
322#*---------------------------------------------------------------------
323* Example 2-5: two CSTRs in serie
324*--------------------------------------------------------------------*#
325
326FlowSheet cstr_cstr
327        VARIABLES
328        V1              as volume       (Brief="1st reactor volume", Unit="l");
329        V2              as volume       (Brief="2nd reactor volume", Unit="l");
330        Vt              as volume       (Brief="Total reactor volumes", Unit="l");
331       
332        DEVICES
333        Inlet   as stream; # Inlet stream
334        R1              as cstr;
335        R2              as cstr;
336
337        CONNECTIONS
338        Inlet           to R1.Inlet;
339        R1.Outlet       to R2.Inlet;
340       
341        EQUATIONS
342        "Rate of reaction in 1st reactor"
343        (-R1.r) = (0.0092*R1.Outlet.X^3 - 0.0153*R1.Outlet.X^2 + 0.0013*R1.Outlet.X + 0.0053)*"mol/l/s";
344        "Rate of reaction in 2nd reactor"
345        (-R2.r) = (0.0092*R2.Outlet.X^3 - 0.0153*R2.Outlet.X^2 + 0.0013*R2.Outlet.X + 0.0053)*"mol/l/s";
346       
347        "1st volume reactor"
348        V1 = R1.V;
349        "1st volume reactor"
350        V2 = R2.V;
351        "Total volume of reactors"
352        Vt = V1 + V2;
353       
354        SPECIFY
355        "Inlet molar flow"
356        Inlet.F = 0.866541*"mol/s";
357        "Inlet conversion"
358        Inlet.X = 0.0;
359       
360        "Required 1st reactor conversion"
361        R1.Outlet.X = 0.4;
362        "Required 2nd reactor conversion"
363        R2.Outlet.X = 0.8;
364       
365        OPTIONS
366        mode = "steady";
367end
368
369
370#*---------------------------------------------------------------------
371* Example 2-6: two PFRs in series (discreted)
372*--------------------------------------------------------------------*#
373
374FlowSheet pfr_pfr
375        VARIABLES
376        V1              as volume       (Brief="1st reactor volume", Unit="l");
377        V2              as volume       (Brief="2nd reactor volume", Unit="l");
378        Vt              as volume       (Brief="Total reactor volumes", Unit="l");
379       
380        DEVICES
381        Inlet   as stream; # Inlet stream
382        R1              as pfr_d;
383        R2              as pfr_d;
384
385        CONNECTIONS
386        Inlet           to      R1.Inlet;
387        R1.Outlet       to      R2.Inlet;
388       
389        EQUATIONS
390        "Rate of reaction in 1st reactor"
391        (-R1.r) = (0.0092*R1.X^3 - 0.0153*R1.X^2 + 0.0013*R1.X + 0.0053)*"mol/l/s";
392        "Rate of reaction in 2nd reactor"
393        (-R2.r) = (0.0092*R2.X^3 - 0.0153*R2.X^2 + 0.0013*R2.X + 0.0053)*"mol/l/s";
394       
395        "1st reactor volume"
396        V1 = R1.V(R1.N);
397        "1st reactor volume"
398        V2 = R2.V(R2.N);
399        "Total reactor volumes"
400        Vt = V1 + V2;
401       
402        SPECIFY
403        "Inlet molar flow"
404        Inlet.F = 0.866541*"mol/s";
405        "Inlet conversion"
406        Inlet.X = 0.0;
407       
408        "Required 1st reactor conversion"
409        R1.Outlet.X = 0.4;
410        "Required 2nd reactor conversion"
411        R2.Outlet.X = 0.8;
412       
413        "Initial 1st reactor volume"
414        R1.V(1) = 0.0*"l";
415        "Initial 2nd reactor volume"
416        R2.V(1) = 0.0*"l";
417       
418        OPTIONS
419        mode = "steady";
420end
421
422
423#*---------------------------------------------------------------------
424* Example 2-7a: one PFR and one CSTR in series
425*--------------------------------------------------------------------*#
426
427FlowSheet pfr_cstr
428        VARIABLES
429        V1              as volume       (Brief="1st reactor volume", Unit="l");
430        V2              as volume       (Brief="2nd reactor volume", Unit="l");
431        Vt              as volume       (Brief="Total reactor volumes", Unit="l");
432       
433        DEVICES
434        Inlet   as stream; # Inlet stream
435        R1              as pfr_d;
436        R2              as cstr;
437
438        CONNECTIONS
439        Inlet           to      R1.Inlet;
440        R1.Outlet       to      R2.Inlet;
441       
442        EQUATIONS
443        "Rate of reaction in 1st reactor"
444        (-R1.r) = (0.0092*R1.X^3 - 0.0153*R1.X^2 + 0.0013*R1.X + 0.0053)*"mol/l/s";
445        "Rate of reaction in 2nd reactor"
446        (-R2.r) = (0.0092*R2.Outlet.X^3 - 0.0153*R2.Outlet.X^2 + 0.0013*R2.Outlet.X + 0.0053)*"mol/l/s";
447       
448        "1st reactor volume"
449        V1 = R1.V(R1.N);
450        "1st reactor volume"
451        V2 = R2.V;
452        "Total reactor volumes"
453        Vt = V1 + V2;
454       
455#       SET
456#       R1.N    = 100;
457       
458        SPECIFY
459        "Inlet molar flow"
460        Inlet.F = 0.866541*"mol/s";
461        "Inlet conversion"
462        Inlet.X = 0.0;
463       
464        "Required 1st reactor conversion"
465        R1.Outlet.X = 0.5;
466        "Required 2nd reactor conversion"
467        R2.Outlet.X = 0.8;
468       
469        "Initial 1st reactor volume"
470        R1.V(1) = 0.0*"l";
471       
472        OPTIONS
473        mode = "steady";
474end
475
476
477#*---------------------------------------------------------------------
478* Example 2-7b: one CSTR and one PFR in series
479*--------------------------------------------------------------------*#
480
481FlowSheet cstr_pfr
482        VARIABLES
483        V1              as volume       (Brief="1st reactor volume", Unit="l");
484        V2              as volume       (Brief="2nd reactor volume", Unit="l");
485        Vt              as volume       (Brief="Total reactor volumes", Unit="l");
486       
487        DEVICES
488        Inlet   as stream; # Inlet stream
489        R1              as cstr;
490        R2              as pfr_d;
491
492        CONNECTIONS
493        Inlet           to      R1.Inlet;
494        R1.Outlet       to      R2.Inlet;
495       
496        EQUATIONS
497        "Rate of reaction in 1st reactor"
498        (-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";
499        "Rate of reaction in 2nd reactor"
500        (-R2.r) = (9.2*R2.X^3 - 15.3*R2.X^2 + 1.3*R2.X + 5.3)*1e-3*"mol/l/s";
501       
502        "1st reactor volume"
503        V1 = R1.V;
504        "1st reactor volume"
505        V2 = R2.V(R2.N);
506        "Total reactor volumes"
507        Vt = V1 + V2;
508       
509#       SET
510#       R2.N    = 100;
511       
512        SPECIFY
513        "Inlet molar flow"
514        Inlet.F = 0.866541*"mol/s";
515        "Inlet conversion"
516        Inlet.X = 0.0;
517       
518        "Required 1st reactor conversion"
519        R1.Outlet.X = 0.5;
520        "Required 2nd reactor conversion"
521        R2.Outlet.X = 0.8;
522       
523        "Initial 2nd reactor volume"
524        R2.V(1) = 0.0*"l";
525       
526        OPTIONS
527        mode = "steady";
528end
Note: See TracBrowser for help on using the repository browser.