The Navier-Stokes equation contains term
$\vec{u} \cdot \nabla \vec{u}$
which should be equal to
$\nabla \cdot \left(\vec{u}\vec{u} \right)$
provided
$\nabla \cdot \vec{u}=0$.
However this computation gives me different results for these two
In[70]:= u = {2*x^2*(x-1)^2*y*(2*y-1)*(y-1), -2*x*(x-1)*(2x-1)*y^2*(y-1)^2}
Out[70]= {2 (-1+x)^2 x^2 (-1+y) y (-1+2 y),-2 (-1+x) x (-1+2 x) (-1+y)^2 y^2}
In[72]:= div = Div[u, {x, y}, "Cartesian"] // Simplify
Out[72]= 0
In[73]:= adv = u.Grad[u, {x, y}, "Cartesian"] //Simplify
Out[73]= {4 (-1+x) x (-1+2 x) (-1+y)^2 y^2 (2 (-1+x)^2 x^2 (1-2 y)^2+(1-6 x+6 x^2) (-1+y)^2 y^2),4 (-1+x)^2 x^2 (-1+y) y (-1+2 y) (2 (1-2 x)^2 (-1+y)^2 y^2+(-1+x)^2 x^2 (1-6 y+6 y^2))}
In[74]:= adv2=Div[TensorProduct[u,u], {x, y}, "Cartesian"] //Simplify
Out[74]= {4 (-1+x)^3 x^3 (-1+2 x) (-1+y)^2 y^2 (1-2 y+2 y^2),4 (-1+x)^2 x^2 (1-2 x+2 x^2) (-1+y)^3 y^3 (-1+2 y)}
In[75]:= dadv = adv-adv2 //Simplify
Out[75]= {4 (-1+x) x (-1+2 x) (-1+y)^2 y^2 (2 (-1+x)^2 x^2 (1-2 y)^2+(1-6 x+6 x^2) (-1+y)^2 y^2-(-1+x)^2 x^2 (1-2 y+2 y^2)),4 (-1+x)^2 x^2 (-1+y) y (-1+2 y) (2 (1-2 x)^2 (-1+y)^2 y^2-(1-2 x+2 x^2) (-1+y)^2 y^2+(-1+x)^2 x^2 (1-6 y+6 y^2))}
I would expect the difference of the two to be 0. Why is that?
TensorProduct[{x, y, z}, {x, y, z}]
what you were expecting it to be? $\endgroup$