OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

calcEk.C

Go to the documentation of this file.
00001 /*======================================================================*/
00002 
00003 // This routine evaluates q(k) (McComb, p61) by summing all wavevectors
00004 // in a k-shell. Then we divide through by the volume of the box
00005 // - to be accurate, by the volume of the ellipsoid enclosing the
00006 // box (assume cells even in each direction). Finally, multiply the
00007 // q(k) values by k^2 to give the full power spectrum E(k). Integrating
00008 // this over the whole range gives the energy in turbulence.
00009 
00010 /*======================================================================*/
00011 
00012 #include "calcEk.H"
00013 #include "fft.H"
00014 #include "Kmesh.H"
00015 #include "kShellIntegration.H"
00016 #include "volFields.H"
00017 #include "graph.H"
00018 
00019 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00020 
00021 namespace Foam
00022 {
00023 
00024 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00025 
00026 graph calcEk
00027 (
00028     const volVectorField& U,
00029     const Kmesh& K
00030 )
00031 {
00032     return kShellIntegration
00033     (
00034         fft::forwardTransform
00035         (
00036             ReComplexField(U.internalField()),
00037             K.nn()
00038         ),
00039         K
00040     );
00041 }
00042 
00043 
00044 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00045 
00046 } // End namespace Foam
00047 
00048 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd