calcEk.C
Go to the documentation of this file.
1/*======================================================================*/
2
3// This routine evaluates q(k) (McComb, p61) by summing all wavevectors
4// in a k-shell. Then we divide through by the volume of the box
5// - to be accurate, by the volume of the ellipsoid enclosing the
6// box (assume cells even in each direction). Finally, multiply the
7// q(k) values by k^2 to give the full power spectrum E(k). Integrating
8// this over the whole range gives the energy in turbulence.
9
10/*======================================================================*/
11
12#include "calcEk.H"
13#include "fft.H"
14#include "Kmesh.H"
15#include "kShellIntegration.H"
16#include "volFields.H"
17#include "graph.H"
18
19// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
20
21namespace Foam
22{
23
24// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
25
27(
28 const volVectorField& U,
29 const Kmesh& K
30)
31{
32 label ntot = 1;
33 forAll(K.nn(), idim)
34 {
35 ntot *= K.nn()[idim];
36 }
37
38 scalar recRootN = 1.0/sqrt(scalar(ntot));
39
41 (
43 (
44 ReComplexField(U.primitiveField()),
45 K.nn()
46 )*recRootN,
47 K
48 );
49}
50
51
52// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53
54} // End namespace Foam
55
56// ************************************************************************* //
CGAL::Exact_predicates_exact_constructions_kernel K
Calculate the wavenumber vector field corresponding to the space vector field of a finite volume mesh...
Definition: Kmesh.H:54
static tmp< complexField > forwardTransform(const tmp< complexField > &field, const UList< int > &nn)
Definition: fft.C:243
Class to create, store and output qgraph files.
Definition: graph.H:62
U
Definition: pEqn.H:72
Integrate a multi-dimensional complexVectorField in k-shells to create the 1D.
Namespace for OpenFOAM.
dimensionedScalar sqrt(const dimensionedScalar &ds)
complexField ReComplexField(const UList< scalar > &re)
Create complex field from a list of real (using imag == 0)
Definition: complexField.C:118
graph calcEk(const volVectorField &U, const Kmesh &K)
Definition: calcEk.C:27
graph kShellIntegration(const complexVectorField &Ek, const Kmesh &K)
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:333