Hi to all,
I need to compute some mean-field and turbulent features of a pyfr simulation. In particular I need to have velocity and pressure mean fields, k, omega, epsilon and nu_t, in order to compare them to RANS results. To do this I need to compute, inside pyfr:
-
time averages of velocity and pressure
-
fluctuations in time (instantaneous field - average field) for velocity
-
space gradients of the velocity fluctuations computed above
-
time averages of some transformations (products and sums) of the gradients computed above
Is It possible to complete one or some of this tasks inside pyfr? right now I’m using paraview to perform this but it’s quite inefficent. It would be good enough to have the space gradients of the velocity field for each timestep, being the most expensive part.
Thanks in advance,
Giulio
Hi Giulio
you can use the time-average plugin to compute the running average of any combination of the primitive variables. See [soln-plugin-tavg] in the user guide.
For instance you can have the averages of the primitive variables with:
avg-rho = rho
avg-u = u
avg-v = v
avg-w = w
avg-p = p
products:
avg-p2 = p*p
and gradients:
avg-grad-u-x = grad_u_x
avg-grad-v-z = grad_v_z
Note also that you can have the gradients of the variables stored in a pyfr solution file computed and exported to Paraview by adding the -g option to the export command, for instance:
pyfr export -g mesh.pyfrm solution.pyfrs solution.vtu
Best
Giorgio
Hi Giorgio,
Thanks for the reply!
Last question, is there an easy way to compute the time average of the gradient of the fluctuation? Where the fluctuation is u - avg-u.
Giulio.
Hi Giulio
in RANS the time average of the fluctuations is zero by definition, and so will its gradients.
In case you want to compute the time-average of the gradients of the product of fluctuations (for instance, the gradients of the components of the Reynolds stress), then, as differentiating and taking the mean commute, you could get the gradients of the time-average of the product of fluctuations as follows:
0. keep in mind that avg(fluct-ufluct-u) = avg(uu) - avg(u)*avg(u)
- get in pyfr the time average of the the variable and its square, say u and u*u
- either compute the gradients of the time-average solution in Paraview or export the solution with the gradients as mentioned in the previous post.
- in Paraview, compute the (gradients of) the product of fluctuations as the difference between the (gradients of) time-average of uu and the (gradients of) time-average u squared: avg(uu) - avg(u)*avg(u)
best
Giorgio
Hi Giorgio,
I need to compute the average of the product of the gradients of the fluctuations:

I could do this simply by exporting the gradients of the velocity field, then inside paraview do all the remaining computations. Is there a better way to do this than that?
Giulio
I think you can compute them by collecting the time-average of :
avg-grad-u-x = grad_u_x
avg-grad-u-x-squared = grad_u_x*grad_u_x
then in Paraview
avg-grad-u-x-squared - (avg-grad-u-x)^2
similarly for all the other components