mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: fftw: missing normalisation. See #867.
This commit is contained in:
@ -66,7 +66,7 @@ int main(int argc, char *argv[])
|
|||||||
fft::reverseTransform
|
fft::reverseTransform
|
||||||
(
|
(
|
||||||
K/(mag(K) + 1.0e-6) ^ forceGen.newField(), K.nn()
|
K/(mag(K) + 1.0e-6) ^ forceGen.newField(), K.nn()
|
||||||
)
|
)*recRootN
|
||||||
);
|
);
|
||||||
|
|
||||||
#include "globalProperties.H"
|
#include "globalProperties.H"
|
||||||
|
|||||||
@ -19,3 +19,10 @@
|
|||||||
|
|
||||||
Kmesh K(mesh);
|
Kmesh K(mesh);
|
||||||
UOprocess forceGen(K, runTime.deltaTValue(), turbulenceProperties);
|
UOprocess forceGen(K, runTime.deltaTValue(), turbulenceProperties);
|
||||||
|
|
||||||
|
label ntot = 1;
|
||||||
|
forAll(K.nn(), idim)
|
||||||
|
{
|
||||||
|
ntot *= K.nn()[idim];
|
||||||
|
}
|
||||||
|
const scalar recRootN = 1.0/Foam::sqrt(scalar(ntot));
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -60,6 +60,13 @@ Foam::vectorField Foam::turbGen::U()
|
|||||||
|
|
||||||
s = Ek(Ea, k0, mag(K))*s;
|
s = Ek(Ea, k0, mag(K))*s;
|
||||||
|
|
||||||
|
label ntot = 1;
|
||||||
|
forAll(K.nn(), idim)
|
||||||
|
{
|
||||||
|
ntot *= K.nn()[idim];
|
||||||
|
}
|
||||||
|
const scalar recRootN = 1.0/sqrt(scalar(ntot));
|
||||||
|
|
||||||
complexVectorField up
|
complexVectorField up
|
||||||
(
|
(
|
||||||
fft::reverseTransform
|
fft::reverseTransform
|
||||||
@ -67,7 +74,7 @@ Foam::vectorField Foam::turbGen::U()
|
|||||||
ComplexField(cos(constant::mathematical::twoPi*rndPhases)*s,
|
ComplexField(cos(constant::mathematical::twoPi*rndPhases)*s,
|
||||||
sin(constant::mathematical::twoPi*rndPhases)*s),
|
sin(constant::mathematical::twoPi*rndPhases)*s),
|
||||||
K.nn()
|
K.nn()
|
||||||
)
|
)*recRootN
|
||||||
);
|
);
|
||||||
|
|
||||||
return ReImSum(up);
|
return ReImSum(up);
|
||||||
|
|||||||
Reference in New Issue
Block a user