User:Jtschier/sandbox

copied from Fick's laws of diffusion

Fick's first law
Fick's first law relates the diffusive flux to the concentration under the assumption of steady state. It postulates that the flux goes from regions of high concentration to regions of low concentration, with a magnitude that is proportional to the concentration gradient (spatial derivative), or in simplistic terms the concept that a solute will move from a region of high concentration to a region of low concentration across a concentration gradient. In one (spatial) dimension, the law is:


 * $$J = -D \frac{d \varphi}{d x} $$

where


 * J is the "diffusion flux," of which the dimension is amount of substance per unit area per unit time, so it is expressed in such units as mol m−2 s−1. J measures the amount of substance that will flow through a unit area during a unit time interval.
 * D is the diffusion coefficient or diffusivity. Its dimension is area per unit time, so typical units for expressing it would be m2/s.
 * φ (for ideal mixtures) is the concentration, of which the dimension is amount of substance per unit volume. It might be expressed in units of mol/m3.
 * x is position, the dimension of which is length. It might thus be expressed in the unit m.

D is proportional to the squared velocity of the diffusing particles, which depends on the temperature, viscosity of the fluid and the size of the particles according to the Stokes-Einstein relation. In dilute aqueous solutions the diffusion coefficients of most ions are similar and have values that at room temperature are in the range of 0.6 × 10−9 to 2 × 10−9 m2/s. For biological molecules the diffusion coefficients normally range from 10−11 to 10−10 m2/s.

In two or more dimensions we must use ∇, the del or gradient operator, which generalises the first derivative, obtaining


 * $$ \mathbf{J}=- D\nabla \varphi $$

where J denotes the diffusion flux vector.

The driving force for the one-dimensional diffusion is the quantity −$∂φ⁄∂x$, which for ideal mixtures is the concentration gradient. In chemical systems other than ideal solutions or mixtures, the driving force for diffusion of each species is the gradient of chemical potential of this species. Then Fick's first law (one-dimensional case) can be written as:


 * $$J_i = - \frac{D c_i}{RT} \frac{\partial \mu_i}{\partial x}$$

where the index i denotes the ith species, c is the concentration (mol/m3), R is the universal gas constant (J/K/mol), T is the absolute temperature (K), and μ is the chemical potential (J/mol).

If the primary variable is mass fraction (yi, given, for example, in kg/kg), then the equation changes to:


 * $$J_i=- \rho D\nabla y_i $$

where ρ is the fluid density (for example, in kg/m3). Note that the density is outside the gradient operator.

copied from Fick's laws of diffusion

Fick's second law
Fick's second law predicts how diffusion causes the concentration to change with time. It is a partial differential equation which in one dimension reads:


 * $$\frac{\partial \varphi}{\partial t} = D\,\frac{\partial^2 \varphi}{\partial x^2}\,\!$$

where


 * φ is the concentration in dimensions of [(amount of substance) length−3], example mol/m3; φ = φ(x,t) is a function that depends on location x and time t
 * t is time [s]
 * D is the diffusion coefficient in dimensions of [length2 time−1], example m2/s
 * x is the position [length], example m

In two or more dimensions we must use the Laplacian Δ = ∇2, which generalises the second derivative, obtaining the equation


 * $$\frac{\partial \varphi}{\partial t} = D\,\Delta \varphi$$

add in section for where fick's second law comes from...mass conservation (continuity equation) combined with fick's first law. Plus the assumption that mass transfer is by diffusion only. In the case were advective diffusion occurs the result is the Convection-diffusion equation.

Derivation
Fick's second law is a special case of the convection–diffusion equation in which there is no advective flux and no net volumetric source. It can be derived from the continuity equation:


 * $$ \frac{\partial \varphi}{\partial t} + \nabla\cdot\vec{j} = R, $$

where $$\vec{j}$$ is the total flux and R is a net volumetric source for $$\varphi$$. The only source of flux in this situation is assumed to be diffusive flux:
 * $$\vec{j}_{\text{diffusion}} = -D \, \nabla \varphi$$

Plugging the definition of diffusive flux to the continuity equation and assuming there is no source (R = 0), we arrive at Fick's second law:


 * $$\frac{\partial \varphi}{\partial t} = D\,\frac{\partial^2 \varphi}{\partial x^2}\,\!$$

If flux were the result of both diffusive flux and advective flux, the convection–diffusion equation is the result.

