-
Notifications
You must be signed in to change notification settings - Fork 1
/
03-mod03.Rmd
1607 lines (1224 loc) · 84.9 KB
/
03-mod03.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Distribution of Residence times
Reactors treated in this course have been modeled under specific flow considerations that lead to simplicity in the mole and energy balances and are valid in many industrial reactors.
Unfortunately, as it is shown in Figure \@ref(fig:fig004000), there are other cases where the deviation of those industrial reactors from ideal behavior may be sufficiently large that the use of an ideal reactor model will give an unacceptably significant error because of the careless treatment that these models do to the fluid flow pattern within the reactors.
```{r fig004000, out.width = "65%", echo=FALSE, fig.align='center', fig.cap='Examples of nonideal flow in a CSTR and packed-bed vessel. [@missen1999]', fig.lp='fig:'}
library(png)
library(grid)
img <- readPNG("figures/004_draw_25.png")
grid.raster(img)
```
If the flow pattern does not follow the ideal models, it must be necessary to apply a more complex methodology for the reactor performance analysis. Nevertheless, before going deeper into these methodologies, it is essential to emphasize that the factors that govern the performance of a chemical reactor can be grouped into two broad classifications:
1. The **amount of time** that a reactant molecule spends in the reactor. The longer that reactant can spend in the reactor, the more chance they can react. The time that molecules spend in the reactor is called **the residence time**, which is a crucial parameter in the flow reactor performance, and the **distribution of residence time** is a key factor in determining the extent of reaction.
2. The **extent of mixing** within the reactor. When dealing with two or more different molecules that must react, molecular collision must occur as a first step. Therefore, the concentration at the molecular level is essential.
The degree of mixing depends not only on the reactor configuration and operating conditions but also on the fluid and reactants' properties.
Mixing is a complex phenomenon that can be analyzed on both a macroscopic and microscopic scale. The RTD functions provide a measure only of macroscopic mixing. [@missen1999]
However, non-ideal flow results in irregularities relating to the micromixing of fluid elements of differing ages at the microscopic level, too. Therefore, in this section of the course, we will see how the classical approach of Residence Time Distribution (RTD) provides a method for evaluating the effect of flow patterns within the reactor on chemical conversion levels.
## RTD functions
First of all, the study of non-ideal flow behavior is based on the RTD of non-reacting species in an arbitrary flow system with constant density fluid. From this point, it will be explained its relationship to a chemically reacting species present in the reactor.
Residence time theory deals with the age of particles within a flow system. The particles may be atoms, molecules, or fluid elements conserved as they flow through the system.
:::: {.infobox .info data-latex="information"}
The residence time, or age, of a particle in the system is the elapsed time between the time at which the particle enters the system and the time it leaves.
::::
This approach assumes specific essential considerations:
1. If a particle reenters the system after it leaves, the aging of that particle resumes from the value it had as its previous exit.
2. A particle is not allowed to remain in the system forever.
3. All particles must have an original entrance and a final departure.
4. The age of the particle when it finally leaves the system will be its residence time.
Regardless the state of mixing or type of flow, we use the classical definition of mean residence time $\overline{t}$ of an element of fluid volume within a fully contained, continuous flow reactor with a total fixed volumen of $V$ operated at steady state which is:
\begin{equation}
\overline{t} = \frac{V}{\upsilon}
(\#eq:ec004001)
\end{equation}
where $\upsilon$ is the steady volumetric flow rate.
It is vital to point out that a fully contained vessel has no diffusion or dispersion at the vessel's entrance or exit so that a fluid element once inside the reactor cannot escape back into the input stream or once removed from cannot return to the vessel.
This assumption is more precisely related to the boundaries of the reactor. It is assumed a plug flow in both the inlet tube and the outlet tube. Such boundary conditions are called "closed-closed." Figure \@ref(fig:fig00400) gives others boundary conditions than closed-closed that they are essential for specific experimental techniques to assess the mixing parameters inside the reactor, but they will not consider in this course.
```{r fig00400, out.width = "65%", echo=FALSE, fig.align='center', fig.cap='Boundary conditions of reactors in relation to the residence time distribution. [@westerterp1984]', fig.lp='fig:'}
library(png)
library(grid)
img <- readPNG("figures/004_draw_28.png")
grid.raster(img)
```
Now, let us introduce some mathematical concepts. Let $d\,V = \upsilon\, dt$ represent a fluid element which entered the system $t$ time ago. Also, let $\mathbf{P}(t)$ represent the probability that the element remains in the reactor during the period $t$. The total volume of the fluid in the reactor must be
\begin{equation}
V = \upsilon \int_{0}^\infty {\mathbf{P}(t)\,dt}
(\#eq:ec004002)
\end{equation}
Now, let us introduce some mathematical concepts. Let $d\,V = \upsilon\, dt$ represent a fluid element which entered the system $t$ time ago. Also, let $\mathbf{P}(t)$ represent the probability that the element remains in the reactor during the period $t$. The total volume of the fluid in the reactor must be
Now, let $\mathbf{F}(t)$ represent the probability of a fluid element leaving the system during the period $t$ so $\mathbf{P}(t) + \mathbf{F}(t) = 1$. The foregoing equation then becomes
\begin{equation}
\frac{V}{\upsilon} = \int_{0}^\infty {\left(1 - \mathbf{F}(t)\right)\,dt}
(\#eq:ec004003)
\end{equation}
which upon integration by parts gives
\begin{equation}
\frac{V}{\upsilon} = \left[1 - \mathbf{F}(t)\right] \cdot \infty - \left[1 - \mathbf{F}(t)\right] \cdot 0+\int_{F(0)}^{F(\infty)} {t\,d\mathbf{F}(t)}
(\#eq:ec004004)
\end{equation}
with boundary conditions of $F(t) = 0$ at $t=0$, and 1 at $t=\infty$ (chance of 100% removal in an infinitive time) so that
\begin{equation}
\frac{V}{\upsilon} = \int_{0}^{1} {t\,d\mathbf{F}(t)} = \overline{t}
(\#eq:ec004005)
\end{equation}
\begin{equation*}
\mathbf{F}(t) \to 1 \text{ when } t \to \infty
\end{equation*}
$\mathbf{F}(t)$ is called "_Cumulative Distribution Function_''. This function is dimensionless, and **represents the fraction of effluent that has been in the reactor for less time than _t_, and leaves the reactor with age less than _t_**.
The typical shape of $\mathbf{F}(t)$ function is shown on Figure \@ref(fig:fig004000a). From this figure, it is possible to note that 80% of the molecules spend 40 min or less in the reactor, and 20% of the molecules spend longer than 40 min in the reactor.
```{r fig004000a, out.width = "55%", echo=FALSE, fig.align='center', fig.cap='Typical cumulative distribution curve **F**. [@fogler2008]', fig.lp='fig:'}
library(png)
library(grid)
img <- readPNG("figures/004_draw_16.png")
grid.raster(img)
```
The distribution of residence times is represented by an external residence time distribution or an exit age distribution, $\mathbf{E}(t)$. This function is called **Residence Time Distribution Function** or (RTD-function) which **defines a fraction of exiting fluid elements with residence times lies between time $t$ and $t+dt$.**
Since $\mathbf{E}(t)$ is a fraction, $\mathbf{E}(t)$ has units of time$^{-1}$. In addition, the fraction of fluid that leaves the reactor over all time, this means between $t=0$ and $t=\infty$ must be 1. Therefore
\begin{equation}
\int_{0}^{\infty} \mathbf{E}(t)\,dt = 1
(\#eq:ec004008)
\end{equation}
The fraction of fluid **_in the effluent stream_** that was **_in the reactor_** for a time between $t=0$ and $t=t$ si given by
\begin{equation*}
\int_{0}^{t} \mathbf{E}(t)\,dt
\end{equation*}
Another way of saying the same thing is that $\int_{0}^{t} \mathbf{E}(t)\,dt$ is the fraction of fluid in the exit stream with an \textit{exit age} less than $t$. This fractions can be represented graphically as shown in Figure \@ref(fig:fig004019).
```{r fig004019, out.width = "70%", echo=FALSE, fig.align='center', fig.cap='Typical RTD curve **E**. [@roberts2009]', fig.lp='fig:'}
library(png)
library(grid)
img <- readPNG("figures/004_draw_17.png")
grid.raster(img)
```
The fraction of the fluid that spends a given duration, $t$ inside the reactor, is given by the value of $\mathbf{E}(t)\,dt$. Therefore, $\mathbf{E}(t)$ curve is related to $\mathbf{F}(t)$ because the fraction of the fluid that leaves the reactor with age less than $t$ is equal to the sum over all times less than $t$ of $\mathbf{E}(t) \Delta t$, or expressed continuously. [@roberts2009]
\begin{equation}
\mathbf{F}(t) = \int_0^{t} \mathbf{E}(t)\,dt
(\#eq:ec004009)
\end{equation}
Equation \@ref(eq:ec004009) could be rewritten as
\begin{equation}
\frac{d \mathbf{F}(t)}{dt} = \mathbf{E}(t)
(\#eq:ec004006)
\end{equation}
Therefore from Eq. \@ref(eq:ec004005)
\begin{equation}
\overline{t} = \int_{0}^{\infty} t\,\mathbf{E}(t)\,dt
(\#eq:ec004007)
\end{equation}
This procedure is called normalizing the distribution, and Figure \@ref(fig:fig004001) shows that.
```{r fig004001, out.width = "70%", echo=FALSE, fig.align='center', fig.cap='The typical exit age distribution curve **E** (RTD) [@levenspiel2004]', fig.lp='fig:'}
library(png)
library(grid)
img <- readPNG("figures/004_draw_01.png")
grid.raster(img)
```
The RTD function may be used directly to analyze reactors, or related functions may be used depending on the application.
Another useful distribution curve is the Washout function, $\mathbf{W}$, which sometimes is called "Complement function''. This function gives **the fraction of effluent that has been in reactor (with the residence times) for longer than time $t$**. It could be calculated from
\begin{equation}
\mathbf{W}(t) = \int_{t}^{\infty} \mathbf{E}(t)\,dt \equiv 1 - \mathbf{F}(t) = 1 - \int_0^t{\mathbf{E}(t)\,dt}
(\#eq:ec004010)
\end{equation}
So,
\begin{equation}
\mathbf{F}(t) + \mathbf{W}(t) = 1
(\#eq:ec004011)
\end{equation}
Furthermore, the relationship between the functions in derivative form is
\begin{equation}
\frac{d\mathbf{F}(t)}{dt} =- \frac{d\mathbf{W}(t)}{dt} = \mathbf{E}(t)
(\#eq:ec004012)
\end{equation}
A typical $\mathbf{F}(t)$ and the corresponding $\mathbf{W}(t)$ function curve are illustrated in Figure \@ref(fig:fig004002)
```{r fig004002, out.width = "70%", echo=FALSE, fig.align='center', fig.cap='The typical **F(t)** and **W(t)** curves. [@hayes2013]', fig.lp='fig:'}
library(png)
library(grid)
img <- readPNG("figures/004_draw_02.png")
grid.raster(img)
```
Another distribution function of interest in some application is the "Internal Age Distribution'', $\mathbf{I}$, which is **the fraction of fluid inside the vessel with age between $t$ and $t + dt$**. It has properties similar to $\mathbf{E}(t)$, so
\begin{equation*}
\int_0^\infty \mathbf{I}(t)\,dt = 1
\end{equation*}
The time $t=0$ refers to an arbitrary initial time and not the start of the flow of fluid into the vessel. In physical terms, this equation states that all fluid has an age between 0 and $\infty$.
As a consequence, the fraction of vessel contents younger that a specified age $t$ is,
\begin{equation*}
\int_0^{t} \mathbf{I}(t^\prime)\,dt^\prime = 1
\end{equation*}
While the fraction older than $t$ is
\begin{equation*}
\int_t^{\infty} \mathbf{I}(t^\prime)\,dt^\prime = 1 - \int_0^{t} \mathbf{I}(t^\prime)\,dt^\prime
\end{equation*}
Similar to $\mathbf{E}(t)$, the mean age fluid elements inside the vessel is,
\begin{equation*}
\overline{t}_1 = \int_0^\infty t\,\mathbf{I}(t)\,dt = \text{ mean internal age }
\end{equation*}
As might be expected, there is an interrelationship between $\mathbf{I}$ and $\mathbf{E}$ since the fluid entering a vessel at a given time obviously either leaves it or stays inside. Therefore:
\begin{equation}
\overline{t}\,\mathbf{I}(t) = 1 - \int_0^t \mathbf{E}(t)\,dt = \mathbf{W}(t)
(\#eq:ec004012a)
\end{equation}
or
\begin{equation}
\mathbf{I}(t) = \frac{\mathbf{E}(t)}{1 - \mathbf{F}(t)} \Rightarrow \mathbf{E(t)} = - \overline{t}\;\frac{d\mathbf{I}(t)}{dt}
\end{equation}
Finally, the **Intensity function**, $\boldsymbol\Lambda(t)$ is defined as **fraction of fluid in the vessel of age $t$ will leave at time between $t$ and $t + dt$**. The intensity is useful in detecting the existence of dead space and bypassing.
The intensity function can be related to $\mathbf{E}$ and $\mathbf{I}$ functions from
<center>
![](figures/intensity_E_I.png)
</center>
Therefore
\begin{equation}
\boldsymbol\Lambda (t) = \frac{1}{\overline{t}} \frac{\mathbf{E}(t)}{\mathbf{I}(t)}
\end{equation}
Combining the last two equations
\begin{equation}
\boldsymbol\Lambda (t) = \cfrac{- \overline{t}\;\cfrac{d\mathbf{I}(t)}{dt}
}{\overline{t}\,\mathbf{I}(t)} = - \frac{d\left[\ln\left(\overline{t}\mathbf{I}(t)\right)\right]}{dt}
\end{equation}
## Means and moments
In addition to characterizing the RTD using the three functions $\mathbf{E}(t)$, $\mathbf{F}(t)$ and $\mathbf{W}(t)$, the residence time can also be characterized using the moments of the RTD functions. There are several types of moments. [@hayes2013]
The first type is the moment around the origin, which is defined in terms of density function as
\begin{equation}
\mu_n = \int_0^{\infty} t^n\,\mathbf{E}(t)\,dt
(\#eq:ec004013)
\end{equation}
The value of **n** determines which moment is calculated. For example, the first moment about the origin is the **mean residence time**, $\overline{t}$
\begin{equation}
\mu_1 = \overline{t} = \int_0^{\infty} t\,\mathbf{E}(t)\,dt
(\#eq:ec004014)
\end{equation}
As we already know, the mean residence time is the average time that molecules spend in the system. In a constant-density system $\overline{t} = V/\upsilon = \tau$
:::: {.infobox .info data-latex="information"}
Equation \@ref(eq:ec004013) can provide a helpful check on operating data because the volumetric flow rate is relatively easy to set and measure. However, the volume of the reactor filled by a fluid is not always so easy to determine.
::::
Rather than compute the moments about the origin, it is common for the moments of the RTD function to be calculated about the mean residence time. These moments are called central moments, and are defined as
\begin{equation}
\mu_n^{\prime} = \int_0^{\infty} {\left(t-\overline{t}\right)}^{n}\,\mathbf{E}(t)\,dt
(\#eq:ec004015)
\end{equation}
The variance, $\sigma_t^2$, of the RTD is the second central moment:
\begin{equation}
\sigma^2 = \mu_2^{\prime} = \int_0^{\infty} {\left(t-\overline{t}\right)}^2\,\mathbf{E}(t)\,dt
(\#eq:ec004016)
\end{equation}
An alternative form may be more convenient to use is obtained by expanding the square in Eq. \@ref(eq:ec004016)
\begin{equation}
\sigma_t^2 = \left(\int_0^{\infty} {t}^2\,\mathbf{E}(t)\,dt\right) - \overline{t}^{\,2}
(\#eq:ec004016a)
\end{equation}
The variance measures the spread of the distribution about the mean characterized by the standard deviation, $\sigma_t$. The third central moment, the skewness, measures the symmetry of the distribution about the mean:
\begin{equation}
\sigma^3 = \mu_3^{\prime} = \int_0^{\infty} {\left(t-\overline{t}\right)}^3\,\mathbf{E}(t)\,dt
(\#eq:ec004017)
\end{equation}
All moments must be calculated meticulously for a complete summary of a distribution. In practice, these three parameters are typically appropriate for a good RTD characterization.
## Normalized RTD functions
It is common when using residence time theory to work with normalized RTD, defined as the residence time divided by the mean residence time. This dimensionless time is given by [@hayes2013]
\begin{equation*}
\theta = \frac{t}{\overline{t}}
\end{equation*}
The density functions for the two cases are related by
\begin{equation*}
\mathbf{E}(\theta)\,d\theta = \mathbf{E}(t)\,dt
\end{equation*}
Because $\overline{t}\,d\theta = dt$, it follows that
\begin{equation*}
\mathbf{E}(\theta) = \overline{t}\,\mathbf{E}(t) = \frac{\overline{t}\;C(t)}{\displaystyle \int_0^\infty C(t)\,dt}
\end{equation*}
The other relationships do not change. The normalized cumulative distribution function is
\begin{equation*}
\mathbf{F}(t) = \int_0^{t} \mathbf{E}(t)\,dt = \int_0^{\theta} \mathbf{E}(\theta)\,d\theta = \mathbf{F}(\theta)
\end{equation*}
The normalized washout function is
\begin{equation*}
\mathbf{W}(\theta) = \int_{\theta}^{\infty} \mathbf{E}(\theta)\,d\theta
\end{equation*}
Finally, the moments about the origin and the central moments for the normalized RTD functions are
\begin{align*}
&\nu_{(1,\theta)} = \int_{\theta}^{\infty} \theta \,\mathbf{E}(\theta)\,d\theta = \overline{\theta} = 1 \\
&\nu_{\theta}^{2} = \int_{\theta}^{\infty} {\left(\theta - \overline{\theta}\right)}^2\,\mathbf{E}(\theta)\,d\theta = \int_{\theta}^{\infty} {\theta}^2\,\mathbf{E}(\theta)\,d\theta - 1 = \frac{\theta^2}{\overline{t}^2}
\end{align*}
For numerical work with tracer data directly, it is common to use the dimensional $\mathbf{E}(t), \overline{t}$, and $\sigma_t^2$. The dimensionless quantities are used with the performance models. Figure \@ref(fig:tabrtd) shows a summary of RTD functions expressed by dimensionless time.
```{r tabrtd, out.width = "65%", echo=FALSE, fig.align='center', fig.cap='Relationships between Residence Time Functions', fig.lp='fig:'}
library(png)
library(grid)
img <- readPNG("figures/tab_rtd.png")
grid.raster(img)
```
## Experimental determination of RTD
The RTD is measured experimentally by injecting a tracer, which is an inert chemical compound into the reactor at some time $t=0$ and then measuring its concentration, $C$, in the effluent stream as a function of time. The tracer must meet the following requirements:
1. it must be a nonreactive species that is easily detectable at low concentrations, e.g., by electrical conductivity, light absorption, or nuclear radiation.
2. it should have physical properties similar to those of the reacting mixture, such as density, and be completely soluble in the mixture to avoid flow changes due to viscosity and molecular diffusion of the tracer in the solution.
3. it should not adsorb on the walls or other surfaces in the reactor.
4. The tracer should be inexpensive and easy to handle.
5. The tracer should be stable and conserved so that it can be accounted for by a material balance relating the response to the input; if tracer decays, its half-life should be such that $t_{1/2}\,(\text{tracer}) > 25\overline{t}\, (\text{fluid})$.
The two most used methods of injection are _pulse input_ and _step input_.
## Determination of **E(t)** from Pulse input
The direct experimental determination of **E(t)** requires a sharp pulse of tracer to be injected into the system. Essentially, an amount of tracer $N_0$ is required to be injected into the vessel's inlet at a single instant of time at $t=0$. Figure \@ref(fig:fig004003) shows typical concentration-time curves at the inlets and outlet of an arbitrary reactor. [@hayes2013]
```{r fig004003, out.width = "65%", echo=FALSE, fig.align='center', fig.cap='Typical pulse impulse curves for RTD measurement', fig.lp='fig:'}
library(png)
library(grid)
img <- readPNG("figures/004_draw_03.png")
grid.raster(img)
```
Mathematically, the ideal shape of the injected pulse is described by a Dirac delta function. In practice, the tracer should be injected in as short an elapsed time as is experimentally possible to achieve.
The tracer's concentration in the effluent is then measured as a function time, and the density function can be evaluated using the following analysis. The fraction of tracer molecules that leave the system over some time interval $dt$ is
\begin{equation}
\frac{dN}{N_0} = \mathbf{E}(t)\,dt
(\#eq:ec004018)
\end{equation}
where $dN$ represents the number of tracer molecules that leaves the system over the time interval $dt$, and $N_0$ is the total number of tracer molecules injected.
The number of molecules can be expressed in terms of the concentration and the volumetric flow rate,
\begin{equation}
dN = \upsilon\,c(t)\,dt
(\#eq:ec004019)
\end{equation}
where $C(t)$ is the concentration of tracer in the effluent streams as a function of time.
Thus, the total number of molecules initially injected can also be calculated from the effluent profile by integration over a long time:
\begin{equation}
N_0 = \int_0^{\infty} \upsilon\,C(t)\,dt \equiv \frac{N_0}{\upsilon} = \int_0^{\infty} C(t)\,dt
(\#eq:ec004020)
\end{equation}
Combining Eqs \@ref(eq:ec004019) and \@ref(eq:ec004020) into Eq. \@ref(eq:ec004018) for a constant-density system,
\begin{equation}
\mathbf{E}(t) = \frac{c(t)}{\displaystyle\int_0^\infty{c(t)\,dt}} \approx \frac{c_i(t)}{\displaystyle\sum_i {c_i(t)\,\Delta t_i}}
(\#eq:ec004021)
\end{equation}
Once $\mathbf{E}(t)$ is determined, the mean residence time, $\overline{t}$, and the variance of distribution, $\sigma_t^2$, may be calculated based on Eqs. \@ref(eq:ec004007) and \@ref(eq:ec004016a)
\begin{gather*}
\overline{t} = \int_{0}^{\infty} t\,\mathbf{E}(t)\,dt \approx \sum_i t_i E_i(t) \Delta t_i \\
\sigma_t^2 = \left(\int_0^{\infty} {t}^2\,\mathbf{E}(t)\,dt\right) - \overline{t}^{\,2} \approx \left[ \sum_i t_i^2 E_i(t) \Delta t_i \right] - \overline{t}^2
\end{gather*}
Advantages of using a pulse input include:
1. requiring only a small amount of tracer.
2. involving usually only a tiny impact on process operation.
Disadvantages include:
1. difficulty in achieving a perfect pulse.
2. difficulty in achieving accurate material balance on traces using equation \@ref(eq:ec004020)
Obtaining $\mathbf{E}(t)$, $\overline{t}$ and $\sigma_t^2$ from experimental tracer data involves determining areas under curves defined continuously or by discrete data. Two simple ways in which discrete data may be treated to obtain the required areas:
1. use of data in histogram form, and
2. use of the trapezoid rule.
In the histogram method, Figure \@ref(fig:fig004003a), the area under the response curve is
\begin{gather*}
\text{area} = \sum_{i=1}^{n_C} c_i(t)\,\Delta t_i \\
\Delta t_i = \frac{t_{i+1} - t_{i-1}}{2}
\end{gather*}
```{r fig004003a, out.width = "65%", echo=FALSE, fig.align='center', fig.cap='Basis for histogram method of area determination. [@missen1999]', fig.lp='fig:'}
library(png)
library(grid)
img <- readPNG("figures/004_draw_26.png")
grid.raster(img)
```
In the use of the trapezoid rule, Figure \@ref(fig:fig004003b), the area under the response curve is given by
```{r fig004003b, out.width = "65%", echo=FALSE, fig.align='center', fig.cap='Basis for histogram method of area determination. [@missen1999]', fig.lp='fig:'}
library(png)
library(grid)
img <- readPNG("figures/004_draw_27.png")
grid.raster(img)
```
\begin{equation*}
\text{area} = \sum_{i=1}^{n_c - 1} c_i(t)_\text{av}\,\Delta t_i = \sum_{i=1}^{n_c - 1} \left(\frac{c_i + c_{i+1}}{2}\right) \left(t_{i+1} - t_i\right)
\end{equation*}
The only way to determine which numerical method provides the best answer is to predict the experimental concentrations using the calculated parameters in an appropriate mixing model.
```{exercise, it004001, name="Calculations of RTD and distribution functions curves from pulse impulse method"}
Consider a vessel through which a fluid is flowing. The RTD function is determined utilizing a pulse injection of the tracer in the inlet stream, and its outlet concentration is monitored as a function of time. The output concentration in mol/L measured as a function of time in seconds is
t (s) | C (mol/L) | t (s) | C (mol/L) | t (s) | C (mol/L) | t (s) | C (mol/L)
--|--|--|--|--|--|--|--
0.0 | 0 | 225 | 7.4 | 275 | 8.2 | 375 | 0.5
150 | 0 | 240 | 9.4 | 300 | 5.0 | 400 | 0.2
175 | 1 | 250 | 9.7 | 325 | 2.5 | 450 | 0.0
200 | 3 | 260 | 9.4 | 350 | 1.2 | 500 | 0.0
Determine:
1. Plot of tracer concentration vs time.
2. RTD curve, $\mathbf{E}(t)$.
3. Cumulative distribution function plot, $\mathbf{F}(t)$.
4. Washout function plot, $\mathbf{W}(t)$.
5. Mean residence time.
6. Fraction of material leaving the reactor that has spent between 230 and 270 seconds.
```
_Solution_
The solution in a Python script is available at [link](https://github.com/aliglara/ebook_che5314_ucv/blob/main/codes/lect_021RTDimpulse.ipynb).
(a) By plotting _C_ as a function of time, the curve shown in Figure \@ref(fig:fig004005a) is obtained. From the $C(t)$ curve is possible to calculate the RTD, according to Eq. \@ref(eq:ec004021), for a pulse impulse test.
We just need to divide each point of c(t) by the integral
\begin{equation*}
\int_0^\infty c(t)\:dt
\end{equation*}
which is just the area under the $C (t)$ curve.
```{r fig004005a, out.width = "65%", echo=FALSE, fig.align='center', fig.cap='Trace concentration curve', fig.lp='fig:'}
library(png)
library(grid)
img <- readPNG("figures/004_01_01.png")
grid.raster(img)
```
Figure \@ref(fig:fig004005b) shows the obtained RTD curve
```{r fig004005b, out.width = "65%", echo=FALSE, fig.align='center', fig.cap='RTD curve', fig.lp='fig:'}
library(png)
library(grid)
img <- readPNG("figures/004_01_02.png")
grid.raster(img)
```
(b) The cumulative distribution curve, _F(t)_, and washout curve, _W(t)_, were obtained from _E(t)_ curve, and Figure \@ref(fig:fig004006a) shows the results obtained.
```{r fig004006a, out.width = "65%", echo=FALSE, fig.align='center', fig.cap='Cumulative curve, F(t)', fig.lp='fig:'}
library(png)
library(grid)
img <- readPNG("figures/004_01_03.png")
grid.raster(img)
```
```{r fig004006b, out.width = "65%", echo=FALSE, fig.align='center', fig.cap='Washout curve, W(t)', fig.lp='fig:'}
library(png)
library(grid)
img <- readPNG("figures/004_01_04.png")
grid.raster(img)
```
(c) The mean residence time is obtained from \@ref(eq:ec004007), thus $\overline{t} = 261.615$ seconds.
(d) To calculate the fraction of material leaving the reactor that has resided in the reactor between 230 and 270 seconds, it is necessary to solve
\begin{equation*}
\int_{230}^{270} {\mathbf{E}(t)dt}
\end{equation*}
However, times 230 and 270 seconds are not presented in the original data. It is necessary to append our data by interpolating _E(t)_ points to correspond times 230 and 270 seconds. Then, the data obtained are plotted in Figure \@ref(fig:fig004007). The shaded area represents the fraction of material leaving the reactor that resided in the reactor between 230 and 270 seconds.
```{r fig004007, out.width = "65%", echo=FALSE, fig.align='center', fig.cap='Analysis of curve E(t)', fig.lp='fig:'}
library(png)
library(grid)
img <- readPNG("figures/004_01_05.png")
grid.raster(img)
```
Then, we learned between 230 and 270 seconds, the 37.53\% of the material left into the reactor.
## Determination of **E(t)** from Step Change
In this case, a step input tracer is a step increase from one steady-state value to another. Usually, as illustrated in Figure \@ref(fig:fig004004), the step increase is from a zero value, and for a $t\to \infty$, the final concentration of the tracer will be equal to its inlet concentration. [@hayes2013]
For a step change, a material-balance criterion is that the steady-steady inlet and outlet tracer concentrations must be equal, both before and after the step change. Then, it may be concluded that the system's response, as shown in Fig. \@ref(fig:fig004004), is linear to the tracer, and there is no loss of tracer because of reaction or adsorption. [@missen1999]
```{r fig004004, out.width = "65%", echo=FALSE, fig.align='center', fig.cap='Typical step change curves for RTD measurement. [@fogler2008]', fig.lp='fig:'}
library(png)
library(grid)
img <- readPNG("figures/004_draw_04.png")
grid.raster(img)
```
In comparison with pulse input, which is related to $\mathbf{E}(t)$, the response to a step change is related to $\mathbf{F}(t)$. The advantages of this experimental method are:
1. A step change is usually easier to achieve.
2. A material balance is usually easier to achieve.
While disadvantages include:
1. Continuous delivery requires a greater amount of tracer.
2. It may have a significant impact on process operation.
Now, considering a constant rate of tracer addition to a feed that is initiated at time $t=0$, the tracer concentration for a system with a constant volumetric flow rate must achieve following conditions:
\begin{equation*}
C_0(t) = \left\{ \begin{array}{ll}
0 & t <0 \\
{\left(C_0\right)} \,\text{ constant} & t \geq 0 \end{array} \right.
\end{equation*}
Thus, in the case of a step increase from an initial value, $C(0)$, to some final value, $c(\infty)$, the outlet concentration as function of time gives the cumulative distribution function, $\mathbf{F}(t)$, directly from the following equation:
\begin{equation}
\mathbf{F}(t) = \frac{c(t) - c(0)}{C(\infty) - c(0)}
(\#eq:ec004022)
\end{equation}
If the inlet tracer concentration has a step decrease from initial value, $C(0)$, to a final value, $C(\infty)$, then the effluent concentration can be used to calculate the washout function, $\mathbf{W}(t)$:
\begin{equation}
\mathbf{W}(t) = \frac{c(t) - c(\infty)}{c(0) - c(\infty)}
(\#eq:ec004023)
\end{equation}
A tracer study may use a step increase followed later by a step decrease; the transient responses in the two cases are the checked consistency. When considered separately, the washout technique has advantages: less tracer is required, and it avoids having to maintain a steady-state value of $C_o$ for a lengthy period. [@missen1999]
The normalized response data may be converted to $\mathbf{E}(t)$, since
\begin{equation*}
\mathbf{E}(t) = \frac{d\mathbf{F}(t)}{dt}
\end{equation*}
Or could be estimated depending on the differencing technique used. From backward differencing:
\begin{equation*}
\mathbf{E}(t) = \frac{d\mathbf{F}(t)}{dt} \approx \frac{F_{i+1} - F_{i}}{t_{i+1} - t_{i}}; \quad i = 1, 2, \,\dots \, n-1
\end{equation*}
and central differencing:
\begin{equation*}
\mathbf{E}(t) = \frac{d\mathbf{F}(t)}{dt} \approx \frac{F_{i+1} - F_{i-1}}{t_{i+1} - t_{i-1}}; \quad i = 2, 3,\, \dots \, n-2
\end{equation*}
Finally, based on the normalized condition of $\mathbf{E}$ curve. The mean residence time could be approximated to:
\begin{equation*}
\overline{t} \approx \sum{t_i\,\mathbf{E}_i\,\Delta t}
\end{equation*}
and the variance $\sigma^{2}$
\begin{equation*}
\sigma_t^{2} \approx \sum{t_i^2\,\mathbf{E}_i\,\Delta t} - \overline{t}^{2}
\end{equation*}
```{exercise, it004002, name="Calculations of RTD and distribution functions curves from step change method"}
The inlet concentration of helium (tracer A) was step-increased from 1.0 to 2.0 mmol/L to determine the mixing pattern in a fluidized-bed reactor. The response data were as follows:
t (min) | C (mmol/L) | t (min) | C (mmol/L)
--|--|--|--
0.0 | 1.000 | 30.0 | 1.410
5.0 | 1.005 | 45.0 | 1.610
10.0 | 1.020 | 60.0 | 1.770
15.0 | 1.060 | 90.0 | 1.920
20.0 | 1.200 | 120.0 | 1.960
Determine $F(t)$, $E(t)$, $\sigma^2$ for flow through the vessel, and calculating $\overline{t}$
```
_Solution_
The solution in a Python script is available at [link](https://github.com/aliglara/ebook_che5314_ucv/blob/main/codes/lect_022RTDstep.ipynb).
The figure \@ref(fig:fig004008) shows results obtained for $F(t)$
```{r fig004008, out.width = "80%", echo=FALSE, fig.align='center', fig.cap='Left: Trace concentration curve. Right: F(t) curve', fig.lp='fig:'}
library(png)
library(grid)
img <- readPNG("figures/004_02_01.png")
grid.raster(img)
```
The RTD was calculated by
\begin{equation*}
\mathbf{E}(t) = \frac{d\mathbf{F}(t)}{dt}
\end{equation*}
Which was estimated using backward differencing for $F(t)$. The figure \@ref(fig:fig004009) shows results obtained for $E(t)$
```{r fig004009, out.width = "65%", echo=FALSE, fig.align='center', fig.cap='E(t) curve', fig.lp='fig:'}
library(png)
library(grid)
img <- readPNG("figures/004_02_03.png")
grid.raster(img)
```
The mean residence time was estimated by trapezoid rule.
\begin{equation*}
\overline{t} = \sum\limits_{i=1}^{n_c - 1} {\left[t_i\,E_i(t)\right]}_{av} \Delta t_i
\end{equation*}
From this,
\begin{equation*}
\overline{t} = 57.537 \text{ min}
\end{equation*}
Finally, the variance was obtained by,
\begin{equation*}
\sigma^2 = \left\{\sum\limits_{i=1}^{n_c - 1} {\left[t_i^2\,E_i(t)\right]}_{av} \Delta t_i \right\} - \overline{t}^2
\end{equation*}
From this,
\begin{equation*}
\sigma^2= 530.249 \text{ min}^2
\end{equation*}
# Applications for RTD functions
As it was said before, RTD provides a measure of macroscopic mixing; therefore, it could be helpful as a tool for:
1. detecting and characterizing flow behavior.
2. estimating of values of parameters for nonideal flow models.
3. assessment of the performance of a vessel as a reactor.
## RTD functions for ideal reactors
$\mathbf{F}(t)$ fits the behavior either when $N$ particles are injected individually at different times to a steady-state reactor or if they are entered all at once to the reactor as $\mathbf{F}(t)$ represents the volume fraction of the fluid leaving the reactor, which resided in the system over a time of $t$ or less.
### Plug Flow Reactor (PFR) {-}
In this reactor, there is not back mixing. Hence, every fluid element has the same mean residence time $\overline{t}$ (or $\tau$). This corresponding to a pulse tracer entering the reactor at time $t=0$ during an infinitesimally short time and does not mix with fluid elements running ahead or behind it within the reactor.
The flow pattern in PFR could be represented in terms of the Dirac delta function $\left( \delta \left(t - \overline{t} \right)\right)$.The Dirac delta function is a generalized function, on the real number line that is zero everywhere except at zero, where it is infinite:
\begin{equation*}
\delta \left(t - \overline{t} \right) = \left \{
\begin{aligned}
& \infty && t = \overline{t} \\
& 0 && t \neq \overline{t}
\end{aligned}
\right.
\end{equation*}
Therefore, the normalized RTD function is written down in terms of Dirac "delta-function''
\begin{equation}
\mathbf{E}(t) = \delta (t - \overline{t} ) = \left \{
\begin{aligned}
& \infty \text{ when } t = \overline{t} \\
& 0 \text{ when } t \neq \overline{t}
\end{aligned}
\right.
(\#eq:ec004025)
\end{equation}
The integral of Dirac $\delta$-function is given as:
\begin{equation*}
\int_a^b \delta {\left(t-\overline{t}\right)} \, f(t) dt = \left \{
\begin{aligned}
& f(\overline{t}) \text{ when } a < \overline{t} < b \\
& 0 \text{ when } a > \overline{t} > b
\end{aligned}
\right.
\end{equation*}
where $a$ and $b$ are any constant.
Therefore,
\[
\mathbf{F}(t) = \left \{
\begin{aligned}
& 0 \text{ when } 0 < t < \overline{t} \\
& 1 \text{ when } t \geq \overline{t}
\end{aligned}
\right.
\]
:::: {.infobox .info data-latex="information"}
The moments of the normalized distribution all equal one, while the central moments equal zero.
::::
### Continuous Stirred Tank Reactor (CSTR) {-}
An ideal CSTR implies that as soon as a fluid element (or pulse of tracer) is injected into the reactor, it distributes itself uniformly throughout the reaction zone. In "ideal'' CSTRs, the exit stream is assumed to have the same composition as the reaction mixture within the reaction zone.
It follows that the exit stream will have the highest possible concentration of material from the tagged fluid element (or pulse tracer) at the outset of the experiment (i.e., $t =0$). After that, the tracer concentration in the main reactor would be diluted with the inlet stream, and the concentration of tracer in the exit stream would be expected to decay to zero gradually.
The RTD for a CSTR can be easily analyzed using a pulse injection. Assume, in the first instance, that the inlet stream to the vessel contains a concentration of the tracer equals to $C_{TR,0}$, given by
\begin{equation}
C_{TR,0} = \frac{N_{TR}}{V_R}
(\#eq:ec004026)
\end{equation}
The decay of tracer concentration in the reactor is an unsteady state process given by,
\begin{equation}
-\upsilon\,C_{TR} = V_R\,\frac{dC_{TR}}{dt}
(\#eq:ec004026a)
\end{equation}
For a constant-density fluid, Eq. \@ref(eq:ec004026a) could be rewritten as
\begin{equation}
-\frac{\upsilon}{V_R}\,dt=-\frac{dt}{\overline{t}} = \frac{dC_{TR}}{C_{TR}}
(\#eq:ec004027)
\end{equation}
Integrating Eq. \@ref(eq:ec004027) yields to:
\begin{equation}
C_{TR}(t) = C_{TR,0}\,\exp{\left(-\frac{t}{\overline{t}}\right)}
(\#eq:ec004028)
\end{equation}
Now, substituting Eq. \@ref(eq:ec004028) into Eq. \@ref(eq:ec004023)
\begin{equation}
\mathbf{W}(t) = \frac{C_{TR}(t) - C_{TR}(\infty)}{C_{TR,0} - C_{TR}(\infty)} = \cfrac{C_{TR,0}\,\exp{\left(-\cfrac{t}{\overline{t}}\right)}
}{C_{TR,0}} = \exp{\left(-\frac{t}{\overline{t}}\right)}
(\#eq:ec004029)
\end{equation}
And, the RTD function is obtained by differentiation:
\begin{equation}
\mathbf{E}(t) = -\frac{d\,\mathbf{W}(t)}{dt} =\frac{1}{\overline{t}} \exp{\left(-\frac{t}{\overline{t}}\right)}\equiv \frac{C(t)}{\displaystyle\int_0^\infty C(t)\, dt}
(\#eq:ec004030)
\end{equation}
The RTD decays exponentially with time. However, the area under the curve is always equal to unity because of the normalization. The typical residence time distribution for a CSTR is presented in Figure \@ref(fig:fig00406)
```{r fig00406, out.width = "65%", echo=FALSE, fig.align='center', fig.cap='The residence time distribution E(t) in a CSTR and the time interval from t to t+dt', fig.lp='fig:'}
library(png)
library(grid)
img <- readPNG("figures/004_draw_07.png")
grid.raster(img)
```
Other tracer experiments can be used to characterize flow patterns for non-ideal reactors. However, the input of a pulse or a step-change is commonly used in practice. Figures \@ref(fig:fig00407a) and \@ref(fig:fig00407b) summarize the exit concentration curves and the shapes of the $\mathbf{E}(t)$ curves for a step change and input pulse of tracer, respectively.
```{r fig00407a, out.width = "65%", echo=FALSE, fig.align='center', fig.cap='Response of tracer species during a step change experiment', fig.lp='fig:'}
library(png)
library(grid)
img <- readPNG("figures/004_draw_08.png")
grid.raster(img)
```
```{r fig00407b, out.width = "55%", echo=FALSE, fig.align='center', fig.cap='Response of tracer species during an input impulse experiment', fig.lp='fig:'}
library(png)
library(grid)
img <- readPNG("figures/004_draw_10.png")
grid.raster(img)
```
## RTD as diagnostic tool for characterizing flow behavior
The RTD curve can be used as a diagnostic method to determine the characteristics of reactor flow patterns. The methods of interpretation fall into two main categories:
1. processes with a relatively small degree of mixing, and
2. processes with significant deviations from ideal flow patterns, namely, dead space, bypassing, and general nonuniform regions.
Since these maldistributions can cause unpredictable conversion in reactors, they are usually detrimental to reactor operation.
### Relatively Small Degree of Mixing {-}
The age-distribution functions for flow patterns with a relatively small degree of mixing will have the general shapes shown in Figure \@ref(fig:fig004agedistribution)
```{r fig004agedistribution, out.width = "65%", echo=FALSE, fig.align='center', fig.cap='Effect of some features of nonideal flow on RTD. [@himmelblau1968]', fig.lp='fig:'}
library(png)
library(grid)
img <- readPNG("figures/004_draw_29.png")
grid.raster(img)
```
As is shown, the peak of the $\mathbf{E}(\theta)$ curve will almost be at the mean holding time $\theta = \overline{t}/\overline{t} = 1$, and $\mathbf{I}(\theta)$ curve will have a value of about 0.5 at $\theta = 1$. None of the curves will have excessively long tails and, in particular, the $\mathbf{E}(\theta)$ will be almost symmetrical.
These features lead to the use of the type of description based on Gaussian curves, namely, the mean and the variance.
\begin{align*}
\text{mean} & = \mu_1 = \int_0^\infty \theta\,\mathbf{E}(\theta)\,d\theta = 1 \\
\text{variance} & = \sigma^2 = \int_0^\infty \left(\theta - \mu_1 \right)^2\,\mathbf{E}(\theta)\,d\theta
\end{align*}
### Detection of Dead Space {-}
A process vessel may exhibit a region where fluid elements are retained for times of an order of magnitudes more significant than the mean residence time of the total fluid, what is called **dead space**. The existence of dead space is most easily verified from the characteristics of the $\mathbf{E}(\theta)$ curve as shown in Figure \@ref(fig:fig004deadspace). The $\mathbf{E}(\theta)$ will have a very long tail indicating that fluid is held in the dead space.
```{r fig004deadspace, out.width = "55%", echo=FALSE, fig.align='center', fig.cap='Identification of the existence of dead space in a process vessel. [@himmelblau1968]', fig.lp='fig:'}
library(png)
library(grid)
img <- readPNG("figures/004_draw_30.png")
grid.raster(img)
```
The _true_ mean residence time will be equal to the vessel volume divided by the flow rate $\overline{t} = V/\upsilon$. However, the experimental data for times longer than $\theta$ equal to 2 or 3 times mean residence time are seldom of sufficient accuracy to use in calculations. Thus, the calculated apparent mean residence time would be
\begin{equation*}
\overline{\theta}_a = \int_0^\theta \theta^\prime \, \mathbf{E}(\theta^\prime)\,d\theta^\prime, \qquad \theta \approx 2 \text{ or } 3
\end{equation*}
whereas the true mean would be
\begin{align*}
\theta & = \int_0^\infty \theta \, \mathbf{E}(\theta)\,d\theta = \int_0^\theta \theta^\prime \, \mathbf{E}(\theta^\prime)\,d\theta^\prime + \int_\theta^\infty \theta^\prime \, \mathbf{E}(\theta^\prime)\,d\theta^\prime = 1 \\
& = \overline{\theta}_a + \int_\theta^\infty \theta^\prime \, \mathbf{E}(\theta^\prime)\,d\theta^\prime = 1
\end{align*}
In presence of dead space, $\overline{\theta}_a < 1$ or $\overline{t}_a < \overline{t}$. The apparent mean gives a measure of the dead volumen of the vessel:
\begin{equation*}
\overline{t}_a = \frac{V_\text{active}}{\upsilon_\text{active}} = \frac{V - V_\text{dead}}{\upsilon_\text{active}} = \overline{t}\, \overline{\theta}_a
\end{equation*}
This equation can be rewritten as
\begin{align*}
\frac{V_\text{dead}}{V} &= \frac{\upsilon_\text{active}}{V} \left(\frac{V}{\upsilon_\text{active}} - \overline{t}\overline{\theta}_a\right) \\
\frac{V_\text{dead}}{V} &= 1 - \overline{\theta}_a\,\overline{t}\,\frac{\upsilon_\text{active}}{V} \\
\frac{V_\text{dead}}{V} &= 1 - \overline{\theta}_a \left(\frac{\upsilon_\text{active}}{\upsilon} \right)\approx 1 - \overline{\theta}_a
\end{align*}
One problem with using these relations is that they assume the true mean holding time, $\overline{t}$, is known. Since it cannot be found from the trace curve (due to the inaccurate tail), it must be known independently and challenging to obtain.
### Detection of Bypassing {-}
If a portion of fluid spends one-tenth of the overall fluid's mean residence time, this fluid can be said to bypass the vessel for all practical purposes. The $\mathbf{E}(\theta)$ curve would then appear as in Figure \@ref(fig:fig004bypass).
```{r fig004bypass, out.width = "55%", echo=FALSE, fig.align='center', fig.cap='Identification of the existence of bypassing in a process vessel. [@himmelblau1968]', fig.lp='fig:'}
library(png)
library(grid)
img <- readPNG("figures/004_draw_31.png")
grid.raster(img)
```
If there is a large amount of dead space or bypassing, the distinction between the two is not clear-cut but depends on which part of the fluid is considered the "major'' part, a somewhat arbitrary assignment.
However, $\mathbf{E}(\theta)$ can be used to detect dead space or bypassing (as discussed above). If the true mean holding time is not known, this curve cannot be used to determine dead space. Instead, the $\mathbf{I}(\theta)$ curve must be used because it always has the same shape as regards the existence of maxima no matter what the time scale. Therefore, the most significant utility of the intensity function is to determine dead space from experimental data, especially if the true mean holding time is unknown.
Figure \@ref(fig:fig004002a) summarizes the typical shapes of the $\mathbf{E}(\theta)$ curve of (a) stagnation, (b) dispersion and (c) channeling or excessive bypassing.
```{r fig004002a, out.width = "55%", echo=FALSE, fig.align='center', fig.cap='Effect of some features of nonideal flow on RTD. [@missen1999]', fig.lp='fig:'}
library(png)
library(grid)
img <- readPNG("figures/004_draw_24.png")
grid.raster(img)
```
If large amounts of dead space of bypassing exist, it may not be worthwhile to try to construct a detailed mathematical model because the unit is sure to give poor performance. Thus, some modifications might be called for to eliminate the severe mixing problems.
In order to provide a better picture of the behavior of the distribution functions, a simple mathematical model will be considered that includes the possibility of having well-defined dead space and bypassing. The model consists of two parallel streams, each with a given number of perfectly mixed tanks in series as shown in Figure \@ref(fig:fig004modeldeadzone)
```{r fig004modeldeadzone, out.width = "55%", echo=FALSE, fig.align='center', fig.cap='Scheme of the mathematical representation. [@himmelblau1968]', fig.lp='fig:'}
library(png)
library(grid)
img <- readPNG("figures/004_draw_32.png")
grid.raster(img)
```
The RTD for this model with $j$ stirred tanks in series is
\begin{equation*}
\mathbf{E}(t) = \frac{j^j}{\left(j-1\right)!} \frac{t^{j-1}}{\overline{t}}\exp\left(-\frac{j\,t}{\overline{t}}\right)
\end{equation*}
where $\overline{t}$ is the mean residence time. If the equation is used for each branch of the model and weighted with respect to the amount of flow in the branch, the RTD for the entire model is:
\begin{equation*}
\mathbf{E}(t) = f\,\left(\frac{n^n}{\left(n-1\right)!} \frac{t^{n-1}}{\overline{t}_1}\exp\left(-\frac{n\,t}{\overline{t}_1}\right)\right) + \left(1-f\right)\,\left(\frac{m^m}{\left(m-1\right)!} \frac{t^{m-1}}{\overline{t}_2}\exp\left(-\frac{m\,t}{\overline{t}_2}\right)\right)
\end{equation*}
where $f$ represents the fraction of flow to branch **1**. The mean residence time is
\begin{equation*}
\overline{t} = f\, \overline{t}_1 + \left(1 - f\right)\, \overline{t}_2
\end{equation*}
Dimensionless variables based on the total mean residence time, $\overline{t}$ can now be defined:
\begin{equation*}
\theta = \frac{t}{\overline{t}} \quad \alpha = \frac{\overline{t}_2}{\overline{t}_1} \quad \beta = f + \left(1 - f\right) \alpha
\end{equation*}
Three situations were considered:
1. Fifteen tanks in each branch correspond to a relatively small amount of mixing in the branch.
2. Two tanks in each branch correspond to a large amount of mixing in the branch.
3. Four tanks in each branch correspond to a moderate amount of mixing in the branch.
Scenario 1. is shown in Figure \@ref(fig:fig004RTDdiagnostic). The rest of scenarios is available clicking on the next [link](https://github.com/aliglara/ebook_che5314_ucv/blob/main/codes/lect_023RTDasDiagnosticTool.ipynb)
```{r fig004RTDdiagnostic, out.width = "65%", echo=FALSE, fig.align='center', fig.cap='RTD curves for parallel stirred-tanks models.', fig.lp='fig:'}
library(png)
library(grid)
img <- readPNG("figures/004_07.png")
grid.raster(img)
```
# Models for nonideal flow
The information provided by RTD functions is essential to know if a reactor has dead zones or bypassing. These situations affect the reactor performance. Thus, the main target is answering the question "How much bypassing or dead volume is acceptable?".
For answering, the chemical engineer needs to calculate the performance of the reactor. Furthermore, to do so, two types of information are required: the flow patterns and the kinetic model.
```{r out.width = "65%", echo=FALSE, fig.align='center'}
library(png)
library(grid)
img <- readPNG("figures/004_modelnonidealstructure.png")
grid.raster(img)
```
The information provided by RTD functions is essential to know if a reactor has dead zones or bypassing. These situations affect the reactor performance. Thus, the main target is answering the question "How much bypassing or dead volume is acceptable?''.
For answering, the chemical engineer needs to calculate the performance of the reactor. Furthermore, to do so, two types of information are required: the flow patterns and the kinetic model.
The RTD curves found from tracer studies are only partial information on the details of the flow patterns because all that is known is the length of time-specific fractions of the fluid stay in the vessel (macromixing), but neither what of these fractions do while in the vessel nor in what geometric locations they reside, that is, information on micromixing.
As a result, several mathematical models of reactor performance have been developed to estimate the conversion levels in a nonideal reactor. [@hill1977]
The micromixing behavior has two extremes views:
1. Complete segregation: any fluid element is isolated from all other fluid elements and retains its identity throughout the entire vessel. No micromixing occurs, but macromixing may occur.
2. Complete dispersion: fluid elements interact and mix thoroughly at the microscopic level.
Besides the degree of segregation of fluid elements, another aspect of mixing is the relative time in passage through a vessel at which fluid element mix (''earliness'' of mixing). [@missen1999]
In general, a mathematical model for nonideal flow in a vessel provides a characterization of mixing and flow behavior. Although it may appear to be an independent alternative to the experimental measurement of RTD, the latter may be required to determine the parameter(s) of the model.
For that reason, these mathematical models can be classified in function of the number of adjustable parameters. [@fogler2008]
1. Zero adjustable parameters
* segregation model
* maximum mixedness model
2. One parameter model
* tanks-in-series model
* dispersion model
3. Two adjustable parameters
* actual reactor modeled as combinations of ideal reactors
These parameters are correlated as functions of fluid and flow properties, reactor configurations, along with other vital features, and can be used in design calculations.
Generally speaking, the more adjustable parameters used in a model, the better the correlation between predicted and observed RTD would be. These adjustable parameters are often related to RTD moments and are usually expressed in terms of dimensionless moments about the mean.
The usual approach is developing a model flow system with the same RTD as the existing system. Provided that the conservation equations can be written for this model system, the performance of the actual vessel can be predicted.
## Zero adjustable parameters
### Segregational or macrofluid model {-}
This model represents the micromixing condition of complete segregation (no mixing) of fluid elements, which means that fluid flows through a vessel with no mixing between adjacent fluid elements. The feed enters the reactor as little _packets_ of fluid. Each packet retains its identity as they pass through the vessel; there is no mass exchange between individual packets. However, packets can mix each other in the reactor. Thus those that enter at some time, _t_, will not all leave at the same time.
Each packet can be treated as a small ideal batch reactor. A reaction (or reactions) takes place as the tiny packets move through the vessel. The composition of each packet changes while it is flowing through the vessel. However, its final conversion will depend on how long the packet has spent in the vessel. [@roberts2009].
After leaving the reactor, all fluid packets are mixed on a molecular level, and the average composition is measured. This situation is represented in Figure \@ref(fig:fig004010c). [@roberts2009]
```{r fig004010c, out.width = "65%", echo=FALSE, fig.align='center', fig.cap='Segregational model scheme. [@roberts2009]', fig.lp='fig:'}
library(png)
library(grid)
img <- readPNG("figures/004_draw_18.png")
grid.raster(img)
```
When the packets are admitted to a CSTR, we can envisage two scenarios that involve perfect mixing: one with perfect mixing at the macroscale and the other with perfect mixing at the microscale, as is shown in Figure \@ref(fig:fig004010d)
```{r fig004010d, out.width = "65%", echo=FALSE, fig.align='center', fig.cap='Different levels of mixing in a CSTR: (a) Segregational model, (b) Ideal CSTR model. [@hayes2013]', fig.lp='fig:'}
library(png)
library(grid)
img <- readPNG("figures/004_draw_19.png")
grid.raster(img)
```
The conversion in a segregated tank reactor can be calculated using the ideal batch reactor equation design and the RTD curve. Each batch reactor has its conversion, which depends on its time in the tank. While the RTD gives information about the mean residence time.
The initial concentration of reactants in the packet is the same as the inlet concentration of the reactor. While each fluid element (assuming constant density) behaves as a batch reactor, the total reactor conversion is the average conversion of all the fluid elements at the outlet conditions. That is:
```{r, echo=FALSE, fig.fullwidth=TRUE}
library(png)
library(grid)
img <- readPNG("figures/004_segregationalmodelbalance.png")
grid.raster(img)
```
where the summation is over all fluid elements in the reactor exit stream. This equation can be written analytically as:
\begin{equation}
\overline{C}_A = \int_0^\infty{C_A(\overline{t})\,\mathbf{E}(t)\,d\overline{t}}
(\#eq:ec004031)
\end{equation}
Where $C_A(t)$ depends on the residence time of the element.
\begin{equation*}
\frac{d\,C_A(t)}{dt} = - r_A = k\,C_A(t)
\end{equation*}
The equation \@ref(eq:ec004031) is rewritten as
\begin{equation}
\frac{\overline{C}_A}{C_{A0}} = \int_0^\infty{\left(\frac{C_A(\overline{t})}{C_{A0}}\right)\,\mathbf{E}(t)\,d\,t} \approx \sum_{\substack{\text{\footnotesize{all age}}\\\text{\footnotesize{intervals}}}}\left(\frac{C_A}{C_{A0}}\right)\,\mathbf{E}(t)\,\Delta t
\end{equation}
(\#eq:ec004032)