- Of particular importance to our simulation is the Darcy Velocity:

$$$
\vec{u} = -\frac{\mathbf{K}}{\mu} \nabla p
$$$

 - The Darcy velocity appears in the heat convection-conduction equation:

$$$
C\left( \frac{\partial T}{\partial t} + \epsilon \vec{u}\cdot\nabla T \right) - \nabla \cdot k \nabla T = 0
$$$

[](---)

 - The primary unknown (aka nonlinear variable) is the pressure.
 - Once the pressure is computed, the `AuxiliarySystem` can compute the velocity field and write it to the output file.
 - We must couple in the primary nonlinear variable's gradient and make use of `Material` properties in the auxiliary computation.
 - Auxiliary variables come in two flavors: Nodal and Elemental
 - Nodal Auxiliary variables cannot couple to gradients of nonlinear variables.
    * Gradients of $$C^0$$ continuous nonlinear variables are not well-defined at the nodes.
 - Elemental Auxiliary variables (i.e. `family = MONOMIAL`) can couple to gradients of nonlinear variables -- they are only evaluated in element interiors.

   

[Auxiliary Variables](/wiki/MooseSystems/AuxVariables)

[Auxiliary Kernels](/wiki/MooseSystems/AuxKernels)

[](---)

# Source Code

[DarcyVelocity.h](https://github.com/idaholab/moose/blob/devel/tutorials/darcy_thermo_mech/step04_velocity_aux/include/auxkernels/DarcyVelocity.h)

[](---)

[DarcyVelocity.C](https://github.com/idaholab/moose/blob/devel/tutorials/darcy_thermo_mech/step04_velocity_aux/src/auxkernels/DarcyVelocity.C)

[](---)

[step4.i](https://github.com/idaholab/moose/blob/devel/tutorials/darcy_thermo_mech/step04_velocity_aux/problems/step4.i)

[](---)
# Create a Test

- Build a test for `DarcyVelocity`.
- To simplify the test, we:
    * Remove Kernels and disable the solve.
    * Create an artificial pressure field using `FunctionIC`.

[tutorials/darcy_thermo_mech/step04_velocity_aux/tests/auxkernels/velocity_aux/tests](https://github.com/idaholab/moose/blob/devel/tutorials/darcy_thermo_mech/step04_velocity_aux/tests/auxkernels/velocity_aux/tests)

[](---)

[tutorials/darcy_thermo_mech/step04_velocity_aux/tests/auxkernels/velocity_aux/velocity_aux.i](https://github.com/idaholab/moose/blob/devel/tutorials/darcy_thermo_mech/step04_velocity_aux/tests/auxkernels/velocity_aux/velocity_aux.i)