# Finite volume method for one-dimensional steady state diffusion

Finite volume method in computational fluid dynamics is a discretization technique for partial differential equations that arise from physical conservation laws. These equations can be different in nature, e.g. elliptic, parabolic, or hyperbolic. First well-documented use was by Evans and Harlow (1957) at Los Alamos. The general equation for steady diffusion can be easily be derived from the general transport equation for property Φ by deleting transient and convective terms.

General Transport equation can be define as

${\frac {\partial \rho \phi }{\partial t}}+\operatorname {div} (\rho \phi \upsilon )=\operatorname {div} (\Gamma \operatorname {grad} \phi )+S_{\phi }$ where,
$\rho$ is density and $\phi$ is conservative form of all fluid flow,
$\Gamma$ is the Diffusion coefficient and $S$ is the Source term.
$\operatorname {div} (\rho \phi \upsilon )$ is Net rate of flow of $\phi$ out of fluid element(convection),
$\operatorname {div} (\Gamma \operatorname {grad} \phi )$ is Rate of increase of $\phi$ due to diffusion,
$S_{\phi }$ is Rate of increase of $\phi$ due to sources.

${\frac {\partial \rho \phi }{\partial t}}$ is Rate of increase of $\phi$ of fluid element(transient),

Conditions under which the transient and convective terms goes to zero:

For one-dimensional steady state diffusion, General Transport equation reduces to:

$\operatorname {div} (\Gamma \operatorname {grad} \phi )+S_{\phi }=0$ or,

${\frac {d}{dx}}(\Gamma \operatorname {grad} \phi )+S_{\phi }=0$ The following steps comprehend one-dimensional steady state diffusion -

STEP 1
Grid Generation

• Create control volume near the edge in such a way that the physical boundaries coincide with control volume boundaries.(Figure 1)
• Assume a general nodal point 'P' for a general control volume. Adjacent nodal points in east and west are identified by E and W respectively. The west side face of the control volume is referred to by 'w' and east side control volume face by 'e'.(Figure 2)
• The distance between WP, wP, Pe and PE are identified by $\delta x_{WP}$ ,$\delta x_{wP}$ ,$\delta x_{Pe}$ and $\delta x_{PE}$ respectively.(Figure 4)

STEP 2
Discretization

• The crux of Finite volume method is to integrate governing equation all over control volume, known discretization.
• Nodal points used to discretize equations.
• At nodal point P control volume is defined as (Figure 3)

$\int _{\Delta V}{\frac {d}{dx}}\left(\Gamma {\frac {d\phi }{dx}}\right)dV+\int _{\Delta V}SdV=\left(\Gamma A{\frac {d\phi }{dx}}\right)_{e}-\left(\Gamma A{\frac {d\phi }{dx}}\right)_{w}+{\overrightarrow {S}}\Delta V=0$ where

$A$ is Cross-sectional Area Cross section (geometry) of control volume face,$\Delta V$ is Volume,${\overrightarrow {S}}$ is average value of source S over control volume

• It states that diffusive flux Fick's laws of diffusion$\phi$ from east face minus west face leads to generation of flux in control volume.
• $\phi$ diffusive coefficient and ${\frac {d\phi }{dx}}$ is required in order to interpreter useful conclusion.
• Central differencing technique  is used to derive $\phi$ diffusive coefficient.

$\Gamma _{w}={\frac {\Gamma _{W}+\Gamma _{P}}{2}}$ $\Gamma _{w}={\frac {\Gamma _{P}+\Gamma _{E}}{2}}$ • ${\frac {d\phi }{dx}}$ gradient from east to west is calculated with help of nodal points.(Figure 4)

$\left({\frac {d\phi }{dx}}\right)_{e}={\frac {\phi _{E}-\phi _{P}}{\delta x_{PE}}}$ $\left({\frac {d\phi }{dx}}\right)_{w}={\frac {\phi _{P}-\phi _{W}}{\delta x_{WP}}}$ • In practical situation source term can be linearize

${\overrightarrow {S}}\Delta V=S_{u}+S_{p}\phi _{p}$ • Merging above equations leads to

$\Gamma _{e}A_{e}\left({\frac {\phi _{E}-\phi _{P}}{\delta x_{PE}}}\right)-\Gamma _{w}A_{w}\left({\frac {\phi _{P}-\phi _{W}}{\delta x_{PE}}}\right)+(S_{u}+S_{p}\phi _{p})$ • Re-arranging

$\left({\frac {\Gamma _{e}}{\delta x_{PE}}}A_{e}+{\frac {\Gamma _{w}}{\delta x_{WP}}}A_{w}-S_{p}\right)\phi _{P}=\left({\frac {\Gamma _{w}}{\delta x_{WP}}}A_{w}\right)\phi _{W}+\left({\frac {\Gamma _{e}}{\delta x_{WP}}}A_{e}\right)\phi _{E}+S_{u}$ • Compare and identify above equation with

$a_{P}\phi _{P}=a_{W}\phi _{W}+a_{E}\phi _{E}+S_{u}$ where

$a_{W}$ $a_{E}$ $a_{P}$ ${\frac {\Gamma _{w}}{\delta x_{WP}}}A_{w}$ ${\frac {\Gamma _{e}}{\delta x_{PE}}}A_{e}$ $a_{W}+a_{E}-S_{P}$ STEP 3:
Solution of equations

• Discretized equation must be set up at each of the nodal points in order to solve the problem.
• The resulting system of linear algebraic equation Linear equation is then solved to obtain distribution of the property $\phi$ at the nodal points by any form of matrix solution technique.
• The matrix of higher order  can be solved in MATLAB.

This method can also be applied to a 2D situation. See Finite volume method for two dimensional diffusion problem.