Home / Science / Materials science / Phase and thermal behaviour / Diffusion calculatorTool #851

Diffusion calculator: Fick's second law, erf profiles, Arrhenius D, carburising case depth and time

Work out diffusion in solids with Fick's second law: the erfc profile under a constant surface concentration, a thin-film Gaussian source, or a diffusion couple. Get D from D₀ and Q at any temperature, the case depth for a target concentration, the time to reach a depth, the concentration profile plot, and an optional finite-difference check.

Keep it one tap away for everyday use.

Bookmark Diffusion calculator?

Press Ctrl + D now. Your browser opens its own bookmark box, where you choose the name and folder.

  1. D(T)
  2. Set-up
  3. Profile
  4. Depth
Nothing is uploadedWorks offline once open

1. Diffusion coefficient

D = D₀ exp(−Q/RT). The example D₀ and Q are round made-up values of the size found for carbon in hot steel; use values for your own system.

2. Set-up and concentration profile

3. Case depth and time to reach a depth

Case depth: how deep the target concentration has reached after the time above. Time: how long until the concentration at x reaches the target. For a couple, x is measured from the joint and may be negative.

Download

What it does

Atoms move through a solid by diffusion, and Fick’s second law, ∂C/∂t = D ∂²C/∂x², tells you how a concentration spreads with time. For three common set-ups it has neat closed-form answers, and this page uses them:

  • Constant surface concentration (carburising, nitriding, doping from a gas): (C − C₀)/(Cₛ − C₀) = erfc(x / 2√(Dt)).
  • Thin film of a total amount M per unit area, on a surface (diffusing inwards) or inside a body (both ways): a Gaussian, C = C₀ + M/√(πDt) · exp(−x²/4Dt), with half of that for a buried film.
  • Diffusion couple of two blocks joined at x = 0: C = (C₁ + C₂)/2 + (C₂ − C₁)/2 · erf(x / 2√(Dt)).

The diffusion coefficient comes from the Arrhenius law D = D₀ exp(−Q/RT), or you can type it. The page then gives the diffusion length √(Dt), the profile at a quarter, one and four times your time, the case depth where the concentration has fallen to a target, the time until a given depth reaches the target, and the concentration at that depth. Tick the finite-difference check to solve the same problem numerically on a grid and see how close the two are.

How to use it

  1. Give D₀ and Q (in kJ/mol or eV per atom) and the temperature in °C or K, or switch to “Type D”.
  2. Pick the situation and type the concentrations (any one unit: wt%, at%, atoms per cm³) and the time.
  3. Type a target concentration and a depth. Read the case depth and the time. Download the profile as CSV, or everything as an image, PDF or Word file.

Worked example

A made-up steel with C₀ = 0.2 wt% carbon is carburised at 1000 °C with the surface held at 1.0 wt%. With D₀ = 2 × 10⁻⁵ m²/s and Q = 140 kJ/mol, D = 3.608 × 10⁻¹¹ m²/s at 1273.15 K. After 4 h the diffusion length √(Dt) is 720.8 µm.

The case depth to 0.4 wt% is 1.173 mm: (0.4 − 0.2)/(1.0 − 0.2) = 0.25 = erfc(z) gives z = 0.8134, and x = 2 × 0.7208 mm × 0.8134. At 0.5 mm the carbon is 0.6990 wt% after 4 h, and it first reached 0.4 wt% there after 43.64 min. Doubling the case depth takes four times as long, 16 h. Near 1000 °C, D doubles for every 66.7 K warmer.

With the finite-difference check on, the explicit scheme (1235 time steps, r = 0.4) agrees with the erfc curve to within about 0.01 % of the range.

Tips

  • The erfc solution assumes the body is thick compared with √(Dt) and that D does not change with concentration. Real carburising often has a surface reaction limit, so measured surface carbon builds up over time.
  • The thin-film Gaussian holds once √(Dt) is much larger than the film; the page warns when it is not.
  • Activation energies in eV per atom convert with 1 eV = 96.485 kJ/mol.

FAQ

Why does the time go as the square of the depth? All the solutions depend on x/√(Dt) only, so the same concentration moves to twice the depth in four times the time.

Why can a depth “never” reach the target in a thin film? The film’s atoms spread out and the total stays fixed, so the concentration at a given depth rises to a peak at t = x²/(2D) and then falls. Targets above that peak are never reached.

Is my input stored? No, all the sums happen on this page.

Where the numbers come from

  • The erf, erfc and Gaussian solutions of Fick's second law and the Arrhenius law are textbook forms (Crank, The Mathematics of Diffusion; Shewmon, Diffusion in Solids; Porter and Easterling, Phase Transformations in Metals and Alloys, ch. 2). fibub's code is checked in the tests against SciPy (scipy.special.erf, erfinv, brentq) and a NumPy finite-difference solver.
  • The example D₀, Q, temperatures and concentrations are made-up round values, not data for any real material.
  • Nothing you type is sent or stored.

Standard scientific values, such as constants, atomic weights and melting points, are facts found in every textbook; we name where ours were checked. If you are an author or publisher and want a value, a credit or a table changed or removed, tell us and we will act quickly.

Last updated 2026-11-09.

Related tools

Stress-strain curve analyser #846 Paste or open force-extension or stress-strain data from a tensile test. Get Young's modulus from a straight-line fit, the 0.2 % offset yield strength, tensile strength, uniform and fracture elongation, toughness, resilience, true stress-strain to the UTS and the strain-hardening exponent, with a plot and CSV. Larson-Miller creep calculator #849 Paste or open creep-rupture tests (temperature, stress, hours) and fit a Larson-Miller master curve with C = 20 or your own C. Predict rupture life and the stress for a design life, compare with Sherby-Dorn and Manson-Haferd, and fit Norton's creep law (n and Q) from minimum creep rates. Thermal mismatch stress calculator #852 Work out the stress from different thermal expansion: the biaxial stress in a thin film on a substrate, film stress from wafer bow or curvature with Stoney's equation, the curvature and layer stresses of a bonded bimetal strip (Timoshenko), and the stress in a bar held between walls. The CTE can change linearly with temperature. Nanoparticle calculator #858 From a particle's diameter, density and molar mass, get the surface-to-volume ratio, specific surface area in m²/g, atoms per particle and the share of atoms on the surface. Count atoms and corner, edge and face sites in magic-number cuboctahedral and icosahedral clusters, convert a mass concentration to particles per mL and nanomolar, and find the BET-equivalent diameter. DLS analyser #859 Paste or open a DLS intensity autocorrelation g2(τ). Get the z-average diameter and polydispersity index by 2nd- or 3rd-order cumulants, and a regularised non-negative (CONTIN-like) size distribution by intensity, volume and number, from your wavelength, angle, refractive index, temperature and viscosity. 1D Schrödinger solver #923 Choose a textbook potential, type a formula or draw your own, and get the lowest energy levels and wavefunctions of the one-dimensional Schrödinger equation by the matrix (finite-difference) method, with the exact levels alongside for the box, harmonic oscillator, finite well, Morse, linear and Pöschl–Teller potentials.