I am currently trying to calculate the drag / friction force in a fluid simulation.
In order to obtain the velocity and the pressure field, I have already solved the Stokes / Navier-Stokes equation, as described in the examples on the documentation website.
Now I need the gradient of the velocity normal to a boundary. Unfortunately, the gradient of the velocity is 0 on the boundaries with a dirichlet condition, making it impossible to determine the shear stresses on these surfaces.
I am using the Grad()-function like this:
velocity = gfu.components
c_u = GridFunction(Q)
c_w = GridFunction(Q)
dudz = Grad(c_u)
dwdx = Grad(c_w)
tau = eta * (dudz + dwdx)
F_fric = Integrate(cf = tau,mesh=mesh,VOL_or_BND=BND,definedon=mesh.Boundaries(‘bottom’))
Is there any way to calculate the gradient of the velocity correctly on a surface with a dirichlet boundary condition?
I also tried to determine the tau tensor via the formula for incompressible fluids:
tau = eta (Grad(velocity)+Grad(velocity).trans)
F_fric = Integrate(cf = taunormal,mesh=mesh,VOL_or_BND=BND,definedon=mesh.Boundaries(‘bottom’))
But the gradient on “bottom” (dirichlet boundary condition) is always calculated to 0, this is also visible in the netgen visualisation.
Using grad() instead of Grad() doesn’t work, either.
I hope, I made my problem clear.
Thank you for your help!