Understanding the diffusion calculator — concept and principle
Diffusion is the spontaneous spreading of molecules from regions of high concentration to regions of low concentration. This calculator gives two numbers: the steady diffusive flux through a layer (Fick's first law) and the typical distance molecules travel in a given time. It helps judge how fast oxygen crosses a membrane or how far a dye spreads in a gel.
How it is calculated
- Flux: J = D × ΔC ÷ Δx, the magnitude of Fick's first law J = −D dC/dx. D is the diffusion coefficient in m²/s, ΔC the concentration difference in mol/m³, and Δx the thickness in metres (the calculator converts your millimetres by dividing by 1,000). J comes out in mol/(m²·s): moles crossing each square metre every second.
- Diffusion length: L = √(2Dt), with t in seconds. The result in metres is multiplied by 1,000 to show millimetres.
The principle
Molecules move randomly. Where there are more molecules, more of them happen to wander outward than wander back, so there is a net flow down the concentration gradient. Fick's law says this net flow is proportional to the gradient, and the minus sign means it runs from high to low. The second formula comes from the random walk: the mean squared displacement along one axis grows linearly with time, ⟨x²⟩ = 2Dt, so the typical distance grows only with the square root of time. Doubling the distance takes four times as long.
Worked example
- Inputs: D = 2 × 10⁻⁹ m²/s (typical of a small molecule in water), ΔC = 100 mol/m³, Δx = 1 mm = 0.001 m, t = 3,600 s.
- Gradient: 100 ÷ 0.001 = 100,000 mol/m⁴.
- Flux: 2 × 10⁻⁹ × 100,000 = 0.0002 mol/(m²·s).
- Diffusion length: √(2 × 2 × 10⁻⁹ × 3,600) = √(1.44 × 10⁻⁵) = 0.003795 m = 3.794733 mm.
| Distance (mm) | Flux (mol/m²·s) |
|---|---|
| 0.25 | 0.0008 |
| 0.5 | 0.0004 |
| 0.75 | 0.0002666667 |
| 1 | 0.0002 |
| 1.25 | 0.00016 |
| 1.5 | 0.0001333333 |
| 2 | 0.0001 |
How to read the result
Small molecules in liquids have D of roughly 10⁻⁹ m²/s, so in one hour they spread only a few millimetres. Gases in air have D near 10⁻⁵ m²/s, about ten thousand times faster. A thin layer gives a large flux, which is why lungs, gills and catalysts have very thin barriers and large surface areas. Multiply J by area for total moles per second.
Common mistakes
- Entering D in cm²/s instead of m²/s (1 cm²/s = 10⁻⁴ m²/s).
- Forgetting that Δx is in millimetres here, not metres.
Frequently asked questions
Why is the factor 2 in √(2Dt)?
It is the one-dimensional random-walk result. For spreading in three dimensions the mean squared distance is 6Dt, so the typical radius is √(6Dt).
How does temperature affect D?
D rises with temperature. In liquids it roughly follows the Stokes–Einstein relation, D = kT/(6πηr), so lower viscosity and smaller molecules diffuse faster.
What is Fick's second law?
It describes how concentration changes with time, ∂C/∂t = D ∂²C/∂x², and is needed when the profile is not yet steady.
Sources: A. Fick, "Ueber Diffusion", Annalen der Physik 94 (1855) · E. L. Cussler, Diffusion: Mass Transfer in Fluid Systems, Cambridge University Press · R. B. Bird, W. E. Stewart, E. N. Lightfoot, Transport Phenomena, Wiley