Turbulence plug-in

Good morning everyone,
I’m trying to use Peter Vincent’s “turbulence plug-in” branch to add free stream turbulence to the flow. I know that this branch is still in development and hasn’t been pushed yet to the official development repository, but I guessed that maybe someone is using or developing it and could give me some help about it. I’m trying to test it on a simple square box mesh, with the following section of the configuration file:

[solver-plugin-turbulence]
seed = 1
turbulence-intensity = 0.0018
sigma = 0.7
avg-u = 0.3
turbulence-length-scale = 0.5
avg-rho = 1
avg-mach = 1
y-dim = 2
z-dim = 2
centre = [0.0, 0.0, 0.0]
rot-axis = [0.0, 0.0, 1.0]
rot-angle = 0

The problem is that, when running the simulation, I get this error back:

File "/cfs/klemming/home/r/rubensde/.conda/envs/turb/lib/python3.10/site-packages/pyfr-1.15.0-py3.10.egg/pyfr/template.py", line 29, in get_template
RuntimeError: Template "pyfr.plugins.kernels.turbulence" not found

Does anyone have any suggestion on how to solve it? (I’m also interested in further explanation about this plug-in: if anyone had the pleasure to share his knowledge about this, I leave here my email address: rubens.dellepiane@gmail.com)
Thank you in advance!

Kind regards,
Rubens

Hi Rubens,

Based on “python3.10/site-packages/pyfr-1.15.0-py3.10.egg/pyfr/” it seems like you might be running v1.15.0, and not the new version with the plugin?

The plugin has now just been merged to the develop branch: Commits · PyFR/PyFR · GitHub

Updated User Guide is here:

Also - note that the turbulence intensity is input as a percentage (so maybe check if 0.0018 is supposed to be 0.18?)

Peter

Good morning Peter, and thank you for the reply!
Today I will download the develop branch and I will work with it, so I’ll write here later if any complex problem shows up. Also, if possible, I’d like to know more about how this method generates turbulence: for example, I don’t get completely the need to define rotation axis and angle: is this only related to cases in which you want to generate turbulence non-normal to the streamwise coordinate, or is there any other reason?
I’d be very grateful if you could point me to a related paper, if there is any already published.
Thank you very much for now!

Kind regards,
Rubens Dellepiane


Hello Peter, hello everyone,
When running the develop branch on a square box mesh I now get these errors.
Do you have any idea on how to solve this?
I compiled the code from source and I should be correctly using the develop branch.

Kind regards,
Rubens Dellepiane.

Please ensure that PyFR is installed using the setup.py (or alternatively via pip install -e .).

Regards, Freddie.

Hello Freddie, thank you for the reply!
I installed it running python setup.py install. I will try now also pip install -e . and I’ll see if it works
Regards,
Rubens

Hello again Freddie,
Installing it like pip install -e . worked; I don’t know why doing python setup.py install gives back that error.
Thank you a lot!
Kind regards,
Rubens

Hello,

I’m trying to use the plugin but when it is turned on no snapshot are written to file while when it is off everything is fine.
I’m using the last version of pyFR (develop) and this are the plugin settings that I’m trying to use:

[solver-plugin-turbulence]
turbulence-intensity = 1
sigma = 0.7
avg-u = 68.277
turbulence-length-scale = 0.002
avg-rho = 2.04
avg-mach = 0.2
y-dim = 0.0396
z-dim = 0.0108
centre = (0.0, 0.0, 0.0)
rot-axis = (0, 0, 0)
rot-angle = 0

I would like to generate turbulence at the inlet plane whose dimension in y and z are in y-dim and z-dim, with a TI of 1% and a length scale of 2mm

Any idea of why this happens, where am I wrong?

Regards

Do you mean that the writer plugin doesn’t output files when the turbulence inflow plugin is on?

I have a similar issue: yesterday I started a simulation with the turbulence plugin on and I got no output (not even the progress bar, it was like the solver was “sleeping”) for the first six hours of simulation. Then, it started working and sending output files regularly, approximately at the same pace as the same simulation without the turbulence plugin. Is this normal and depends on the turbulence quantities that you impose, or is it a bug of the solver?

I attach here the specific section in the .ini file:

[solver-plugin-turbulence]
avg-rho = 1.0
avg-u = 0.3
avg-mach = 0.3
turbulence-intensity = 0.17 ; we had 0.16 0.17 0.18 and 0.19
turbulence-length-scale = 0.3345
sigma = 0.7 ; default value
centre = (-20, -2.5, -21.875)
y-dim = 55
z-dim = 43.75
rot-axis = (0, 0, 1)
rot-angle = 0.0

Thank you in advance!

Kind regards,
Rubens

1 Like

Can either @rubens or @Frankx9 please raise this as a bug topic?