Home

Diffusion

Add x particles Diffusivity

From discrete to continuous space

To get a feeling of the statistical nature of diffusion, we can simulate it in a 1D discrete space.
Try clicking onto the cells below to add particles.
In each step, each particle has a 50% chance to move one cell to the left or to the right. Mathematically, we can define a density for each cell \(\\rho) which describes how many particles are in that cell. Intuitively, the probability of a particle to move to the left or to the right is then proportional to the density of the neighboring cells. For a given cell n that has two neighbors (e.g. cell 5), the change in that density for each time step is then given by the difference of the densities of the neighboring cells:
As you can see in the last equation, we are subtracting the change over the right barrier from the change over the left barrier. So formally we describe a difference of differences:
So to describe the change in density of one cell over time, we look at the difference of the differences of the densities of the neighboring cells. Since we want to understand what this change looks like in a continuous space, first let us take a look at how quickly the density for one cell changes over time. To get this rate expression, we just have to divide the change in density by the time step:
Notice how on one hand we have the rate expression on the left side, and on the other side the difference of the differences divided by the size of the spatial step.
The last term is used to relate the spatial step to the time step. This is also called the diffusion constant D. D is characteristic for each material and describes how quickly (space step per time step) diffusion occurs.
Now we can take the limit of the spatial step going to zero..
.. to get the continuous version of the rate expression:
Notice the partial derivatives. This is because we are looking at the change of density over time and space at the same time.

Going three-dimensional

Mass, Momentum, Energy