# Substantial Derivative

Reference to Fluid Simulation for Computer Graphics.
In fluid simulation, we have a velocity vector field $\mathbf{u}(\mathbf{x}, t)=[u(\mathbf{x}, t), v(\mathbf{x}, t), w(\mathbf{x}, t)]$ which depends on position $\mathbf{x}=[x, y, z]$ and time $t$. We can calculate its full derivative for time $t$ base on the chain rule:
\begin{aligned} \frac{d}{dt}\mathbf{u}(\mathbf{x},t) &= \frac{\partial{\mathbf{u}}}{\partial{t}}\frac{dt}{dt} + \nabla\mathbf{u}\cdot\frac{d\mathbf{x}}{dt}\\ &= \frac{\partial{\mathbf{u}}}{\partial{t}} + \frac{\partial{\mathbf{u}}}{\partial{x}}\frac{dx}{dt} + \frac{\partial{\mathbf{u}}}{\partial{y}}\frac{dy}{dt} + \frac{\partial{\mathbf{u}}}{\partial{z}}\frac{dz}{dt} \\ &= \frac{\partial{\mathbf{u}}}{\partial{t}} + u\frac{\partial{\mathbf{u}}}{\partial{x}} + v\frac{\partial{\mathbf{u}}}{\partial{y}} + w\frac{\partial{\mathbf{u}}}{\partial{z}} \\ &= \frac{\partial{\mathbf{u}}}{\partial{t}} + \mathbf{u}\cdot\nabla\mathbf{u} \\ &= \frac{D\mathbf{u}}{Dt} \end{aligned}

Which is the substantial derivative (or material derivative).

If you want to fully expand this derivative:

\begin{aligned} \frac{D\mathbf{u}}{Dt} &= \frac{\partial{\mathbf{u}}}{\partial{t}} + \mathbf{u}\cdot\nabla\mathbf{u} \\ &= \begin{bmatrix} \partial{u}/\partial{t} + \mathbf{u}\cdot\nabla{u}\\ \partial{v}/\partial{t} + \mathbf{u}\cdot\nabla{v}\\ \partial{w}/\partial{t} + \mathbf{u}\cdot\nabla{w} \end{bmatrix}\\ &= \begin{bmatrix} \frac{\partial{u}}{\partial{t}}+u\frac{\partial{u}}{\partial{x}} + v\frac{\partial{u}}{\partial{y}} + w\frac{\partial{u}}{\partial{z}}\\ \frac{\partial{v}}{\partial{t}}+u\frac{\partial{v}}{\partial{x}} + v\frac{\partial{v}}{\partial{y}} + w\frac{\partial{v}}{\partial{z}}\\ \frac{\partial{w}}{\partial{t}}+u\frac{\partial{w}}{\partial{x}} + v\frac{\partial{w}}{\partial{y}} + w\frac{\partial{w}}{\partial{z}} \end{bmatrix} \end{aligned}