Skip to content

polykin.reactors.rtd¤

F_dispersion_model ¤

F_dispersion_model(
    t: float, tavg: float, Pe: float
) -> float

Cumulative residence time distribution for the dispersed plug flow model (also known as dispersion model).

Only approximate analytical solutions are available for this model. For small deviations from plug flow, i.e. when \(Pe > 10^2\), the distribution is approximated by:

\[ F(t) = \frac{1}{2}\left[ 1 + \mathrm{erf} \left( \frac{\sqrt{Pe}}{2}(\theta-1)\right) \right] \]

Otherwise, when \(Pe \le 10^2\), the distribution is approximated by the numerical integral of the so-called open-open solution:

\[ F(t) = \frac{1}{\bar{t}} \sqrt{\frac{Pe}{4\pi}} \int_0^{\theta} \frac{1}{\sqrt{\theta'}} \exp\left[-\frac{Pe}{4}\frac{(1-\theta')^2}{\theta'}\right] d\theta' \]

where \(\theta = t/\bar{t}\), and \(Pe = (v L)/D\).

PARAMETER DESCRIPTION
t

Residence time.

TYPE: float

tavg

Average residence time, \(\bar{t}\).

TYPE: float

Pe

Péclet number, \((v L)/D\).

TYPE: float

RETURNS DESCRIPTION
float

Cumulative residence time distribution.

See also
Source code in src/polykin/reactors/rtd.py
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
def F_dispersion_model(t: float, tavg: float, Pe: float) -> float:
    r"""Cumulative residence time distribution for the dispersed plug flow
    model (also known as dispersion model).

    Only approximate analytical solutions are available for this model. For
    small deviations from plug flow, i.e. when $Pe > 10^2$, the distribution is
    approximated by:

    $$ F(t) = \frac{1}{2}\left[ 1 +
        \mathrm{erf} \left( \frac{\sqrt{Pe}}{2}(\theta-1)\right) \right]  $$

    Otherwise, when $Pe \le 10^2$, the distribution is approximated by the
    numerical integral of the so-called open-open solution:

    $$ F(t) = \frac{1}{\bar{t}} \sqrt{\frac{Pe}{4\pi}}
        \int_0^{\theta} \frac{1}{\sqrt{\theta'}}
        \exp\left[-\frac{Pe}{4}\frac{(1-\theta')^2}{\theta'}\right] d\theta' $$

    where $\theta = t/\bar{t}$, and $Pe = (v L)/D$.

    Parameters
    ----------
    t : float
        Residence time.
    tavg : float
        Average residence time, $\bar{t}$.
    Pe : float
        Péclet number, $(v L)/D$.

    Returns
    -------
    float
        Cumulative residence time distribution.

    See also
    --------
    * [`E_dispersion_model`](E_dispersion_model.md): related method to determine
      the differential distribution.
    """
    q = t/tavg
    if q == 0:
        return 0
    elif q == inf:
        return 1
    else:
        if Pe > 1e2:
            return 0.5*(1 + erf(sqrt(Pe)/2*(q - 1)))
        else:
            result, _ = integrate.quad(
                E_dispersion_model,
                a=0.,
                b=t,
                args=(tavg, Pe),
                epsabs=1e-5)
            return result