I test my iterative algorithm for solving Navier-Stokes Equation. My variation equation has this term
: ( ( \nabla \dot U_k ) U , V ), where U_k: know, and U :trial function and V: test function.
The problem is :
When I use :
inner ( nabla_grad (U) * U_k, V ) * dx
the solution will blow up. Especially for high Reynolds number !
But when I use (nothing changed other place) :
inner ( nabla_grad (U).T * U_k, V ) * dx
the solution is right.
Then I changed my code into the representation in components:
( ( U_k[0] * U[0].dx(0) + U_k[1] * U[0].dx(1) ) * V[0] + ( U_k[0] * U[1].dx(0) + U_k[1] * U[1].dx(1) ) * V[1] ) * dx
the solution is also right.
But I see the FEniCS Book 's example (page 402.) , and these examples are all using the first code. So , Does this change in new versions or my code is wrong? Thanks!