jorgensd / dolfinx-tutorial

A reimplementation of the Springer book: https://github.com/hplgit/fenics-tutorial/, covering new topics as well as transitioning from dolfin to dolfinx
https://jorgensd.github.io/dolfinx-tutorial/
114 stars 64 forks source link

Sign of The Navier-Stokes equation test problem 2 #173

Closed RequieMa closed 10 months ago

RequieMa commented 10 months ago

Hi,

I am confused by the sign of the Navier-Stokes equation test problem 2. image

It seems that the code flips the sign for this two lines. What happens? image

jorgensd commented 10 months ago

Do you mean the two last terms on the LHS of the first equation (The one relating to the laplace operator and the gradient of the pressure)? We have used integration by parts on both of them, thus a sign flip.

RequieMa commented 10 months ago

Hi @jorgensd,

Thanks for your reply. I understand the two last terms on the LHS of the first equation now. I should have noticed that.

Then how about the RHS? Shouldn't it be minus once it is put to left?

jorgensd commented 10 months ago

Sure, But f is Zero in this tutorial, so it doesn’t really matter wrt the sign