Set diffusion coefficient, slab thickness, and boundary conditions to visualize the time evolution of concentration profiles. Explore Fick's first and second laws with analytical and numerical solutions.
Parameters
Material Presets
Diffusion coefficient D [m²/s]
10⁻¹⁴ ~ 10⁻⁸ m²/s(Log Scale)
slab thickness L [mm]
mm
Surface concentration C_s / C0
Initial concentration ratio C0/Cs
Number of displayed times
Maximum time t_max [h]
h
Initial concentration profile
Click on the chart to set initial concentration distribution points. A concentration point is added at the clicked position with linear interpolation.
Playback Controls
0.00 s
Concentration Distribution Snapshot
Results
—
Diffusion length sqrt(Dt) [um]
—
Penetration Depth (C/Cs=0.1) [μm]
—
Average concentration Cbar/Cs
—
Surface Flux J₀ [mol/m²s]
—
Time to 50% [h]
Diff
CAE Applications
Carburization and nitriding heat treatment depth design / Hydrogen embrittlement and delayed fracture hydrogen concentration evaluation / Oxidation film growth analysis (Ti-6Al-4V, etc.). Also usable as a hand-calculation benchmark for ABAQUS/COMSOL mass diffusion solver verification.
Theory & Key Formulas
Fick's second law (diffusion equation):
$$\frac{\partial C}{\partial t}= D \frac{\partial^2 C}{\partial x^2}$$
What exactly is mass diffusion? I hear about it in heat treatment and corrosion, but what's physically happening?
🎓
Basically, it's the net movement of atoms or molecules from a region of high concentration to low concentration, just like heat flows from hot to cold. In practice, this is how carbon gets into steel to harden it, or how oxygen reacts with a metal surface. Try moving the "surface concentration C_s" slider in the simulator—you're setting the driving force for this atomic migration.
🙋
Wait, really? So the "Diffusion coefficient D" is like a speed rating for how fast atoms move? What affects it?
🎓
Exactly! D is the material's "diffusivity." It depends heavily on temperature and the diffusing species. For instance, carbon diffuses much faster in iron at 900°C than at 700°C. In the simulator, if you increase D, you'll see the concentration profile penetrate deeper in the same amount of time. A common case is hydrogen diffusion in steel, which is surprisingly fast and can cause embrittlement.
🙋
That makes sense. But the graph shows the concentration changing over time. How do we predict the profile at, say, 10 hours versus 100 hours?
🎓
Great question! That's where Fick's Laws come in. The shape of the curve is governed by a mathematical solution involving the error function. You can test this directly: set your "Maximum time t_max" to 100 hours and watch the "Number of displayed times" slider progress through the timesteps. You'll see the concentration front slowly marches inward, and the rate slows down over time—it's proportional to the square root of time.
Physical Model & Key Equations
The fundamental governing equation for transient (time-dependent) diffusion in one dimension is Fick's Second Law. It states that the rate of change of concentration at a point is proportional to the second spatial derivative (the curvature) of the concentration profile.
$$\frac{\partial C(x,t)}{\partial t}= D \frac{\partial^2 C(x,t)}{\partial x^2}$$
Where: $C(x,t)$ = Concentration [mol/m³ or wt%] at position $x$ and time $t$. $D$ = Diffusion coefficient [m²/s]. $t$ = Time [s].
This is a partial differential equation that needs a solution based on initial and boundary conditions.
For a common engineering case—a semi-infinite solid with a constant surface concentration—the solution to Fick's Second Law is given by the complementary error function (erfc). This is the equation powering the main simulator plot.
Where: $C_0$ = Initial, uniform concentration inside the material (set by "initial concentration ratio"). $C_s$ = Constant surface concentration (set by "surface concentration"). $\text{erfc}()$ = Complementary error function, a mathematically defined S-shaped curve.
The key physical insight is in the term $\sqrt{Dt}$: the diffusion penetration depth scales with the square root of time, not linearly.
Frequently Asked Questions
The diffusion coefficients of typical materials can be found in literature or databases. For example, the diffusion coefficient of carbon in iron is approximately 1e-11 m²/s (at 1000°C). If an approximate value is sufficient, refer to the values of similar materials and adjust them so that the simulation results match actual measurements.
'Constant concentration' fixes the surface concentration (e.g., constant gas concentration in carburizing), while 'constant flux' fixes the inflow amount to the surface (e.g., diffusion through an oxide film). In the former, the concentration does not change over time, and in the latter, the concentration gradient becomes constant. Choose according to the application.
In thin slabs, the concentration gradient becomes steep, and if the time step in numerical calculation is insufficient, divergence occurs. As a countermeasure, set a time step sufficiently smaller than the characteristic time (τ = L²/D) determined by the diffusion coefficient and thickness, or use the automatic time step adjustment function.
Yes, it is possible. By setting the diffusion coefficient to the value for hydrogen (e.g., approximately 1e-9 m²/s in iron) and the boundary condition to the hydrogen concentration or flux, you can visualize the hydrogen concentration distribution over time. However, a separate stress analysis is required for evaluating the embrittlement threshold.
Real-World Applications
Case Hardening (Carburization/Nitriding): This is a classic heat treatment process. Engineers pack low-carbon steel parts in a carbon-rich environment at high temperature. Carbon atoms diffuse in from the surface, creating a hard, wear-resistant outer layer while keeping the ductile core. The simulator directly models this: C_s is the surface carbon potential, and the plot shows the resulting carbon gradient. Engineers use this to design treatment time and temperature to achieve a specified case depth.
Hydrogen Embrittlement Analysis: Hydrogen atoms, often from corrosion or electroplating, can diffuse into high-strength steels and cause catastrophic delayed fracture. Predicting the hydrogen concentration profile over time is critical for assessing risk in pipelines, pressure vessels, and fasteners. The "Diffusion coefficient D" for hydrogen is relatively high, meaning dangerous concentrations can build up faster than you might expect.
Oxidation & Corrosion Film Growth: When metals like titanium (Ti-6Al-4V) or alloys are exposed to high-temperature air, oxygen diffuses inward (or metal ions diffuse outward) to form an oxide layer. The growth kinetics of this protective (or detrimental) layer are often diffusion-controlled. Analyzing this helps predict material lifespan in jet engines or chemical reactors.
CAE Solver Benchmarking: Before running complex 3D simulations in software like ABAQUS or COMSOL, engineers validate their mass diffusion model setup against an analytical solution. This 1D Fick's Law simulator provides that exact benchmark. You can match the parameters (D, L, C_s) in your CAE model and compare results to ensure accuracy before moving to more complicated geometries.
Common Misconceptions and Points to Note
When you start using this simulator, especially for calculations close to real-world applications, there are several key points to keep in mind. First, "the diffusion coefficient D changes drastically with temperature." For example, the diffusion coefficient of carbon in iron is about 1.5×10⁻¹¹ m²/s at 900°C, but nearly doubles to about 3.0×10⁻¹¹ m²/s at 1000°C. When adjusting D in the simulator, always be conscious of "at what temperature this value is valid." When using datasheet values, check the temperature.
Next, errors in setting initial and boundary conditions. The semi-infinite solution fundamentally assumes "a uniform initial concentration C₀ throughout the material." For instance, this simple solution cannot be used to predict the time-dependent change of a material that already has an internal concentration gradient. Also, note the assumption that the surface concentration Cₛ is "constant." In actual carburizing processes, Cₛ fluctuates if the carbon potential of the furnace atmosphere changes. Remember that simulation results are predictions under "ideal conditions."
Finally, interpreting results for a "finite slab". When you reduce the plate thickness L, "reflection" from the opposite surface occurs, making the concentration profile complex, but this is not a physical bouncing back of material. Think of it as the diffusion "wave" being blocked at the boundary. Particularly when you want to simulate conditions with diffusion from both sides (e.g., carburizing both surfaces of a plate), the initial conditions and the form of the solution change, so directly using this tool's results can be risky.