From 8d5718c6a0c4ae399599b3d8a953fd3ce145e784 Mon Sep 17 00:00:00 2001
From: Anna Wellmann <a.wellmann@tu-bs.de>
Date: Mon, 13 Jun 2022 15:35:59 +0000
Subject: [PATCH] Change bcs for flow around sphere

---
 .../gpu/FlowAroundSphere/FlowAroundSphere.cpp | 23 +++++++++----------
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/apps/gpu/FlowAroundSphere/FlowAroundSphere.cpp b/apps/gpu/FlowAroundSphere/FlowAroundSphere.cpp
index bbc69fa18..10dfd23ba 100644
--- a/apps/gpu/FlowAroundSphere/FlowAroundSphere.cpp
+++ b/apps/gpu/FlowAroundSphere/FlowAroundSphere.cpp
@@ -28,7 +28,7 @@
 //
 //! \file LidDrivenCavity.cpp
 //! \ingroup Applications
-//! \author Martin Schoenherr, Stephan Lenz
+//! \author Martin Schoenherr, Stephan Lenz, Anna Wellmann
 //=======================================================================================
 #define _USE_MATH_DEFINES
 #include <exception>
@@ -83,8 +83,8 @@ int main(int argc, char *argv[])
         const real dt = (real)0.5e-3;
         const uint nx = 64;
 
-        const uint timeStepOut = 10000;
-        const uint timeStepEnd = 250000;
+        const uint timeStepOut = 10;
+        const uint timeStepEnd = 100;
 
         //////////////////////////////////////////////////////////////////////////
         // setup logger
@@ -131,8 +131,7 @@ int main(int argc, char *argv[])
 
         const real velocityLB = velocity * dt / dx; // LB units
 
-        const real vx = velocityLB / sqrt(2.0); // LB units
-        const real vy = velocityLB / sqrt(2.0); // LB units
+        const real vxLB = velocityLB / sqrt(2.0); // LB units
 
         const real viscosityLB = nx * velocityLB / Re; // LB units
 
@@ -162,13 +161,13 @@ int main(int argc, char *argv[])
         // set boundary conditions
         //////////////////////////////////////////////////////////////////////////
 
-        gridBuilder->setNoSlipBoundaryCondition(SideType::PX);
-        gridBuilder->setNoSlipBoundaryCondition(SideType::MX);
-        gridBuilder->setNoSlipBoundaryCondition(SideType::PY);
-        gridBuilder->setNoSlipBoundaryCondition(SideType::MY);
-        gridBuilder->setVelocityBoundaryCondition(SideType::PZ, vx, vy, 0.0);
-        gridBuilder->setNoSlipBoundaryCondition(SideType::MZ);
+        gridBuilder->setVelocityBoundaryCondition(SideType::MX, vxLB, 0.0, 0.0);
+        gridBuilder->setVelocityBoundaryCondition(SideType::MY, 0.0, 0.0, 0.0);
+        gridBuilder->setVelocityBoundaryCondition(SideType::PY, vxLB, 0.0, 0.0);
+        gridBuilder->setVelocityBoundaryCondition(SideType::MZ, vxLB, 0.0, 0.0);
+        gridBuilder->setVelocityBoundaryCondition(SideType::PZ, vxLB, 0.0, 0.0);
         gridBuilder->setVelocityBoundaryCondition(SideType::GEOMETRY, 0.0, 0.0, 0.0);
+        gridBuilder->setPressureBoundaryCondition(SideType::PX, 0.0); // set pressure BC after velocity BCs
 
         //////////////////////////////////////////////////////////////////////////
         // set copy mesh to simulation
@@ -187,7 +186,7 @@ int main(int argc, char *argv[])
         sim.init(para, gridGenerator, fileWriter, cudaMemoryManager);
         sim.run();
         sim.free();
-        
+
     } catch (const std::bad_alloc &e) {
         *logging::out << logging::Logger::LOGGER_ERROR << "Bad Alloc:" << e.what() << "\n";
     } catch (const std::exception &e) {
-- 
GitLab