From b97e040a3fa4399b12f6762b6ed692e14b483cac Mon Sep 17 00:00:00 2001 From: Anna Wellmann <a.wellmann@tu-braunschweig.de> Date: Fri, 3 Sep 2021 14:10:38 +0200 Subject: [PATCH] Small fixes in config and app --- apps/gpu/LBM/MusselOyster/MusselOyster.cpp | 19 ++++++++++++------- .../LBM/MusselOyster/configMusselOyster.txt | 4 ++-- .../Communication/Communicator.cpp | 2 +- src/gpu/VirtualFluids_GPU/LBM/Simulation.cpp | 6 ++++-- 4 files changed, 19 insertions(+), 12 deletions(-) diff --git a/apps/gpu/LBM/MusselOyster/MusselOyster.cpp b/apps/gpu/LBM/MusselOyster/MusselOyster.cpp index bd5b7fce8..e277fc835 100644 --- a/apps/gpu/LBM/MusselOyster/MusselOyster.cpp +++ b/apps/gpu/LBM/MusselOyster/MusselOyster.cpp @@ -117,7 +117,7 @@ void multipleLevel(const std::string& configPath) std::string bivalveType = "MUSSEL"; // "MUSSEL" "OYSTER" std::string gridPath(gridPathParent + bivalveType); // only for GridGenerator, for GridReader the gridPath needs to be set in the config file - real dxGrid = (real)2.0; + real dxGrid = (real)1.0; real vxLB = (real)0.051; // LB units real Re = (real)300.0; real viscosityLB = (vxLB * dxGrid) / Re; @@ -131,9 +131,14 @@ void multipleLevel(const std::string& configPath) *logging::out << logging::Logger::INFO_HIGH << "viscosity LB [dx^2/dt] = " << viscosityLB << "\n"; *logging::out << logging::Logger::INFO_HIGH << "velocity real [m/s] = " << vxLB * para->getVelocityRatio()<< " \n"; *logging::out << logging::Logger::INFO_HIGH << "viscosity real [m^2/s] = " << viscosityLB * para->getViscosityRatio() << "\n"; + *logging::out << logging::Logger::INFO_HIGH << "dxGrid = " << dxGrid << "\n"; + *logging::out << logging::Logger::INFO_HIGH << "useGridGenerator = " << useGridGenerator << "\n"; + *logging::out << logging::Logger::INFO_HIGH << "useMultiGPU = " << useMultiGPU << "\n"; + *logging::out << logging::Logger::INFO_HIGH << "useStreams = " << useStreams << "\n"; - para->setTOut(10); - para->setTEnd(10); + + para->setTOut(10000); + para->setTEnd(10000); para->setCalcDragLift(false); para->setUseWale(false); @@ -242,8 +247,8 @@ void multipleLevel(const std::string& configPath) gridBuilder->setVelocityBoundaryCondition(SideType::PY, vxLB, 0.0, 0.0); gridBuilder->setVelocityBoundaryCondition(SideType::GEOMETRY, 0.0, 0.0, 0.0); ////////////////////////////////////////////////////////////////////////// - - gridBuilder->findFluidNodes(useStreams); + if (useStreams) + gridBuilder->findFluidNodes(useStreams); //gridBuilder->writeGridsToVtk(path + "/" + bivalveType + "/grid/part" + std::to_string(generatePart) + "_"); //gridBuilder->writeGridsToVtk(path + "/" + bivalveType + "/" + std::to_string(generatePart) + "/grid/"); @@ -272,8 +277,8 @@ void multipleLevel(const std::string& configPath) gridBuilder->setVelocityBoundaryCondition(SideType::GEOMETRY, 0.0, 0.0, 0.0); ////////////////////////////////////////////////////////////////////////// - - gridBuilder->findFluidNodes(useStreams); + if (useStreams) + gridBuilder->findFluidNodes(useStreams); // gridBuilder->writeGridsToVtk("E:/temp/MusselOyster/" + bivalveType + "/grid/"); // gridBuilder->writeArrows ("E:/temp/MusselOyster/" + bivalveType + "/arrow"); diff --git a/apps/gpu/LBM/MusselOyster/configMusselOyster.txt b/apps/gpu/LBM/MusselOyster/configMusselOyster.txt index f80b80469..1cc651641 100644 --- a/apps/gpu/LBM/MusselOyster/configMusselOyster.txt +++ b/apps/gpu/LBM/MusselOyster/configMusselOyster.txt @@ -7,14 +7,14 @@ ################################################## #informations for Writing ################################################## -Path="E:/MusselOyster/results" +Path=E:/temp/MusselOysterResults #Path="F:/Work/Computations/out/MusselOyster/" #Prefix="MusselOyster" #WriteGrid=true ################################################## #informations for reading ################################################## -GridPath="E:/temp/GridMussel/MUSSEL" +GridPath=E:/temp/GridMussel/MUSSEL #GridPath="C:" ################################################## diff --git a/src/gpu/VirtualFluids_GPU/Communication/Communicator.cpp b/src/gpu/VirtualFluids_GPU/Communication/Communicator.cpp index 23fe11666..80823e8c1 100644 --- a/src/gpu/VirtualFluids_GPU/Communication/Communicator.cpp +++ b/src/gpu/VirtualFluids_GPU/Communication/Communicator.cpp @@ -208,7 +208,7 @@ int Communicator::mapCudaDevice(const int &rank, const int &size, const std::vec std::vector<double> Communicator::gatherNUPS(double processNups) { double *buffer_send = &processNups; - double *buffer_recv = buffer_recv = (double *)malloc(sizeof(double) * this->numprocs); + double *buffer_recv = (double *)malloc(sizeof(double) * this->numprocs); MPI_Gather(buffer_send, 1, MPI_DOUBLE, buffer_recv, 1, MPI_DOUBLE, 0, commGPU); diff --git a/src/gpu/VirtualFluids_GPU/LBM/Simulation.cpp b/src/gpu/VirtualFluids_GPU/LBM/Simulation.cpp index 4985ab81b..06f436f3a 100644 --- a/src/gpu/VirtualFluids_GPU/LBM/Simulation.cpp +++ b/src/gpu/VirtualFluids_GPU/LBM/Simulation.cpp @@ -87,8 +87,10 @@ void Simulation::init(SPtr<Parameter> para, SPtr<GridProvider> gridProvider, std gridProvider->allocAndCopyForcing(); gridProvider->allocAndCopyQuadricLimiters(); - gridProvider->allocArrays_fluidNodeIndices(); - gridProvider->allocArrays_fluidNodeIndicesBorder(); + if (para->getUseStreams()) { + gridProvider->allocArrays_fluidNodeIndices(); + gridProvider->allocArrays_fluidNodeIndicesBorder(); + } gridProvider->setDimensions(); gridProvider->setBoundingBox(); -- GitLab