IsakYt
April 2, 2024, 10:48am
1
In an effort to solve Navier-Stokes with a generalized laplacian approach I need to transpose the gradient of u in the linear form, as such:

\int_{\Omega} \nabla^T \mathbf{u} \nabla \nu \; d\Omega

What is the best way to do this in ngsolve? I’ve used Sym(grad(u)) previously to get the symmtric gradient of u, but doign something akin to 2*Sym(grad(u)) - grad(u) only seems to raise error messages.

Thanks!

you can transpose a matrix-coefficientfunction using `grad(u).trans`

However, I guess, you want to contract grad(u) and grad(v), which you do using `InnerProduct(grad(u), grad(v))`

IsakYt
April 2, 2024, 2:17pm
3
Thanks for the reply. It looks like I forgot about the test function in my inital post though, sorry. It should be:

\int_{\Omega} \mathbf{w} \cdot \nabla^T \mathbf{u} \nabla \nu \; d\Omega

with \nabla \nu being the gradient of the vicsosity. Your reply about transposing still holds though. Thanks again!