Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
765c2051
Commit
765c2051
authored
Jun 13, 2018
by
mattijs
Browse files
BUG: fftw: missing normalisation. See
#867
.
parent
51c48fa9
Changes
3
Hide whitespace changes
Inline
Side-by-side
applications/solvers/DNS/dnsFoam/dnsFoam.C
View file @
765c2051
...
...
@@ -66,7 +66,7 @@ int main(int argc, char *argv[])
fft
::
reverseTransform
(
K
/
(
mag
(
K
)
+
1.0e-6
)
^
forceGen
.
newField
(),
K
.
nn
()
)
)
*
recRootN
);
#include
"globalProperties.H"
...
...
applications/solvers/DNS/dnsFoam/readTurbulenceProperties.H
View file @
765c2051
...
...
@@ -19,3 +19,10 @@
Kmesh
K
(
mesh
);
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
));
src/randomProcesses/turbulence/turbGen.C
View file @
765c2051
...
...
@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation |
Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -60,6 +60,13 @@ Foam::vectorField Foam::turbGen::U()
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
(
fft
::
reverseTransform
...
...
@@ -67,7 +74,7 @@ Foam::vectorField Foam::turbGen::U()
ComplexField
(
cos
(
constant
::
mathematical
::
twoPi
*
rndPhases
)
*
s
,
sin
(
constant
::
mathematical
::
twoPi
*
rndPhases
)
*
s
),
K
.
nn
()
)
)
*
recRootN
);
return
ReImSum
(
up
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment