velocity gradients in /navstokes/kernels/flux.mako

76 views
Skip to first unread message

Vishal Saini

unread,
Mar 27, 2018, 3:50:49 PM3/27/18
to PyFR Mailing List
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

Kiny Wan

unread,
Nov 14, 2019, 7:11:11 AM11/14/19
to PyFR Mailing List
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

Freddie Witherden

unread,
Nov 14, 2019, 7:31:16 AM11/14/19
to pyfrmai...@googlegroups.com
Hi Kiny,
In 3D:

u[None, 1:-1] = [rho*u, rho*v, 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.

signature.asc

Kiny Wan

unread,
Nov 14, 2019, 8:39:13 AM11/14/19
to PyFR Mailing List
Hi Freddie,
        Thank you. I misunderstood u as [u, v, w].
Regards,
Kiny

Reply all
Reply to author
Forward
0 new messages