Skip to content

polykin.transport.diffusion¤

uptake_constc_sphere ¤

uptake_constc_sphere(Fo: float) -> float

Fractional mass uptake for transient diffusion in a sphere subjected to a constant surface concentration boundary condition.

For a sphere of radius \(a\), where the concentration is initially \(C_0\) everywhere, and the surface concentration is maintained at \(C_s\), the fractional mass uptake is:

\[ \frac{\bar{C}-C_0}{C_s -C_0} = 1 - \frac{6}{\pi^2}\sum_{n=1}^{\infty}\frac{1}{n^2} \exp (-n^2 \pi^2 Fo) \]

where \(Fo = D t/a^2\) is the Fourier number.

References

  • J. Crank, "The mathematics of diffusion", Oxford University Press, 1975, p. 91.
PARAMETER DESCRIPTION
Fo

Fourier number, \(D t/a^2\).

TYPE: float

RETURNS DESCRIPTION
float

Fractional mass uptake.

See also

Examples:

Determine the fractional mass uptake after 100 seconds for a polymer sphere with a radius of 0.1 mm and a diffusion coefficient of 1e-11 m²/s.

>>> from polykin.transport import uptake_constc_sphere
>>> t = 1e2   # s
>>> a = 1e-4  # m
>>> D = 1e-11 # m²/s
>>> Fo = D*t/a**2
>>> uptake_constc_sphere(Fo)
0.7704787380259631
Source code in src/polykin/transport/diffusion.py
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
def uptake_constc_sphere(Fo: float) -> float:
    r"""Fractional mass uptake for transient diffusion in a sphere subjected
    to a constant surface concentration boundary condition. 

    For a sphere of radius $a$, where the concentration is initially $C_0$
    everywhere, and the surface concentration is maintained at $C_s$, the
    fractional mass uptake is:

    $$ \frac{\bar{C}-C_0}{C_s -C_0} =
    1 - \frac{6}{\pi^2}\sum_{n=1}^{\infty}\frac{1}{n^2} \exp (-n^2 \pi^2 Fo) $$

    where $Fo = D t/a^2$ is the Fourier number.

    **References**

    * J. Crank, "The mathematics of diffusion", Oxford University Press, 1975,
      p. 91.

    Parameters
    ----------
    Fo : float
        Fourier number, $D t/a^2$.

    Returns
    -------
    float
        Fractional mass uptake.

    See also
    --------
    * [`profile_constc_sphere`](profile_constc_sphere.md): related method to
      determine the concentration profile.
    * [`uptake_convection_sphere`](uptake_convection_sphere.md): related method
      for surface convection boundary condition.

    Examples
    --------
    Determine the fractional mass uptake after 100 seconds for a polymer sphere
    with a radius of 0.1 mm and a diffusion coefficient of 1e-11 m²/s.
    >>> from polykin.transport import uptake_constc_sphere
    >>> t = 1e2   # s
    >>> a = 1e-4  # m
    >>> D = 1e-11 # m²/s
    >>> Fo = D*t/a**2
    >>> uptake_constc_sphere(Fo)
    0.7704787380259631
    """
    N = 4  # Number of terms in series expansion (optimal value)

    if Fo == 0:
        result = 0
    elif Fo < 1/4:
        # Solution for small times
        A = sqrt(Fo)
        S = sum(ierfc(n/A) for n in range(1, N))
        result = 6*A * (1/sqrt(pi) + 2*S) - 3*Fo
    else:
        # Solution for normal times
        B = -Fo*pi**2
        S = sum(1/n**2 * exp(B*n**2) for n in range(1, N))
        result = 1 - (6/pi**2)*S

    return result

Graphical Illustration¤

uptake_constc_sphere