From 5178e467b733b7df4893f67ffd9db76064ee8c32 Mon Sep 17 00:00:00 2001
From: Martin Bauer <martin.bauer@fau.de>
Date: Tue, 18 Jun 2019 15:17:59 +0200
Subject: [PATCH] Fix in shear flow initialization (fluctuation now centered
 around 0)

---
 lbmpy/geometry.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lbmpy/geometry.py b/lbmpy/geometry.py
index e0cec5ae..1012d22c 100644
--- a/lbmpy/geometry.py
+++ b/lbmpy/geometry.py
@@ -185,7 +185,7 @@ def get_shear_flow_velocity_field(domain_size, u_max, random_y_factor=0.01):
     velocity[..., 0] = u_max
     velocity[..., height // 3: height // 3 * 2, 0] = -u_max
     for j in range(1, len(domain_size)):
-        velocity[..., j] = random_y_factor * u_max * np.random.rand(*domain_size)
+        velocity[..., j] = random_y_factor * u_max * (np.random.rand(*domain_size) - 0.5)
     return velocity
 
 
-- 
GitLab