Divergence of stress tensor in momentum transfer equation Let suppose that we work in a 2D cartesian coordinates. what will be x and y components of
$\nabla.\left[-p I+\mu \left(\nabla \text{u}+(\nabla \text{u})^T\right)-\frac{2}{3} \mu (\nabla.\text{u})
 I \right]$
$p=p(x,y)$ is pressure, $\mu$ is viscosity and constant, $I$ is identity tensor and $\text{u}=u \hat i +v \hat j$ is velocity field.
 A: Rule of thumb: the divergence of a matrix (a second order tensor) can be defined by the trace of the gradient of a tensor field.
For a $2\times 2$ matrix, the divergence is actually the divergence of each row:
$$
\nabla\cdot A = 
\begin{pmatrix}\nabla \cdot A_{1i}
\\
\nabla \cdot A_{2i} \end{pmatrix}
=
\begin{pmatrix}\partial_{x} A_{11}+\partial_y A_{12}
\\
\partial_{x} A_{21} + \partial_y A_{22} \end{pmatrix}.
$$


*

*Pressure term $pI$:
$$
\nabla\cdot (pI) = \begin{pmatrix}\partial_{x} p
\\
\partial_{y} p\end{pmatrix} = \nabla p.
$$

*The first term in the stress tensor is the first order strain tensor (by some factor of constants) $\nabla \mathbf{u}+(\nabla \mathbf{u})^T$: firstly when $\mathbf{u} = (u_1, u_2)
 = u_1 \mathbf{i} + u_2 \mathbf{j}$,
$$
\nabla \mathbf{u} = 
\begin{pmatrix}\partial_{x} \mathbf{u}_1 & \partial_y\mathbf{u}_1
\\
\partial_{x} \mathbf{u}_2 & \partial_y\mathbf{u}_2 \end{pmatrix},
$$
and taking the divergence:
$$
\nabla\cdot\nabla \mathbf{u} = 
\begin{pmatrix}\partial_{xx} \mathbf{u}_1 & \partial_{yy}\mathbf{u}_1
\\
\partial_{xx} \mathbf{u}_2 & \partial_{yy}\mathbf{u}_2 \end{pmatrix}.
$$
$\nabla \cdot (\nabla \mathbf{u})^T$ is left for you.

*For the second term in the stress tensor $(\nabla \cdot \mathbf{u}) I$:
$$
(\nabla \cdot \mathbf{u}) I = 
\begin{pmatrix}\nabla \cdot \mathbf{u} & 0
\\
0 & \nabla \cdot \mathbf{u}\end{pmatrix},
$$
and taking the divergence:
$$
\nabla\cdot \Big((\nabla \cdot \mathbf{u}) I\Big) = 
\begin{pmatrix} \partial_x (\nabla \cdot \mathbf{u} )
\\
 \partial_y (\nabla \cdot \mathbf{u})\end{pmatrix} = \nabla (\nabla \cdot \mathbf{u}).
$$
