
The diffusivities are calculated in appSrc files diffusivityAir.H and diffusivityFuel.H. The following discussion refers only to air, but applies equally to fuel. Of interest is the diffusivity, D(a), of specie a in the mixture. A diffusivity field is thus calculated for each specie, except for the background “inert” specie. A specie a can be given a fixed diffusivity value using the fixedDiffusivity model, or its diffusivity in the mixture, D(a), can be modelled from the pairwise binary diffusivities D(a,b) of specie a diffusing in specie b.
The sofcFoam model combines pairwise binary diffusivities following Wilke (1950):
$$D\left( a \right)=~\frac{1-~{{x}_{a}}}{{{S}_{a}}}$$
where
$${{S}_{a}}~=\underset{b\ne a}{\mathop \sum }\,\frac{{{x}_{b}}}{D\left( a,b \right)}$$
with mole fractions x and specie indices a,b.
The calculation proceeds by first fixing specie a, stepping through the species b and accumulating the results to obtain the sum Sa, which is then used to get D(a). The computed diffusivity is stored in volScalarField diffSpAir[a].
The diffusivity calculations have the following algorithmic structure:
forAll(airSpecies, a)
{
if(airSpecies[a].name() != airInertSpecie)
{
forAll(airDiffModels, m)
{
if(airDiffModels[m]->isFixed())
{
//obtain fixed diffusivity
}
else if(!airDiffModels[m]->isBinary())
{
Error: must have fixed or binary: exit
}
else
{
initialize sumA = 0
forAll(airSpecies,b)
{
if (b != a)
{
set specie b in airDiffModel[m]
calculate binary diffusivity
accumulate sumA
}
}
obtain diffusivity in mixture using sumA
} //isBinary
} //m
} //!inert
} //a