USER_PROBLEM: Make sure the wave numbers are not fractions of 2 pi.

If the wave number of the perturbation is a fraction of 2 pi there in no
match at the periodic boundary.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
This commit is contained in:
Grzegorz Kowal 2020-12-15 20:32:30 -03:00
parent 019f3245cc
commit 09284fcf25

View File

@ -307,9 +307,9 @@ module user_problem
ux(n) = cos(thh) * cos(thv)
uy(n) = sin(thh) * cos(thv)
uz(n) = sin(thv)
kx(n) = pi2 * kper * ux(n)
ky(n) = pi2 * kper * uy(n)
kz(n) = pi2 * kper * uz(n)
kx(n) = pi2 * nint(kper * ux(n))
ky(n) = pi2 * nint(kper * uy(n))
kz(n) = pi2 * nint(kper * uz(n))
tt = 0.0d+00
do while(tt < 1.0d-08)
thh = pi2 * randuni()
@ -326,8 +326,8 @@ module user_problem
uy(n) = fc * uy(n) / tt
uz(n) = fc * uz(n) / tt
#else /* NDIMS == 3 */
kx(n) = pi2 * kper * cos(thh)
ky(n) = pi2 * kper * sin(thh)
kx(n) = pi2 * nint(kper * cos(thh))
ky(n) = pi2 * nint(kper * sin(thh))
kz(n) = 0.0d+00
ux(n) = fc * sin(thh)
uy(n) = fc * cos(thh)