From dcf5402077ab83b615f16ab6c232aa9a88762339 Mon Sep 17 00:00:00 2001
From: Michael Kuron <mkuron@icp.uni-stuttgart.de>
Date: Sat, 5 Sep 2020 08:25:26 +0200
Subject: [PATCH] Bugfix: Guo force model for 2D non-SRT

---
 src/lbm/lattice_model/ForceModel.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/lbm/lattice_model/ForceModel.h b/src/lbm/lattice_model/ForceModel.h
index c670713dc..fdb1d83e9 100644
--- a/src/lbm/lattice_model/ForceModel.h
+++ b/src/lbm/lattice_model/ForceModel.h
@@ -499,11 +499,12 @@ public:
       if (!std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value)
       {
          const real_t one_third  = real_t(1) / real_t(3);
+         const real_t one_over_d  = real_t(1) / real_t(LatticeModel_T::Stencil::D);
       
          const auto common = Matrix3<real_t>::makeDiagonalMatrix( velocity * bodyForce_ );
          return (tensorProduct( velocity, bodyForce_ ) +
                  tensorProduct( bodyForce_, velocity ) -
-                 common * (real_t(2)*one_third) ) * real_t(0.5) * ( real_t(2) + omega )
+                 common * (real_t(2)*one_over_d) ) * real_t(0.5) * ( real_t(2) + omega )
                 + common * ( one_third * ( real_t(2) + omega_bulk ) );
       }
       else
@@ -585,11 +586,12 @@ public:
       if (!std::is_same< typename LatticeModel_T::CollisionModel::tag, collision_model::SRT_tag >::value)
       {
          const real_t one_third  = real_t(1) / real_t(3);
+         const real_t one_over_d  = real_t(1) / real_t(LatticeModel_T::Stencil::D);
       
          const auto common = Matrix3<real_t>::makeDiagonalMatrix( velocity * force(x,y,z) );
          return (tensorProduct( velocity, force(x,y,z) ) +
                  tensorProduct( force(x,y,z), velocity ) -
-                 common * (real_t(2)*one_third) ) * real_t(0.5) * ( real_t(2) + omega )
+                 common * (real_t(2)*one_over_d) ) * real_t(0.5) * ( real_t(2) + omega )
                 + common * ( one_third * ( real_t(2) + omega_bulk ) );
       }
       else
-- 
GitLab