Example solution in one dimension: diffusion length
A simple case of diffusion with time t in one dimension (taken as the x-axis) from a boundary located at position x = 0, where the concentration is maintained at a value n0 is


 * $$n \left(x,t \right)=n_0 \mathrm{erfc} \left( \frac{x}{2\sqrt{Dt}}\right)$$.

where erfc is the complementary error function. This is the case when corrosive gases diffuse through the oxidative layer towards the metal surface (if we assume that concentration of gases in the environment is constant and the diffusion space (i. e., corrosion product layer) is semi-infinite – starting at 0 at the surface and spreading infinitely deep in the material). If, in its turn, the diffusion space is infinite (lasting both through the layer with n(x,0) = 0, x > 0 and that with n(x,0) = n0, x ≤ 0), then the solution is amended only with coefficient 1⁄2 in front of n0 (this might seem obvious, as the diffusion now occurs in both directions). This case is valid when some solution with concentration n0 is put in contact with a layer of pure solvent. (Bokstein, 2005) The length 2√Dt is called the diffusion length and provides a measure of how far the concentration has propagated in the x-direction by diffusion in time t (Bird, 1976).

As a quick approximation of the error function, the first 2 terms of the Taylor series can be used:
 * $$n \left(x,t \right)=n_0 \left[ 1 - 2 \left(\frac{x}{2\sqrt{Dt\pi}}\right) \right] $$

If D is time-dependent, the diffusion length becomes
 * $$ 2\sqrt{\int_0^{t}D(t')dt'} $$.

This idea is useful for estimating a diffusion length over a heating and cooling cycle, where D varies with temperature.

Generalizations
1. In inhomogeneous media, the diffusion coefficient varies in space, D = D(x). This dependence does not affect Fick's first law but the second law changes:
 * $$\frac{\partial \varphi(x,t)}{\partial t}=\nabla\cdot (D(x) \nabla \varphi(x,t))=D(x) \Delta \varphi(x,t)+\sum_{i=1}^3 \frac{\partial D(x)}{\partial x_i} \frac{\partial \varphi(x,t)}{\partial x_i}\  $$

2. In anisotropic media, the diffusion coefficient depends on the direction. It is a symmetric tensor D = Dij. Fick's first law changes to
 * $$J=-D \nabla \varphi \ $$,

it is the product of a tensor and a vector:
 * $$ \;\; J_i=-\sum_{j=1}^3D_{ij} \frac{\partial \varphi}{\partial x_j} \ .$$

For the diffusion equation this formula gives
 * $$\frac{\partial \varphi(x,t)}{\partial t}=\nabla\cdot (D \nabla \varphi(x,t))=\sum_{i=1}^3\sum_{j=1}^3D_{ij} \frac{\partial^2 \varphi(x,t)}{\partial x_i \partial x_j}\ . $$

The symmetric matrix of diffusion coefficients Dij should be positive definite. It is needed to make the right hand side operator elliptic.

3. For inhomogeneous anisotropic media these two forms of the diffusion equation should be combined in
 * $$\frac{\partial \varphi(x,t)}{\partial t}=\nabla\cdot (D(x) \nabla \varphi(x,t))=\sum_{i,j=1}^3\left(D_{ij}(x) \frac{\partial^2 \varphi(x,t)}{\partial x_i \partial x_j}+ \frac{\partial D_{ij}(x)}{\partial x_i } \frac{\partial \varphi(x,t)}{\partial x_j}\right)\ . $$

4. The approach based on Einstein's mobility and Teorell formula gives the following generalization of Fick's equation for the multicomponent diffusion of the perfect components:
 * $$\frac{\partial \varphi_i}{\partial t} =\sum_j \nabla\cdot\left(D_{ij} \frac{\varphi_i}{\varphi_j} \nabla \, \varphi_j\right) \, .$$

where φi are concentrations of the components and Dij is the matrix of coefficients. Here, indices i, j are related to the various components and not to the space coordinates.

The Chapman–Enskog formulae for diffusion in gases include exactly the same terms. It should be stressed that these physical models of diffusion are different from the test models ∂tφi = ΣjDij Δφj which are valid for very small deviations from the uniform equilibrium. Earlier, such terms were introduced in the Maxwell–Stefan diffusion equation.

For anisotropic multicomponent diffusion coefficients one needs a rank-four tensor, for example Dij,αβ, where i, j refer to the components and α, β = 1, 2, 3 correspond to the space coordinates.