diff --git a/apps/cpu/TPMSRow/TPMSRow.cpp b/apps/cpu/TPMSRow/TPMSRow.cpp index ddf236534d4b05dfff260bc0bb77f16bd166411b..f02797add95dae7c364454361faca8eea5793a44 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 d84a8fac2874a93d520b6f7dda86fb9554988145..19184eca2afa74c3457379564cd8b26f49053b4d 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 b3c9b6ba833d32d7fe551f561e366f581f518eee..1395f3810cc2ea2faf84a4143d72981ee650b864 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__