BUG: Inconsistent energy spectrum with boxTurb
Summary
The utility boxTurb is supposed to generate a divergence-free velocity field with the following energy spectrum
E(\kappa) = A_0 (\frac{\kappa}{\kappa_0})^4 e^{-2 (\frac{\kappa}{\kappa_0})^2}
-
However, when analyzing the energy spectrum from the file
graphs/0/Ek.xy
which appears appear running the applicationboxTurb
, I don't see at the expected spectrum from the previous equation. I attach a picture comparing the obtained spectrum vs the theoretical spectrum. -
The computation of the ensemble kinetic energy presents a multiplication by a factor for 3 which seems wrong for me as
k = \int_0^{\infty} E(\kappa) d\kappa = average(\sum \frac{1}{2} mag(U)^2) = \frac{3}{2} u_{RMS}^2
Info<< "k("
<< runTime.timeName()
<< ") = "
<< 3.0/2.0*average(magSqr(U)).value() << endl;
- At last the values of the wavenumber output in
graphs/0/Ek.xy
seems to not be in accordance with the mesh. One expects the maximum wavenumber to be\kappa_{max}= \frac{\pi}{h}wherehis the cell size but I in my tests the maximum value of the wavenumber is not consistent with the theoretical formula
Steps to reproduce
- Run
boxTurb
in theboxTurb16
tutorial increasing the number of cells in each direction to64
and changing the scale parameter toscale 6.28318530718;
This value corresponds to 2pi. Decaying isotropic turbulence are commonly simulated using a box with 2pi edge length - Compare the data from the file
graphs/0/Ek.xy
with the theoretical spectrum from the previous equation
Example case
What is the current bug behaviour?
What is the expected correct behavior?
Relevant logs and/or images
Environment information
- OpenFOAM version : v2006
- Operating system : ubuntu
- Hardware info : -
- Compiler : -