- In order to implement the Darcy pressure equation, a `Kernel` object is needed to represent:

$$$
-\nabla \cdot \frac{\mathbf{K}}{\mu} \nabla p  = 0
$$$

[](---)

- The weak form of this equation is:

$$$
\left (\frac{\mathbf{K}}{\mu} \nabla p, \nabla \psi_i \right ) - \left <\frac{\mathbf{K}}{\mu} \nabla p \cdot \mathbf{n}, \psi_i \right >  = 0
$$$

 - For now we'll ignore the boundary term (essentially setting $$ \frac{\mathbf{K}}{\mu} \nabla p \cdot \mathbf{n} = 0 $$ : a "no-flux" boundary condition).
 - The volume integral looks exactly like the `Diffusion` equation multiplied by some constants: so we can simply extend the `Diffusion` `Kernel` by inheriting from it...

[MOOSE Mesh](/wiki/MooseSystems/Mesh)

[MOOSE Outputs](/wiki/MooseSystems/Outputs)

[Coordinate Systems](/wiki/MooseTraining/CoordinateSystems)

[Anatomy of a `MooseObject`](/wiki/MooseTraining/MooseObject)

[InputParameters and MOOSE Types](/wiki/MooseTraining/InputParameters)

[Kernels](/wiki/MooseSystems/Kernels)

[](---)
# Step 2: Source Code

[include/kernels/DarcyPressure.h](https://github.com/idaholab/moose/blob/devel/tutorials/darcy_thermo_mech/step02_darcy_pressure/include/kernels/DarcyPressure.h)

[](---)

[src/kernels/DarcyPressure.C](https://github.com/idaholab/moose/blob/devel/tutorials/darcy_thermo_mech/step02_darcy_pressure/src/kernels/DarcyPressure.C)

[](---)

[src/base/DarcyThermoMechApp.C](https://github.com/idaholab/moose/blob/devel/tutorials/darcy_thermo_mech/step02_darcy_pressure/src/base/DarcyThermoMechApp.C)

[](---)

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

[](---)
# Create a Test

- Create a simple test that mimics the behavior of the problem above, i.e., a test that verifies that the `DarcyPressure` kernel is operating as expected.

[tutorials/darcy_thermo_mech/step02_darcy_pressure/tests/kernels/darcy_pressure/tests](https://github.com/idaholab/moose/blob/devel/tutorials/darcy_thermo_mech/step02_darcy_pressure/tests/kernels/darcy_pressure/tests)

[](---)

[tutorials/darcy_thermo_mech/step02_darcy_pressure/tests/kernels/darcy_pressure/darcy_pressure.i](https://github.com/idaholab/moose/blob/devel/tutorials/darcy_thermo_mech/step02_darcy_pressure/tests/kernels/darcy_pressure/darcy_pressure.i)