Velocity gradients in /navstokes/kernels/flux.mako

Hi all,

I’m new to the high-order CFD world. I just have started playing around with PyFR and was hoping to implement Smagorinsky SGS model in the code.
This model requires velocity gradients which I think are being calculated in flux calculation of navstokes solver (pyfr/solvers/navstokes/kernels/flux.mako) (??).
May be I can directly calculate mu_sgs using the vel. gradients here and add it to mu_c.

My question is: Are these gradients being calculated in the physical space or the standard element space (transformed space)? If the answer is latter, then
can someone please suggest how to transform these gradients into the physical space in order to be able to use them in the SGS model?

Regards,
Vishal

Hi Vishal,
I found the gradient of velocity in fluidforce.py, expressed as

`

Gradient of velocity

`
gradu = (gradrhou - gradrho[:, None]*u[None, 1:-1]/rho) / rho

Is this form right? I think that the “rho” should be deleted as

gradu = (gradrhou - gradrho[:, None]*u[None, 1:-1]) / rho

Yours
Kiny

Hi Kiny,
In 3D:

u[None, 1:-1] = [rhou, rhov, rho*w] (the momenta)

and thus we divide through by rho here to get the actual velocities
which are required as per the chain rule.

Regards, Freddie.

Hi Freddie,
Thank you. I misunderstood u as [u, v, w].

Regards,

Kiny