From 09284fcf259f5f81691c0464d9f5ec21cc6e8b8a Mon Sep 17 00:00:00 2001 From: Grzegorz Kowal Date: Tue, 15 Dec 2020 20:32:30 -0300 Subject: [PATCH] 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 --- sources/user_problem.F90 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sources/user_problem.F90 b/sources/user_problem.F90 index 2a693d4..e78685a 100644 --- a/sources/user_problem.F90 +++ b/sources/user_problem.F90 @@ -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)