11.8 Advecting extra passive scalar fields

In some cases, it might be useful to advect passive scalar fields with the velocity obtained from the solution of the Navier-Stokes equation. For example, in study of mass transfer or heat transfer problems where getting analytical expression for advection velocity is not possible, the transport (advection-diffusion) equation needs to be solved along with the Navier-Stokes equation to get the scalar concentration or temperature distribution in the flow field.

In the input file, the extra field variables that are being advected need to be defined after the variables representing the velocity components. The pressure needs to be at the end of the list. For example, for a 2D simulation the expansions and variables would be defined as

1<EXPANSIONS>
2    <E COMPOSITE="C[0]" NUMMODES="5" FIELDS="u,v,c1,c2,p" TYPE="MODIFIED" />
3</EXPANSIONS>
4
5<VARIABLES>
6    <V ID="0"> u  </V>
7    <V ID="1"> v  </V>
8    <V ID="2"> c1 </V>
9    <V ID="3"> c2 </V>
10    <V ID="4"> p  </V>
11</VARIABLES>

where u, v are the velocity components, c1 and c2 are extra fields that are being advected and p is the pressure.

In addition, diffusion coefficients for each extra variable can be specified by adding a function `DiffusionCoefficient`

1<FUNCTION NAME="DiffusionCoefficient">
2    <E VAR="c1" VALUE="0.1" />
3    <E VAR="c2" VALUE="0.01" />
4</FUNCTION>

Boundary conditions for the extra fields are set up in the same way as the velocity and pressure

1<BOUNDARYCONDITIONS>
2  <REGION REF="0">
3    <D VAR="u"  VALUE="0" />
4    <D VAR="v"  VALUE="0" />
5    <D VAR="c1" VALUE="1" />
6    <D VAR="c2" VALUE="0" />
7    <N VAR="p"  USERDEFINEDTYPE="H" VALUE="0" />
8  </REGION>
9</BOUNDARYCONDITIONS>

It should be noted that if the diffusion coefficient is too small, the transport equation becomes advection dominated. This leads to small grid spacing required to resolve all physical scales associated with the transport equation (the ratio of resolution required for transport to Navier Stokes equation scales with Sc3∕4, where Sc is the Schmidt number = kinematic viscosity/diffusion coefficient). Hence, small diffusion coefficient might lead to spurious oscillations if the mesh spacing is not small enough.