From 62bc4a98eb67c07b335dd047b98e3f07bce83156 Mon Sep 17 00:00:00 2001
From: Hussein Alihussein <h.alihussein@tu-braunschweig.de>
Date: Mon, 20 Nov 2023 08:18:24 +0100
Subject: [PATCH] clean Inflow BC

---
 apps/cpu/TPMSRow/TPMSRow.cpp                          |  2 +-
 .../NonReflectingInflowBCStrategy.cpp                 | 11 ++++++++---
 .../NonReflectingInflowBCStrategy.h                   |  5 ++++-
 3 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/apps/cpu/TPMSRow/TPMSRow.cpp b/apps/cpu/TPMSRow/TPMSRow.cpp
index ddf236534..f02797add 100644
--- a/apps/cpu/TPMSRow/TPMSRow.cpp
+++ b/apps/cpu/TPMSRow/TPMSRow.cpp
@@ -107,7 +107,7 @@ void run(string configname)
 
          //xMinApr->setBcAlgorithm(SPtr<BCStrategy>(new NonEqDensityBCStrategy()));
         // xMinApr->setBcAlgorithm(SPtr<BCStrategy>(new VelocityBCStrategy()));
-        xMinApr->setBCStrategy(SPtr<BCStrategy>(new NonReflectingInflowBCStrategy())); 
+        xMinApr->setBCStrategy(SPtr<BCStrategy>(new NonReflectingInflowBCStrategy(vx, c1o2))); 
         // xMinApr->setBcAlgorithm(SPtr<BCStrategy>(new VelocityWithDensityBCStrategy()));
          //xMaxApr->setBcAlgorithm(SPtr<BCStrategy>(new NonEqDensityBCStrategy()));
          xMaxApr->setBCStrategy(SPtr<BCStrategy>(new NonReflectingOutflowWithRelaxationBCStrategy()));
diff --git a/src/cpu/core/BoundaryConditions/NonReflectingInflowBCStrategy.cpp b/src/cpu/core/BoundaryConditions/NonReflectingInflowBCStrategy.cpp
index d84a8fac2..19184eca2 100644
--- a/src/cpu/core/BoundaryConditions/NonReflectingInflowBCStrategy.cpp
+++ b/src/cpu/core/BoundaryConditions/NonReflectingInflowBCStrategy.cpp
@@ -36,10 +36,13 @@
 #include "D3Q27System.h"
 #include "DistributionArray3D.h"
 
-NonReflectingInflowBCStrategy::NonReflectingInflowBCStrategy()
+NonReflectingInflowBCStrategy::NonReflectingInflowBCStrategy(LBMReal velocity, LBMReal relaxationRate)
 {
     BCStrategy::type         = BCStrategy::NonReflectingInflowBCStrategy;
     BCStrategy::preCollision = true;
+    this->BCVeloWeight=relaxationRate;
+    this->velocity=velocity;
+
 }
 //////////////////////////////////////////////////////////////////////////
 NonReflectingInflowBCStrategy::~NonReflectingInflowBCStrategy() = default;
@@ -98,14 +101,16 @@ void NonReflectingInflowBCStrategy::applyBC()
     LBMReal rho, vx1, vx2, vx3;
     calcMacrosFct(f, rho, vx1, vx2, vx3);
     //vx1                  = 0.;
-    LBMReal BCVeloWeight = c1o2;
+    //LBMReal BCVeloWeight = c1o2;
+     LBMReal BCVeloWeight =this->BCVeloWeight
     // LBMReal velocity     = 0.004814077025232405; 
      // LBMReal velocity     = 0.00057735;
     //LBMReal velocity = 0.04; 
       // LBMReal velocity = 0.01; 
      // LBMReal velocity = 1./112.; 
     // LBMReal velocity = 1./126.; 
-     LBMReal velocity = c1o100/2;
+     //LBMReal velocity = c1o100/2;
+     LBMReal velocity = this->velocity;
      // LBMReal velocity = 0.005; 
     //LBMReal delf         =(-velocity+vx1)*0.5 ;
     LBMReal delf; 
diff --git a/src/cpu/core/BoundaryConditions/NonReflectingInflowBCStrategy.h b/src/cpu/core/BoundaryConditions/NonReflectingInflowBCStrategy.h
index b3c9b6ba8..1395f3810 100644
--- a/src/cpu/core/BoundaryConditions/NonReflectingInflowBCStrategy.h
+++ b/src/cpu/core/BoundaryConditions/NonReflectingInflowBCStrategy.h
@@ -41,10 +41,13 @@ class DistributionArray3D;
 class NonReflectingInflowBCStrategy : public BCStrategy
 {
 public:
-    NonReflectingInflowBCStrategy();
+    NonReflectingInflowBCStrategy(LBMReal velocity, LBMReal relaxationRate);
     ~NonReflectingInflowBCStrategy() override;
     SPtr<BCStrategy> clone() override;
     void addDistributions(SPtr<DistributionArray3D> distributions) override;
     void applyBC() override;
+private:
+LBMReal velocity;
+LBMReal BCVeloWeight;    
 };
 #endif // NonReflectingDensityBCStrategy_h__
-- 
GitLab