From dabd33295ffc08d480ac8b347e8ef3181f0cd576 Mon Sep 17 00:00:00 2001
From: "LEGOLAS\\lenz" <lenz@irmb.tu-bs.de>
Date: Wed, 10 Jun 2020 11:42:05 +0200
Subject: [PATCH] fixes bug with pressure outflow boundary condition in
 redesign

---
 src/VirtualFluids_GPU/Calculation/UpdateGrid27.cpp    | 10 +++++-----
 src/VirtualFluids_GPU/LBM/Simulation.cpp              | 11 +++++------
 .../apps/LBM/gridGeneratorTest/gridGeneratorTest.cpp  |  4 +++-
 3 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/VirtualFluids_GPU/Calculation/UpdateGrid27.cpp b/src/VirtualFluids_GPU/Calculation/UpdateGrid27.cpp
index d4f388512..3e6955e67 100644
--- a/src/VirtualFluids_GPU/Calculation/UpdateGrid27.cpp
+++ b/src/VirtualFluids_GPU/Calculation/UpdateGrid27.cpp
@@ -126,10 +126,10 @@ void collisionAdvectionDiffusion(Parameter* para, int level)
         ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
         // incompressible
         ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-        //         KernelADincomp27( para->getParD(level)->numberofthreads,    para->getParD(level)->diffusivity,  para->getParD(level)->geoSP, 
-        //		   para->getParD(level)->neighborX_SP,       para->getParD(level)->neighborY_SP, para->getParD(level)->neighborZ_SP,
-        //		   para->getParD(level)->d0SP.f[0],          para->getParD(level)->d27.f[0],     para->getParD(level)->size_Mat_SP,  
-        //		   para->getParD(level)->evenOrOdd); 
+        //KernelADincomp27( para->getParD(level)->numberofthreads,    para->getParD(level)->diffusivity,  para->getParD(level)->geoSP, 
+        //		            para->getParD(level)->neighborX_SP,       para->getParD(level)->neighborY_SP, para->getParD(level)->neighborZ_SP,
+        //		            para->getParD(level)->d0SP.f[0],          para->getParD(level)->d27.f[0],     para->getParD(level)->size_Mat_SP,  
+        //		            para->getParD(level)->evenOrOdd); 
         //getLastCudaError("KernelADincomp27 execution failed");
 
         ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -799,7 +799,7 @@ void preCollisionBC(Parameter* para, CudaMemoryManager* cudaManager, int level,
     // P R E S S U R E
     //////////////////////////////////////////////////////////////////////////
 
-	if (para->getParD(level)->kPressQ > 0)
+	if (para->getParD(level)->QPress.kQ > 0)
 	{
 		QPressNoRhoDev27(para->getParD(level)->numberofthreads, para->getParD(level)->QPress.RhoBC,
 		                 para->getParD(level)->d0SP.f[0],       para->getParD(level)->QPress.k,
diff --git a/src/VirtualFluids_GPU/LBM/Simulation.cpp b/src/VirtualFluids_GPU/LBM/Simulation.cpp
index 04a36ef72..a9928d7aa 100644
--- a/src/VirtualFluids_GPU/LBM/Simulation.cpp
+++ b/src/VirtualFluids_GPU/LBM/Simulation.cpp
@@ -199,7 +199,7 @@ void Simulation::init(SPtr<Parameter> para, SPtr<GridProvider> gridProvider, std
    //////////////////////////////////////////////////////////////////////////
    //Allocate Memory for Drag Lift Calculation
    //////////////////////////////////////////////////////////////////////////
-   //allocDragLift(para);
+   if (para->getCalcDragLift()) allocDragLift(para.get(), cudaManager.get());
 
 
    //////////////////////////////////////////////////////////////////////////
@@ -1725,7 +1725,7 @@ void Simulation::run()
 	  //output << "vor CalcMed\n";
 	  ////////////////////////////////////////////////////////////////////////////////
 
-
+      */
 
 
 	  ////////////////////////////////////////////////////////////////////////////////
@@ -1954,8 +1954,6 @@ void Simulation::run()
 	  }
 	  //////////////////////////////////////////////////////////////////////////////////
 
-      */
-
 
 	  ////////////////////////////////////////////////////////////////////////////////
       // File IO
@@ -2139,7 +2137,8 @@ void Simulation::run()
 			   }
 
 			   //////////////////////////////////////////////////////////////////////////
-			   VeloASCIIWriter::writeVelocitiesAsTXT(para.get(), lev, t);
+               //TODO: implement flag to write ASCII data
+			   //VeloASCIIWriter::writeVelocitiesAsTXT(para.get(), lev, t);
 			   //////////////////////////////////////////////////////////////////////////
                if( this->kineticEnergyAnalyzer || this->enstrophyAnalyzer )
                {
@@ -2283,7 +2282,7 @@ void Simulation::run()
 			////////////////////////////////////////////////////////////////////////
 			dataWriter->writeTimestep(para, t);
 			////////////////////////////////////////////////////////////////////////
-			//printDragLift(para, t);
+            if (para->getCalcDragLift()) printDragLift(para.get(), cudaManager.get(), t);
 			////////////////////////////////////////////////////////////////////////
 			if (para->getCalcParticle()) copyAndPrintParticles(para.get(), cudaManager.get(), t, false);
 			////////////////////////////////////////////////////////////////////////
diff --git a/targets/apps/LBM/gridGeneratorTest/gridGeneratorTest.cpp b/targets/apps/LBM/gridGeneratorTest/gridGeneratorTest.cpp
index c67827ffe..94d51b37a 100644
--- a/targets/apps/LBM/gridGeneratorTest/gridGeneratorTest.cpp
+++ b/targets/apps/LBM/gridGeneratorTest/gridGeneratorTest.cpp
@@ -187,7 +187,7 @@ void multipleLevel(const std::string& configPath)
             real vx = 0.05;
 
             real D = 1.0;
-            real Re = 11400;
+            real Re = 100;
 
             para->setOutputPath( "F:/Work/Computations/out/Sphere/" );
             para->setOutputPrefix( "Sphere" );
@@ -204,6 +204,8 @@ void multipleLevel(const std::string& configPath)
             para->setTOut( 1000 );
             para->setTEnd( 100000 );
 
+            para->setCalcDragLift(true);
+
             para->setUseWale(false);
 
             para->setMainKernel(kernelMapper->getEnum("CumulantK15Comp"));
-- 
GitLab