From 4322165a7c1c7e57fdf2687e57a7d0904e84a930 Mon Sep 17 00:00:00 2001
From: Michael Kuron <m.kuron@gmx.de>
Date: Sat, 12 Feb 2022 16:49:59 +0100
Subject: [PATCH] fix occasional NaNs in Oldroyd-B test

---
 lbmpy_tests/test_oldroydb.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lbmpy_tests/test_oldroydb.py b/lbmpy_tests/test_oldroydb.py
index f7f80fb9..8b836f6c 100755
--- a/lbmpy_tests/test_oldroydb.py
+++ b/lbmpy_tests/test_oldroydb.py
@@ -132,6 +132,7 @@ def test_oldroydb():
         assert len(bh._boundary_object_to_boundary_info) == 1, "Restart kernel to clear boundaries"
 
     def init():
+        dh.fill(ρ.name, np.nan, ghost_layers=True, inner_ghost_layers=True)
         dh.fill(ρ.name, 1)
         dh.fill(u.name, np.nan, ghost_layers=True, inner_ghost_layers=True)
         dh.fill(u.name, 0)
@@ -139,9 +140,12 @@ def test_oldroydb():
         dh.fill(tau.name, 0)
         dh.fill(tauflux.name, np.nan, ghost_layers=True, inner_ghost_layers=True)
         dh.fill(tauface.name, np.nan, ghost_layers=True, inner_ghost_layers=True)
+        dh.fill(F.name, np.nan, ghost_layers=True, inner_ghost_layers=True)
+        dh.fill(F.name, 0) # needed for LB initialization
     
         sync_tau() # force calculation inside the initialization needs neighbor taus
         dh.run_kernel(init_kernel)
+        dh.fill(F.name, np.nan)
 
 
     # In[7]:
-- 
GitLab