diff --git a/.clang-format b/.clang-format index cca4fe23c1d1eb12fe71b5d097d7e5ec4146839b..8131cada04983790482482445948740a8cc4da23 100644 --- a/.clang-format +++ b/.clang-format @@ -107,7 +107,6 @@ SpaceAfterCStyleCast: false SpaceAfterLogicalNot: false SpaceAfterTemplateKeyword: true SpaceBeforeAssignmentOperators: true -SpaceBeforeCpp11BracedList: false SpaceBeforeCtorInitializerColon: true SpaceBeforeInheritanceColon: true SpaceBeforeParens: ControlStatements diff --git a/CMake/cmake_config_files/ARAGORN.config.cmake b/CMake/cmake_config_files/ARAGORN.config.cmake index 438e697b08ddf37399a2e5fafb7909dab2c1ffea..c6d9a56857a5b87ffca516fc83663af2944aaa4e 100644 --- a/CMake/cmake_config_files/ARAGORN.config.cmake +++ b/CMake/cmake_config_files/ARAGORN.config.cmake @@ -11,6 +11,4 @@ set(GPU_APP "apps/gpu/") list(APPEND USER_APPS "${GPU_APP}DrivenCavityMultiGPU" "${GPU_APP}SphereMultiGPU" - # "${GPU_APP}ChannelFlow" - # "${GPU_APP}MusselOyster" ) diff --git a/CMake/cmake_config_files/ELDARION.config.cmake b/CMake/cmake_config_files/ELDARION.config.cmake index ad4606918cdf644849f3f449347f3ca9a68a0eeb..530b94966c8071399de6407699cf5b2ba4f3c085 100644 --- a/CMake/cmake_config_files/ELDARION.config.cmake +++ b/CMake/cmake_config_files/ELDARION.config.cmake @@ -14,5 +14,4 @@ set(GPU_APP "apps/gpu/") list(APPEND USER_APPS "${GPU_APP}DrivenCavityMultiGPU" "${GPU_APP}SphereMultiGPU" - # "${GPU_APP}MusselOyster" ) \ No newline at end of file diff --git a/CMake/cmake_config_files/KI4ALLGPU.config.cmake b/CMake/cmake_config_files/KI4ALLGPU.config.cmake index d53f2a772f0f31188098f4e65589b79f0fc9cb4c..2f102dca2f9c38fba7b7cc8b0d5934464edbea7f 100644 --- a/CMake/cmake_config_files/KI4ALLGPU.config.cmake +++ b/CMake/cmake_config_files/KI4ALLGPU.config.cmake @@ -8,7 +8,6 @@ set(CMAKE_CUDA_ARCHITECTURES 80) # Nvidia Tesla A100 set(GPU_APP "apps/gpu/") list(APPEND USER_APPS - "${GPU_APP}ChannelFlow" "${GPU_APP}SphereMultiGPU" ) diff --git a/CMake/cmake_config_files/MOLLOK.config.cmake b/CMake/cmake_config_files/MOLLOK.config.cmake index 8192f4fafd0752557fdb60d100549baa422b2dd9..5bfafefabb5485d55469292bb3c949f5e2de02d4 100644 --- a/CMake/cmake_config_files/MOLLOK.config.cmake +++ b/CMake/cmake_config_files/MOLLOK.config.cmake @@ -10,7 +10,3 @@ set(CMAKE_CUDA_ARCHITECTURES 86) # numerical tests location of the grids set(PATH_NUMERICAL_TESTS "D:/out/numericalTests/") list(APPEND VF_COMPILER_DEFINITION "PATH_NUMERICAL_TESTS=${PATH_NUMERICAL_TESTS}") - -# add invidual apps here -list(APPEND USER_APPS "apps/gpu/WTG_RUB") -list(APPEND USER_APPS "apps/gpu/TGV_3D_GridRef") diff --git a/CMake/cmake_config_files/PHOENIX.config.cmake b/CMake/cmake_config_files/PHOENIX.config.cmake index fe9d70f6cd38fe487b38a69d8d85e570fb6f31df..14beaf03d482562692c9186c94528dbb15503c9e 100644 --- a/CMake/cmake_config_files/PHOENIX.config.cmake +++ b/CMake/cmake_config_files/PHOENIX.config.cmake @@ -12,5 +12,4 @@ set(GPU_APP "apps/gpu/") list(APPEND USER_APPS # "${GPU_APP}DrivenCavityMultiGPU" # "${GPU_APP}SphereMultiGPU" - # "${GPU_APP}MusselOyster" ) diff --git a/CMake/cmake_config_files/TESLA03.config.cmake b/CMake/cmake_config_files/TESLA03.config.cmake index dc0f1253c668dd6fba92c5d1ee33c387af67ee5a..be6052d6fca0797cd053fe4815a3750dce79a98f 100644 --- a/CMake/cmake_config_files/TESLA03.config.cmake +++ b/CMake/cmake_config_files/TESLA03.config.cmake @@ -10,6 +10,3 @@ SET(CMAKE_CUDA_ARCHITECTURES 52) # numerical tests location of the grids SET(PATH_NUMERICAL_TESTS "E:/temp/numericalTests/") list(APPEND VF_COMPILER_DEFINITION "PATH_NUMERICAL_TESTS=${PATH_NUMERICAL_TESTS}") - -# add invidual apps here -list(APPEND USER_APPS "apps/gpu/MusselOyster") diff --git a/apps/cpu/GyroidsRow/GyroidsRow_Re_425_u_001_N_100_compressible_regression.cfg b/apps/cpu/GyroidsRow/GyroidsRow_Re_425_u_001_N_100_compressible_regression.cfg new file mode 100644 index 0000000000000000000000000000000000000000..39dcd0d3b4dea8bfdfcce76b6790d69150a7c5e2 --- /dev/null +++ b/apps/cpu/GyroidsRow/GyroidsRow_Re_425_u_001_N_100_compressible_regression.cfg @@ -0,0 +1,43 @@ +#pathname = /Users/grk2075/temp/GyroidsRow_Re_425_u_001_N_100_compressible +pathname = output/GyroidsRow +numOfThreads = 1 +availMem = 15e10 +refineLevel = 0 + +#Grid +length =0.025 0.01 0.01 +blocknx = 50 25 25 +dx =0.0001 + +#Geometry +UnitEdgeLength=0.01 +TPMSL = 0.01 0.01 0.01 +TPMSOrigin = 0 0 0 +gridCubeOrigin = -0.005 0 0 + + +# #Grid +# length =0.155 0.01 0.01 +# blocknx = 62 25 25 +# dx = 0.0001 + +# #Geometry +# UnitEdgeLength=0.01 +# TPMSL = 0.14 0.01 0.01 +# TPMSOrigin = 0 0 0 +# gridCubeOrigin = -0.005 0 0 + + +#Simulation +nu = 0.00234936 +Re = 425.6478360064018 +vx = 0.01 + +beginTime = 0 +outTime = 100 +endTime = 100 +logToFile = false +newStart = true +restartStep = 600000 +cpStart = 600000 +cpStep = 600000 \ No newline at end of file diff --git a/apps/gpu/ActuatorLine/ActuatorLine.cpp b/apps/gpu/ActuatorLine/ActuatorLine.cpp index 9e8af64ee40a2e93318eefb1c8ea8177a762fe62..e205d73f0f54285885ef7147df3fa6e1ba9879fc 100644 --- a/apps/gpu/ActuatorLine/ActuatorLine.cpp +++ b/apps/gpu/ActuatorLine/ActuatorLine.cpp @@ -308,7 +308,7 @@ int main(int argc, char* argv[]) return 0; try { - auto config = vf::basics::loadConfig(argc, argv, "./configActuatorLine.txt"); + auto config = vf::basics::loadConfig(argc, argv, "./actuatorline.cfg"); run(config); } catch (const spdlog::spdlog_ex& ex) { std::cout << "Log initialization failed: " << ex.what() << std::endl; diff --git a/apps/gpu/ActuatorLine/configActuatorLine.txt b/apps/gpu/ActuatorLine/actuatorline.cfg similarity index 100% rename from apps/gpu/ActuatorLine/configActuatorLine.txt rename to apps/gpu/ActuatorLine/actuatorline.cfg diff --git a/apps/gpu/ActuatorLine/configActuatorLineRegression.txt b/apps/gpu/ActuatorLine/actuatorline_regressiontest.cfg similarity index 100% rename from apps/gpu/ActuatorLine/configActuatorLineRegression.txt rename to apps/gpu/ActuatorLine/actuatorline_regressiontest.cfg diff --git a/apps/gpu/AtmosphericBoundaryLayer/AtmosphericBoundaryLayer.cpp b/apps/gpu/AtmosphericBoundaryLayer/AtmosphericBoundaryLayer.cpp index 0ec4dd18b10f31fa2bea8872ac2ad6582c6c06f8..deac5fbdcd6980bfe8866f28be03d7fa1fd3fdc2 100644 --- a/apps/gpu/AtmosphericBoundaryLayer/AtmosphericBoundaryLayer.cpp +++ b/apps/gpu/AtmosphericBoundaryLayer/AtmosphericBoundaryLayer.cpp @@ -335,7 +335,7 @@ void run(const vf::basics::ConfigurationFile& config) BoundaryConditionFactory bcFactory = BoundaryConditionFactory(); bcFactory.setVelocityBoundaryCondition(BoundaryConditionFactory::VelocityBC::VelocityInterpolatedCompressible); bcFactory.setStressBoundaryCondition(BoundaryConditionFactory::StressBC::StressPressureBounceBack); - bcFactory.setSlipBoundaryCondition(BoundaryConditionFactory::SlipBC::SlipCompressibleTurbulentViscosity); + bcFactory.setSlipBoundaryCondition(BoundaryConditionFactory::SlipBC::SlipTurbulentViscosityCompressible); bcFactory.setPressureBoundaryCondition(BoundaryConditionFactory::PressureBC::OutflowNonReflective); if (useDistributionsForPrecursor) { bcFactory.setPrecursorBoundaryCondition(BoundaryConditionFactory::PrecursorBC::DistributionsPrecursor); @@ -450,7 +450,7 @@ int main(int argc, char* argv[]) { try { vf::logging::Logger::initializeLogger(); - auto config = vf::basics::loadConfig(argc, argv, "./configBoundaryLayer.txt"); + auto config = vf::basics::loadConfig(argc, argv, "./abl.cfg"); run(config); } catch (const spdlog::spdlog_ex& ex) { std::cout << "Log initialization failed: " << ex.what() << '\n'; diff --git a/apps/gpu/AtmosphericBoundaryLayer/configAtmosphericBoundaryLayer.txt b/apps/gpu/AtmosphericBoundaryLayer/abl.cfg similarity index 100% rename from apps/gpu/AtmosphericBoundaryLayer/configAtmosphericBoundaryLayer.txt rename to apps/gpu/AtmosphericBoundaryLayer/abl.cfg diff --git a/apps/gpu/AtmosphericBoundaryLayer/configAtmosphericBoundaryLayerRegression.txt b/apps/gpu/AtmosphericBoundaryLayer/abl_regressiontest.cfg similarity index 100% rename from apps/gpu/AtmosphericBoundaryLayer/configAtmosphericBoundaryLayerRegression.txt rename to apps/gpu/AtmosphericBoundaryLayer/abl_regressiontest.cfg diff --git a/apps/gpu/Basel/3rdPartyLinking.cmake b/apps/gpu/Basel/3rdPartyLinking.cmake deleted file mode 100644 index 6dd6ba1bc73e73dfbf01a3cc36aaeb3664e1c04c..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/3rdPartyLinking.cmake +++ /dev/null @@ -1,13 +0,0 @@ -include (${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/MPI/Link.cmake) -linkMPI(${targetName}) -include (${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/Cuda/Link.cmake) -linkCuda(${targetName}) -include (${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/Boost/Link.cmake) -linkBoost(${targetName} "serialization") -include (${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/Metis/Link.cmake) -linkMetis(${targetName}) - -if(HULC.BUILD_JSONCPP) - include (${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/JsonCpp/Link.cmake) - linkJsonCpp(${targetName}) -endif() \ No newline at end of file diff --git a/apps/gpu/Basel/CMakeLists.txt b/apps/gpu/Basel/CMakeLists.txt deleted file mode 100644 index 2d05f78bd85244eee12b8b65c9df157ff175b1e5..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -setTargetNameToFolderName(${CMAKE_CURRENT_LIST_DIR}) - -set(linkDirectories "") -set(libsToLink gpu_core GridGenerator) -set(includeDirectories "${CMAKE_SOURCE_DIR}/src" "${CMAKE_SOURCE_DIR}/src/gpu_core" "${CMAKE_SOURCE_DIR}/src/GridGenerator" "${CMAKE_SOURCE_DIR}/src/VirtualFluidsBasics") - -#glob files and save in MY_SRCS -include(CMakePackage.cmake) - -buildExe(${targetName} "${MY_SRCS}" "${linkDirectories}" "${libsToLink}" "${includeDirectories}") -groupTarget(${targetName} ${lbmAppFolder}) - -# Specify the linking to 3rdParty libs -include(3rdPartyLinking.cmake) \ No newline at end of file diff --git a/apps/gpu/Basel/CMakePackage.cmake b/apps/gpu/Basel/CMakePackage.cmake deleted file mode 100644 index 5d39e3804dbd180790629111449a7dc918292430..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/CMakePackage.cmake +++ /dev/null @@ -1,9 +0,0 @@ -#FILE ENDINGS -resetFileEndingsToCollect() -addCAndCPPFileTypes() -addFileEndingToCollect("*.cu") -addFileEndingToCollect("*.cuh") - -#GLOB SOURCE FILES IN MY_SRCS -unset(MY_SRCS) -includeRecursiveAllFilesFrom(${targetName} ${CMAKE_CURRENT_LIST_DIR}) \ No newline at end of file diff --git a/apps/gpu/Basel/main.cpp b/apps/gpu/Basel/main.cpp deleted file mode 100644 index 0d8a821d1bb3dd5e14c008673cdab81c353c0d95..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/main.cpp +++ /dev/null @@ -1,279 +0,0 @@ -//#define MPI_LOGGING - -//Martin Branch - -#include <mpi.h> -#if defined( MPI_LOGGING ) -#include <mpe.h> -#endif - -#include <string> -#include <iostream> -#include <stdexcept> -#include <fstream> -#define _USE_MATH_DEFINES -#include <math.h> - -#include "Input/Input.h" -#include "StringUtilities/StringUtil.h" -#include "Input/ConfigFileReader/ConfigFileReader.h" - -#include "gpu/core/LBM/Simulation.h" -#include "gpu/core/Communication/MpiCommunicator.h" -#include "gpu/core/DataStructureInitializer/GridReaderGenerator/GridGenerator.h" -#include "gpu/core/DataStructureInitializer/GridProvider.h" -#include "gpu/core/DataStructureInitializer/GridReaderFiles/GridReader.h" -#include "gpu/core/Parameter/Parameter.h" -#include "gpu/core/Output/FileWriter.h" -#include "gpu/core/GPU/CudaMemoryManager.h" -#include "gpu/core/BoundaryConditions/BoundaryConditionFactory.h" - -#include "global.h" - -#include "GridGenerator/StreetPointFinder/StreetPointFinder.h" - -#include "geometries/Sphere/Sphere.h" -#include "geometries/VerticalCylinder/VerticalCylinder.h" -#include "geometries/Cuboid/Cuboid.h" -#include "geometries/TriangularMesh/TriangularMesh.h" -#include "geometries/Conglomerate/Conglomerate.h" -#include "geometries/TriangularMesh/TriangularMeshStrategy.h" - -#include "grid/GridBuilder/LevelGridBuilder.h" -#include "grid/GridBuilder/MultipleGridBuilder.h" -#include "grid/BoundaryConditions/Side.h" -#include "grid/BoundaryConditions/BoundaryCondition.h" -#include "grid/GridFactory.h" - -#include "io/SimulationFileWriter/SimulationFileWriter.h" -#include "io/GridVTKWriter/GridVTKWriter.h" -#include "io/STLReaderWriter/STLReader.h" -#include "io/STLReaderWriter/STLWriter.h" - -#include "utilities/math/Math.h" -#include "utilities/communication.h" -#include "utilities/transformator/TransformatorImp.h" - -#include "Kernel/Utilities/KernelFactory/KernelFactoryImp.h" -#include "PreProcessor/PreProcessorFactory/PreProcessorFactoryImp.h" - - -void multipleLevel(const std::string& configPath) -{ - auto gridFactory = GridFactory::make(); - gridFactory->setGridStrategy(Device::CPU); - //gridFactory->setTriangularMeshDiscretizationMethod(TriangularMeshDiscretizationMethod::RAYCASTING); - gridFactory->setTriangularMeshDiscretizationMethod(TriangularMeshDiscretizationMethod::POINT_IN_OBJECT); - //gridFactory->setTriangularMeshDiscretizationMethod(TriangularMeshDiscretizationMethod::POINT_UNDER_TRIANGLE); - - auto gridBuilder = MultipleGridBuilder::makeShared(gridFactory); - - SPtr<ConfigFileReader> configReader = ConfigFileReader::getNewInstance(); - SPtr<ConfigData> configData = configReader->readConfigFile(configPath); - Communicator* comm = Communicator::getInstanz(); - - SPtr<Parameter> para = Parameter::make(configData, comm); - BoundaryConditionFactory bcFactory = BoundaryConditionFactory(); - SPtr<CudaMemoryManager> cudaMemManager = CudaMemoryManager::make(para); - SPtr<GridProvider> gridGenerator; - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -#ifdef _WIN32 - //Baumbart - std::string gridpath = "F:/Basel2019"; -#else - //Phoenix - std::string gridpath = "/work/marschoe/Basel4GPU"; -#endif // _WIN32 - - - std::ofstream logFile; - logFile.open(gridpath + "/gridGeneratorLog.txt"); - - bool useGridGenerator = false; - - if (useGridGenerator) { - - real dx = 1.0; - real vx = 0.05; - -#ifdef _WIN32 - //Baumbart - auto BaselSTL = std::make_shared<TriangularMesh>("M:/Basel2019/stl/BaselUrbanProfile_066_deg_bridge_3_All_CLOSED_WIDE_GROUND.stl"); -#else - //Phoenix - auto BaselSTL = std::make_shared<TriangularMesh>(gridpath + "/stl/BaselUrbanProfile_066_deg_bridge_3_All_CLOSED_WIDE_GROUND.stl"); -#endif - - - gridBuilder->addCoarseGrid(-256.0, -256.0, -8.0, - 256.0, 256.0, 160.0, dx); - - gridBuilder->addGeometry(BaselSTL); - - //Merged for Wind in X Direction - gridBuilder->setPeriodicBoundaryCondition(true, true, false); - - gridBuilder->buildGrids(true); // buildGrids() has to be called before setting the BCs!!!! - - ////////////////////////////////////////////////////////////////////////// - - gridBuilder->setVelocityBoundaryCondition(SideType::PZ, vx, 0.0, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::MZ, vx, 0.0, 0.0); - - gridBuilder->setVelocityBoundaryCondition(SideType::GEOMETRY, 0.0, 0.0, 0.0); - - //no forcing - // gridBuilder->setPressureBoundaryCondition(SideType::PY, 0.0); - // gridBuilder->setPressureBoundaryCondition(SideType::MY, 0.0); - - // gridBuilder->setPressureBoundaryCondition(SideType::PX, 0.0); - // gridBuilder->setPressureBoundaryCondition(SideType::MX, 0.0); - - bcFactory.setVelocityBoundaryCondition(BoundaryConditionFactory::VelocityBC::VelocityCompressible); - bcFactory.setGeometryBoundaryCondition(BoundaryConditionFactory::VelocityBC::VelocityCompressible); - ////////////////////////////////////////////////////////////////////////// - //Merged for Wind in X Direction - //gridBuilder->writeGridsToVtk(gridpath + "/grids/BaselUni/Basel_Grid"); - //SimulationFileWriter::write(gridpath + "/grids/BaselUni/", gridBuilder, FILEFORMAT::BINARY); - //////////////////// - //one street closed - gridBuilder->writeGridsToVtk(gridpath + "/grids/BaselUniOSC_1m/Basel_Grid"); - SimulationFileWriter::write(gridpath + "/grids/BaselUniOSC_1m/", gridBuilder, FILEFORMAT::BINARY); - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - StreetPointFinder finder; -#ifdef _WIN32 - //Baumbart - finder.readStreets("C:/Users/schoen/Desktop/git/MS2/git/targets/apps/LBM/Basel/resources/Streets.txt"); -#else - //Phoenix - finder.readStreets(gridpath + "/source/git/targets/apps/LBM/Basel/resources/Streets.txt"); -#endif - - finder.writeVTK(gridpath + "/results/ExampleStreets.vtk"); - - finder.findIndicesLB(gridBuilder->getGrid(0), 7.0); - - //all Streets - //finder.writeConnectionVTK(gridpath + "/grids/BaselUni/Basel_Grid/ExampleStreetsConnection.vtk", gridBuilder->getGrid(0)); - //finder.writeSimulationFile(gridpath + "/grids/BaselUni/", 1.0, gridBuilder->getNumberOfLevels(), 0); - //finder.writeStreetVectorFile(gridpath + "/grids/BaselUni/", 1.0, gridBuilder->getNumberOfLevels(), 0); - //////////////////// - //one street closed - finder.writeConnectionVTK(gridpath + "/grids/BaselUniOSC_1m/Basel_Grid/ExampleStreetsConnection.vtk", gridBuilder->getGrid(0)); - finder.writeSimulationFile(gridpath + "/grids/BaselUniOSC_1m/", 1.0, gridBuilder->getNumberOfLevels(), 0); - finder.writeStreetVectorFile(gridpath + "/grids/BaselUniOSC_1m/", 1.0, gridBuilder->getNumberOfLevels(), 0); - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - return; - - gridGenerator = GridProvider::makeGridGenerator(gridBuilder, para, cudaMemManager, communicator); - //gridGenerator = GridGenerator::make(gridBuilder, para); - - } - else - { - gridGenerator = GridProvider::makeGridReader(FILEFORMAT::BINARY, para, cudaMemManager); - //gridGenerator = GridReader::make(FileFormat::BINARY, para); - //gridGenerator = GridReader::make(FileFormat::ASCII, para); - } - - logFile.close(); - - //return; - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - - Simulation sim; - SPtr<FileWriter> fileWriter = SPtr<FileWriter>(new FileWriter()); - SPtr<KernelFactoryImp> kernelFactory = KernelFactoryImp::getInstance(); - SPtr<PreProcessorFactoryImp> preProcessorFactory = PreProcessorFactoryImp::getInstance(); - sim.setFactories(kernelFactory, preProcessorFactory); - sim.init(para, gridGenerator, fileWriter, cudaMemManager); - sim.run(); - sim.free(); -} - - -int main(int argc, char* argv[]) -{ - MPI_Init(&argc, &argv); - std::string str, str2; - if (argv != NULL) - { - str = static_cast<std::string>(argv[0]); - if (argc > 1) - { - str2 = static_cast<std::string>(argv[1]); - try - { - multipleLevel(str2); - } - catch (const std::exception& e) - { - //MPI_Abort(MPI_COMM_WORLD, -1); - } - catch (...) - { - std::cout << "unknown exeption" << std::endl; - } - } - else - { - try - { - //multipleLevel("E:/temp/Basel2019/config/configBasel.txt"); //Tesla03 - //multipleLevel("C:/Users/schoen/Desktop/bin/ReleaseBasel/configBasel.txt"); //Baumbart 1 - multipleLevel("F:/Basel2019/configBasel.txt"); //Baumbart 2 - //multipleLevel("F:/Work/Computations/gridGenerator/inp/configTest.txt"); - //multipleLevel("C:/Users/hiwi/Desktop/configBasel.txt"); //Gamling - } - catch (const std::exception& e) - { - std::cout << e.what() << std::flush; - //MPI_Abort(MPI_COMM_WORLD, -1); - } - catch (const std::bad_alloc e) - { - std::cout << e.what() << std::flush; - //MPI_Abort(MPI_COMM_WORLD, -1); - } - catch (...) - { - std::cout << "unknown exeption" << std::endl; - } - - std::cout << "\nConfiguration file must be set!: lbmgm <config file>" << std::endl << std::flush; - //MPI_Abort(MPI_COMM_WORLD, -1); - } - } - - - /* - MPE_Init_log() & MPE_Finish_log() are NOT needed when - liblmpe.a is linked with this program. In that case, - MPI_Init() would have called MPE_Init_log() already. - */ -#if defined( MPI_LOGGING ) - MPE_Init_log(); -#endif - -#if defined( MPI_LOGGING ) - if (argv != NULL) - MPE_Finish_log(argv[0]); - if (str != "") - MPE_Finish_log(str.c_str()); - else - MPE_Finish_log("TestLog"); -#endif - - MPI_Finalize(); - return 0; -} diff --git a/apps/gpu/Basel/resources/Junctions.txt b/apps/gpu/Basel/resources/Junctions.txt deleted file mode 100644 index 52c6953f71996b212052661faa3a8c4f26630fc6..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/Junctions.txt +++ /dev/null @@ -1,32 +0,0 @@ -30 -in 40 14 4 out 56 5 15 t 43 -in 41 56 37 out 42 40 39 -in 49 35 39 45 out 48 34 37 57 -in 47 57 44 out 46 45 43 -in 33 15 3 out 31 4 16 t 45 -in 42 31 32 out 41 33 29 -in 34 28 29 38 out 35 32 30 36 -in 30 27 out 28 26 c -in 16 12 18 2 out 3 21 6 13 t 54 -in 26 112 13 1 out 27 113 2 19 t 31 -in 104 19 0 out 105 1 20 t 35 -in 115 21 11 out 114 12 22 t 42 -in 113 93 114 107 out 112 92 115 111 -in 108 106 111 out 110 107 109 -in 105 102 109 119 out 104 103 106 118 -in 22 10 63 89 out 11 23 62 86 t 57 -in 84 86 88 out 85 89 87 -in 92 82 87 91 out 93 83 88 90 -in 110 95 90 97 out 108 94 91 96 -in 103 100 96 99 out 102 101 97 98 -in 74 23 9 out 75 10 24 t 52 -in 85 77 75 79 out 84 76 74 78 -in 83 78 81 out 82 79 80 -in 69 24 8 out 68 25 9 t 50 -in 55 53 50 out 54 51 52 -in 52 59 17 6 out 50 58 7 18 t 30 -in 58 65 61 62 out 59 64 60 63 -in 66 72 71 68 out 67 73 69 70 -in 64 67 out 65 66 c -in 117 70 out 116 71 c -end \ No newline at end of file diff --git a/apps/gpu/Basel/resources/Sinks.txt b/apps/gpu/Basel/resources/Sinks.txt deleted file mode 100644 index 527902f09dbf229abeec5eff0db02b9be7f3583d..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/Sinks.txt +++ /dev/null @@ -1,20 +0,0 @@ -19 -25 0.5 -98 0.5 -5 0.5 -60 0.5 -7 0.4 -20 0.4 -51 0.2 -54 0.2 -116 0.2 -73 0.2 -76 0.2 -80 0.2 -94 0.2 -101 0.2 -36 0.2 -43 0.2 -46 0.2 -48 0.2 -118 0.2 diff --git a/apps/gpu/Basel/resources/Sources.txt b/apps/gpu/Basel/resources/Sources.txt deleted file mode 100644 index cfcdc1cdacf314ae20bd7c303c401f8d86a43da3..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/Sources.txt +++ /dev/null @@ -1,20 +0,0 @@ -19 -61 0.7 -8 0.7 -99 0.7 -14 0.7 -17 0.6 -0 0.6 -53 0.2 -55 0.2 -117 0.2 -72 0.2 -77 0.2 -81 0.2 -95 0.2 -100 0.2 -38 0.2 -44 0.2 -47 0.2 -49 0.2 -119 0.2 diff --git a/apps/gpu/Basel/resources/Streets.txt b/apps/gpu/Basel/resources/Streets.txt deleted file mode 100644 index f82c1e9ae0d990128a99d2c66d3eb08e94703296..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/Streets.txt +++ /dev/null @@ -1,133 +0,0 @@ -120 - 256 5 220 5 1 - 220 5 93 5 1 - 88 5 -86 5 1 - -86 5 -82 134 1 - -82 139 -80 224 1 - -80 229 -80 256 1 - -92 5 -200 5 1 - -205 5 -256 5 1 - -184 -256 -179 -244 1 - -179 -244 -165 -210 1 - -163 -205 -134 -131 1 - -133 -126 -106 -53 1 - -105 -48 -87 0 1 - -87 0 87 0 1 - -85 256 -85 226 1 - -85 226 -87 137 1 - -87 137 -92 5 1 - -256 0 -209 0 1 - -204 0 -92 0 1 - 92 0 218 0 1 - 223 0 256 0 1 - -92 0 -110 -49 1 - -110 -49 -138 -125 1 - -139 -130 -168 -204 1 - -168 -204 -183 -240 1 - -185 -245 -189 -256 1 - 122 83 88 5 1 - 93 5 127 83 1 - 127 83 137 137 1 - 25 136 132 137 1 - 132 137 122 83 1 - -82 134 25 136 1 - 132 142 27 141 1 - 22 141 -82 139 1 - 129 224 132 142 1 - 137 142 134 224 1 - 137 137 256 137 1 - 129 229 24 229 1 - 256 142 137 142 1 - 27 224 129 224 1 - 24 229 -80 229 1 - 27 141 27 224 1 - 22 224 22 141 1 - 237 222 256 222 1 - 256 227 239 227 1 - 234 227 134 229 1 - 239 227 239 256 1 - 234 256 234 227 1 - 134 229 134 256 1 - 129 256 129 229 1 - -200 5 -196 124 1 - -196 124 -195 256 1 - -201 121 -205 5 1 - -200 256 -201 126 1 - -201 126 -256 130 1 - -256 125 -201 121 1 - -80 224 22 224 1 - 134 224 237 222 1 - -209 0 -211 -109 1 - -206 -110 -204 0 1 - -211 -109 -256 -101 1 - -256 -106 -210 -114 1 - -138 -125 -206 -110 1 - -205 -115 -139 -130 1 - -210 -114 -217 -158 1 - -212 -160 -205 -115 1 - -217 -158 -239 -208 1 - -236 -213 -212 -160 1 - -183 -240 -236 -213 1 - -238 -218 -185 -245 1 - -239 -208 -241 -188 1 - -246 -191 -243 -215 1 - -256 -251 -238 -218 1 - -243 -215 -256 -240 1 - -87 -221 -163 -205 1 - -165 -210 -90 -226 1 - -90 -226 -100 -256 1 - -95 -256 -85 -227 1 - -85 -227 22 -252 1 - 20 -247 -83 -222 1 - 22 -252 29 -256 1 - 38 -256 25 -248 1 - 25 -248 49 -165 1 - 44 -164 20 -247 1 - -83 -222 -53 -146 1 - -58 -145 -87 -221 1 - -134 -131 -58 -145 1 - -53 -146 44 -164 1 - 46 -159 -54 -141 1 - -54 -141 -133 -126 1 - 49 -165 157 -183 1 - 158 -178 50 -159 1 - 66 -73 46 -159 1 - 50 -159 72 -73 1 - 157 -183 140 -256 1 - 145 -256 162 -184 1 - 162 -184 238 -195 1 - 239 -191 163 -179 1 - 243 -196 256 -199 1 - 256 -194 244 -192 1 - 227 -256 243 -196 1 - 238 -195 222 -256 1 - 244 -192 250 -93 1 - 244 -92 239 -191 1 - 250 -88 223 0 1 - 218 0 244 -87 1 - 244 -87 177 -79 1 - 177 -79 73 -68 1 - 163 -179 179 -84 1 - 179 -84 244 -92 1 - 174 -84 158 -178 1 - 72 -73 174 -84 1 - 73 -68 92 0 1 - 87 0 68 -67 1 - -106 -53 66 -72 1 - 68 -67 -105 -48 1 - -241 -188 -256 -177 1 - -256 -184 -246 -191 1 - 250 -93 256 -94 1 - 256 -89 250 -88 1 - - - - - - - - - - - - \ No newline at end of file diff --git a/apps/gpu/Basel/resources/allStreets/Junctions.txt b/apps/gpu/Basel/resources/allStreets/Junctions.txt deleted file mode 100644 index 52c6953f71996b212052661faa3a8c4f26630fc6..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/allStreets/Junctions.txt +++ /dev/null @@ -1,32 +0,0 @@ -30 -in 40 14 4 out 56 5 15 t 43 -in 41 56 37 out 42 40 39 -in 49 35 39 45 out 48 34 37 57 -in 47 57 44 out 46 45 43 -in 33 15 3 out 31 4 16 t 45 -in 42 31 32 out 41 33 29 -in 34 28 29 38 out 35 32 30 36 -in 30 27 out 28 26 c -in 16 12 18 2 out 3 21 6 13 t 54 -in 26 112 13 1 out 27 113 2 19 t 31 -in 104 19 0 out 105 1 20 t 35 -in 115 21 11 out 114 12 22 t 42 -in 113 93 114 107 out 112 92 115 111 -in 108 106 111 out 110 107 109 -in 105 102 109 119 out 104 103 106 118 -in 22 10 63 89 out 11 23 62 86 t 57 -in 84 86 88 out 85 89 87 -in 92 82 87 91 out 93 83 88 90 -in 110 95 90 97 out 108 94 91 96 -in 103 100 96 99 out 102 101 97 98 -in 74 23 9 out 75 10 24 t 52 -in 85 77 75 79 out 84 76 74 78 -in 83 78 81 out 82 79 80 -in 69 24 8 out 68 25 9 t 50 -in 55 53 50 out 54 51 52 -in 52 59 17 6 out 50 58 7 18 t 30 -in 58 65 61 62 out 59 64 60 63 -in 66 72 71 68 out 67 73 69 70 -in 64 67 out 65 66 c -in 117 70 out 116 71 c -end \ No newline at end of file diff --git a/apps/gpu/Basel/resources/allStreets/Sinks.txt b/apps/gpu/Basel/resources/allStreets/Sinks.txt deleted file mode 100644 index 527902f09dbf229abeec5eff0db02b9be7f3583d..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/allStreets/Sinks.txt +++ /dev/null @@ -1,20 +0,0 @@ -19 -25 0.5 -98 0.5 -5 0.5 -60 0.5 -7 0.4 -20 0.4 -51 0.2 -54 0.2 -116 0.2 -73 0.2 -76 0.2 -80 0.2 -94 0.2 -101 0.2 -36 0.2 -43 0.2 -46 0.2 -48 0.2 -118 0.2 diff --git a/apps/gpu/Basel/resources/allStreets/Sources.txt b/apps/gpu/Basel/resources/allStreets/Sources.txt deleted file mode 100644 index cfcdc1cdacf314ae20bd7c303c401f8d86a43da3..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/allStreets/Sources.txt +++ /dev/null @@ -1,20 +0,0 @@ -19 -61 0.7 -8 0.7 -99 0.7 -14 0.7 -17 0.6 -0 0.6 -53 0.2 -55 0.2 -117 0.2 -72 0.2 -77 0.2 -81 0.2 -95 0.2 -100 0.2 -38 0.2 -44 0.2 -47 0.2 -49 0.2 -119 0.2 diff --git a/apps/gpu/Basel/resources/allStreets/Streets.txt b/apps/gpu/Basel/resources/allStreets/Streets.txt deleted file mode 100644 index f82c1e9ae0d990128a99d2c66d3eb08e94703296..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/allStreets/Streets.txt +++ /dev/null @@ -1,133 +0,0 @@ -120 - 256 5 220 5 1 - 220 5 93 5 1 - 88 5 -86 5 1 - -86 5 -82 134 1 - -82 139 -80 224 1 - -80 229 -80 256 1 - -92 5 -200 5 1 - -205 5 -256 5 1 - -184 -256 -179 -244 1 - -179 -244 -165 -210 1 - -163 -205 -134 -131 1 - -133 -126 -106 -53 1 - -105 -48 -87 0 1 - -87 0 87 0 1 - -85 256 -85 226 1 - -85 226 -87 137 1 - -87 137 -92 5 1 - -256 0 -209 0 1 - -204 0 -92 0 1 - 92 0 218 0 1 - 223 0 256 0 1 - -92 0 -110 -49 1 - -110 -49 -138 -125 1 - -139 -130 -168 -204 1 - -168 -204 -183 -240 1 - -185 -245 -189 -256 1 - 122 83 88 5 1 - 93 5 127 83 1 - 127 83 137 137 1 - 25 136 132 137 1 - 132 137 122 83 1 - -82 134 25 136 1 - 132 142 27 141 1 - 22 141 -82 139 1 - 129 224 132 142 1 - 137 142 134 224 1 - 137 137 256 137 1 - 129 229 24 229 1 - 256 142 137 142 1 - 27 224 129 224 1 - 24 229 -80 229 1 - 27 141 27 224 1 - 22 224 22 141 1 - 237 222 256 222 1 - 256 227 239 227 1 - 234 227 134 229 1 - 239 227 239 256 1 - 234 256 234 227 1 - 134 229 134 256 1 - 129 256 129 229 1 - -200 5 -196 124 1 - -196 124 -195 256 1 - -201 121 -205 5 1 - -200 256 -201 126 1 - -201 126 -256 130 1 - -256 125 -201 121 1 - -80 224 22 224 1 - 134 224 237 222 1 - -209 0 -211 -109 1 - -206 -110 -204 0 1 - -211 -109 -256 -101 1 - -256 -106 -210 -114 1 - -138 -125 -206 -110 1 - -205 -115 -139 -130 1 - -210 -114 -217 -158 1 - -212 -160 -205 -115 1 - -217 -158 -239 -208 1 - -236 -213 -212 -160 1 - -183 -240 -236 -213 1 - -238 -218 -185 -245 1 - -239 -208 -241 -188 1 - -246 -191 -243 -215 1 - -256 -251 -238 -218 1 - -243 -215 -256 -240 1 - -87 -221 -163 -205 1 - -165 -210 -90 -226 1 - -90 -226 -100 -256 1 - -95 -256 -85 -227 1 - -85 -227 22 -252 1 - 20 -247 -83 -222 1 - 22 -252 29 -256 1 - 38 -256 25 -248 1 - 25 -248 49 -165 1 - 44 -164 20 -247 1 - -83 -222 -53 -146 1 - -58 -145 -87 -221 1 - -134 -131 -58 -145 1 - -53 -146 44 -164 1 - 46 -159 -54 -141 1 - -54 -141 -133 -126 1 - 49 -165 157 -183 1 - 158 -178 50 -159 1 - 66 -73 46 -159 1 - 50 -159 72 -73 1 - 157 -183 140 -256 1 - 145 -256 162 -184 1 - 162 -184 238 -195 1 - 239 -191 163 -179 1 - 243 -196 256 -199 1 - 256 -194 244 -192 1 - 227 -256 243 -196 1 - 238 -195 222 -256 1 - 244 -192 250 -93 1 - 244 -92 239 -191 1 - 250 -88 223 0 1 - 218 0 244 -87 1 - 244 -87 177 -79 1 - 177 -79 73 -68 1 - 163 -179 179 -84 1 - 179 -84 244 -92 1 - 174 -84 158 -178 1 - 72 -73 174 -84 1 - 73 -68 92 0 1 - 87 0 68 -67 1 - -106 -53 66 -72 1 - 68 -67 -105 -48 1 - -241 -188 -256 -177 1 - -256 -184 -246 -191 1 - 250 -93 256 -94 1 - 256 -89 250 -88 1 - - - - - - - - - - - - \ No newline at end of file diff --git a/apps/gpu/Basel/resources/allStreetsDouble/Junctions.txt b/apps/gpu/Basel/resources/allStreetsDouble/Junctions.txt deleted file mode 100644 index ba5e39707188c974e35c87aac0e2e699c80fe0cf..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/allStreetsDouble/Junctions.txt +++ /dev/null @@ -1,62 +0,0 @@ -60 -in 40 14 4 out 56 5 15 t 43 -in 41 56 37 out 42 40 39 -in 49 35 39 45 out 48 34 37 57 -in 47 57 44 out 46 45 43 -in 33 15 3 out 31 4 16 t 45 -in 42 31 32 out 41 33 29 -in 34 28 29 38 out 35 32 30 36 -in 30 27 out 28 26 c -in 16 12 18 2 out 3 21 6 13 t 54 -in 26 112 13 1 out 27 113 2 19 t 31 -in 104 19 0 out 105 1 20 t 35 -in 115 21 11 out 114 12 22 t 42 -in 113 93 114 107 out 112 92 115 111 -in 108 106 111 out 110 107 109 -in 105 102 109 119 out 104 103 106 118 -in 22 10 63 89 out 11 23 62 86 t 57 -in 84 86 88 out 85 89 87 -in 92 82 87 91 out 93 83 88 90 -in 110 95 90 97 out 108 94 91 96 -in 103 100 96 99 out 102 101 97 98 -in 74 23 9 out 75 10 24 t 52 -in 85 77 75 79 out 84 76 74 78 -in 83 78 81 out 82 79 80 -in 69 24 8 out 68 25 9 t 50 -in 55 53 50 out 54 51 52 -in 52 59 17 6 out 50 58 7 18 t 30 -in 58 65 61 62 out 59 64 60 63 -in 66 72 71 68 out 67 73 69 70 -in 64 67 out 65 66 c -in 117 70 out 116 71 c -in 160 134 124 out 176 125 135 t 63 -in 161 176 157 out 162 160 159 -in 169 155 159 165 out 168 154 157 177 -in 167 177 164 out 166 165 163 -in 153 135 123 out 151 124 136 t 65 -in 162 151 152 out 161 153 149 -in 154 148 149 158 out 155 152 150 156 -in 150 147 out 148 146 c -in 136 132 138 122 out 123 141 126 133 t 74 -in 146 232 133 121 out 147 233 122 139 t 51 -in 224 139 120 out 225 121 140 t 55 -in 235 141 131 out 234 132 142 t 62 -in 233 213 234 227 out 232 212 235 231 -in 228 226 231 out 230 227 229 -in 225 222 229 239 out 224 223 226 238 -in 142 130 183 209 out 131 143 182 206 t 77 -in 204 206 208 out 205 209 207 -in 212 202 207 211 out 213 203 208 210 -in 230 215 210 217 out 228 214 211 216 -in 223 220 216 219 out 222 221 217 218 -in 194 143 129 out 195 130 144 t 72 -in 205 197 195 199 out 204 196 194 198 -in 203 198 201 out 202 199 200 -in 189 144 128 out 188 145 129 t 70 -in 175 173 170 out 174 171 172 -in 172 179 137 126 out 170 178 127 138 t 50 -in 178 185 181 182 out 179 184 180 183 -in 186 192 191 188 out 187 193 189 190 -in 184 187 out 185 186 c -in 237 190 out 236 191 c -end \ No newline at end of file diff --git a/apps/gpu/Basel/resources/allStreetsDouble/Sinks.txt b/apps/gpu/Basel/resources/allStreetsDouble/Sinks.txt deleted file mode 100644 index ec674f5dcebd6a15804293e497d2d4c148692afe..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/allStreetsDouble/Sinks.txt +++ /dev/null @@ -1,39 +0,0 @@ -38 -25 0.5 -98 0.5 -5 0.5 -60 0.5 -7 0.4 -20 0.4 -51 0.2 -54 0.2 -116 0.2 -73 0.2 -76 0.2 -80 0.2 -94 0.2 -101 0.2 -36 0.2 -43 0.2 -46 0.2 -48 0.2 -118 0.2 -145 0.5 -218 0.5 -125 0.5 -180 0.5 -127 0.4 -140 0.4 -171 0.2 -174 0.2 -236 0.2 -193 0.2 -196 0.2 -200 0.2 -214 0.2 -221 0.2 -156 0.2 -163 0.2 -166 0.2 -168 0.2 -238 0.2 diff --git a/apps/gpu/Basel/resources/allStreetsDouble/Sources.txt b/apps/gpu/Basel/resources/allStreetsDouble/Sources.txt deleted file mode 100644 index a51dc831d3e9a01bfbf920d980c5cacbb3cb326e..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/allStreetsDouble/Sources.txt +++ /dev/null @@ -1,39 +0,0 @@ -38 -61 0.7 -8 0.7 -99 0.7 -14 0.7 -17 0.6 -0 0.6 -53 0.2 -55 0.2 -117 0.2 -72 0.2 -77 0.2 -81 0.2 -95 0.2 -100 0.2 -38 0.2 -44 0.2 -47 0.2 -49 0.2 -119 0.2 -181 0.7 -128 0.7 -219 0.7 -134 0.7 -137 0.6 -120 0.6 -173 0.2 -175 0.2 -237 0.2 -192 0.2 -197 0.2 -201 0.2 -215 0.2 -220 0.2 -158 0.2 -164 0.2 -167 0.2 -169 0.2 -239 0.2 diff --git a/apps/gpu/Basel/resources/allStreetsDouble/Streets.txt b/apps/gpu/Basel/resources/allStreetsDouble/Streets.txt deleted file mode 100644 index 17533ee0ce81645a6ffc78147d38cf72c528bcda..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/allStreetsDouble/Streets.txt +++ /dev/null @@ -1,253 +0,0 @@ -240 - 256 5 220 5 1 - 220 5 93 5 1 - 88 5 -86 5 1 - -86 5 -82 134 1 - -82 139 -80 224 1 - -80 229 -80 256 1 - -92 5 -200 5 1 - -205 5 -256 5 1 - -184 -256 -179 -244 1 - -179 -244 -165 -210 1 - -163 -205 -134 -131 1 - -133 -126 -106 -53 1 - -105 -48 -87 0 1 - -87 0 87 0 1 - -85 256 -85 226 1 - -85 226 -87 137 1 - -87 137 -92 5 1 - -256 0 -209 0 1 - -204 0 -92 0 1 - 92 0 218 0 1 - 223 0 256 0 1 - -92 0 -110 -49 1 - -110 -49 -138 -125 1 - -139 -130 -168 -204 1 - -168 -204 -183 -240 1 - -185 -245 -189 -256 1 - 122 83 88 5 1 - 93 5 127 83 1 - 127 83 137 137 1 - 25 136 132 137 1 - 132 137 122 83 1 - -82 134 25 136 1 - 132 142 27 141 1 - 22 141 -82 139 1 - 129 224 132 142 1 - 137 142 134 224 1 - 137 137 256 137 1 - 129 229 24 229 1 - 256 142 137 142 1 - 27 224 129 224 1 - 24 229 -80 229 1 - 27 141 27 224 1 - 22 224 22 141 1 - 237 222 256 222 1 - 256 227 239 227 1 - 234 227 134 229 1 - 239 227 239 256 1 - 234 256 234 227 1 - 134 229 134 256 1 - 129 256 129 229 1 - -200 5 -196 124 1 - -196 124 -195 256 1 - -201 121 -205 5 1 - -200 256 -201 126 1 - -201 126 -256 130 1 - -256 125 -201 121 1 - -80 224 22 224 1 - 134 224 237 222 1 - -209 0 -211 -109 1 - -206 -110 -204 0 1 - -211 -109 -256 -101 1 - -256 -106 -210 -114 1 - -138 -125 -206 -110 1 - -205 -115 -139 -130 1 - -210 -114 -217 -158 1 - -212 -160 -205 -115 1 - -217 -158 -239 -208 1 - -236 -213 -212 -160 1 - -183 -240 -236 -213 1 - -238 -218 -185 -245 1 - -239 -208 -241 -188 1 - -246 -191 -243 -215 1 - -256 -251 -238 -218 1 - -243 -215 -256 -240 1 - -87 -221 -163 -205 1 - -165 -210 -90 -226 1 - -90 -226 -100 -256 1 - -95 -256 -85 -227 1 - -85 -227 22 -252 1 - 20 -247 -83 -222 1 - 22 -252 29 -256 1 - 38 -256 25 -248 1 - 25 -248 49 -165 1 - 44 -164 20 -247 1 - -83 -222 -53 -146 1 - -58 -145 -87 -221 1 - -134 -131 -58 -145 1 - -53 -146 44 -164 1 - 46 -159 -54 -141 1 - -54 -141 -133 -126 1 - 49 -165 157 -183 1 - 158 -178 50 -159 1 - 66 -73 46 -159 1 - 50 -159 72 -73 1 - 157 -183 140 -256 1 - 145 -256 162 -184 1 - 162 -184 238 -195 1 - 239 -191 163 -179 1 - 243 -196 256 -199 1 - 256 -194 244 -192 1 - 227 -256 243 -196 1 - 238 -195 222 -256 1 - 244 -192 251 -93 1 - 244 -92 239 -191 1 - 251 -88 223 0 1 - 218 0 244 -87 1 - 244 -87 177 -79 1 - 177 -79 73 -68 1 - 163 -179 179 -84 1 - 179 -84 244 -92 1 - 174 -84 158 -178 1 - 72 -73 174 -84 1 - 73 -68 92 0 1 - 87 0 68 -67 1 - -106 -53 66 -72 1 - 68 -67 -105 -48 1 - -241 -188 -256 -177 1 - -256 -184 -246 -191 1 - 251 -93 256 -94 1 - 256 -89 251 -88 1 - 256 5 220 5 1 - 220 5 93 5 1 - 88 5 -86 5 1 - -86 5 -82 134 1 - -82 139 -80 224 1 - -80 229 -80 256 1 - -92 5 -200 5 1 - -205 5 -256 5 1 - -184 -256 -179 -244 1 - -179 -244 -165 -210 1 - -163 -205 -134 -131 1 - -133 -126 -106 -53 1 - -105 -48 -87 0 1 - -87 0 87 0 1 - -85 256 -85 226 1 - -85 226 -87 137 1 - -87 137 -92 5 1 - -256 0 -209 0 1 - -204 0 -92 0 1 - 92 0 218 0 1 - 223 0 256 0 1 - -92 0 -110 -49 1 - -110 -49 -138 -125 1 - -139 -130 -168 -204 1 - -168 -204 -183 -240 1 - -185 -245 -189 -256 1 - 122 83 88 5 1 - 93 5 127 83 1 - 127 83 137 137 1 - 25 136 132 137 1 - 132 137 122 83 1 - -82 134 25 136 1 - 132 142 27 141 1 - 22 141 -82 139 1 - 129 224 132 142 1 - 137 142 134 224 1 - 137 137 256 137 1 - 129 229 24 229 1 - 256 142 137 142 1 - 27 224 129 224 1 - 24 229 -80 229 1 - 27 141 27 224 1 - 22 224 22 141 1 - 237 222 256 222 1 - 256 227 239 227 1 - 234 227 134 229 1 - 239 227 239 256 1 - 234 256 234 227 1 - 134 229 134 256 1 - 129 256 129 229 1 - -200 5 -196 124 1 - -196 124 -195 256 1 - -201 121 -205 5 1 - -200 256 -201 126 1 - -201 126 -256 130 1 - -256 125 -201 121 1 - -80 224 22 224 1 - 134 224 237 222 1 - -209 0 -211 -109 1 - -206 -110 -204 0 1 - -211 -109 -256 -101 1 - -256 -106 -210 -114 1 - -138 -125 -206 -110 1 - -205 -115 -139 -130 1 - -210 -114 -217 -158 1 - -212 -160 -205 -115 1 - -217 -158 -239 -208 1 - -236 -213 -212 -160 1 - -183 -240 -236 -213 1 - -238 -218 -185 -245 1 - -239 -208 -241 -188 1 - -246 -191 -243 -215 1 - -256 -251 -238 -218 1 - -243 -215 -256 -240 1 - -87 -221 -163 -205 1 - -165 -210 -90 -226 1 - -90 -226 -100 -256 1 - -95 -256 -85 -227 1 - -85 -227 22 -252 1 - 20 -247 -83 -222 1 - 22 -252 29 -256 1 - 38 -256 25 -248 1 - 25 -248 49 -165 1 - 44 -164 20 -247 1 - -83 -222 -53 -146 1 - -58 -145 -87 -221 1 - -134 -131 -58 -145 1 - -53 -146 44 -164 1 - 46 -159 -54 -141 1 - -54 -141 -133 -126 1 - 49 -165 157 -183 1 - 158 -178 50 -159 1 - 66 -73 46 -159 1 - 50 -159 72 -73 1 - 157 -183 140 -256 1 - 145 -256 162 -184 1 - 162 -184 238 -195 1 - 239 -191 163 -179 1 - 243 -196 256 -199 1 - 256 -194 244 -192 1 - 227 -256 243 -196 1 - 238 -195 222 -256 1 - 244 -192 251 -93 1 - 244 -92 239 -191 1 - 251 -88 223 0 1 - 218 0 244 -87 1 - 244 -87 177 -79 1 - 177 -79 73 -68 1 - 163 -179 179 -84 1 - 179 -84 244 -92 1 - 174 -84 158 -178 1 - 72 -73 174 -84 1 - 73 -68 92 0 1 - 87 0 68 -67 1 - -106 -53 66 -72 1 - 68 -67 -105 -48 1 - -241 -188 -256 -177 1 - -256 -184 -246 -191 1 - 251 -93 256 -94 1 - 256 -89 251 -88 1 - - - - - - - - - - - - \ No newline at end of file diff --git a/apps/gpu/Basel/resources/allStreetsOneClosed/Junctions.txt b/apps/gpu/Basel/resources/allStreetsOneClosed/Junctions.txt deleted file mode 100644 index 38c8736ebed6d076aa4b7c4873bf9d118bcfd57a..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/allStreetsOneClosed/Junctions.txt +++ /dev/null @@ -1,32 +0,0 @@ -30 -in 38 12 3 out 54 4 13 t 41 -in 39 54 35 out 40 38 37 -in 47 33 37 43 out 46 32 35 55 -in 45 55 42 out 44 43 41 -in 31 13 2 out 29 3 14 t 43 -in 40 29 30 out 39 31 27 -in 32 26 27 36 out 33 30 28 34 -in 28 25 out 26 24 c -in 14 11 16 out 2 19 5 12 t 52 -in 24 110 1 out 25 111 17 t 29 -in 102 17 0 out 103 1 18 t 33 -in 113 19 10 out 112 11 20 t 40 -in 111 91 112 105 out 110 90 113 109 -in 106 104 109 out 108 105 107 -in 103 100 107 117 out 102 101 104 116 -in 20 9 61 87 out 10 21 60 84 t 55 -in 82 84 86 out 83 87 85 -in 90 80 85 89 out 91 81 86 88 -in 108 93 88 95 out 106 92 89 94 -in 101 98 94 97 out 100 99 95 96 -in 72 21 8 out 73 9 22 t 50 -in 83 75 73 77 out 82 74 72 76 -in 81 76 79 out 80 77 78 -in 67 22 7 out 66 23 8 t 48 -in 53 51 48 out 52 49 50 -in 50 57 15 5 out 48 56 6 16 t 28 -in 56 63 59 60 out 57 62 58 61 -in 64 70 69 66 out 65 71 67 68 -in 62 65 out 63 64 c -in 115 68 out 114 69 c -end \ No newline at end of file diff --git a/apps/gpu/Basel/resources/allStreetsOneClosed/Sinks.txt b/apps/gpu/Basel/resources/allStreetsOneClosed/Sinks.txt deleted file mode 100644 index f9181533e9214c8fb7dba93c77831e9418129317..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/allStreetsOneClosed/Sinks.txt +++ /dev/null @@ -1,20 +0,0 @@ -19 -23 0.5 -96 0.5 -4 0.5 -58 0.5 -6 0.4 -18 0.4 -49 0.2 -52 0.2 -114 0.2 -71 0.2 -74 0.2 -78 0.2 -92 0.2 -99 0.2 -34 0.2 -41 0.2 -44 0.2 -46 0.2 -116 0.2 diff --git a/apps/gpu/Basel/resources/allStreetsOneClosed/Sources.txt b/apps/gpu/Basel/resources/allStreetsOneClosed/Sources.txt deleted file mode 100644 index 32916664b95b20a8e675e5906a46ffca0600d46c..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/allStreetsOneClosed/Sources.txt +++ /dev/null @@ -1,20 +0,0 @@ -19 -59 0.7 -7 0.7 -97 0.7 -12 0.7 -15 0.6 -0 0.6 -51 0.2 -53 0.2 -115 0.2 -70 0.2 -75 0.2 -79 0.2 -93 0.2 -98 0.2 -36 0.2 -42 0.2 -45 0.2 -47 0.2 -117 0.2 diff --git a/apps/gpu/Basel/resources/allStreetsOneClosed/Streets.txt b/apps/gpu/Basel/resources/allStreetsOneClosed/Streets.txt deleted file mode 100644 index 2e643bab84b95b82e90c82cf39e56429dfa5867f..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/allStreetsOneClosed/Streets.txt +++ /dev/null @@ -1,131 +0,0 @@ -118 - 256 5 220 5 1 - 220 5 93 5 1 - -86 5 -82 134 1 - -82 139 -80 224 1 - -80 229 -80 256 1 - -92 5 -200 5 1 - -205 5 -256 5 1 - -184 -256 -179 -244 1 - -179 -244 -165 -210 1 - -163 -205 -134 -131 1 - -133 -126 -106 -53 1 - -105 -48 -87 0 1 - -85 256 -85 226 1 - -85 226 -87 137 1 - -87 137 -92 5 1 - -256 0 -209 0 1 - -204 0 -92 0 1 - 92 0 218 0 1 - 223 0 256 0 1 - -92 0 -110 -49 1 - -110 -49 -138 -125 1 - -139 -130 -168 -204 1 - -168 -204 -183 -240 1 - -185 -245 -189 -256 1 - 122 83 88 5 1 - 93 5 127 83 1 - 127 83 137 137 1 - 25 136 132 137 1 - 132 137 122 83 1 - -82 134 25 136 1 - 132 142 27 141 1 - 22 141 -82 139 1 - 129 224 132 142 1 - 137 142 134 224 1 - 137 137 256 137 1 - 129 229 24 229 1 - 256 142 137 142 1 - 27 224 129 224 1 - 24 229 -80 229 1 - 27 141 27 224 1 - 22 224 22 141 1 - 237 222 256 222 1 - 256 227 239 227 1 - 234 227 134 229 1 - 239 227 239 256 1 - 234 256 234 227 1 - 134 229 134 256 1 - 129 256 129 229 1 - -200 5 -196 124 1 - -196 124 -195 256 1 - -201 121 -205 5 1 - -200 256 -201 126 1 - -201 126 -256 130 1 - -256 125 -201 121 1 - -80 224 22 224 1 - 134 224 237 222 1 - -209 0 -211 -109 1 - -206 -110 -204 0 1 - -211 -109 -256 -101 1 - -256 -106 -210 -114 1 - -138 -125 -206 -110 1 - -205 -115 -139 -130 1 - -210 -114 -217 -158 1 - -212 -160 -205 -115 1 - -217 -158 -239 -208 1 - -236 -213 -212 -160 1 - -183 -240 -236 -213 1 - -238 -218 -185 -245 1 - -239 -208 -241 -188 1 - -246 -191 -243 -215 1 - -256 -251 -238 -218 1 - -243 -215 -256 -240 1 - -87 -221 -163 -205 1 - -165 -210 -90 -226 1 - -90 -226 -100 -256 1 - -95 -256 -85 -227 1 - -85 -227 22 -252 1 - 20 -247 -83 -222 1 - 22 -252 29 -256 1 - 38 -256 25 -248 1 - 25 -248 49 -165 1 - 44 -164 20 -247 1 - -83 -222 -53 -146 1 - -58 -145 -87 -221 1 - -134 -131 -58 -145 1 - -53 -146 44 -164 1 - 46 -159 -54 -141 1 - -54 -141 -133 -126 1 - 49 -165 157 -183 1 - 158 -178 50 -159 1 - 66 -73 46 -159 1 - 50 -159 72 -73 1 - 157 -183 140 -256 1 - 145 -256 162 -184 1 - 162 -184 238 -195 1 - 239 -191 163 -179 1 - 243 -196 256 -199 1 - 256 -194 244 -192 1 - 227 -256 243 -196 1 - 238 -195 222 -256 1 - 244 -192 250 -93 1 - 244 -92 239 -191 1 - 250 -88 223 0 1 - 218 0 244 -87 1 - 244 -87 177 -79 1 - 177 -79 73 -68 1 - 163 -179 179 -84 1 - 179 -84 244 -92 1 - 174 -84 158 -178 1 - 72 -73 174 -84 1 - 73 -68 92 0 1 - 87 0 68 -67 1 - -106 -53 66 -72 1 - 68 -67 -105 -48 1 - -241 -188 -256 -177 1 - -256 -184 -246 -191 1 - 250 -93 256 -94 1 - 256 -89 250 -88 1 - - - - - - - - - - - - \ No newline at end of file diff --git a/apps/gpu/Basel/resources/allStreetsQuadruple/Junctions.txt b/apps/gpu/Basel/resources/allStreetsQuadruple/Junctions.txt deleted file mode 100644 index 4193493b7736df7abe9df61d10ed87572e7d1b61..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/allStreetsQuadruple/Junctions.txt +++ /dev/null @@ -1,122 +0,0 @@ -120 -in 40 14 4 out 56 5 15 t 43 -in 41 56 37 out 42 40 39 -in 49 35 39 45 out 48 34 37 57 -in 47 57 44 out 46 45 43 -in 33 15 3 out 31 4 16 t 45 -in 42 31 32 out 41 33 29 -in 34 28 29 38 out 35 32 30 36 -in 30 27 out 28 26 c -in 16 12 18 2 out 3 21 6 13 t 54 -in 26 112 13 1 out 27 113 2 19 t 31 -in 104 19 0 out 105 1 20 t 35 -in 115 21 11 out 114 12 22 t 42 -in 113 93 114 107 out 112 92 115 111 -in 108 106 111 out 110 107 109 -in 105 102 109 119 out 104 103 106 118 -in 22 10 63 89 out 11 23 62 86 t 57 -in 84 86 88 out 85 89 87 -in 92 82 87 91 out 93 83 88 90 -in 110 95 90 97 out 108 94 91 96 -in 103 100 96 99 out 102 101 97 98 -in 74 23 9 out 75 10 24 t 52 -in 85 77 75 79 out 84 76 74 78 -in 83 78 81 out 82 79 80 -in 69 24 8 out 68 25 9 t 50 -in 55 53 50 out 54 51 52 -in 52 59 17 6 out 50 58 7 18 t 30 -in 58 65 61 62 out 59 64 60 63 -in 66 72 71 68 out 67 73 69 70 -in 64 67 out 65 66 c -in 117 70 out 116 71 c -in 160 134 124 out 176 125 135 t 63 -in 161 176 157 out 162 160 159 -in 169 155 159 165 out 168 154 157 177 -in 167 177 164 out 166 165 163 -in 153 135 123 out 151 124 136 t 65 -in 162 151 152 out 161 153 149 -in 154 148 149 158 out 155 152 150 156 -in 150 147 out 148 146 c -in 136 132 138 122 out 123 141 126 133 t 74 -in 146 232 133 121 out 147 233 122 139 t 51 -in 224 139 120 out 225 121 140 t 55 -in 235 141 131 out 234 132 142 t 62 -in 233 213 234 227 out 232 212 235 231 -in 228 226 231 out 230 227 229 -in 225 222 229 239 out 224 223 226 238 -in 142 130 183 209 out 131 143 182 206 t 77 -in 204 206 208 out 205 209 207 -in 212 202 207 211 out 213 203 208 210 -in 230 215 210 217 out 228 214 211 216 -in 223 220 216 219 out 222 221 217 218 -in 194 143 129 out 195 130 144 t 72 -in 205 197 195 199 out 204 196 194 198 -in 203 198 201 out 202 199 200 -in 189 144 128 out 188 145 129 t 70 -in 175 173 170 out 174 171 172 -in 172 179 137 126 out 170 178 127 138 t 50 -in 178 185 181 182 out 179 184 180 183 -in 186 192 191 188 out 187 193 189 190 -in 184 187 out 185 186 c -in 237 190 out 236 191 c -in 280 254 244 out 296 245 255 t 283 -in 281 296 277 out 282 280 279 -in 289 275 279 285 out 288 274 277 297 -in 287 297 284 out 286 285 283 -in 273 255 243 out 271 244 256 t 285 -in 282 271 272 out 281 273 269 -in 274 268 269 278 out 275 272 270 276 -in 270 267 out 268 266 c -in 256 252 258 242 out 243 261 246 253 t 294 -in 266 352 253 241 out 267 353 242 259 t 271 -in 344 259 240 out 345 241 260 t 275 -in 355 261 251 out 354 252 262 t 282 -in 353 333 354 347 out 352 332 355 351 -in 348 346 351 out 350 347 349 -in 345 342 349 359 out 344 343 346 358 -in 262 250 303 329 out 251 263 302 326 t 297 -in 324 326 328 out 325 329 327 -in 332 322 327 331 out 333 323 328 330 -in 350 335 330 337 out 348 334 331 336 -in 343 340 336 339 out 342 341 337 338 -in 314 263 249 out 315 250 264 t 292 -in 325 317 315 319 out 324 316 314 318 -in 323 318 321 out 322 319 320 -in 309 264 248 out 308 265 249 t 290 -in 295 293 290 out 294 291 292 -in 292 299 257 246 out 290 298 247 258 t 270 -in 298 305 301 302 out 299 304 300 303 -in 306 312 311 308 out 307 313 309 310 -in 304 307 out 305 306 c -in 357 310 out 356 311 c -in 400 374 364 out 416 365 375 t 403 -in 401 416 397 out 402 400 399 -in 409 395 399 405 out 408 394 397 417 -in 407 417 404 out 406 405 403 -in 393 375 363 out 391 364 376 t 405 -in 402 391 392 out 401 393 389 -in 394 388 389 398 out 395 392 390 396 -in 390 387 out 388 386 c -in 376 372 378 362 out 363 381 366 373 t 414 -in 386 472 373 361 out 387 473 362 379 t 391 -in 464 379 360 out 465 361 380 t 395 -in 475 381 371 out 474 372 382 t 402 -in 473 453 474 467 out 472 452 475 471 -in 468 466 471 out 470 467 469 -in 465 462 469 479 out 464 463 466 478 -in 382 370 423 449 out 371 383 422 446 t 417 -in 444 446 448 out 445 449 447 -in 452 442 447 451 out 453 443 448 450 -in 470 455 450 457 out 468 454 451 456 -in 463 460 456 459 out 462 461 457 458 -in 434 383 369 out 435 370 384 t 412 -in 445 437 435 439 out 444 436 434 438 -in 443 438 441 out 442 439 440 -in 429 384 368 out 428 385 369 t 410 -in 415 413 410 out 414 411 412 -in 412 419 377 366 out 410 418 367 378 t 390 -in 418 425 421 422 out 419 424 420 423 -in 426 432 431 428 out 427 433 429 430 -in 424 427 out 425 426 c -in 477 430 out 476 431 c -end \ No newline at end of file diff --git a/apps/gpu/Basel/resources/allStreetsQuadruple/Sinks.txt b/apps/gpu/Basel/resources/allStreetsQuadruple/Sinks.txt deleted file mode 100644 index 12245da9ed3963d4caf43fa40d441b044a4e4bc7..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/allStreetsQuadruple/Sinks.txt +++ /dev/null @@ -1,77 +0,0 @@ -76 -25 0.5 -98 0.5 -5 0.5 -60 0.5 -7 0.4 -20 0.4 -51 0.2 -54 0.2 -116 0.2 -73 0.2 -76 0.2 -80 0.2 -94 0.2 -101 0.2 -36 0.2 -43 0.2 -46 0.2 -48 0.2 -118 0.2 -145 0.5 -218 0.5 -125 0.5 -180 0.5 -127 0.4 -140 0.4 -171 0.2 -174 0.2 -236 0.2 -193 0.2 -196 0.2 -200 0.2 -214 0.2 -221 0.2 -156 0.2 -163 0.2 -166 0.2 -168 0.2 -238 0.2 -265 0.5 -338 0.5 -245 0.5 -300 0.5 -247 0.4 -260 0.4 -291 0.2 -294 0.2 -356 0.2 -313 0.2 -316 0.2 -320 0.2 -334 0.2 -341 0.2 -276 0.2 -283 0.2 -286 0.2 -288 0.2 -358 0.2 -385 0.5 -458 0.5 -365 0.5 -420 0.5 -367 0.4 -380 0.4 -411 0.2 -414 0.2 -476 0.2 -433 0.2 -436 0.2 -440 0.2 -454 0.2 -461 0.2 -396 0.2 -403 0.2 -406 0.2 -408 0.2 -478 0.2 \ No newline at end of file diff --git a/apps/gpu/Basel/resources/allStreetsQuadruple/Sources.txt b/apps/gpu/Basel/resources/allStreetsQuadruple/Sources.txt deleted file mode 100644 index 0bf91e6c71af3c0a58237f13263e2162f13fd280..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/allStreetsQuadruple/Sources.txt +++ /dev/null @@ -1,77 +0,0 @@ -76 -61 0.7 -8 0.7 -99 0.7 -14 0.7 -17 0.6 -0 0.6 -53 0.2 -55 0.2 -117 0.2 -72 0.2 -77 0.2 -81 0.2 -95 0.2 -100 0.2 -38 0.2 -44 0.2 -47 0.2 -49 0.2 -119 0.2 -181 0.7 -128 0.7 -219 0.7 -134 0.7 -137 0.6 -120 0.6 -173 0.2 -175 0.2 -237 0.2 -192 0.2 -197 0.2 -201 0.2 -215 0.2 -220 0.2 -158 0.2 -164 0.2 -167 0.2 -169 0.2 -239 0.2 -301 0.7 -248 0.7 -339 0.7 -254 0.7 -257 0.6 -240 0.6 -293 0.2 -295 0.2 -357 0.2 -312 0.2 -317 0.2 -321 0.2 -335 0.2 -340 0.2 -278 0.2 -284 0.2 -287 0.2 -289 0.2 -359 0.2 -421 0.7 -368 0.7 -459 0.7 -374 0.7 -377 0.6 -360 0.6 -413 0.2 -415 0.2 -477 0.2 -432 0.2 -437 0.2 -441 0.2 -455 0.2 -460 0.2 -398 0.2 -404 0.2 -407 0.2 -409 0.2 -479 0.2 diff --git a/apps/gpu/Basel/resources/allStreetsQuadruple/Streets.txt b/apps/gpu/Basel/resources/allStreetsQuadruple/Streets.txt deleted file mode 100644 index 8ed4aeff895c89d4511df89959ddcde914dc2241..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/allStreetsQuadruple/Streets.txt +++ /dev/null @@ -1,481 +0,0 @@ -480 - 256 5 220 5 1 - 220 5 93 5 1 - 88 5 -86 5 1 - -86 5 -82 134 1 - -82 139 -80 224 1 - -80 229 -80 256 1 - -92 5 -200 5 1 - -205 5 -256 5 1 - -184 -256 -179 -244 1 - -179 -244 -165 -210 1 - -163 -205 -134 -131 1 - -133 -126 -106 -53 1 - -105 -48 -87 0 1 - -87 0 87 0 1 - -85 256 -85 226 1 - -85 226 -87 137 1 - -87 137 -92 5 1 - -256 0 -209 0 1 - -204 0 -92 0 1 - 92 0 218 0 1 - 223 0 256 0 1 - -92 0 -110 -49 1 - -110 -49 -138 -125 1 - -139 -130 -168 -204 1 - -168 -204 -183 -240 1 - -185 -245 -189 -256 1 - 122 83 88 5 1 - 93 5 127 83 1 - 127 83 137 137 1 - 25 136 132 137 1 - 132 137 122 83 1 - -82 134 25 136 1 - 132 142 27 141 1 - 22 141 -82 139 1 - 129 224 132 142 1 - 137 142 134 224 1 - 137 137 256 137 1 - 129 229 24 229 1 - 256 142 137 142 1 - 27 224 129 224 1 - 24 229 -80 229 1 - 27 141 27 224 1 - 22 224 22 141 1 - 237 222 256 222 1 - 256 227 239 227 1 - 234 227 134 229 1 - 239 227 239 256 1 - 234 256 234 227 1 - 134 229 134 256 1 - 129 256 129 229 1 - -200 5 -196 124 1 - -196 124 -195 256 1 - -201 121 -205 5 1 - -200 256 -201 126 1 - -201 126 -256 130 1 - -256 125 -201 121 1 - -80 224 22 224 1 - 134 224 237 222 1 - -209 0 -211 -109 1 - -206 -110 -204 0 1 - -211 -109 -256 -101 1 - -256 -106 -210 -114 1 - -138 -125 -206 -110 1 - -205 -115 -139 -130 1 - -210 -114 -217 -158 1 - -212 -160 -205 -115 1 - -217 -158 -239 -208 1 - -236 -213 -212 -160 1 - -183 -240 -236 -213 1 - -238 -218 -185 -245 1 - -239 -208 -241 -188 1 - -246 -191 -243 -215 1 - -256 -251 -238 -218 1 - -243 -215 -256 -240 1 - -87 -221 -163 -205 1 - -165 -210 -90 -226 1 - -90 -226 -100 -256 1 - -95 -256 -85 -227 1 - -85 -227 22 -252 1 - 20 -247 -83 -222 1 - 22 -252 29 -256 1 - 38 -256 25 -248 1 - 25 -248 49 -165 1 - 44 -164 20 -247 1 - -83 -222 -53 -146 1 - -58 -145 -87 -221 1 - -134 -131 -58 -145 1 - -53 -146 44 -164 1 - 46 -159 -54 -141 1 - -54 -141 -133 -126 1 - 49 -165 157 -183 1 - 158 -178 50 -159 1 - 66 -73 46 -159 1 - 50 -159 72 -73 1 - 157 -183 140 -256 1 - 145 -256 162 -184 1 - 162 -184 238 -195 1 - 239 -191 163 -179 1 - 243 -196 256 -199 1 - 256 -194 244 -192 1 - 227 -256 243 -196 1 - 238 -195 222 -256 1 - 244 -192 251 -93 1 - 244 -92 239 -191 1 - 251 -88 223 0 1 - 218 0 244 -87 1 - 244 -87 177 -79 1 - 177 -79 73 -68 1 - 163 -179 179 -84 1 - 179 -84 244 -92 1 - 174 -84 158 -178 1 - 72 -73 174 -84 1 - 73 -68 92 0 1 - 87 0 68 -67 1 - -106 -53 66 -72 1 - 68 -67 -105 -48 1 - -241 -188 -256 -177 1 - -256 -184 -246 -191 1 - 251 -93 256 -94 1 - 256 -89 251 -88 1 - 256 5 220 5 1 - 220 5 93 5 1 - 88 5 -86 5 1 - -86 5 -82 134 1 - -82 139 -80 224 1 - -80 229 -80 256 1 - -92 5 -200 5 1 - -205 5 -256 5 1 - -184 -256 -179 -244 1 - -179 -244 -165 -210 1 - -163 -205 -134 -131 1 - -133 -126 -106 -53 1 - -105 -48 -87 0 1 - -87 0 87 0 1 - -85 256 -85 226 1 - -85 226 -87 137 1 - -87 137 -92 5 1 - -256 0 -209 0 1 - -204 0 -92 0 1 - 92 0 218 0 1 - 223 0 256 0 1 - -92 0 -110 -49 1 - -110 -49 -138 -125 1 - -139 -130 -168 -204 1 - -168 -204 -183 -240 1 - -185 -245 -189 -256 1 - 122 83 88 5 1 - 93 5 127 83 1 - 127 83 137 137 1 - 25 136 132 137 1 - 132 137 122 83 1 - -82 134 25 136 1 - 132 142 27 141 1 - 22 141 -82 139 1 - 129 224 132 142 1 - 137 142 134 224 1 - 137 137 256 137 1 - 129 229 24 229 1 - 256 142 137 142 1 - 27 224 129 224 1 - 24 229 -80 229 1 - 27 141 27 224 1 - 22 224 22 141 1 - 237 222 256 222 1 - 256 227 239 227 1 - 234 227 134 229 1 - 239 227 239 256 1 - 234 256 234 227 1 - 134 229 134 256 1 - 129 256 129 229 1 - -200 5 -196 124 1 - -196 124 -195 256 1 - -201 121 -205 5 1 - -200 256 -201 126 1 - -201 126 -256 130 1 - -256 125 -201 121 1 - -80 224 22 224 1 - 134 224 237 222 1 - -209 0 -211 -109 1 - -206 -110 -204 0 1 - -211 -109 -256 -101 1 - -256 -106 -210 -114 1 - -138 -125 -206 -110 1 - -205 -115 -139 -130 1 - -210 -114 -217 -158 1 - -212 -160 -205 -115 1 - -217 -158 -239 -208 1 - -236 -213 -212 -160 1 - -183 -240 -236 -213 1 - -238 -218 -185 -245 1 - -239 -208 -241 -188 1 - -246 -191 -243 -215 1 - -256 -251 -238 -218 1 - -243 -215 -256 -240 1 - -87 -221 -163 -205 1 - -165 -210 -90 -226 1 - -90 -226 -100 -256 1 - -95 -256 -85 -227 1 - -85 -227 22 -252 1 - 20 -247 -83 -222 1 - 22 -252 29 -256 1 - 38 -256 25 -248 1 - 25 -248 49 -165 1 - 44 -164 20 -247 1 - -83 -222 -53 -146 1 - -58 -145 -87 -221 1 - -134 -131 -58 -145 1 - -53 -146 44 -164 1 - 46 -159 -54 -141 1 - -54 -141 -133 -126 1 - 49 -165 157 -183 1 - 158 -178 50 -159 1 - 66 -73 46 -159 1 - 50 -159 72 -73 1 - 157 -183 140 -256 1 - 145 -256 162 -184 1 - 162 -184 238 -195 1 - 239 -191 163 -179 1 - 243 -196 256 -199 1 - 256 -194 244 -192 1 - 227 -256 243 -196 1 - 238 -195 222 -256 1 - 244 -192 251 -93 1 - 244 -92 239 -191 1 - 251 -88 223 0 1 - 218 0 244 -87 1 - 244 -87 177 -79 1 - 177 -79 73 -68 1 - 163 -179 179 -84 1 - 179 -84 244 -92 1 - 174 -84 158 -178 1 - 72 -73 174 -84 1 - 73 -68 92 0 1 - 87 0 68 -67 1 - -106 -53 66 -72 1 - 68 -67 -105 -48 1 - -241 -188 -256 -177 1 - -256 -184 -246 -191 1 - 251 -93 256 -94 1 - 256 -89 251 -88 1 - 256 5 220 5 1 - 220 5 93 5 1 - 88 5 -86 5 1 - -86 5 -82 134 1 - -82 139 -80 224 1 - -80 229 -80 256 1 - -92 5 -200 5 1 - -205 5 -256 5 1 - -184 -256 -179 -244 1 - -179 -244 -165 -210 1 - -163 -205 -134 -131 1 - -133 -126 -106 -53 1 - -105 -48 -87 0 1 - -87 0 87 0 1 - -85 256 -85 226 1 - -85 226 -87 137 1 - -87 137 -92 5 1 - -256 0 -209 0 1 - -204 0 -92 0 1 - 92 0 218 0 1 - 223 0 256 0 1 - -92 0 -110 -49 1 - -110 -49 -138 -125 1 - -139 -130 -168 -204 1 - -168 -204 -183 -240 1 - -185 -245 -189 -256 1 - 122 83 88 5 1 - 93 5 127 83 1 - 127 83 137 137 1 - 25 136 132 137 1 - 132 137 122 83 1 - -82 134 25 136 1 - 132 142 27 141 1 - 22 141 -82 139 1 - 129 224 132 142 1 - 137 142 134 224 1 - 137 137 256 137 1 - 129 229 24 229 1 - 256 142 137 142 1 - 27 224 129 224 1 - 24 229 -80 229 1 - 27 141 27 224 1 - 22 224 22 141 1 - 237 222 256 222 1 - 256 227 239 227 1 - 234 227 134 229 1 - 239 227 239 256 1 - 234 256 234 227 1 - 134 229 134 256 1 - 129 256 129 229 1 - -200 5 -196 124 1 - -196 124 -195 256 1 - -201 121 -205 5 1 - -200 256 -201 126 1 - -201 126 -256 130 1 - -256 125 -201 121 1 - -80 224 22 224 1 - 134 224 237 222 1 - -209 0 -211 -109 1 - -206 -110 -204 0 1 - -211 -109 -256 -101 1 - -256 -106 -210 -114 1 - -138 -125 -206 -110 1 - -205 -115 -139 -130 1 - -210 -114 -217 -158 1 - -212 -160 -205 -115 1 - -217 -158 -239 -208 1 - -236 -213 -212 -160 1 - -183 -240 -236 -213 1 - -238 -218 -185 -245 1 - -239 -208 -241 -188 1 - -246 -191 -243 -215 1 - -256 -251 -238 -218 1 - -243 -215 -256 -240 1 - -87 -221 -163 -205 1 - -165 -210 -90 -226 1 - -90 -226 -100 -256 1 - -95 -256 -85 -227 1 - -85 -227 22 -252 1 - 20 -247 -83 -222 1 - 22 -252 29 -256 1 - 38 -256 25 -248 1 - 25 -248 49 -165 1 - 44 -164 20 -247 1 - -83 -222 -53 -146 1 - -58 -145 -87 -221 1 - -134 -131 -58 -145 1 - -53 -146 44 -164 1 - 46 -159 -54 -141 1 - -54 -141 -133 -126 1 - 49 -165 157 -183 1 - 158 -178 50 -159 1 - 66 -73 46 -159 1 - 50 -159 72 -73 1 - 157 -183 140 -256 1 - 145 -256 162 -184 1 - 162 -184 238 -195 1 - 239 -191 163 -179 1 - 243 -196 256 -199 1 - 256 -194 244 -192 1 - 227 -256 243 -196 1 - 238 -195 222 -256 1 - 244 -192 251 -93 1 - 244 -92 239 -191 1 - 251 -88 223 0 1 - 218 0 244 -87 1 - 244 -87 177 -79 1 - 177 -79 73 -68 1 - 163 -179 179 -84 1 - 179 -84 244 -92 1 - 174 -84 158 -178 1 - 72 -73 174 -84 1 - 73 -68 92 0 1 - 87 0 68 -67 1 - -106 -53 66 -72 1 - 68 -67 -105 -48 1 - -241 -188 -256 -177 1 - -256 -184 -246 -191 1 - 251 -93 256 -94 1 - 256 -89 251 -88 1 - 256 5 220 5 1 - 220 5 93 5 1 - 88 5 -86 5 1 - -86 5 -82 134 1 - -82 139 -80 224 1 - -80 229 -80 256 1 - -92 5 -200 5 1 - -205 5 -256 5 1 - -184 -256 -179 -244 1 - -179 -244 -165 -210 1 - -163 -205 -134 -131 1 - -133 -126 -106 -53 1 - -105 -48 -87 0 1 - -87 0 87 0 1 - -85 256 -85 226 1 - -85 226 -87 137 1 - -87 137 -92 5 1 - -256 0 -209 0 1 - -204 0 -92 0 1 - 92 0 218 0 1 - 223 0 256 0 1 - -92 0 -110 -49 1 - -110 -49 -138 -125 1 - -139 -130 -168 -204 1 - -168 -204 -183 -240 1 - -185 -245 -189 -256 1 - 122 83 88 5 1 - 93 5 127 83 1 - 127 83 137 137 1 - 25 136 132 137 1 - 132 137 122 83 1 - -82 134 25 136 1 - 132 142 27 141 1 - 22 141 -82 139 1 - 129 224 132 142 1 - 137 142 134 224 1 - 137 137 256 137 1 - 129 229 24 229 1 - 256 142 137 142 1 - 27 224 129 224 1 - 24 229 -80 229 1 - 27 141 27 224 1 - 22 224 22 141 1 - 237 222 256 222 1 - 256 227 239 227 1 - 234 227 134 229 1 - 239 227 239 256 1 - 234 256 234 227 1 - 134 229 134 256 1 - 129 256 129 229 1 - -200 5 -196 124 1 - -196 124 -195 256 1 - -201 121 -205 5 1 - -200 256 -201 126 1 - -201 126 -256 130 1 - -256 125 -201 121 1 - -80 224 22 224 1 - 134 224 237 222 1 - -209 0 -211 -109 1 - -206 -110 -204 0 1 - -211 -109 -256 -101 1 - -256 -106 -210 -114 1 - -138 -125 -206 -110 1 - -205 -115 -139 -130 1 - -210 -114 -217 -158 1 - -212 -160 -205 -115 1 - -217 -158 -239 -208 1 - -236 -213 -212 -160 1 - -183 -240 -236 -213 1 - -238 -218 -185 -245 1 - -239 -208 -241 -188 1 - -246 -191 -243 -215 1 - -256 -251 -238 -218 1 - -243 -215 -256 -240 1 - -87 -221 -163 -205 1 - -165 -210 -90 -226 1 - -90 -226 -100 -256 1 - -95 -256 -85 -227 1 - -85 -227 22 -252 1 - 20 -247 -83 -222 1 - 22 -252 29 -256 1 - 38 -256 25 -248 1 - 25 -248 49 -165 1 - 44 -164 20 -247 1 - -83 -222 -53 -146 1 - -58 -145 -87 -221 1 - -134 -131 -58 -145 1 - -53 -146 44 -164 1 - 46 -159 -54 -141 1 - -54 -141 -133 -126 1 - 49 -165 157 -183 1 - 158 -178 50 -159 1 - 66 -73 46 -159 1 - 50 -159 72 -73 1 - 157 -183 140 -256 1 - 145 -256 162 -184 1 - 162 -184 238 -195 1 - 239 -191 163 -179 1 - 243 -196 256 -199 1 - 256 -194 244 -192 1 - 227 -256 243 -196 1 - 238 -195 222 -256 1 - 244 -192 251 -93 1 - 244 -92 239 -191 1 - 251 -88 223 0 1 - 218 0 244 -87 1 - 244 -87 177 -79 1 - 177 -79 73 -68 1 - 163 -179 179 -84 1 - 179 -84 244 -92 1 - 174 -84 158 -178 1 - 72 -73 174 -84 1 - 73 -68 92 0 1 - 87 0 68 -67 1 - -106 -53 66 -72 1 - 68 -67 -105 -48 1 - -241 -188 -256 -177 1 - -256 -184 -246 -191 1 - 251 -93 256 -94 1 - 256 -89 251 -88 1 \ No newline at end of file diff --git a/apps/gpu/Basel/resources/fourStreets/Junctions.txt b/apps/gpu/Basel/resources/fourStreets/Junctions.txt deleted file mode 100644 index fca1e6e7153d4381dee0f821dd9638d624f4c97e..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/fourStreets/Junctions.txt +++ /dev/null @@ -1,4 +0,0 @@ -2 -in 1 7 6 4 out 5 3 2 9 t 45 -in 0 5 out 8 1 c -end \ No newline at end of file diff --git a/apps/gpu/Basel/resources/fourStreets/Sinks.txt b/apps/gpu/Basel/resources/fourStreets/Sinks.txt deleted file mode 100644 index 1c6fe5bbc0cf7d9ed86db3f463b69bc7a76e3bb9..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/fourStreets/Sinks.txt +++ /dev/null @@ -1,5 +0,0 @@ -4 -2 0.5 -3 0.5 -9 0.5 -8 0.5 diff --git a/apps/gpu/Basel/resources/fourStreets/Sources.txt b/apps/gpu/Basel/resources/fourStreets/Sources.txt deleted file mode 100644 index 4af10e940263a0fb86c946e1005ded89d7ddb2fc..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/fourStreets/Sources.txt +++ /dev/null @@ -1,5 +0,0 @@ -4 -6 0.4 -7 0.4 -4 0.4 -0 0.4 \ No newline at end of file diff --git a/apps/gpu/Basel/resources/fourStreets/Streets.txt b/apps/gpu/Basel/resources/fourStreets/Streets.txt deleted file mode 100644 index 8cd812cf91709b18eb1d28488271f8cc5803b248..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/fourStreets/Streets.txt +++ /dev/null @@ -1,11 +0,0 @@ -10 - 256 5 87 5 1 - 87 5 -85 5 1 - -85 5 -80 256 1 - -92 5 -256 5 1 - -185 -256 -87 0 1 - -87 0 87 0 1 - -85 256 -92 5 1 - -256 0 -92 0 1 - 87 0 256 0 1 - -92 0 -190 -256 1 \ No newline at end of file diff --git a/apps/gpu/Basel/resources/testStreets/Junctions1.txt b/apps/gpu/Basel/resources/testStreets/Junctions1.txt deleted file mode 100644 index d65d3e7d0b1484b4b577b08f41142cd75dbc3a69..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/testStreets/Junctions1.txt +++ /dev/null @@ -1,3 +0,0 @@ -1 -in 3 7 5 1 out 2 6 4 0 t 30 -end \ No newline at end of file diff --git a/apps/gpu/Basel/resources/testStreets/Junctions2.txt b/apps/gpu/Basel/resources/testStreets/Junctions2.txt deleted file mode 100644 index f5dd18195ba12373f4dd8709ca48de49b614e30e..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/testStreets/Junctions2.txt +++ /dev/null @@ -1,3 +0,0 @@ -1 -in 3 5 1 out 2 4 0 t 30 -end \ No newline at end of file diff --git a/apps/gpu/Basel/resources/testStreets/Junctions3.txt b/apps/gpu/Basel/resources/testStreets/Junctions3.txt deleted file mode 100644 index c44f1c8e418b216c293b8101be3926a824616de2..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/testStreets/Junctions3.txt +++ /dev/null @@ -1,3 +0,0 @@ -1 -in 3 1 out 2 0 4 t 30 -end \ No newline at end of file diff --git a/apps/gpu/Basel/resources/testStreets/Junctions4.txt b/apps/gpu/Basel/resources/testStreets/Junctions4.txt deleted file mode 100644 index 62f8927f46ed99d069981b4d8cc84f039a7b5de1..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/testStreets/Junctions4.txt +++ /dev/null @@ -1,3 +0,0 @@ -1 -in 3 1 4 out 2 0 -2 t 30 -end \ No newline at end of file diff --git a/apps/gpu/Basel/resources/testStreets/Junctions5.txt b/apps/gpu/Basel/resources/testStreets/Junctions5.txt deleted file mode 100644 index 505c5fca91aa49e765706a969f6445a3b6c24ed8..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/testStreets/Junctions5.txt +++ /dev/null @@ -1,3 +0,0 @@ -1 -in 4 3 1 out -2 2 0 t 30 -end \ No newline at end of file diff --git a/apps/gpu/Basel/resources/testStreets/Junctions6.txt b/apps/gpu/Basel/resources/testStreets/Junctions6.txt deleted file mode 100644 index de197e65ee32f4efef0cc18960a0e54eebf45b72..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/testStreets/Junctions6.txt +++ /dev/null @@ -1,3 +0,0 @@ -1 -in 3 5 1 out -2 -2 -2 2 4 0 t 30 -end \ No newline at end of file diff --git a/apps/gpu/Basel/resources/testStreets/Sinks1.txt b/apps/gpu/Basel/resources/testStreets/Sinks1.txt deleted file mode 100644 index c4b251547e1e82adfc410509cf3073cc3f72130e..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/testStreets/Sinks1.txt +++ /dev/null @@ -1,5 +0,0 @@ -4 -0 0.5 -2 0.5 -4 0.5 -6 0.5 diff --git a/apps/gpu/Basel/resources/testStreets/Sinks2.txt b/apps/gpu/Basel/resources/testStreets/Sinks2.txt deleted file mode 100644 index aef3eef93f236d5d575119b6d2ed31038315b103..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/testStreets/Sinks2.txt +++ /dev/null @@ -1,4 +0,0 @@ -3 -0 0.5 -2 0.5 -4 0.5 diff --git a/apps/gpu/Basel/resources/testStreets/Sinks3.txt b/apps/gpu/Basel/resources/testStreets/Sinks3.txt deleted file mode 100644 index aef3eef93f236d5d575119b6d2ed31038315b103..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/testStreets/Sinks3.txt +++ /dev/null @@ -1,4 +0,0 @@ -3 -0 0.5 -2 0.5 -4 0.5 diff --git a/apps/gpu/Basel/resources/testStreets/Sinks4.txt b/apps/gpu/Basel/resources/testStreets/Sinks4.txt deleted file mode 100644 index 96360230279247af416b4e5112aa7c14b4765050..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/testStreets/Sinks4.txt +++ /dev/null @@ -1,3 +0,0 @@ -2 -0 0.5 -2 0.5 diff --git a/apps/gpu/Basel/resources/testStreets/Sinks5.txt b/apps/gpu/Basel/resources/testStreets/Sinks5.txt deleted file mode 100644 index 96360230279247af416b4e5112aa7c14b4765050..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/testStreets/Sinks5.txt +++ /dev/null @@ -1,3 +0,0 @@ -2 -0 0.5 -2 0.5 diff --git a/apps/gpu/Basel/resources/testStreets/Sinks6.txt b/apps/gpu/Basel/resources/testStreets/Sinks6.txt deleted file mode 100644 index aef3eef93f236d5d575119b6d2ed31038315b103..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/testStreets/Sinks6.txt +++ /dev/null @@ -1,4 +0,0 @@ -3 -0 0.5 -2 0.5 -4 0.5 diff --git a/apps/gpu/Basel/resources/testStreets/Sources1.txt b/apps/gpu/Basel/resources/testStreets/Sources1.txt deleted file mode 100644 index fa58c8e04bf85a9f41caccaed215220f04e15e58..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/testStreets/Sources1.txt +++ /dev/null @@ -1,5 +0,0 @@ -4 -1 0.4 -3 0.4 -5 0.4 -7 0.4 \ No newline at end of file diff --git a/apps/gpu/Basel/resources/testStreets/Sources2.txt b/apps/gpu/Basel/resources/testStreets/Sources2.txt deleted file mode 100644 index 34986f41d940cdedde923034dd4c6f36a4672058..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/testStreets/Sources2.txt +++ /dev/null @@ -1,4 +0,0 @@ -3 -1 0.4 -3 0.4 -5 0.4 \ No newline at end of file diff --git a/apps/gpu/Basel/resources/testStreets/Sources3.txt b/apps/gpu/Basel/resources/testStreets/Sources3.txt deleted file mode 100644 index 584594eaa23a65228f647dc3c4153e1cf1cdeb2d..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/testStreets/Sources3.txt +++ /dev/null @@ -1,3 +0,0 @@ -2 -1 0.4 -3 0.4 \ No newline at end of file diff --git a/apps/gpu/Basel/resources/testStreets/Sources4.txt b/apps/gpu/Basel/resources/testStreets/Sources4.txt deleted file mode 100644 index 6ff2b74df08a4fadf1902f4a8bd2260dc017100e..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/testStreets/Sources4.txt +++ /dev/null @@ -1,4 +0,0 @@ -3 -1 0.4 -3 0.4 -4 0.4 \ No newline at end of file diff --git a/apps/gpu/Basel/resources/testStreets/Sources5.txt b/apps/gpu/Basel/resources/testStreets/Sources5.txt deleted file mode 100644 index 6ff2b74df08a4fadf1902f4a8bd2260dc017100e..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/testStreets/Sources5.txt +++ /dev/null @@ -1,4 +0,0 @@ -3 -1 0.4 -3 0.4 -4 0.4 \ No newline at end of file diff --git a/apps/gpu/Basel/resources/testStreets/Sources6.txt b/apps/gpu/Basel/resources/testStreets/Sources6.txt deleted file mode 100644 index 34986f41d940cdedde923034dd4c6f36a4672058..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/testStreets/Sources6.txt +++ /dev/null @@ -1,4 +0,0 @@ -3 -1 0.4 -3 0.4 -5 0.4 \ No newline at end of file diff --git a/apps/gpu/Basel/resources/testStreets/Streets1.txt b/apps/gpu/Basel/resources/testStreets/Streets1.txt deleted file mode 100644 index ea10aefbdb6960296a30ba4a279771a10814d493..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/testStreets/Streets1.txt +++ /dev/null @@ -1,9 +0,0 @@ -8 - 0 0 256 0 1 - 256 5 0 5 1 - 0 5 0 256 1 - -5 256 -5 5 1 - -5 5 -256 5 1 - -256 0 -5 0 1 - -5 0 -5 -256 1 - 0 -256 0 0 1 \ No newline at end of file diff --git a/apps/gpu/Basel/resources/testStreets/Streets2.txt b/apps/gpu/Basel/resources/testStreets/Streets2.txt deleted file mode 100644 index 1c297ca830081d311dfe2d3673630e350c03a599..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/testStreets/Streets2.txt +++ /dev/null @@ -1,7 +0,0 @@ -6 - -2 0 256 0 1 - 256 5 0 5 1 - 0 5 0 256 1 - -5 256 -5 5 1 - -5 5 -256 5 1 - -256 0 -2 0 1 diff --git a/apps/gpu/Basel/resources/testStreets/Streets3.txt b/apps/gpu/Basel/resources/testStreets/Streets3.txt deleted file mode 100644 index eff013edaaa496e1a887fd23bb0c788b5dac635b..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/testStreets/Streets3.txt +++ /dev/null @@ -1,6 +0,0 @@ -5 - 0 0 256 0 1 - 256 5 0 5 1 - 0 5 0 256 1 - -5 256 -5 5 1 - -5 5 -256 5 1 diff --git a/apps/gpu/Basel/resources/testStreets/Streets4.txt b/apps/gpu/Basel/resources/testStreets/Streets4.txt deleted file mode 100644 index 64aa5c46a64ebabdc56949d124a0081acb86208f..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/testStreets/Streets4.txt +++ /dev/null @@ -1,6 +0,0 @@ -5 - 0 0 256 0 1 - 256 5 0 5 1 - 0 5 0 256 1 - -5 256 -5 5 1 - -256 0 -5 0 1 diff --git a/apps/gpu/Basel/resources/testStreets/Streets5.txt b/apps/gpu/Basel/resources/testStreets/Streets5.txt deleted file mode 100644 index 64aa5c46a64ebabdc56949d124a0081acb86208f..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/testStreets/Streets5.txt +++ /dev/null @@ -1,6 +0,0 @@ -5 - 0 0 256 0 1 - 256 5 0 5 1 - 0 5 0 256 1 - -5 256 -5 5 1 - -256 0 -5 0 1 diff --git a/apps/gpu/Basel/resources/testStreets/Streets6.txt b/apps/gpu/Basel/resources/testStreets/Streets6.txt deleted file mode 100644 index 1c297ca830081d311dfe2d3673630e350c03a599..0000000000000000000000000000000000000000 --- a/apps/gpu/Basel/resources/testStreets/Streets6.txt +++ /dev/null @@ -1,7 +0,0 @@ -6 - -2 0 256 0 1 - 256 5 0 5 1 - 0 5 0 256 1 - -5 256 -5 5 1 - -5 5 -256 5 1 - -256 0 -2 0 1 diff --git a/apps/gpu/BaselMultiGPU/3rdPartyLinking.cmake b/apps/gpu/BaselMultiGPU/3rdPartyLinking.cmake deleted file mode 100644 index 6dd6ba1bc73e73dfbf01a3cc36aaeb3664e1c04c..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselMultiGPU/3rdPartyLinking.cmake +++ /dev/null @@ -1,13 +0,0 @@ -include (${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/MPI/Link.cmake) -linkMPI(${targetName}) -include (${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/Cuda/Link.cmake) -linkCuda(${targetName}) -include (${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/Boost/Link.cmake) -linkBoost(${targetName} "serialization") -include (${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/Metis/Link.cmake) -linkMetis(${targetName}) - -if(HULC.BUILD_JSONCPP) - include (${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/JsonCpp/Link.cmake) - linkJsonCpp(${targetName}) -endif() \ No newline at end of file diff --git a/apps/gpu/BaselMultiGPU/CMakeLists.txt b/apps/gpu/BaselMultiGPU/CMakeLists.txt deleted file mode 100644 index 2d05f78bd85244eee12b8b65c9df157ff175b1e5..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselMultiGPU/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -setTargetNameToFolderName(${CMAKE_CURRENT_LIST_DIR}) - -set(linkDirectories "") -set(libsToLink gpu_core GridGenerator) -set(includeDirectories "${CMAKE_SOURCE_DIR}/src" "${CMAKE_SOURCE_DIR}/src/gpu_core" "${CMAKE_SOURCE_DIR}/src/GridGenerator" "${CMAKE_SOURCE_DIR}/src/VirtualFluidsBasics") - -#glob files and save in MY_SRCS -include(CMakePackage.cmake) - -buildExe(${targetName} "${MY_SRCS}" "${linkDirectories}" "${libsToLink}" "${includeDirectories}") -groupTarget(${targetName} ${lbmAppFolder}) - -# Specify the linking to 3rdParty libs -include(3rdPartyLinking.cmake) \ No newline at end of file diff --git a/apps/gpu/BaselMultiGPU/CMakePackage.cmake b/apps/gpu/BaselMultiGPU/CMakePackage.cmake deleted file mode 100644 index 5d39e3804dbd180790629111449a7dc918292430..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselMultiGPU/CMakePackage.cmake +++ /dev/null @@ -1,9 +0,0 @@ -#FILE ENDINGS -resetFileEndingsToCollect() -addCAndCPPFileTypes() -addFileEndingToCollect("*.cu") -addFileEndingToCollect("*.cuh") - -#GLOB SOURCE FILES IN MY_SRCS -unset(MY_SRCS) -includeRecursiveAllFilesFrom(${targetName} ${CMAKE_CURRENT_LIST_DIR}) \ No newline at end of file diff --git a/apps/gpu/BaselMultiGPU/main.cpp b/apps/gpu/BaselMultiGPU/main.cpp deleted file mode 100644 index 87a230da5c012bac7487e7e634de2b4c3f8bf712..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselMultiGPU/main.cpp +++ /dev/null @@ -1,299 +0,0 @@ -//#define MPI_LOGGING - -//Martin Branch - -#include <mpi.h> -#if defined( MPI_LOGGING ) - #include <mpe.h> -#endif - -#include <string> -#include <iostream> -#include <stdexcept> -#include <fstream> -#define _USE_MATH_DEFINES -#include <math.h> - -#include "Input/Input.h" -#include "StringUtilities/StringUtil.h" -#include "Input/ConfigFileReader/ConfigFileReader.h" - -#include "gpu/core/LBM/Simulation.h" -#include "gpu/core/Communication/MpiCommunicator.h" -#include "gpu/core/DataStructureInitializer/GridReaderGenerator/GridGenerator.h" -#include "gpu/core/DataStructureInitializer/GridProvider.h" -#include "gpu/core/DataStructureInitializer/GridReaderFiles/GridReader.h" -#include "gpu/core/Parameter/Parameter.h" -#include "gpu/core/Output/FileWriter.h" -#include "gpu/core/GPU/CudaMemoryManager.h" -#include "gpu/core/BoundaryConditions/BoundaryConditionFactory.h" - -#include "global.h" - -#include "GridGenerator/StreetPointFinder/StreetPointFinder.h" - -#include "geometries/Sphere/Sphere.h" -#include "geometries/VerticalCylinder/VerticalCylinder.h" -#include "geometries/Cuboid/Cuboid.h" -#include "geometries/TriangularMesh/TriangularMesh.h" -#include "geometries/Conglomerate/Conglomerate.h" -#include "geometries/TriangularMesh/TriangularMeshStrategy.h" - -#include "grid/GridBuilder/LevelGridBuilder.h" -#include "grid/GridBuilder/MultipleGridBuilder.h" -#include "grid/BoundaryConditions/Side.h" -#include "grid/BoundaryConditions/BoundaryCondition.h" -#include "grid/GridFactory.h" - -#include "io/SimulationFileWriter/SimulationFileWriter.h" -#include "io/GridVTKWriter/GridVTKWriter.h" -#include "io/STLReaderWriter/STLReader.h" -#include "io/STLReaderWriter/STLWriter.h" - -#include "utilities/math/Math.h" -#include "utilities/communication.h" -#include "utilities/transformator/TransformatorImp.h" - - -void multipleLevel(const std::string& configPath) -{ - - //UbLog::reportingLevel() = UbLog::logLevelFromString("DEBUG5"); - - auto gridFactory = GridFactory::make(); - gridFactory->setGridStrategy(Device::CPU); - //gridFactory->setTriangularMeshDiscretizationMethod(TriangularMeshDiscretizationMethod::RAYCASTING); - gridFactory->setTriangularMeshDiscretizationMethod(TriangularMeshDiscretizationMethod::POINT_IN_OBJECT); - //gridFactory->setTriangularMeshDiscretizationMethod(TriangularMeshDiscretizationMethod::POINT_UNDER_TRIANGLE); - - auto gridBuilder = MultipleGridBuilder::makeShared(gridFactory); - - SPtr<ConfigFileReader> configReader = ConfigFileReader::getNewInstance(); - SPtr<ConfigData> configData = configReader->readConfigFile(configPath); - Communicator* comm = Communicator::getInstanz(); - - SPtr<Parameter> para = Parameter::make(configData, comm); - BoundaryConditionFactory bcFactory = BoundaryConditionFactory(); - SPtr<CudaMemoryManager> cudaMemManager = CudaMemoryManager::make(para); - SPtr<GridProvider> gridGenerator; - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - const uint generatePart = comm->getPID(); - - std::ofstream logFile2; - std::string gridpath = "/work/marschoe/Basel4GPU/"; - logFile2.open(gridpath + std::to_string(generatePart) + "/gridGeneratorLog.txt");//Phoenix - //logFile2.open(std::string("M:/Basel2019/grids4/") + std::to_string(generatePart) + "/gridGeneratorLog.txt");//Baumbart - - bool useGridGenerator = false; - - if(useGridGenerator){ - real dx = 1.0; - real vx = 0.05; - - SPtr<TriangularMesh> BaselSTL; - - if (generatePart == 0) - BaselSTL = std::make_shared<TriangularMesh>("/work/marschoe/Basel4GPU/stl/BaselUrbanProfile_066_deg_bridge_3_All_CLOSED_WIDE_GROUND.stl"); //Phoenix - //BaselSTL = std::make_shared<TriangularMesh>("M:/Basel2019/stl/BaselUrbanProfile_066_deg_bridge_3_All_CLOSED_WIDE_GROUND.stl"); //Baumbart - if (generatePart == 1) - BaselSTL = std::make_shared<TriangularMesh>("/work/marschoe/Basel4GPU/stl/BaselUrbanProfile_066_deg_bridge_3_All_CLOSED_WIDE_GROUND_MIRROR_X.stl"); //Phoenix - //BaselSTL = std::make_shared<TriangularMesh>("M:/Basel2019/stl/BaselUrbanProfile_066_deg_bridge_3_All_CLOSED_WIDE_GROUND_MIRROR_X.stl"); //Baumbart - if (generatePart == 2) - BaselSTL = std::make_shared<TriangularMesh>("/work/marschoe/Basel4GPU/stl/BaselUrbanProfile_066_deg_bridge_3_All_CLOSED_WIDE_GROUND_MIRROR_X_Y.stl"); //Phoenix - //BaselSTL = std::make_shared<TriangularMesh>("M:/Basel2019/stl/BaselUrbanProfile_066_deg_bridge_3_All_CLOSED_WIDE_GROUND_MIRROR_X_Y.stl"); //Baumbart - if (generatePart == 3) - BaselSTL = std::make_shared<TriangularMesh>("/work/marschoe/Basel4GPU/stl/BaselUrbanProfile_066_deg_bridge_3_All_CLOSED_WIDE_GROUND_MIRROR_Y.stl"); //Phoenix - //BaselSTL = std::make_shared<TriangularMesh>("M:/Basel2019/stl/BaselUrbanProfile_066_deg_bridge_3_All_CLOSED_WIDE_GROUND_MIRROR_Y.stl"); //Baumbart - - real lengthInXDirection = 512.0; - real lengthInYDirection = 512.0; - real lengthInXDirectionOverlap = 520.0; - real lengthInYDirectionOverlap = 520.0; - real centerInX; - real centerInY; - - if (generatePart == 0){ centerInX = 0.0; centerInY = 0.0;} - if (generatePart == 1){ centerInX = -512.0; centerInY = 0.0;} - if (generatePart == 2){ centerInX = -512.0; centerInY = 512.0;} - if (generatePart == 3){ centerInX = 0.0; centerInY = 512.0;} - - gridBuilder->addCoarseGrid( (centerInX - lengthInXDirectionOverlap * 0.5), (centerInY - lengthInYDirectionOverlap * 0.5), -8.0, - (centerInX + lengthInXDirectionOverlap * 0.5), (centerInY + lengthInYDirectionOverlap * 0.5), 160.0, dx); - - gridBuilder->addGeometry(BaselSTL); - - gridBuilder->setSubDomainBox(std::make_shared<BoundingBox>( (centerInX - lengthInXDirection * 0.5), (centerInX + lengthInXDirection * 0.5), - (centerInY - lengthInYDirection * 0.5), (centerInY + lengthInYDirection * 0.5), - -200.0, 200.0)); - - gridBuilder->setPeriodicBoundaryCondition(false, false, false); - - gridBuilder->buildGrids(true); // buildGrids() has to be called before setting the BCs!!!! - - ////////////////////////////////////////////////////////////////////////// - - uint xNeighborRank, yNeighborRank; - if (generatePart == 0) { xNeighborRank = 1; yNeighborRank = 3; } - if (generatePart == 1) { xNeighborRank = 0; yNeighborRank = 2; } - if (generatePart == 2) { xNeighborRank = 3; yNeighborRank = 1; } - if (generatePart == 3) { xNeighborRank = 2; yNeighborRank = 0; } - - gridBuilder->findCommunicationIndices(CommunicationDirections::PX); - gridBuilder->setCommunicationProcess (CommunicationDirections::PX, xNeighborRank); - gridBuilder->findCommunicationIndices(CommunicationDirections::MX); - gridBuilder->setCommunicationProcess (CommunicationDirections::MX, xNeighborRank); - gridBuilder->findCommunicationIndices(CommunicationDirections::PY); - gridBuilder->setCommunicationProcess (CommunicationDirections::PY, yNeighborRank); - gridBuilder->findCommunicationIndices(CommunicationDirections::MY); - gridBuilder->setCommunicationProcess (CommunicationDirections::MY, yNeighborRank); - - ////////////////////////////////////////////////////////////////////////// - - gridBuilder->setVelocityBoundaryCondition(SideType::PZ, vx , 0.0, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::MZ, vx , 0.0, 0.0); - - gridBuilder->setVelocityBoundaryCondition(SideType::GEOMETRY, 0.0, 0.0, 0.0); - - bcFactory.setVelocityBoundaryCondition(BoundaryConditionFactory::VelocityBC::VelocityCompressible); - - if (generatePart == 0 || generatePart == 3) gridBuilder->setPressureBoundaryCondition(SideType::PX, 0.0); - if (generatePart == 1 || generatePart == 2) gridBuilder->setPressureBoundaryCondition(SideType::MX, 0.0); - if (generatePart == 2 || generatePart == 3) gridBuilder->setPressureBoundaryCondition(SideType::PY, 0.0); - if (generatePart == 0 || generatePart == 1) gridBuilder->setPressureBoundaryCondition(SideType::MY, 0.0); - - ////////////////////////////////////////////////////////////////////////// - - gridBuilder->writeGridsToVtk(gridpath + std::to_string(generatePart) + "/Basel_Grid"); - SimulationFileWriter::write(gridpath + std::to_string(generatePart )+ "/", gridBuilder, FILEFORMAT::BINARY); - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - if (generatePart == 0) { - StreetPointFinder finder; - finder.readStreets("/work/marschoe/Basel4GPU/source/git/targets/apps/LBM/streetTest/resources/ExampleStreets.txt");//phoenix - //finder.readStreets("C:/Users/schoen/Desktop/git/MS2/git/targets/apps/LBM/streetTest/resources/ExampleStreets.txt");//Baumbart - //finder.writeVTK("M:/Basel2019/results/ExampleStreets.vtk"); - finder.findIndicesLB(gridBuilder->getGrid(0), 7.0); - //finder.writeConnectionVTK("M:/Basel2019/grids/BaselUniMergedX/Basel_Grid/ExampleStreetsConnection.vtk", gridBuilder->getGrid(0)); - finder.writeSimulationFile(gridpath + std::to_string(generatePart) + "/", 1.0, gridBuilder->getNumberOfLevels(), 0); - } - else - { - StreetPointFinder finder; - finder.writeSimulationFile(gridpath + std::to_string(generatePart) + "/", 1.0, gridBuilder->getNumberOfLevels(), 0); - } - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - return; - - gridGenerator = GridProvider::makeGridGenerator(gridBuilder, para, cudaMemManager, communicator); - //gridGenerator = GridGenerator::make(gridBuilder, para); - - } - else - { - gridGenerator = GridProvider::makeGridReader(FILEFORMAT::BINARY, para, cudaMemManager); - //gridGenerator = GridReader::make(FileFormat::BINARY, para); - //gridGenerator = GridReader::make(FileFormat::ASCII, para); - } - - logFile2.close(); - - //return; - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - - //std::ifstream stream; - //stream.open(configPath.c_str(), std::ios::in); - //if (stream.fail()) - // throw std::runtime_error("can not open config file!"); - - //UPtr<input::Input> input = input::Input::makeInput(stream, "config"); - - Simulation sim; - SPtr<FileWriter> fileWriter = SPtr<FileWriter>(new FileWriter()); - sim.init(para, gridGenerator, fileWriter, cudaMemManager); - sim.run(); - sim.free(); -} - - -int main( int argc, char* argv[]) -{ - MPI_Init(&argc, &argv); - std::string str, str2; - if ( argv != NULL ) - { - str = static_cast<std::string>(argv[0]); - if (argc > 1) - { - str2 = static_cast<std::string>(argv[1]); - try - { - multipleLevel(str2); - } - catch (const std::exception& e) - { - //MPI_Abort(MPI_COMM_WORLD, -1); - } - catch (...) - { - std::cout << "unknown exeption" << std::endl; - } - } - else - { - try - { - //multipleLevel("E:/temp/Basel2019/config/configBasel.txt"); //Tesla03 - //multipleLevel("C:/Users/schoen/Desktop/bin/ReleaseBasel/configBasel.txt"); //Baumbart - multipleLevel("/work/marschoe/Basel4GPU/source/configBasel.txt"); //Phoenix - //multipleLevel("F:/Work/Computations/gridGenerator/inp/configTest.txt"); - } - catch (const std::exception& e) - { - std::cout << e.what() << std::flush; - //MPI_Abort(MPI_COMM_WORLD, -1); - } - catch (const std::bad_alloc e) - { - std::cout << e.what() << std::flush; - //MPI_Abort(MPI_COMM_WORLD, -1); - } - catch (...) - { - std::cout << "unknown exeption" << std::endl; - } - - std::cout << "\nConfiguration file must be set!: lbmgm <config file>" << std::endl << std::flush; - //MPI_Abort(MPI_COMM_WORLD, -1); - } - } - - - /* - MPE_Init_log() & MPE_Finish_log() are NOT needed when - liblmpe.a is linked with this program. In that case, - MPI_Init() would have called MPE_Init_log() already. - */ -#if defined( MPI_LOGGING ) - MPE_Init_log(); -#endif - -#if defined( MPI_LOGGING ) - if ( argv != NULL ) - MPE_Finish_log( argv[0] ); - if ( str != "" ) - MPE_Finish_log( str.c_str() ); - else - MPE_Finish_log( "TestLog" ); -#endif - - MPI_Finalize(); - return 0; -} diff --git a/apps/gpu/BaselMultiGPU/resources/ExampleStreets.txt b/apps/gpu/BaselMultiGPU/resources/ExampleStreets.txt deleted file mode 100644 index 9e2df6c6dad1adc8fbfcdb7f8e91d794c56d0773..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselMultiGPU/resources/ExampleStreets.txt +++ /dev/null @@ -1,11 +0,0 @@ -10 - 256 5 87 5 1 - 87 5 -85 5 1 - -85 5 -80 256 1 - -85 5 -256 5 1 - -185 -256 -85 5 1 - -92 0 87 0 1 - -85 256 -92 0 1 - -256 0 -92 0 1 - 87 0 256 0 1 - -92 0 -190 -256 1 \ No newline at end of file diff --git a/apps/gpu/BaselMultiGPU/resources/Junctions.txt b/apps/gpu/BaselMultiGPU/resources/Junctions.txt deleted file mode 100644 index 4b4a4ec0aa09eab8ac8f8faabbd01db3aa6f5903..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselMultiGPU/resources/Junctions.txt +++ /dev/null @@ -1,3 +0,0 @@ -2 -in 1 6 7 4 out 5 2 3 9 -in 0 5 -1 -1 out 8 1 -1 -1 \ No newline at end of file diff --git a/apps/gpu/BaselMultiGPU/resources/Sinks.txt b/apps/gpu/BaselMultiGPU/resources/Sinks.txt deleted file mode 100644 index 1c6fe5bbc0cf7d9ed86db3f463b69bc7a76e3bb9..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselMultiGPU/resources/Sinks.txt +++ /dev/null @@ -1,5 +0,0 @@ -4 -2 0.5 -3 0.5 -9 0.5 -8 0.5 diff --git a/apps/gpu/BaselMultiGPU/resources/Sources.txt b/apps/gpu/BaselMultiGPU/resources/Sources.txt deleted file mode 100644 index 22f4882a537328c3a14f42bc7fade201c977a3ca..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselMultiGPU/resources/Sources.txt +++ /dev/null @@ -1,5 +0,0 @@ -4 -6 0.9 -7 0.9 -4 0.9 -0 0.9 \ No newline at end of file diff --git a/apps/gpu/BaselNU/3rdPartyLinking.cmake b/apps/gpu/BaselNU/3rdPartyLinking.cmake deleted file mode 100644 index 6dd6ba1bc73e73dfbf01a3cc36aaeb3664e1c04c..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/3rdPartyLinking.cmake +++ /dev/null @@ -1,13 +0,0 @@ -include (${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/MPI/Link.cmake) -linkMPI(${targetName}) -include (${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/Cuda/Link.cmake) -linkCuda(${targetName}) -include (${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/Boost/Link.cmake) -linkBoost(${targetName} "serialization") -include (${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/Metis/Link.cmake) -linkMetis(${targetName}) - -if(HULC.BUILD_JSONCPP) - include (${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/JsonCpp/Link.cmake) - linkJsonCpp(${targetName}) -endif() \ No newline at end of file diff --git a/apps/gpu/BaselNU/CMakeLists.txt b/apps/gpu/BaselNU/CMakeLists.txt deleted file mode 100644 index 2d05f78bd85244eee12b8b65c9df157ff175b1e5..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -setTargetNameToFolderName(${CMAKE_CURRENT_LIST_DIR}) - -set(linkDirectories "") -set(libsToLink gpu_core GridGenerator) -set(includeDirectories "${CMAKE_SOURCE_DIR}/src" "${CMAKE_SOURCE_DIR}/src/gpu_core" "${CMAKE_SOURCE_DIR}/src/GridGenerator" "${CMAKE_SOURCE_DIR}/src/VirtualFluidsBasics") - -#glob files and save in MY_SRCS -include(CMakePackage.cmake) - -buildExe(${targetName} "${MY_SRCS}" "${linkDirectories}" "${libsToLink}" "${includeDirectories}") -groupTarget(${targetName} ${lbmAppFolder}) - -# Specify the linking to 3rdParty libs -include(3rdPartyLinking.cmake) \ No newline at end of file diff --git a/apps/gpu/BaselNU/CMakePackage.cmake b/apps/gpu/BaselNU/CMakePackage.cmake deleted file mode 100644 index 5d39e3804dbd180790629111449a7dc918292430..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/CMakePackage.cmake +++ /dev/null @@ -1,9 +0,0 @@ -#FILE ENDINGS -resetFileEndingsToCollect() -addCAndCPPFileTypes() -addFileEndingToCollect("*.cu") -addFileEndingToCollect("*.cuh") - -#GLOB SOURCE FILES IN MY_SRCS -unset(MY_SRCS) -includeRecursiveAllFilesFrom(${targetName} ${CMAKE_CURRENT_LIST_DIR}) \ No newline at end of file diff --git a/apps/gpu/BaselNU/main.cpp b/apps/gpu/BaselNU/main.cpp deleted file mode 100644 index 3a54000a2fdf86be1e2133d3323a79550a4c9a77..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/main.cpp +++ /dev/null @@ -1,273 +0,0 @@ -//#define MPI_LOGGING - -//Martin Branch - -#include <mpi.h> -#if defined( MPI_LOGGING ) -#include <mpe.h> -#endif - -#include <string> -#include <iostream> -#include <stdexcept> -#include <fstream> -#define _USE_MATH_DEFINES -#include <math.h> - -#include "Input/Input.h" -#include "StringUtilities/StringUtil.h" -#include "Input/ConfigFileReader/ConfigFileReader.h" - -#include "gpu/core/LBM/Simulation.h" -#include "gpu/core/Communication/MpiCommunicator.h" -#include "gpu/core/DataStructureInitializer/GridReaderGenerator/GridGenerator.h" -#include "gpu/core/DataStructureInitializer/GridProvider.h" -#include "gpu/core/DataStructureInitializer/GridReaderFiles/GridReader.h" -#include "gpu/core/Parameter/Parameter.h" -#include "gpu/core/Output/FileWriter.h" -#include "gpu/core/GPU/CudaMemoryManager.h" -#include "gpu/core/BoundaryCondtions/BoundaryConditionFactory.h" - -#include "global.h" - -#include "GridGenerator/StreetPointFinder/StreetPointFinder.h" - -#include "geometries/Sphere/Sphere.h" -#include "geometries/VerticalCylinder/VerticalCylinder.h" -#include "geometries/Cuboid/Cuboid.h" -#include "geometries/TriangularMesh/TriangularMesh.h" -#include "geometries/Conglomerate/Conglomerate.h" -#include "geometries/TriangularMesh/TriangularMeshStrategy.h" - -#include "grid/GridBuilder/LevelGridBuilder.h" -#include "grid/GridBuilder/MultipleGridBuilder.h" -#include "grid/BoundaryConditions/Side.h" -#include "grid/BoundaryConditions/BoundaryCondition.h" -#include "grid/GridFactory.h" - -#include "io/SimulationFileWriter/SimulationFileWriter.h" -#include "io/GridVTKWriter/GridVTKWriter.h" -#include "io/STLReaderWriter/STLReader.h" -#include "io/STLReaderWriter/STLWriter.h" - -#include "utilities/math/Math.h" -#include "utilities/communication.h" -#include "utilities/transformator/TransformatorImp.h" - - -void multipleLevel(const std::string& configPath) -{ - auto gridFactory = GridFactory::make(); - gridFactory->setGridStrategy(Device::CPU); - //gridFactory->setTriangularMeshDiscretizationMethod(TriangularMeshDiscretizationMethod::RAYCASTING); - gridFactory->setTriangularMeshDiscretizationMethod(TriangularMeshDiscretizationMethod::POINT_IN_OBJECT); - //gridFactory->setTriangularMeshDiscretizationMethod(TriangularMeshDiscretizationMethod::POINT_UNDER_TRIANGLE); - - auto gridBuilder = MultipleGridBuilder::makeShared(gridFactory); - - SPtr<ConfigFileReader> configReader = ConfigFileReader::getNewInstance(); - SPtr<ConfigData> configData = configReader->readConfigFile(configPath); - Communicator* comm = Communicator::getInstanz(); - - SPtr<Parameter> para = Parameter::make(configData, comm); - BoundaryConditionFactory bcFactory = BoundaryConditionFactory(); - SPtr<CudaMemoryManager> cudaMemManager = CudaMemoryManager::make(para); - SPtr<GridProvider> gridGenerator; - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - bool useGridGenerator = false; - - if (useGridGenerator) { - - real dx = 4.0; - real vx = 0.05; - - auto BaselSTL = std::make_shared<TriangularMesh>("M:/Basel2019/stl/BaselUrbanProfile_066_deg_bridge_3_All_CLOSED_WIDE_GROUND.stl"); - - gridBuilder->addCoarseGrid(-256.0, -256.0, -8.0, - 256.0, 256.0, 160.0, dx); - - gridBuilder->addGeometry(BaselSTL); - - ////////////////////////////////////////////////////////////////////////// - - Cuboid* refBoxMX = std::make_shared<Cuboid>( -300, -300, - 20, - -254, 300, 200 ); - Cuboid* refBoxPX = std::make_shared<Cuboid>( 254, -300, - 20, - 300, 300, 200 ); - Cuboid* refBoxMY = std::make_shared<Cuboid>( -300, -300, - 20, - 300, -254, 200 ); - Cuboid* refBoxPY = std::make_shared<Cuboid>( -300, 254, - 20, - 300, 300, 200 ); - - Conglomerate* refRegion = new Conglomerate(); - - refRegion->add(refBoxMX); - refRegion->add(refBoxPX); - refRegion->add(refBoxMY); - refRegion->add(refBoxPY); - - refRegion->add(BaselSTL); - - gridBuilder->setNumberOfLayers(12, 8); - - gridBuilder->addGrid(refRegion, 2); - - ////////////////////////////////////////////////////////////////////////// - - gridBuilder->setPeriodicBoundaryCondition(true, true, false); - - gridBuilder->buildGrids(true); // buildGrids() has to be called before setting the BCs!!!! - - ////////////////////////////////////////////////////////////////////////// - - gridBuilder->setVelocityBoundaryCondition(SideType::PZ, vx, 0.0, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::MZ, vx, 0.0, 0.0); - - gridBuilder->setVelocityBoundaryCondition(SideType::GEOMETRY, 0.0, 0.0, 0.0); - - //no forcing - // gridBuilder->setPressureBoundaryCondition(SideType::PY, 0.0); - // gridBuilder->setPressureBoundaryCondition(SideType::MY, 0.0); - - // gridBuilder->setPressureBoundaryCondition(SideType::PX, 0.0); - // gridBuilder->setPressureBoundaryCondition(SideType::MX, 0.0); - - bcFactory.setVelocityBoundaryCondition(BoundaryConditionFactory::VelocityBC::VelocityCompressible); - - ////////////////////////////////////////////////////////////////////////// - //Merged for Wind in X Direction - gridBuilder->writeGridsToVtk("F:/Basel2019NU/grids/BaselUniMergedXAllStreets/Basel_Grid"); - SimulationFileWriter::write("F:/Basel2019NU/grids/BaselUniMergedXAllStreets/", gridBuilder, FILEFORMAT::BINARY); - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - StreetPointFinder finder; - uint streetLevel = 2; - - finder.readStreets("C:/Users/schoen/Desktop/git/MS2/git/targets/apps/LBM/Basel/resources/Streets.txt"); - - finder.writeVTK("F:/Basel2019NU/results/ExampleStreets.vtk"); - - finder.findIndicesLB(gridBuilder->getGrid(streetLevel), 7.0); - - //Merged for Wind in X Direction - finder.writeConnectionVTK("F:/Basel2019NU/grids/BaselUniMergedXAllStreets/Basel_Grid/ExampleStreetsConnection.vtk", gridBuilder->getGrid(streetLevel)); - finder.writeSimulationFile("F:/Basel2019NU/grids/BaselUniMergedXAllStreets/", 1.0, gridBuilder->getNumberOfLevels(), streetLevel); - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - return; - - gridGenerator = GridProvider::makeGridGenerator(gridBuilder, para, cudaMemManager, communicator); - //gridGenerator = GridGenerator::make(gridBuilder, para); - - } - else - { - gridGenerator = GridProvider::makeGridReader(FILEFORMAT::BINARY, para, cudaMemManager); - //gridGenerator = GridReader::make(FileFormat::BINARY, para); - //gridGenerator = GridReader::make(FileFormat::ASCII, para); - } - - logFile.close(); - - //return; - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - - //std::ifstream stream; - //stream.open(configPath.c_str(), std::ios::in); - //if (stream.fail()) - // throw std::runtime_error("can not open config file!"); - - //UPtr<input::Input> input = input::Input::makeInput(stream, "config"); - - Simulation sim; - SPtr<FileWriter> fileWriter = SPtr<FileWriter>(new FileWriter()); - sim.init(para, gridGenerator, fileWriter, cudaMemManager); - sim.run(); - sim.free(); -} - - -int main(int argc, char* argv[]) -{ - MPI_Init(&argc, &argv); - std::string str, str2; - if (argv != NULL) - { - str = static_cast<std::string>(argv[0]); - if (argc > 1) - { - str2 = static_cast<std::string>(argv[1]); - try - { - multipleLevel(str2); - } - catch (const std::exception& e) - { - //MPI_Abort(MPI_COMM_WORLD, -1); - } - catch (...) - { - std::cout << "unknown exeption" << std::endl; - } - } - else - { - try - { - //multipleLevel("E:/temp/Basel2019/config/configBasel.txt"); //Tesla03 - //multipleLevel("C:/Users/schoen/Desktop/bin/ReleaseBasel/configBasel.txt"); //Baumbart 1 - multipleLevel("F:/Basel2019NU/configBasel.txt"); //Baumbart 2 - //multipleLevel("F:/Work/Computations/gridGenerator/inp/configTest.txt"); - //multipleLevel("C:/Users/hiwi/Desktop/configBasel.txt"); //Gamling - } - catch (const std::exception& e) - { - std::cout << e.what() << std::flush; - //MPI_Abort(MPI_COMM_WORLD, -1); - } - catch (const std::bad_alloc e) - { - std::cout << e.what() << std::flush; - //MPI_Abort(MPI_COMM_WORLD, -1); - } - catch (...) - { - std::cout << "unknown exeption" << std::endl; - } - - std::cout << "\nConfiguration file must be set!: lbmgm <config file>" << std::endl << std::flush; - //MPI_Abort(MPI_COMM_WORLD, -1); - } - } - - - /* - MPE_Init_log() & MPE_Finish_log() are NOT needed when - liblmpe.a is linked with this program. In that case, - MPI_Init() would have called MPE_Init_log() already. - */ -#if defined( MPI_LOGGING ) - MPE_Init_log(); -#endif - -#if defined( MPI_LOGGING ) - if (argv != NULL) - MPE_Finish_log(argv[0]); - if (str != "") - MPE_Finish_log(str.c_str()); - else - MPE_Finish_log("TestLog"); -#endif - - MPI_Finalize(); - return 0; -} diff --git a/apps/gpu/BaselNU/resources/Junctions.txt b/apps/gpu/BaselNU/resources/Junctions.txt deleted file mode 100644 index 52c6953f71996b212052661faa3a8c4f26630fc6..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/Junctions.txt +++ /dev/null @@ -1,32 +0,0 @@ -30 -in 40 14 4 out 56 5 15 t 43 -in 41 56 37 out 42 40 39 -in 49 35 39 45 out 48 34 37 57 -in 47 57 44 out 46 45 43 -in 33 15 3 out 31 4 16 t 45 -in 42 31 32 out 41 33 29 -in 34 28 29 38 out 35 32 30 36 -in 30 27 out 28 26 c -in 16 12 18 2 out 3 21 6 13 t 54 -in 26 112 13 1 out 27 113 2 19 t 31 -in 104 19 0 out 105 1 20 t 35 -in 115 21 11 out 114 12 22 t 42 -in 113 93 114 107 out 112 92 115 111 -in 108 106 111 out 110 107 109 -in 105 102 109 119 out 104 103 106 118 -in 22 10 63 89 out 11 23 62 86 t 57 -in 84 86 88 out 85 89 87 -in 92 82 87 91 out 93 83 88 90 -in 110 95 90 97 out 108 94 91 96 -in 103 100 96 99 out 102 101 97 98 -in 74 23 9 out 75 10 24 t 52 -in 85 77 75 79 out 84 76 74 78 -in 83 78 81 out 82 79 80 -in 69 24 8 out 68 25 9 t 50 -in 55 53 50 out 54 51 52 -in 52 59 17 6 out 50 58 7 18 t 30 -in 58 65 61 62 out 59 64 60 63 -in 66 72 71 68 out 67 73 69 70 -in 64 67 out 65 66 c -in 117 70 out 116 71 c -end \ No newline at end of file diff --git a/apps/gpu/BaselNU/resources/Sinks.txt b/apps/gpu/BaselNU/resources/Sinks.txt deleted file mode 100644 index 527902f09dbf229abeec5eff0db02b9be7f3583d..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/Sinks.txt +++ /dev/null @@ -1,20 +0,0 @@ -19 -25 0.5 -98 0.5 -5 0.5 -60 0.5 -7 0.4 -20 0.4 -51 0.2 -54 0.2 -116 0.2 -73 0.2 -76 0.2 -80 0.2 -94 0.2 -101 0.2 -36 0.2 -43 0.2 -46 0.2 -48 0.2 -118 0.2 diff --git a/apps/gpu/BaselNU/resources/Sources.txt b/apps/gpu/BaselNU/resources/Sources.txt deleted file mode 100644 index cfcdc1cdacf314ae20bd7c303c401f8d86a43da3..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/Sources.txt +++ /dev/null @@ -1,20 +0,0 @@ -19 -61 0.7 -8 0.7 -99 0.7 -14 0.7 -17 0.6 -0 0.6 -53 0.2 -55 0.2 -117 0.2 -72 0.2 -77 0.2 -81 0.2 -95 0.2 -100 0.2 -38 0.2 -44 0.2 -47 0.2 -49 0.2 -119 0.2 diff --git a/apps/gpu/BaselNU/resources/Streets.txt b/apps/gpu/BaselNU/resources/Streets.txt deleted file mode 100644 index f82c1e9ae0d990128a99d2c66d3eb08e94703296..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/Streets.txt +++ /dev/null @@ -1,133 +0,0 @@ -120 - 256 5 220 5 1 - 220 5 93 5 1 - 88 5 -86 5 1 - -86 5 -82 134 1 - -82 139 -80 224 1 - -80 229 -80 256 1 - -92 5 -200 5 1 - -205 5 -256 5 1 - -184 -256 -179 -244 1 - -179 -244 -165 -210 1 - -163 -205 -134 -131 1 - -133 -126 -106 -53 1 - -105 -48 -87 0 1 - -87 0 87 0 1 - -85 256 -85 226 1 - -85 226 -87 137 1 - -87 137 -92 5 1 - -256 0 -209 0 1 - -204 0 -92 0 1 - 92 0 218 0 1 - 223 0 256 0 1 - -92 0 -110 -49 1 - -110 -49 -138 -125 1 - -139 -130 -168 -204 1 - -168 -204 -183 -240 1 - -185 -245 -189 -256 1 - 122 83 88 5 1 - 93 5 127 83 1 - 127 83 137 137 1 - 25 136 132 137 1 - 132 137 122 83 1 - -82 134 25 136 1 - 132 142 27 141 1 - 22 141 -82 139 1 - 129 224 132 142 1 - 137 142 134 224 1 - 137 137 256 137 1 - 129 229 24 229 1 - 256 142 137 142 1 - 27 224 129 224 1 - 24 229 -80 229 1 - 27 141 27 224 1 - 22 224 22 141 1 - 237 222 256 222 1 - 256 227 239 227 1 - 234 227 134 229 1 - 239 227 239 256 1 - 234 256 234 227 1 - 134 229 134 256 1 - 129 256 129 229 1 - -200 5 -196 124 1 - -196 124 -195 256 1 - -201 121 -205 5 1 - -200 256 -201 126 1 - -201 126 -256 130 1 - -256 125 -201 121 1 - -80 224 22 224 1 - 134 224 237 222 1 - -209 0 -211 -109 1 - -206 -110 -204 0 1 - -211 -109 -256 -101 1 - -256 -106 -210 -114 1 - -138 -125 -206 -110 1 - -205 -115 -139 -130 1 - -210 -114 -217 -158 1 - -212 -160 -205 -115 1 - -217 -158 -239 -208 1 - -236 -213 -212 -160 1 - -183 -240 -236 -213 1 - -238 -218 -185 -245 1 - -239 -208 -241 -188 1 - -246 -191 -243 -215 1 - -256 -251 -238 -218 1 - -243 -215 -256 -240 1 - -87 -221 -163 -205 1 - -165 -210 -90 -226 1 - -90 -226 -100 -256 1 - -95 -256 -85 -227 1 - -85 -227 22 -252 1 - 20 -247 -83 -222 1 - 22 -252 29 -256 1 - 38 -256 25 -248 1 - 25 -248 49 -165 1 - 44 -164 20 -247 1 - -83 -222 -53 -146 1 - -58 -145 -87 -221 1 - -134 -131 -58 -145 1 - -53 -146 44 -164 1 - 46 -159 -54 -141 1 - -54 -141 -133 -126 1 - 49 -165 157 -183 1 - 158 -178 50 -159 1 - 66 -73 46 -159 1 - 50 -159 72 -73 1 - 157 -183 140 -256 1 - 145 -256 162 -184 1 - 162 -184 238 -195 1 - 239 -191 163 -179 1 - 243 -196 256 -199 1 - 256 -194 244 -192 1 - 227 -256 243 -196 1 - 238 -195 222 -256 1 - 244 -192 250 -93 1 - 244 -92 239 -191 1 - 250 -88 223 0 1 - 218 0 244 -87 1 - 244 -87 177 -79 1 - 177 -79 73 -68 1 - 163 -179 179 -84 1 - 179 -84 244 -92 1 - 174 -84 158 -178 1 - 72 -73 174 -84 1 - 73 -68 92 0 1 - 87 0 68 -67 1 - -106 -53 66 -72 1 - 68 -67 -105 -48 1 - -241 -188 -256 -177 1 - -256 -184 -246 -191 1 - 250 -93 256 -94 1 - 256 -89 250 -88 1 - - - - - - - - - - - - \ No newline at end of file diff --git a/apps/gpu/BaselNU/resources/allStreets/Junctions.txt b/apps/gpu/BaselNU/resources/allStreets/Junctions.txt deleted file mode 100644 index 52c6953f71996b212052661faa3a8c4f26630fc6..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/allStreets/Junctions.txt +++ /dev/null @@ -1,32 +0,0 @@ -30 -in 40 14 4 out 56 5 15 t 43 -in 41 56 37 out 42 40 39 -in 49 35 39 45 out 48 34 37 57 -in 47 57 44 out 46 45 43 -in 33 15 3 out 31 4 16 t 45 -in 42 31 32 out 41 33 29 -in 34 28 29 38 out 35 32 30 36 -in 30 27 out 28 26 c -in 16 12 18 2 out 3 21 6 13 t 54 -in 26 112 13 1 out 27 113 2 19 t 31 -in 104 19 0 out 105 1 20 t 35 -in 115 21 11 out 114 12 22 t 42 -in 113 93 114 107 out 112 92 115 111 -in 108 106 111 out 110 107 109 -in 105 102 109 119 out 104 103 106 118 -in 22 10 63 89 out 11 23 62 86 t 57 -in 84 86 88 out 85 89 87 -in 92 82 87 91 out 93 83 88 90 -in 110 95 90 97 out 108 94 91 96 -in 103 100 96 99 out 102 101 97 98 -in 74 23 9 out 75 10 24 t 52 -in 85 77 75 79 out 84 76 74 78 -in 83 78 81 out 82 79 80 -in 69 24 8 out 68 25 9 t 50 -in 55 53 50 out 54 51 52 -in 52 59 17 6 out 50 58 7 18 t 30 -in 58 65 61 62 out 59 64 60 63 -in 66 72 71 68 out 67 73 69 70 -in 64 67 out 65 66 c -in 117 70 out 116 71 c -end \ No newline at end of file diff --git a/apps/gpu/BaselNU/resources/allStreets/Sinks.txt b/apps/gpu/BaselNU/resources/allStreets/Sinks.txt deleted file mode 100644 index 527902f09dbf229abeec5eff0db02b9be7f3583d..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/allStreets/Sinks.txt +++ /dev/null @@ -1,20 +0,0 @@ -19 -25 0.5 -98 0.5 -5 0.5 -60 0.5 -7 0.4 -20 0.4 -51 0.2 -54 0.2 -116 0.2 -73 0.2 -76 0.2 -80 0.2 -94 0.2 -101 0.2 -36 0.2 -43 0.2 -46 0.2 -48 0.2 -118 0.2 diff --git a/apps/gpu/BaselNU/resources/allStreets/Sources.txt b/apps/gpu/BaselNU/resources/allStreets/Sources.txt deleted file mode 100644 index cfcdc1cdacf314ae20bd7c303c401f8d86a43da3..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/allStreets/Sources.txt +++ /dev/null @@ -1,20 +0,0 @@ -19 -61 0.7 -8 0.7 -99 0.7 -14 0.7 -17 0.6 -0 0.6 -53 0.2 -55 0.2 -117 0.2 -72 0.2 -77 0.2 -81 0.2 -95 0.2 -100 0.2 -38 0.2 -44 0.2 -47 0.2 -49 0.2 -119 0.2 diff --git a/apps/gpu/BaselNU/resources/allStreets/Streets.txt b/apps/gpu/BaselNU/resources/allStreets/Streets.txt deleted file mode 100644 index f82c1e9ae0d990128a99d2c66d3eb08e94703296..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/allStreets/Streets.txt +++ /dev/null @@ -1,133 +0,0 @@ -120 - 256 5 220 5 1 - 220 5 93 5 1 - 88 5 -86 5 1 - -86 5 -82 134 1 - -82 139 -80 224 1 - -80 229 -80 256 1 - -92 5 -200 5 1 - -205 5 -256 5 1 - -184 -256 -179 -244 1 - -179 -244 -165 -210 1 - -163 -205 -134 -131 1 - -133 -126 -106 -53 1 - -105 -48 -87 0 1 - -87 0 87 0 1 - -85 256 -85 226 1 - -85 226 -87 137 1 - -87 137 -92 5 1 - -256 0 -209 0 1 - -204 0 -92 0 1 - 92 0 218 0 1 - 223 0 256 0 1 - -92 0 -110 -49 1 - -110 -49 -138 -125 1 - -139 -130 -168 -204 1 - -168 -204 -183 -240 1 - -185 -245 -189 -256 1 - 122 83 88 5 1 - 93 5 127 83 1 - 127 83 137 137 1 - 25 136 132 137 1 - 132 137 122 83 1 - -82 134 25 136 1 - 132 142 27 141 1 - 22 141 -82 139 1 - 129 224 132 142 1 - 137 142 134 224 1 - 137 137 256 137 1 - 129 229 24 229 1 - 256 142 137 142 1 - 27 224 129 224 1 - 24 229 -80 229 1 - 27 141 27 224 1 - 22 224 22 141 1 - 237 222 256 222 1 - 256 227 239 227 1 - 234 227 134 229 1 - 239 227 239 256 1 - 234 256 234 227 1 - 134 229 134 256 1 - 129 256 129 229 1 - -200 5 -196 124 1 - -196 124 -195 256 1 - -201 121 -205 5 1 - -200 256 -201 126 1 - -201 126 -256 130 1 - -256 125 -201 121 1 - -80 224 22 224 1 - 134 224 237 222 1 - -209 0 -211 -109 1 - -206 -110 -204 0 1 - -211 -109 -256 -101 1 - -256 -106 -210 -114 1 - -138 -125 -206 -110 1 - -205 -115 -139 -130 1 - -210 -114 -217 -158 1 - -212 -160 -205 -115 1 - -217 -158 -239 -208 1 - -236 -213 -212 -160 1 - -183 -240 -236 -213 1 - -238 -218 -185 -245 1 - -239 -208 -241 -188 1 - -246 -191 -243 -215 1 - -256 -251 -238 -218 1 - -243 -215 -256 -240 1 - -87 -221 -163 -205 1 - -165 -210 -90 -226 1 - -90 -226 -100 -256 1 - -95 -256 -85 -227 1 - -85 -227 22 -252 1 - 20 -247 -83 -222 1 - 22 -252 29 -256 1 - 38 -256 25 -248 1 - 25 -248 49 -165 1 - 44 -164 20 -247 1 - -83 -222 -53 -146 1 - -58 -145 -87 -221 1 - -134 -131 -58 -145 1 - -53 -146 44 -164 1 - 46 -159 -54 -141 1 - -54 -141 -133 -126 1 - 49 -165 157 -183 1 - 158 -178 50 -159 1 - 66 -73 46 -159 1 - 50 -159 72 -73 1 - 157 -183 140 -256 1 - 145 -256 162 -184 1 - 162 -184 238 -195 1 - 239 -191 163 -179 1 - 243 -196 256 -199 1 - 256 -194 244 -192 1 - 227 -256 243 -196 1 - 238 -195 222 -256 1 - 244 -192 250 -93 1 - 244 -92 239 -191 1 - 250 -88 223 0 1 - 218 0 244 -87 1 - 244 -87 177 -79 1 - 177 -79 73 -68 1 - 163 -179 179 -84 1 - 179 -84 244 -92 1 - 174 -84 158 -178 1 - 72 -73 174 -84 1 - 73 -68 92 0 1 - 87 0 68 -67 1 - -106 -53 66 -72 1 - 68 -67 -105 -48 1 - -241 -188 -256 -177 1 - -256 -184 -246 -191 1 - 250 -93 256 -94 1 - 256 -89 250 -88 1 - - - - - - - - - - - - \ No newline at end of file diff --git a/apps/gpu/BaselNU/resources/allStreetsDouble/Junctions.txt b/apps/gpu/BaselNU/resources/allStreetsDouble/Junctions.txt deleted file mode 100644 index ba5e39707188c974e35c87aac0e2e699c80fe0cf..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/allStreetsDouble/Junctions.txt +++ /dev/null @@ -1,62 +0,0 @@ -60 -in 40 14 4 out 56 5 15 t 43 -in 41 56 37 out 42 40 39 -in 49 35 39 45 out 48 34 37 57 -in 47 57 44 out 46 45 43 -in 33 15 3 out 31 4 16 t 45 -in 42 31 32 out 41 33 29 -in 34 28 29 38 out 35 32 30 36 -in 30 27 out 28 26 c -in 16 12 18 2 out 3 21 6 13 t 54 -in 26 112 13 1 out 27 113 2 19 t 31 -in 104 19 0 out 105 1 20 t 35 -in 115 21 11 out 114 12 22 t 42 -in 113 93 114 107 out 112 92 115 111 -in 108 106 111 out 110 107 109 -in 105 102 109 119 out 104 103 106 118 -in 22 10 63 89 out 11 23 62 86 t 57 -in 84 86 88 out 85 89 87 -in 92 82 87 91 out 93 83 88 90 -in 110 95 90 97 out 108 94 91 96 -in 103 100 96 99 out 102 101 97 98 -in 74 23 9 out 75 10 24 t 52 -in 85 77 75 79 out 84 76 74 78 -in 83 78 81 out 82 79 80 -in 69 24 8 out 68 25 9 t 50 -in 55 53 50 out 54 51 52 -in 52 59 17 6 out 50 58 7 18 t 30 -in 58 65 61 62 out 59 64 60 63 -in 66 72 71 68 out 67 73 69 70 -in 64 67 out 65 66 c -in 117 70 out 116 71 c -in 160 134 124 out 176 125 135 t 63 -in 161 176 157 out 162 160 159 -in 169 155 159 165 out 168 154 157 177 -in 167 177 164 out 166 165 163 -in 153 135 123 out 151 124 136 t 65 -in 162 151 152 out 161 153 149 -in 154 148 149 158 out 155 152 150 156 -in 150 147 out 148 146 c -in 136 132 138 122 out 123 141 126 133 t 74 -in 146 232 133 121 out 147 233 122 139 t 51 -in 224 139 120 out 225 121 140 t 55 -in 235 141 131 out 234 132 142 t 62 -in 233 213 234 227 out 232 212 235 231 -in 228 226 231 out 230 227 229 -in 225 222 229 239 out 224 223 226 238 -in 142 130 183 209 out 131 143 182 206 t 77 -in 204 206 208 out 205 209 207 -in 212 202 207 211 out 213 203 208 210 -in 230 215 210 217 out 228 214 211 216 -in 223 220 216 219 out 222 221 217 218 -in 194 143 129 out 195 130 144 t 72 -in 205 197 195 199 out 204 196 194 198 -in 203 198 201 out 202 199 200 -in 189 144 128 out 188 145 129 t 70 -in 175 173 170 out 174 171 172 -in 172 179 137 126 out 170 178 127 138 t 50 -in 178 185 181 182 out 179 184 180 183 -in 186 192 191 188 out 187 193 189 190 -in 184 187 out 185 186 c -in 237 190 out 236 191 c -end \ No newline at end of file diff --git a/apps/gpu/BaselNU/resources/allStreetsDouble/Sinks.txt b/apps/gpu/BaselNU/resources/allStreetsDouble/Sinks.txt deleted file mode 100644 index ec674f5dcebd6a15804293e497d2d4c148692afe..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/allStreetsDouble/Sinks.txt +++ /dev/null @@ -1,39 +0,0 @@ -38 -25 0.5 -98 0.5 -5 0.5 -60 0.5 -7 0.4 -20 0.4 -51 0.2 -54 0.2 -116 0.2 -73 0.2 -76 0.2 -80 0.2 -94 0.2 -101 0.2 -36 0.2 -43 0.2 -46 0.2 -48 0.2 -118 0.2 -145 0.5 -218 0.5 -125 0.5 -180 0.5 -127 0.4 -140 0.4 -171 0.2 -174 0.2 -236 0.2 -193 0.2 -196 0.2 -200 0.2 -214 0.2 -221 0.2 -156 0.2 -163 0.2 -166 0.2 -168 0.2 -238 0.2 diff --git a/apps/gpu/BaselNU/resources/allStreetsDouble/Sources.txt b/apps/gpu/BaselNU/resources/allStreetsDouble/Sources.txt deleted file mode 100644 index a51dc831d3e9a01bfbf920d980c5cacbb3cb326e..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/allStreetsDouble/Sources.txt +++ /dev/null @@ -1,39 +0,0 @@ -38 -61 0.7 -8 0.7 -99 0.7 -14 0.7 -17 0.6 -0 0.6 -53 0.2 -55 0.2 -117 0.2 -72 0.2 -77 0.2 -81 0.2 -95 0.2 -100 0.2 -38 0.2 -44 0.2 -47 0.2 -49 0.2 -119 0.2 -181 0.7 -128 0.7 -219 0.7 -134 0.7 -137 0.6 -120 0.6 -173 0.2 -175 0.2 -237 0.2 -192 0.2 -197 0.2 -201 0.2 -215 0.2 -220 0.2 -158 0.2 -164 0.2 -167 0.2 -169 0.2 -239 0.2 diff --git a/apps/gpu/BaselNU/resources/allStreetsDouble/Streets.txt b/apps/gpu/BaselNU/resources/allStreetsDouble/Streets.txt deleted file mode 100644 index 17533ee0ce81645a6ffc78147d38cf72c528bcda..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/allStreetsDouble/Streets.txt +++ /dev/null @@ -1,253 +0,0 @@ -240 - 256 5 220 5 1 - 220 5 93 5 1 - 88 5 -86 5 1 - -86 5 -82 134 1 - -82 139 -80 224 1 - -80 229 -80 256 1 - -92 5 -200 5 1 - -205 5 -256 5 1 - -184 -256 -179 -244 1 - -179 -244 -165 -210 1 - -163 -205 -134 -131 1 - -133 -126 -106 -53 1 - -105 -48 -87 0 1 - -87 0 87 0 1 - -85 256 -85 226 1 - -85 226 -87 137 1 - -87 137 -92 5 1 - -256 0 -209 0 1 - -204 0 -92 0 1 - 92 0 218 0 1 - 223 0 256 0 1 - -92 0 -110 -49 1 - -110 -49 -138 -125 1 - -139 -130 -168 -204 1 - -168 -204 -183 -240 1 - -185 -245 -189 -256 1 - 122 83 88 5 1 - 93 5 127 83 1 - 127 83 137 137 1 - 25 136 132 137 1 - 132 137 122 83 1 - -82 134 25 136 1 - 132 142 27 141 1 - 22 141 -82 139 1 - 129 224 132 142 1 - 137 142 134 224 1 - 137 137 256 137 1 - 129 229 24 229 1 - 256 142 137 142 1 - 27 224 129 224 1 - 24 229 -80 229 1 - 27 141 27 224 1 - 22 224 22 141 1 - 237 222 256 222 1 - 256 227 239 227 1 - 234 227 134 229 1 - 239 227 239 256 1 - 234 256 234 227 1 - 134 229 134 256 1 - 129 256 129 229 1 - -200 5 -196 124 1 - -196 124 -195 256 1 - -201 121 -205 5 1 - -200 256 -201 126 1 - -201 126 -256 130 1 - -256 125 -201 121 1 - -80 224 22 224 1 - 134 224 237 222 1 - -209 0 -211 -109 1 - -206 -110 -204 0 1 - -211 -109 -256 -101 1 - -256 -106 -210 -114 1 - -138 -125 -206 -110 1 - -205 -115 -139 -130 1 - -210 -114 -217 -158 1 - -212 -160 -205 -115 1 - -217 -158 -239 -208 1 - -236 -213 -212 -160 1 - -183 -240 -236 -213 1 - -238 -218 -185 -245 1 - -239 -208 -241 -188 1 - -246 -191 -243 -215 1 - -256 -251 -238 -218 1 - -243 -215 -256 -240 1 - -87 -221 -163 -205 1 - -165 -210 -90 -226 1 - -90 -226 -100 -256 1 - -95 -256 -85 -227 1 - -85 -227 22 -252 1 - 20 -247 -83 -222 1 - 22 -252 29 -256 1 - 38 -256 25 -248 1 - 25 -248 49 -165 1 - 44 -164 20 -247 1 - -83 -222 -53 -146 1 - -58 -145 -87 -221 1 - -134 -131 -58 -145 1 - -53 -146 44 -164 1 - 46 -159 -54 -141 1 - -54 -141 -133 -126 1 - 49 -165 157 -183 1 - 158 -178 50 -159 1 - 66 -73 46 -159 1 - 50 -159 72 -73 1 - 157 -183 140 -256 1 - 145 -256 162 -184 1 - 162 -184 238 -195 1 - 239 -191 163 -179 1 - 243 -196 256 -199 1 - 256 -194 244 -192 1 - 227 -256 243 -196 1 - 238 -195 222 -256 1 - 244 -192 251 -93 1 - 244 -92 239 -191 1 - 251 -88 223 0 1 - 218 0 244 -87 1 - 244 -87 177 -79 1 - 177 -79 73 -68 1 - 163 -179 179 -84 1 - 179 -84 244 -92 1 - 174 -84 158 -178 1 - 72 -73 174 -84 1 - 73 -68 92 0 1 - 87 0 68 -67 1 - -106 -53 66 -72 1 - 68 -67 -105 -48 1 - -241 -188 -256 -177 1 - -256 -184 -246 -191 1 - 251 -93 256 -94 1 - 256 -89 251 -88 1 - 256 5 220 5 1 - 220 5 93 5 1 - 88 5 -86 5 1 - -86 5 -82 134 1 - -82 139 -80 224 1 - -80 229 -80 256 1 - -92 5 -200 5 1 - -205 5 -256 5 1 - -184 -256 -179 -244 1 - -179 -244 -165 -210 1 - -163 -205 -134 -131 1 - -133 -126 -106 -53 1 - -105 -48 -87 0 1 - -87 0 87 0 1 - -85 256 -85 226 1 - -85 226 -87 137 1 - -87 137 -92 5 1 - -256 0 -209 0 1 - -204 0 -92 0 1 - 92 0 218 0 1 - 223 0 256 0 1 - -92 0 -110 -49 1 - -110 -49 -138 -125 1 - -139 -130 -168 -204 1 - -168 -204 -183 -240 1 - -185 -245 -189 -256 1 - 122 83 88 5 1 - 93 5 127 83 1 - 127 83 137 137 1 - 25 136 132 137 1 - 132 137 122 83 1 - -82 134 25 136 1 - 132 142 27 141 1 - 22 141 -82 139 1 - 129 224 132 142 1 - 137 142 134 224 1 - 137 137 256 137 1 - 129 229 24 229 1 - 256 142 137 142 1 - 27 224 129 224 1 - 24 229 -80 229 1 - 27 141 27 224 1 - 22 224 22 141 1 - 237 222 256 222 1 - 256 227 239 227 1 - 234 227 134 229 1 - 239 227 239 256 1 - 234 256 234 227 1 - 134 229 134 256 1 - 129 256 129 229 1 - -200 5 -196 124 1 - -196 124 -195 256 1 - -201 121 -205 5 1 - -200 256 -201 126 1 - -201 126 -256 130 1 - -256 125 -201 121 1 - -80 224 22 224 1 - 134 224 237 222 1 - -209 0 -211 -109 1 - -206 -110 -204 0 1 - -211 -109 -256 -101 1 - -256 -106 -210 -114 1 - -138 -125 -206 -110 1 - -205 -115 -139 -130 1 - -210 -114 -217 -158 1 - -212 -160 -205 -115 1 - -217 -158 -239 -208 1 - -236 -213 -212 -160 1 - -183 -240 -236 -213 1 - -238 -218 -185 -245 1 - -239 -208 -241 -188 1 - -246 -191 -243 -215 1 - -256 -251 -238 -218 1 - -243 -215 -256 -240 1 - -87 -221 -163 -205 1 - -165 -210 -90 -226 1 - -90 -226 -100 -256 1 - -95 -256 -85 -227 1 - -85 -227 22 -252 1 - 20 -247 -83 -222 1 - 22 -252 29 -256 1 - 38 -256 25 -248 1 - 25 -248 49 -165 1 - 44 -164 20 -247 1 - -83 -222 -53 -146 1 - -58 -145 -87 -221 1 - -134 -131 -58 -145 1 - -53 -146 44 -164 1 - 46 -159 -54 -141 1 - -54 -141 -133 -126 1 - 49 -165 157 -183 1 - 158 -178 50 -159 1 - 66 -73 46 -159 1 - 50 -159 72 -73 1 - 157 -183 140 -256 1 - 145 -256 162 -184 1 - 162 -184 238 -195 1 - 239 -191 163 -179 1 - 243 -196 256 -199 1 - 256 -194 244 -192 1 - 227 -256 243 -196 1 - 238 -195 222 -256 1 - 244 -192 251 -93 1 - 244 -92 239 -191 1 - 251 -88 223 0 1 - 218 0 244 -87 1 - 244 -87 177 -79 1 - 177 -79 73 -68 1 - 163 -179 179 -84 1 - 179 -84 244 -92 1 - 174 -84 158 -178 1 - 72 -73 174 -84 1 - 73 -68 92 0 1 - 87 0 68 -67 1 - -106 -53 66 -72 1 - 68 -67 -105 -48 1 - -241 -188 -256 -177 1 - -256 -184 -246 -191 1 - 251 -93 256 -94 1 - 256 -89 251 -88 1 - - - - - - - - - - - - \ No newline at end of file diff --git a/apps/gpu/BaselNU/resources/allStreetsOneClosed/Junctions.txt b/apps/gpu/BaselNU/resources/allStreetsOneClosed/Junctions.txt deleted file mode 100644 index 38c8736ebed6d076aa4b7c4873bf9d118bcfd57a..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/allStreetsOneClosed/Junctions.txt +++ /dev/null @@ -1,32 +0,0 @@ -30 -in 38 12 3 out 54 4 13 t 41 -in 39 54 35 out 40 38 37 -in 47 33 37 43 out 46 32 35 55 -in 45 55 42 out 44 43 41 -in 31 13 2 out 29 3 14 t 43 -in 40 29 30 out 39 31 27 -in 32 26 27 36 out 33 30 28 34 -in 28 25 out 26 24 c -in 14 11 16 out 2 19 5 12 t 52 -in 24 110 1 out 25 111 17 t 29 -in 102 17 0 out 103 1 18 t 33 -in 113 19 10 out 112 11 20 t 40 -in 111 91 112 105 out 110 90 113 109 -in 106 104 109 out 108 105 107 -in 103 100 107 117 out 102 101 104 116 -in 20 9 61 87 out 10 21 60 84 t 55 -in 82 84 86 out 83 87 85 -in 90 80 85 89 out 91 81 86 88 -in 108 93 88 95 out 106 92 89 94 -in 101 98 94 97 out 100 99 95 96 -in 72 21 8 out 73 9 22 t 50 -in 83 75 73 77 out 82 74 72 76 -in 81 76 79 out 80 77 78 -in 67 22 7 out 66 23 8 t 48 -in 53 51 48 out 52 49 50 -in 50 57 15 5 out 48 56 6 16 t 28 -in 56 63 59 60 out 57 62 58 61 -in 64 70 69 66 out 65 71 67 68 -in 62 65 out 63 64 c -in 115 68 out 114 69 c -end \ No newline at end of file diff --git a/apps/gpu/BaselNU/resources/allStreetsOneClosed/Sinks.txt b/apps/gpu/BaselNU/resources/allStreetsOneClosed/Sinks.txt deleted file mode 100644 index f9181533e9214c8fb7dba93c77831e9418129317..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/allStreetsOneClosed/Sinks.txt +++ /dev/null @@ -1,20 +0,0 @@ -19 -23 0.5 -96 0.5 -4 0.5 -58 0.5 -6 0.4 -18 0.4 -49 0.2 -52 0.2 -114 0.2 -71 0.2 -74 0.2 -78 0.2 -92 0.2 -99 0.2 -34 0.2 -41 0.2 -44 0.2 -46 0.2 -116 0.2 diff --git a/apps/gpu/BaselNU/resources/allStreetsOneClosed/Sources.txt b/apps/gpu/BaselNU/resources/allStreetsOneClosed/Sources.txt deleted file mode 100644 index 32916664b95b20a8e675e5906a46ffca0600d46c..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/allStreetsOneClosed/Sources.txt +++ /dev/null @@ -1,20 +0,0 @@ -19 -59 0.7 -7 0.7 -97 0.7 -12 0.7 -15 0.6 -0 0.6 -51 0.2 -53 0.2 -115 0.2 -70 0.2 -75 0.2 -79 0.2 -93 0.2 -98 0.2 -36 0.2 -42 0.2 -45 0.2 -47 0.2 -117 0.2 diff --git a/apps/gpu/BaselNU/resources/allStreetsOneClosed/Streets.txt b/apps/gpu/BaselNU/resources/allStreetsOneClosed/Streets.txt deleted file mode 100644 index 2e643bab84b95b82e90c82cf39e56429dfa5867f..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/allStreetsOneClosed/Streets.txt +++ /dev/null @@ -1,131 +0,0 @@ -118 - 256 5 220 5 1 - 220 5 93 5 1 - -86 5 -82 134 1 - -82 139 -80 224 1 - -80 229 -80 256 1 - -92 5 -200 5 1 - -205 5 -256 5 1 - -184 -256 -179 -244 1 - -179 -244 -165 -210 1 - -163 -205 -134 -131 1 - -133 -126 -106 -53 1 - -105 -48 -87 0 1 - -85 256 -85 226 1 - -85 226 -87 137 1 - -87 137 -92 5 1 - -256 0 -209 0 1 - -204 0 -92 0 1 - 92 0 218 0 1 - 223 0 256 0 1 - -92 0 -110 -49 1 - -110 -49 -138 -125 1 - -139 -130 -168 -204 1 - -168 -204 -183 -240 1 - -185 -245 -189 -256 1 - 122 83 88 5 1 - 93 5 127 83 1 - 127 83 137 137 1 - 25 136 132 137 1 - 132 137 122 83 1 - -82 134 25 136 1 - 132 142 27 141 1 - 22 141 -82 139 1 - 129 224 132 142 1 - 137 142 134 224 1 - 137 137 256 137 1 - 129 229 24 229 1 - 256 142 137 142 1 - 27 224 129 224 1 - 24 229 -80 229 1 - 27 141 27 224 1 - 22 224 22 141 1 - 237 222 256 222 1 - 256 227 239 227 1 - 234 227 134 229 1 - 239 227 239 256 1 - 234 256 234 227 1 - 134 229 134 256 1 - 129 256 129 229 1 - -200 5 -196 124 1 - -196 124 -195 256 1 - -201 121 -205 5 1 - -200 256 -201 126 1 - -201 126 -256 130 1 - -256 125 -201 121 1 - -80 224 22 224 1 - 134 224 237 222 1 - -209 0 -211 -109 1 - -206 -110 -204 0 1 - -211 -109 -256 -101 1 - -256 -106 -210 -114 1 - -138 -125 -206 -110 1 - -205 -115 -139 -130 1 - -210 -114 -217 -158 1 - -212 -160 -205 -115 1 - -217 -158 -239 -208 1 - -236 -213 -212 -160 1 - -183 -240 -236 -213 1 - -238 -218 -185 -245 1 - -239 -208 -241 -188 1 - -246 -191 -243 -215 1 - -256 -251 -238 -218 1 - -243 -215 -256 -240 1 - -87 -221 -163 -205 1 - -165 -210 -90 -226 1 - -90 -226 -100 -256 1 - -95 -256 -85 -227 1 - -85 -227 22 -252 1 - 20 -247 -83 -222 1 - 22 -252 29 -256 1 - 38 -256 25 -248 1 - 25 -248 49 -165 1 - 44 -164 20 -247 1 - -83 -222 -53 -146 1 - -58 -145 -87 -221 1 - -134 -131 -58 -145 1 - -53 -146 44 -164 1 - 46 -159 -54 -141 1 - -54 -141 -133 -126 1 - 49 -165 157 -183 1 - 158 -178 50 -159 1 - 66 -73 46 -159 1 - 50 -159 72 -73 1 - 157 -183 140 -256 1 - 145 -256 162 -184 1 - 162 -184 238 -195 1 - 239 -191 163 -179 1 - 243 -196 256 -199 1 - 256 -194 244 -192 1 - 227 -256 243 -196 1 - 238 -195 222 -256 1 - 244 -192 250 -93 1 - 244 -92 239 -191 1 - 250 -88 223 0 1 - 218 0 244 -87 1 - 244 -87 177 -79 1 - 177 -79 73 -68 1 - 163 -179 179 -84 1 - 179 -84 244 -92 1 - 174 -84 158 -178 1 - 72 -73 174 -84 1 - 73 -68 92 0 1 - 87 0 68 -67 1 - -106 -53 66 -72 1 - 68 -67 -105 -48 1 - -241 -188 -256 -177 1 - -256 -184 -246 -191 1 - 250 -93 256 -94 1 - 256 -89 250 -88 1 - - - - - - - - - - - - \ No newline at end of file diff --git a/apps/gpu/BaselNU/resources/allStreetsQuadruple/Junctions.txt b/apps/gpu/BaselNU/resources/allStreetsQuadruple/Junctions.txt deleted file mode 100644 index 4193493b7736df7abe9df61d10ed87572e7d1b61..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/allStreetsQuadruple/Junctions.txt +++ /dev/null @@ -1,122 +0,0 @@ -120 -in 40 14 4 out 56 5 15 t 43 -in 41 56 37 out 42 40 39 -in 49 35 39 45 out 48 34 37 57 -in 47 57 44 out 46 45 43 -in 33 15 3 out 31 4 16 t 45 -in 42 31 32 out 41 33 29 -in 34 28 29 38 out 35 32 30 36 -in 30 27 out 28 26 c -in 16 12 18 2 out 3 21 6 13 t 54 -in 26 112 13 1 out 27 113 2 19 t 31 -in 104 19 0 out 105 1 20 t 35 -in 115 21 11 out 114 12 22 t 42 -in 113 93 114 107 out 112 92 115 111 -in 108 106 111 out 110 107 109 -in 105 102 109 119 out 104 103 106 118 -in 22 10 63 89 out 11 23 62 86 t 57 -in 84 86 88 out 85 89 87 -in 92 82 87 91 out 93 83 88 90 -in 110 95 90 97 out 108 94 91 96 -in 103 100 96 99 out 102 101 97 98 -in 74 23 9 out 75 10 24 t 52 -in 85 77 75 79 out 84 76 74 78 -in 83 78 81 out 82 79 80 -in 69 24 8 out 68 25 9 t 50 -in 55 53 50 out 54 51 52 -in 52 59 17 6 out 50 58 7 18 t 30 -in 58 65 61 62 out 59 64 60 63 -in 66 72 71 68 out 67 73 69 70 -in 64 67 out 65 66 c -in 117 70 out 116 71 c -in 160 134 124 out 176 125 135 t 63 -in 161 176 157 out 162 160 159 -in 169 155 159 165 out 168 154 157 177 -in 167 177 164 out 166 165 163 -in 153 135 123 out 151 124 136 t 65 -in 162 151 152 out 161 153 149 -in 154 148 149 158 out 155 152 150 156 -in 150 147 out 148 146 c -in 136 132 138 122 out 123 141 126 133 t 74 -in 146 232 133 121 out 147 233 122 139 t 51 -in 224 139 120 out 225 121 140 t 55 -in 235 141 131 out 234 132 142 t 62 -in 233 213 234 227 out 232 212 235 231 -in 228 226 231 out 230 227 229 -in 225 222 229 239 out 224 223 226 238 -in 142 130 183 209 out 131 143 182 206 t 77 -in 204 206 208 out 205 209 207 -in 212 202 207 211 out 213 203 208 210 -in 230 215 210 217 out 228 214 211 216 -in 223 220 216 219 out 222 221 217 218 -in 194 143 129 out 195 130 144 t 72 -in 205 197 195 199 out 204 196 194 198 -in 203 198 201 out 202 199 200 -in 189 144 128 out 188 145 129 t 70 -in 175 173 170 out 174 171 172 -in 172 179 137 126 out 170 178 127 138 t 50 -in 178 185 181 182 out 179 184 180 183 -in 186 192 191 188 out 187 193 189 190 -in 184 187 out 185 186 c -in 237 190 out 236 191 c -in 280 254 244 out 296 245 255 t 283 -in 281 296 277 out 282 280 279 -in 289 275 279 285 out 288 274 277 297 -in 287 297 284 out 286 285 283 -in 273 255 243 out 271 244 256 t 285 -in 282 271 272 out 281 273 269 -in 274 268 269 278 out 275 272 270 276 -in 270 267 out 268 266 c -in 256 252 258 242 out 243 261 246 253 t 294 -in 266 352 253 241 out 267 353 242 259 t 271 -in 344 259 240 out 345 241 260 t 275 -in 355 261 251 out 354 252 262 t 282 -in 353 333 354 347 out 352 332 355 351 -in 348 346 351 out 350 347 349 -in 345 342 349 359 out 344 343 346 358 -in 262 250 303 329 out 251 263 302 326 t 297 -in 324 326 328 out 325 329 327 -in 332 322 327 331 out 333 323 328 330 -in 350 335 330 337 out 348 334 331 336 -in 343 340 336 339 out 342 341 337 338 -in 314 263 249 out 315 250 264 t 292 -in 325 317 315 319 out 324 316 314 318 -in 323 318 321 out 322 319 320 -in 309 264 248 out 308 265 249 t 290 -in 295 293 290 out 294 291 292 -in 292 299 257 246 out 290 298 247 258 t 270 -in 298 305 301 302 out 299 304 300 303 -in 306 312 311 308 out 307 313 309 310 -in 304 307 out 305 306 c -in 357 310 out 356 311 c -in 400 374 364 out 416 365 375 t 403 -in 401 416 397 out 402 400 399 -in 409 395 399 405 out 408 394 397 417 -in 407 417 404 out 406 405 403 -in 393 375 363 out 391 364 376 t 405 -in 402 391 392 out 401 393 389 -in 394 388 389 398 out 395 392 390 396 -in 390 387 out 388 386 c -in 376 372 378 362 out 363 381 366 373 t 414 -in 386 472 373 361 out 387 473 362 379 t 391 -in 464 379 360 out 465 361 380 t 395 -in 475 381 371 out 474 372 382 t 402 -in 473 453 474 467 out 472 452 475 471 -in 468 466 471 out 470 467 469 -in 465 462 469 479 out 464 463 466 478 -in 382 370 423 449 out 371 383 422 446 t 417 -in 444 446 448 out 445 449 447 -in 452 442 447 451 out 453 443 448 450 -in 470 455 450 457 out 468 454 451 456 -in 463 460 456 459 out 462 461 457 458 -in 434 383 369 out 435 370 384 t 412 -in 445 437 435 439 out 444 436 434 438 -in 443 438 441 out 442 439 440 -in 429 384 368 out 428 385 369 t 410 -in 415 413 410 out 414 411 412 -in 412 419 377 366 out 410 418 367 378 t 390 -in 418 425 421 422 out 419 424 420 423 -in 426 432 431 428 out 427 433 429 430 -in 424 427 out 425 426 c -in 477 430 out 476 431 c -end \ No newline at end of file diff --git a/apps/gpu/BaselNU/resources/allStreetsQuadruple/Sinks.txt b/apps/gpu/BaselNU/resources/allStreetsQuadruple/Sinks.txt deleted file mode 100644 index 12245da9ed3963d4caf43fa40d441b044a4e4bc7..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/allStreetsQuadruple/Sinks.txt +++ /dev/null @@ -1,77 +0,0 @@ -76 -25 0.5 -98 0.5 -5 0.5 -60 0.5 -7 0.4 -20 0.4 -51 0.2 -54 0.2 -116 0.2 -73 0.2 -76 0.2 -80 0.2 -94 0.2 -101 0.2 -36 0.2 -43 0.2 -46 0.2 -48 0.2 -118 0.2 -145 0.5 -218 0.5 -125 0.5 -180 0.5 -127 0.4 -140 0.4 -171 0.2 -174 0.2 -236 0.2 -193 0.2 -196 0.2 -200 0.2 -214 0.2 -221 0.2 -156 0.2 -163 0.2 -166 0.2 -168 0.2 -238 0.2 -265 0.5 -338 0.5 -245 0.5 -300 0.5 -247 0.4 -260 0.4 -291 0.2 -294 0.2 -356 0.2 -313 0.2 -316 0.2 -320 0.2 -334 0.2 -341 0.2 -276 0.2 -283 0.2 -286 0.2 -288 0.2 -358 0.2 -385 0.5 -458 0.5 -365 0.5 -420 0.5 -367 0.4 -380 0.4 -411 0.2 -414 0.2 -476 0.2 -433 0.2 -436 0.2 -440 0.2 -454 0.2 -461 0.2 -396 0.2 -403 0.2 -406 0.2 -408 0.2 -478 0.2 \ No newline at end of file diff --git a/apps/gpu/BaselNU/resources/allStreetsQuadruple/Sources.txt b/apps/gpu/BaselNU/resources/allStreetsQuadruple/Sources.txt deleted file mode 100644 index 0bf91e6c71af3c0a58237f13263e2162f13fd280..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/allStreetsQuadruple/Sources.txt +++ /dev/null @@ -1,77 +0,0 @@ -76 -61 0.7 -8 0.7 -99 0.7 -14 0.7 -17 0.6 -0 0.6 -53 0.2 -55 0.2 -117 0.2 -72 0.2 -77 0.2 -81 0.2 -95 0.2 -100 0.2 -38 0.2 -44 0.2 -47 0.2 -49 0.2 -119 0.2 -181 0.7 -128 0.7 -219 0.7 -134 0.7 -137 0.6 -120 0.6 -173 0.2 -175 0.2 -237 0.2 -192 0.2 -197 0.2 -201 0.2 -215 0.2 -220 0.2 -158 0.2 -164 0.2 -167 0.2 -169 0.2 -239 0.2 -301 0.7 -248 0.7 -339 0.7 -254 0.7 -257 0.6 -240 0.6 -293 0.2 -295 0.2 -357 0.2 -312 0.2 -317 0.2 -321 0.2 -335 0.2 -340 0.2 -278 0.2 -284 0.2 -287 0.2 -289 0.2 -359 0.2 -421 0.7 -368 0.7 -459 0.7 -374 0.7 -377 0.6 -360 0.6 -413 0.2 -415 0.2 -477 0.2 -432 0.2 -437 0.2 -441 0.2 -455 0.2 -460 0.2 -398 0.2 -404 0.2 -407 0.2 -409 0.2 -479 0.2 diff --git a/apps/gpu/BaselNU/resources/allStreetsQuadruple/Streets.txt b/apps/gpu/BaselNU/resources/allStreetsQuadruple/Streets.txt deleted file mode 100644 index 8ed4aeff895c89d4511df89959ddcde914dc2241..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/allStreetsQuadruple/Streets.txt +++ /dev/null @@ -1,481 +0,0 @@ -480 - 256 5 220 5 1 - 220 5 93 5 1 - 88 5 -86 5 1 - -86 5 -82 134 1 - -82 139 -80 224 1 - -80 229 -80 256 1 - -92 5 -200 5 1 - -205 5 -256 5 1 - -184 -256 -179 -244 1 - -179 -244 -165 -210 1 - -163 -205 -134 -131 1 - -133 -126 -106 -53 1 - -105 -48 -87 0 1 - -87 0 87 0 1 - -85 256 -85 226 1 - -85 226 -87 137 1 - -87 137 -92 5 1 - -256 0 -209 0 1 - -204 0 -92 0 1 - 92 0 218 0 1 - 223 0 256 0 1 - -92 0 -110 -49 1 - -110 -49 -138 -125 1 - -139 -130 -168 -204 1 - -168 -204 -183 -240 1 - -185 -245 -189 -256 1 - 122 83 88 5 1 - 93 5 127 83 1 - 127 83 137 137 1 - 25 136 132 137 1 - 132 137 122 83 1 - -82 134 25 136 1 - 132 142 27 141 1 - 22 141 -82 139 1 - 129 224 132 142 1 - 137 142 134 224 1 - 137 137 256 137 1 - 129 229 24 229 1 - 256 142 137 142 1 - 27 224 129 224 1 - 24 229 -80 229 1 - 27 141 27 224 1 - 22 224 22 141 1 - 237 222 256 222 1 - 256 227 239 227 1 - 234 227 134 229 1 - 239 227 239 256 1 - 234 256 234 227 1 - 134 229 134 256 1 - 129 256 129 229 1 - -200 5 -196 124 1 - -196 124 -195 256 1 - -201 121 -205 5 1 - -200 256 -201 126 1 - -201 126 -256 130 1 - -256 125 -201 121 1 - -80 224 22 224 1 - 134 224 237 222 1 - -209 0 -211 -109 1 - -206 -110 -204 0 1 - -211 -109 -256 -101 1 - -256 -106 -210 -114 1 - -138 -125 -206 -110 1 - -205 -115 -139 -130 1 - -210 -114 -217 -158 1 - -212 -160 -205 -115 1 - -217 -158 -239 -208 1 - -236 -213 -212 -160 1 - -183 -240 -236 -213 1 - -238 -218 -185 -245 1 - -239 -208 -241 -188 1 - -246 -191 -243 -215 1 - -256 -251 -238 -218 1 - -243 -215 -256 -240 1 - -87 -221 -163 -205 1 - -165 -210 -90 -226 1 - -90 -226 -100 -256 1 - -95 -256 -85 -227 1 - -85 -227 22 -252 1 - 20 -247 -83 -222 1 - 22 -252 29 -256 1 - 38 -256 25 -248 1 - 25 -248 49 -165 1 - 44 -164 20 -247 1 - -83 -222 -53 -146 1 - -58 -145 -87 -221 1 - -134 -131 -58 -145 1 - -53 -146 44 -164 1 - 46 -159 -54 -141 1 - -54 -141 -133 -126 1 - 49 -165 157 -183 1 - 158 -178 50 -159 1 - 66 -73 46 -159 1 - 50 -159 72 -73 1 - 157 -183 140 -256 1 - 145 -256 162 -184 1 - 162 -184 238 -195 1 - 239 -191 163 -179 1 - 243 -196 256 -199 1 - 256 -194 244 -192 1 - 227 -256 243 -196 1 - 238 -195 222 -256 1 - 244 -192 251 -93 1 - 244 -92 239 -191 1 - 251 -88 223 0 1 - 218 0 244 -87 1 - 244 -87 177 -79 1 - 177 -79 73 -68 1 - 163 -179 179 -84 1 - 179 -84 244 -92 1 - 174 -84 158 -178 1 - 72 -73 174 -84 1 - 73 -68 92 0 1 - 87 0 68 -67 1 - -106 -53 66 -72 1 - 68 -67 -105 -48 1 - -241 -188 -256 -177 1 - -256 -184 -246 -191 1 - 251 -93 256 -94 1 - 256 -89 251 -88 1 - 256 5 220 5 1 - 220 5 93 5 1 - 88 5 -86 5 1 - -86 5 -82 134 1 - -82 139 -80 224 1 - -80 229 -80 256 1 - -92 5 -200 5 1 - -205 5 -256 5 1 - -184 -256 -179 -244 1 - -179 -244 -165 -210 1 - -163 -205 -134 -131 1 - -133 -126 -106 -53 1 - -105 -48 -87 0 1 - -87 0 87 0 1 - -85 256 -85 226 1 - -85 226 -87 137 1 - -87 137 -92 5 1 - -256 0 -209 0 1 - -204 0 -92 0 1 - 92 0 218 0 1 - 223 0 256 0 1 - -92 0 -110 -49 1 - -110 -49 -138 -125 1 - -139 -130 -168 -204 1 - -168 -204 -183 -240 1 - -185 -245 -189 -256 1 - 122 83 88 5 1 - 93 5 127 83 1 - 127 83 137 137 1 - 25 136 132 137 1 - 132 137 122 83 1 - -82 134 25 136 1 - 132 142 27 141 1 - 22 141 -82 139 1 - 129 224 132 142 1 - 137 142 134 224 1 - 137 137 256 137 1 - 129 229 24 229 1 - 256 142 137 142 1 - 27 224 129 224 1 - 24 229 -80 229 1 - 27 141 27 224 1 - 22 224 22 141 1 - 237 222 256 222 1 - 256 227 239 227 1 - 234 227 134 229 1 - 239 227 239 256 1 - 234 256 234 227 1 - 134 229 134 256 1 - 129 256 129 229 1 - -200 5 -196 124 1 - -196 124 -195 256 1 - -201 121 -205 5 1 - -200 256 -201 126 1 - -201 126 -256 130 1 - -256 125 -201 121 1 - -80 224 22 224 1 - 134 224 237 222 1 - -209 0 -211 -109 1 - -206 -110 -204 0 1 - -211 -109 -256 -101 1 - -256 -106 -210 -114 1 - -138 -125 -206 -110 1 - -205 -115 -139 -130 1 - -210 -114 -217 -158 1 - -212 -160 -205 -115 1 - -217 -158 -239 -208 1 - -236 -213 -212 -160 1 - -183 -240 -236 -213 1 - -238 -218 -185 -245 1 - -239 -208 -241 -188 1 - -246 -191 -243 -215 1 - -256 -251 -238 -218 1 - -243 -215 -256 -240 1 - -87 -221 -163 -205 1 - -165 -210 -90 -226 1 - -90 -226 -100 -256 1 - -95 -256 -85 -227 1 - -85 -227 22 -252 1 - 20 -247 -83 -222 1 - 22 -252 29 -256 1 - 38 -256 25 -248 1 - 25 -248 49 -165 1 - 44 -164 20 -247 1 - -83 -222 -53 -146 1 - -58 -145 -87 -221 1 - -134 -131 -58 -145 1 - -53 -146 44 -164 1 - 46 -159 -54 -141 1 - -54 -141 -133 -126 1 - 49 -165 157 -183 1 - 158 -178 50 -159 1 - 66 -73 46 -159 1 - 50 -159 72 -73 1 - 157 -183 140 -256 1 - 145 -256 162 -184 1 - 162 -184 238 -195 1 - 239 -191 163 -179 1 - 243 -196 256 -199 1 - 256 -194 244 -192 1 - 227 -256 243 -196 1 - 238 -195 222 -256 1 - 244 -192 251 -93 1 - 244 -92 239 -191 1 - 251 -88 223 0 1 - 218 0 244 -87 1 - 244 -87 177 -79 1 - 177 -79 73 -68 1 - 163 -179 179 -84 1 - 179 -84 244 -92 1 - 174 -84 158 -178 1 - 72 -73 174 -84 1 - 73 -68 92 0 1 - 87 0 68 -67 1 - -106 -53 66 -72 1 - 68 -67 -105 -48 1 - -241 -188 -256 -177 1 - -256 -184 -246 -191 1 - 251 -93 256 -94 1 - 256 -89 251 -88 1 - 256 5 220 5 1 - 220 5 93 5 1 - 88 5 -86 5 1 - -86 5 -82 134 1 - -82 139 -80 224 1 - -80 229 -80 256 1 - -92 5 -200 5 1 - -205 5 -256 5 1 - -184 -256 -179 -244 1 - -179 -244 -165 -210 1 - -163 -205 -134 -131 1 - -133 -126 -106 -53 1 - -105 -48 -87 0 1 - -87 0 87 0 1 - -85 256 -85 226 1 - -85 226 -87 137 1 - -87 137 -92 5 1 - -256 0 -209 0 1 - -204 0 -92 0 1 - 92 0 218 0 1 - 223 0 256 0 1 - -92 0 -110 -49 1 - -110 -49 -138 -125 1 - -139 -130 -168 -204 1 - -168 -204 -183 -240 1 - -185 -245 -189 -256 1 - 122 83 88 5 1 - 93 5 127 83 1 - 127 83 137 137 1 - 25 136 132 137 1 - 132 137 122 83 1 - -82 134 25 136 1 - 132 142 27 141 1 - 22 141 -82 139 1 - 129 224 132 142 1 - 137 142 134 224 1 - 137 137 256 137 1 - 129 229 24 229 1 - 256 142 137 142 1 - 27 224 129 224 1 - 24 229 -80 229 1 - 27 141 27 224 1 - 22 224 22 141 1 - 237 222 256 222 1 - 256 227 239 227 1 - 234 227 134 229 1 - 239 227 239 256 1 - 234 256 234 227 1 - 134 229 134 256 1 - 129 256 129 229 1 - -200 5 -196 124 1 - -196 124 -195 256 1 - -201 121 -205 5 1 - -200 256 -201 126 1 - -201 126 -256 130 1 - -256 125 -201 121 1 - -80 224 22 224 1 - 134 224 237 222 1 - -209 0 -211 -109 1 - -206 -110 -204 0 1 - -211 -109 -256 -101 1 - -256 -106 -210 -114 1 - -138 -125 -206 -110 1 - -205 -115 -139 -130 1 - -210 -114 -217 -158 1 - -212 -160 -205 -115 1 - -217 -158 -239 -208 1 - -236 -213 -212 -160 1 - -183 -240 -236 -213 1 - -238 -218 -185 -245 1 - -239 -208 -241 -188 1 - -246 -191 -243 -215 1 - -256 -251 -238 -218 1 - -243 -215 -256 -240 1 - -87 -221 -163 -205 1 - -165 -210 -90 -226 1 - -90 -226 -100 -256 1 - -95 -256 -85 -227 1 - -85 -227 22 -252 1 - 20 -247 -83 -222 1 - 22 -252 29 -256 1 - 38 -256 25 -248 1 - 25 -248 49 -165 1 - 44 -164 20 -247 1 - -83 -222 -53 -146 1 - -58 -145 -87 -221 1 - -134 -131 -58 -145 1 - -53 -146 44 -164 1 - 46 -159 -54 -141 1 - -54 -141 -133 -126 1 - 49 -165 157 -183 1 - 158 -178 50 -159 1 - 66 -73 46 -159 1 - 50 -159 72 -73 1 - 157 -183 140 -256 1 - 145 -256 162 -184 1 - 162 -184 238 -195 1 - 239 -191 163 -179 1 - 243 -196 256 -199 1 - 256 -194 244 -192 1 - 227 -256 243 -196 1 - 238 -195 222 -256 1 - 244 -192 251 -93 1 - 244 -92 239 -191 1 - 251 -88 223 0 1 - 218 0 244 -87 1 - 244 -87 177 -79 1 - 177 -79 73 -68 1 - 163 -179 179 -84 1 - 179 -84 244 -92 1 - 174 -84 158 -178 1 - 72 -73 174 -84 1 - 73 -68 92 0 1 - 87 0 68 -67 1 - -106 -53 66 -72 1 - 68 -67 -105 -48 1 - -241 -188 -256 -177 1 - -256 -184 -246 -191 1 - 251 -93 256 -94 1 - 256 -89 251 -88 1 - 256 5 220 5 1 - 220 5 93 5 1 - 88 5 -86 5 1 - -86 5 -82 134 1 - -82 139 -80 224 1 - -80 229 -80 256 1 - -92 5 -200 5 1 - -205 5 -256 5 1 - -184 -256 -179 -244 1 - -179 -244 -165 -210 1 - -163 -205 -134 -131 1 - -133 -126 -106 -53 1 - -105 -48 -87 0 1 - -87 0 87 0 1 - -85 256 -85 226 1 - -85 226 -87 137 1 - -87 137 -92 5 1 - -256 0 -209 0 1 - -204 0 -92 0 1 - 92 0 218 0 1 - 223 0 256 0 1 - -92 0 -110 -49 1 - -110 -49 -138 -125 1 - -139 -130 -168 -204 1 - -168 -204 -183 -240 1 - -185 -245 -189 -256 1 - 122 83 88 5 1 - 93 5 127 83 1 - 127 83 137 137 1 - 25 136 132 137 1 - 132 137 122 83 1 - -82 134 25 136 1 - 132 142 27 141 1 - 22 141 -82 139 1 - 129 224 132 142 1 - 137 142 134 224 1 - 137 137 256 137 1 - 129 229 24 229 1 - 256 142 137 142 1 - 27 224 129 224 1 - 24 229 -80 229 1 - 27 141 27 224 1 - 22 224 22 141 1 - 237 222 256 222 1 - 256 227 239 227 1 - 234 227 134 229 1 - 239 227 239 256 1 - 234 256 234 227 1 - 134 229 134 256 1 - 129 256 129 229 1 - -200 5 -196 124 1 - -196 124 -195 256 1 - -201 121 -205 5 1 - -200 256 -201 126 1 - -201 126 -256 130 1 - -256 125 -201 121 1 - -80 224 22 224 1 - 134 224 237 222 1 - -209 0 -211 -109 1 - -206 -110 -204 0 1 - -211 -109 -256 -101 1 - -256 -106 -210 -114 1 - -138 -125 -206 -110 1 - -205 -115 -139 -130 1 - -210 -114 -217 -158 1 - -212 -160 -205 -115 1 - -217 -158 -239 -208 1 - -236 -213 -212 -160 1 - -183 -240 -236 -213 1 - -238 -218 -185 -245 1 - -239 -208 -241 -188 1 - -246 -191 -243 -215 1 - -256 -251 -238 -218 1 - -243 -215 -256 -240 1 - -87 -221 -163 -205 1 - -165 -210 -90 -226 1 - -90 -226 -100 -256 1 - -95 -256 -85 -227 1 - -85 -227 22 -252 1 - 20 -247 -83 -222 1 - 22 -252 29 -256 1 - 38 -256 25 -248 1 - 25 -248 49 -165 1 - 44 -164 20 -247 1 - -83 -222 -53 -146 1 - -58 -145 -87 -221 1 - -134 -131 -58 -145 1 - -53 -146 44 -164 1 - 46 -159 -54 -141 1 - -54 -141 -133 -126 1 - 49 -165 157 -183 1 - 158 -178 50 -159 1 - 66 -73 46 -159 1 - 50 -159 72 -73 1 - 157 -183 140 -256 1 - 145 -256 162 -184 1 - 162 -184 238 -195 1 - 239 -191 163 -179 1 - 243 -196 256 -199 1 - 256 -194 244 -192 1 - 227 -256 243 -196 1 - 238 -195 222 -256 1 - 244 -192 251 -93 1 - 244 -92 239 -191 1 - 251 -88 223 0 1 - 218 0 244 -87 1 - 244 -87 177 -79 1 - 177 -79 73 -68 1 - 163 -179 179 -84 1 - 179 -84 244 -92 1 - 174 -84 158 -178 1 - 72 -73 174 -84 1 - 73 -68 92 0 1 - 87 0 68 -67 1 - -106 -53 66 -72 1 - 68 -67 -105 -48 1 - -241 -188 -256 -177 1 - -256 -184 -246 -191 1 - 251 -93 256 -94 1 - 256 -89 251 -88 1 \ No newline at end of file diff --git a/apps/gpu/BaselNU/resources/fourStreets/Junctions.txt b/apps/gpu/BaselNU/resources/fourStreets/Junctions.txt deleted file mode 100644 index fca1e6e7153d4381dee0f821dd9638d624f4c97e..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/fourStreets/Junctions.txt +++ /dev/null @@ -1,4 +0,0 @@ -2 -in 1 7 6 4 out 5 3 2 9 t 45 -in 0 5 out 8 1 c -end \ No newline at end of file diff --git a/apps/gpu/BaselNU/resources/fourStreets/Sinks.txt b/apps/gpu/BaselNU/resources/fourStreets/Sinks.txt deleted file mode 100644 index 1c6fe5bbc0cf7d9ed86db3f463b69bc7a76e3bb9..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/fourStreets/Sinks.txt +++ /dev/null @@ -1,5 +0,0 @@ -4 -2 0.5 -3 0.5 -9 0.5 -8 0.5 diff --git a/apps/gpu/BaselNU/resources/fourStreets/Sources.txt b/apps/gpu/BaselNU/resources/fourStreets/Sources.txt deleted file mode 100644 index 4af10e940263a0fb86c946e1005ded89d7ddb2fc..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/fourStreets/Sources.txt +++ /dev/null @@ -1,5 +0,0 @@ -4 -6 0.4 -7 0.4 -4 0.4 -0 0.4 \ No newline at end of file diff --git a/apps/gpu/BaselNU/resources/fourStreets/Streets.txt b/apps/gpu/BaselNU/resources/fourStreets/Streets.txt deleted file mode 100644 index 8cd812cf91709b18eb1d28488271f8cc5803b248..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/fourStreets/Streets.txt +++ /dev/null @@ -1,11 +0,0 @@ -10 - 256 5 87 5 1 - 87 5 -85 5 1 - -85 5 -80 256 1 - -92 5 -256 5 1 - -185 -256 -87 0 1 - -87 0 87 0 1 - -85 256 -92 5 1 - -256 0 -92 0 1 - 87 0 256 0 1 - -92 0 -190 -256 1 \ No newline at end of file diff --git a/apps/gpu/BaselNU/resources/testStreets/Junctions1.txt b/apps/gpu/BaselNU/resources/testStreets/Junctions1.txt deleted file mode 100644 index d65d3e7d0b1484b4b577b08f41142cd75dbc3a69..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/testStreets/Junctions1.txt +++ /dev/null @@ -1,3 +0,0 @@ -1 -in 3 7 5 1 out 2 6 4 0 t 30 -end \ No newline at end of file diff --git a/apps/gpu/BaselNU/resources/testStreets/Junctions2.txt b/apps/gpu/BaselNU/resources/testStreets/Junctions2.txt deleted file mode 100644 index f5dd18195ba12373f4dd8709ca48de49b614e30e..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/testStreets/Junctions2.txt +++ /dev/null @@ -1,3 +0,0 @@ -1 -in 3 5 1 out 2 4 0 t 30 -end \ No newline at end of file diff --git a/apps/gpu/BaselNU/resources/testStreets/Junctions3.txt b/apps/gpu/BaselNU/resources/testStreets/Junctions3.txt deleted file mode 100644 index c44f1c8e418b216c293b8101be3926a824616de2..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/testStreets/Junctions3.txt +++ /dev/null @@ -1,3 +0,0 @@ -1 -in 3 1 out 2 0 4 t 30 -end \ No newline at end of file diff --git a/apps/gpu/BaselNU/resources/testStreets/Junctions4.txt b/apps/gpu/BaselNU/resources/testStreets/Junctions4.txt deleted file mode 100644 index 62f8927f46ed99d069981b4d8cc84f039a7b5de1..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/testStreets/Junctions4.txt +++ /dev/null @@ -1,3 +0,0 @@ -1 -in 3 1 4 out 2 0 -2 t 30 -end \ No newline at end of file diff --git a/apps/gpu/BaselNU/resources/testStreets/Junctions5.txt b/apps/gpu/BaselNU/resources/testStreets/Junctions5.txt deleted file mode 100644 index 505c5fca91aa49e765706a969f6445a3b6c24ed8..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/testStreets/Junctions5.txt +++ /dev/null @@ -1,3 +0,0 @@ -1 -in 4 3 1 out -2 2 0 t 30 -end \ No newline at end of file diff --git a/apps/gpu/BaselNU/resources/testStreets/Junctions6.txt b/apps/gpu/BaselNU/resources/testStreets/Junctions6.txt deleted file mode 100644 index de197e65ee32f4efef0cc18960a0e54eebf45b72..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/testStreets/Junctions6.txt +++ /dev/null @@ -1,3 +0,0 @@ -1 -in 3 5 1 out -2 -2 -2 2 4 0 t 30 -end \ No newline at end of file diff --git a/apps/gpu/BaselNU/resources/testStreets/Sinks1.txt b/apps/gpu/BaselNU/resources/testStreets/Sinks1.txt deleted file mode 100644 index c4b251547e1e82adfc410509cf3073cc3f72130e..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/testStreets/Sinks1.txt +++ /dev/null @@ -1,5 +0,0 @@ -4 -0 0.5 -2 0.5 -4 0.5 -6 0.5 diff --git a/apps/gpu/BaselNU/resources/testStreets/Sinks2.txt b/apps/gpu/BaselNU/resources/testStreets/Sinks2.txt deleted file mode 100644 index aef3eef93f236d5d575119b6d2ed31038315b103..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/testStreets/Sinks2.txt +++ /dev/null @@ -1,4 +0,0 @@ -3 -0 0.5 -2 0.5 -4 0.5 diff --git a/apps/gpu/BaselNU/resources/testStreets/Sinks3.txt b/apps/gpu/BaselNU/resources/testStreets/Sinks3.txt deleted file mode 100644 index aef3eef93f236d5d575119b6d2ed31038315b103..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/testStreets/Sinks3.txt +++ /dev/null @@ -1,4 +0,0 @@ -3 -0 0.5 -2 0.5 -4 0.5 diff --git a/apps/gpu/BaselNU/resources/testStreets/Sinks4.txt b/apps/gpu/BaselNU/resources/testStreets/Sinks4.txt deleted file mode 100644 index 96360230279247af416b4e5112aa7c14b4765050..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/testStreets/Sinks4.txt +++ /dev/null @@ -1,3 +0,0 @@ -2 -0 0.5 -2 0.5 diff --git a/apps/gpu/BaselNU/resources/testStreets/Sinks5.txt b/apps/gpu/BaselNU/resources/testStreets/Sinks5.txt deleted file mode 100644 index 96360230279247af416b4e5112aa7c14b4765050..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/testStreets/Sinks5.txt +++ /dev/null @@ -1,3 +0,0 @@ -2 -0 0.5 -2 0.5 diff --git a/apps/gpu/BaselNU/resources/testStreets/Sinks6.txt b/apps/gpu/BaselNU/resources/testStreets/Sinks6.txt deleted file mode 100644 index aef3eef93f236d5d575119b6d2ed31038315b103..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/testStreets/Sinks6.txt +++ /dev/null @@ -1,4 +0,0 @@ -3 -0 0.5 -2 0.5 -4 0.5 diff --git a/apps/gpu/BaselNU/resources/testStreets/Sources1.txt b/apps/gpu/BaselNU/resources/testStreets/Sources1.txt deleted file mode 100644 index fa58c8e04bf85a9f41caccaed215220f04e15e58..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/testStreets/Sources1.txt +++ /dev/null @@ -1,5 +0,0 @@ -4 -1 0.4 -3 0.4 -5 0.4 -7 0.4 \ No newline at end of file diff --git a/apps/gpu/BaselNU/resources/testStreets/Sources2.txt b/apps/gpu/BaselNU/resources/testStreets/Sources2.txt deleted file mode 100644 index 34986f41d940cdedde923034dd4c6f36a4672058..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/testStreets/Sources2.txt +++ /dev/null @@ -1,4 +0,0 @@ -3 -1 0.4 -3 0.4 -5 0.4 \ No newline at end of file diff --git a/apps/gpu/BaselNU/resources/testStreets/Sources3.txt b/apps/gpu/BaselNU/resources/testStreets/Sources3.txt deleted file mode 100644 index 584594eaa23a65228f647dc3c4153e1cf1cdeb2d..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/testStreets/Sources3.txt +++ /dev/null @@ -1,3 +0,0 @@ -2 -1 0.4 -3 0.4 \ No newline at end of file diff --git a/apps/gpu/BaselNU/resources/testStreets/Sources4.txt b/apps/gpu/BaselNU/resources/testStreets/Sources4.txt deleted file mode 100644 index 6ff2b74df08a4fadf1902f4a8bd2260dc017100e..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/testStreets/Sources4.txt +++ /dev/null @@ -1,4 +0,0 @@ -3 -1 0.4 -3 0.4 -4 0.4 \ No newline at end of file diff --git a/apps/gpu/BaselNU/resources/testStreets/Sources5.txt b/apps/gpu/BaselNU/resources/testStreets/Sources5.txt deleted file mode 100644 index 6ff2b74df08a4fadf1902f4a8bd2260dc017100e..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/testStreets/Sources5.txt +++ /dev/null @@ -1,4 +0,0 @@ -3 -1 0.4 -3 0.4 -4 0.4 \ No newline at end of file diff --git a/apps/gpu/BaselNU/resources/testStreets/Sources6.txt b/apps/gpu/BaselNU/resources/testStreets/Sources6.txt deleted file mode 100644 index 34986f41d940cdedde923034dd4c6f36a4672058..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/testStreets/Sources6.txt +++ /dev/null @@ -1,4 +0,0 @@ -3 -1 0.4 -3 0.4 -5 0.4 \ No newline at end of file diff --git a/apps/gpu/BaselNU/resources/testStreets/Streets1.txt b/apps/gpu/BaselNU/resources/testStreets/Streets1.txt deleted file mode 100644 index ea10aefbdb6960296a30ba4a279771a10814d493..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/testStreets/Streets1.txt +++ /dev/null @@ -1,9 +0,0 @@ -8 - 0 0 256 0 1 - 256 5 0 5 1 - 0 5 0 256 1 - -5 256 -5 5 1 - -5 5 -256 5 1 - -256 0 -5 0 1 - -5 0 -5 -256 1 - 0 -256 0 0 1 \ No newline at end of file diff --git a/apps/gpu/BaselNU/resources/testStreets/Streets2.txt b/apps/gpu/BaselNU/resources/testStreets/Streets2.txt deleted file mode 100644 index 1c297ca830081d311dfe2d3673630e350c03a599..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/testStreets/Streets2.txt +++ /dev/null @@ -1,7 +0,0 @@ -6 - -2 0 256 0 1 - 256 5 0 5 1 - 0 5 0 256 1 - -5 256 -5 5 1 - -5 5 -256 5 1 - -256 0 -2 0 1 diff --git a/apps/gpu/BaselNU/resources/testStreets/Streets3.txt b/apps/gpu/BaselNU/resources/testStreets/Streets3.txt deleted file mode 100644 index eff013edaaa496e1a887fd23bb0c788b5dac635b..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/testStreets/Streets3.txt +++ /dev/null @@ -1,6 +0,0 @@ -5 - 0 0 256 0 1 - 256 5 0 5 1 - 0 5 0 256 1 - -5 256 -5 5 1 - -5 5 -256 5 1 diff --git a/apps/gpu/BaselNU/resources/testStreets/Streets4.txt b/apps/gpu/BaselNU/resources/testStreets/Streets4.txt deleted file mode 100644 index 64aa5c46a64ebabdc56949d124a0081acb86208f..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/testStreets/Streets4.txt +++ /dev/null @@ -1,6 +0,0 @@ -5 - 0 0 256 0 1 - 256 5 0 5 1 - 0 5 0 256 1 - -5 256 -5 5 1 - -256 0 -5 0 1 diff --git a/apps/gpu/BaselNU/resources/testStreets/Streets5.txt b/apps/gpu/BaselNU/resources/testStreets/Streets5.txt deleted file mode 100644 index 64aa5c46a64ebabdc56949d124a0081acb86208f..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/testStreets/Streets5.txt +++ /dev/null @@ -1,6 +0,0 @@ -5 - 0 0 256 0 1 - 256 5 0 5 1 - 0 5 0 256 1 - -5 256 -5 5 1 - -256 0 -5 0 1 diff --git a/apps/gpu/BaselNU/resources/testStreets/Streets6.txt b/apps/gpu/BaselNU/resources/testStreets/Streets6.txt deleted file mode 100644 index 1c297ca830081d311dfe2d3673630e350c03a599..0000000000000000000000000000000000000000 --- a/apps/gpu/BaselNU/resources/testStreets/Streets6.txt +++ /dev/null @@ -1,7 +0,0 @@ -6 - -2 0 256 0 1 - 256 5 0 5 1 - 0 5 0 256 1 - -5 256 -5 5 1 - -5 5 -256 5 1 - -256 0 -2 0 1 diff --git a/apps/gpu/ChannelFlow/CMakeLists.txt b/apps/gpu/ChannelFlow/CMakeLists.txt deleted file mode 100644 index 3aab31339616f98f4f5c14138686fe04ac4e28ae..0000000000000000000000000000000000000000 --- a/apps/gpu/ChannelFlow/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -PROJECT(ChannelFlow LANGUAGES CUDA CXX) - -vf_add_library(BUILDTYPE binary PRIVATE_LINK basics gpu_core GridGenerator FILES ChannelFlow.cpp) - -set_source_files_properties(ChannelFlow.cpp PROPERTIES LANGUAGE CUDA) - -set_target_properties(ChannelFlow PROPERTIES CUDA_SEPARABLE_COMPILATION ON) diff --git a/apps/gpu/ChannelFlow/ChannelFlow.cpp b/apps/gpu/ChannelFlow/ChannelFlow.cpp deleted file mode 100644 index 1d79a27493b1b6a2409e89ecd06e5970c98d54bf..0000000000000000000000000000000000000000 --- a/apps/gpu/ChannelFlow/ChannelFlow.cpp +++ /dev/null @@ -1,253 +0,0 @@ -//======================================================================================= -// ____ ____ __ ______ __________ __ __ __ __ -// \ \ | | | | | _ \ |___ ___| | | | | / \ | | -// \ \ | | | | | |_) | | | | | | | / \ | | -// \ \ | | | | | _ / | | | | | | / /\ \ | | -// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ -// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| -// \ \ | | ________________________________________________________________ -// \ \ | | | ______________________________________________________________| -// \ \| | | | __ __ __ __ ______ _______ -// \ | | |_____ | | | | | | | | | _ \ / _____) -// \ | | _____| | | | | | | | | | | \ \ \_______ -// \ | | | | |_____ | \_/ | | | | |_/ / _____ | -// \ _____| |__| |________| \_______/ |__| |______/ (_______/ -// -// This file is part of VirtualFluids. VirtualFluids is free software: you can -// redistribute it and/or modify it under the terms of the GNU General Public -// License as published by the Free Software Foundation, either version 3 of -// the License, or (at your option) any later version. -// -// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// for more details. -// -// You should have received a copy of the GNU General Public License along -// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. -// -//! \file ChannelFlow.cpp -//! \ingroup Applications -//! \author Anna Wellmann -//======================================================================================= -#include <numeric> -#define _USE_MATH_DEFINES -#include <exception> -#include <filesystem> -#include <fstream> -#include <iostream> -#include <memory> -#include <sstream> -#include <stdexcept> -#include <string> - -////////////////////////////////////////////////////////////////////////// - -#include <basics/DataTypes.h> -#include <basics/PointerDefinitions.h> -#include <basics/StringUtilities/StringUtil.h> -#include <basics/config/ConfigurationFile.h> - -////////////////////////////////////////////////////////////////////////// - -#include "GridGenerator/grid/BoundaryConditions/Side.h" -#include "GridGenerator/grid/GridBuilder/LevelGridBuilder.h" -#include "GridGenerator/grid/GridBuilder/MultipleGridBuilder.h" - -#include "GridGenerator/geometries/Sphere/Sphere.h" -#include "GridGenerator/geometries/TriangularMesh/TriangularMesh.h" -#include "GridGenerator/utilities/communication.h" - -////////////////////////////////////////////////////////////////////////// - -#include "gpu/core/BoundaryConditions/BoundaryConditionFactory.h" -#include "gpu/core/DataStructureInitializer/GridProvider.h" -#include "gpu/core/DataStructureInitializer/GridReaderGenerator/GridGenerator.h" -#include "gpu/core/GPU/CudaMemoryManager.h" -#include "gpu/core/LBM/Simulation.h" -#include "gpu/core/Output/FileWriter.h" -#include "gpu/core/Parameter/Parameter.h" -#include "gpu/core/Kernel/Utilities/KernelTypes.h" - -////////////////////////////////////////////////////////////////////////// - -#include <parallel/MPICommunicator.h> - -int main(int argc, char *argv[]) -{ - try { - ////////////////////////////////////////////////////////////////////////// - // Simulation parameters - ////////////////////////////////////////////////////////////////////////// - - const real channelWidth = 1.0; - const real Re = 10000.0; - const uint nx = 700; // 700 nodes need ~60 GB on A100 (single precision) - const real velocityLB = 0.05; // LB units - - const uint timeStepOut = 10000; - const uint timeStepEnd = 100000; - - ////////////////////////////////////////////////////////////////////////// - // setup simulation parameters (without config file) - ////////////////////////////////////////////////////////////////////////// - - vf::parallel::Communicator &communicator = *vf::parallel::MPICommunicator::getInstance(); - const int numberOfProcesses = communicator.getNumberOfProcesses(); - const auto processID = communicator.getProcessID(); - SPtr<Parameter> para = std::make_shared<Parameter>(numberOfProcesses, processID); - std::vector<uint> devices(10); - std::iota(devices.begin(), devices.end(), 0); - para->setDevices(devices); - para->setMaxDev(communicator.getNumberOfProcesses()); - BoundaryConditionFactory bcFactory = BoundaryConditionFactory(); - - ////////////////////////////////////////////////////////////////////////// - // setup logger - ////////////////////////////////////////////////////////////////////////// - vf::logging::Logger::changeLogPath("output/vflog_process" + - std::to_string(processID) + ".txt"); - vf::logging::Logger::initializeLogger(); - - ////////////////////////////////////////////////////////////////////////// - // create grid - ////////////////////////////////////////////////////////////////////////// - - const real yGridMin = 0.0 * channelWidth; - const real yGridMax = 1.0 * channelWidth; - const real zGridMin = 0.0 * channelWidth; - const real zGridMax = 1.0 * channelWidth; - - real dx = channelWidth / real(nx); - - ////////////////////////////////////////////////////////////////////////// - // compute parameters in lattice units - ////////////////////////////////////////////////////////////////////////// - - const real viscosityLB = (channelWidth / dx) * velocityLB / Re; // LB units - - VF_LOG_INFO("LB parameters:"); - VF_LOG_INFO("velocity LB [dx/dt] = {}", velocityLB); - VF_LOG_INFO("viscosity LB [dx/dt] = {}", viscosityLB); - - ////////////////////////////////////////////////////////////////////////// - // set parameters - ////////////////////////////////////////////////////////////////////////// - - para->setPrintFiles(true); - - para->setVelocityLB(velocityLB); - para->setViscosityLB(viscosityLB); - - para->setVelocityRatio((real)1.0); - para->setDensityRatio((real)1.0); - - para->setTimestepOut(timeStepOut); - para->setTimestepEnd(timeStepEnd); - - para->setOutputPrefix("ChannelFlow"); - para->configureMainKernel(vf::collisionKernel::compressible::K17CompressibleNavierStokes); - - real overlap = (real)8.0 * dx; - - if (numberOfProcesses > 1) { - - ////////////////////////////////////////////////////////////////////////// - // add coarse grids - ////////////////////////////////////////////////////////////////////////// - - real subdomainMinX = channelWidth * processID; - real subdomainMinXoverlap = subdomainMinX; - real subdomainMaxX = subdomainMinX + channelWidth; - real subdomainMaxXoverlap = subdomainMaxX; - - if (processID != 0) - subdomainMinXoverlap -= overlap; - - if (processID != numberOfProcesses - 1) - subdomainMaxXoverlap += overlap; - - auto gridBuilder = std::make_shared<MultipleGridBuilder>(); - - gridBuilder->addCoarseGrid(subdomainMinXoverlap, yGridMin, zGridMin, subdomainMaxXoverlap, yGridMax, - zGridMax, dx); - - ////////////////////////////////////////////////////////////////////////// - // set subdomain dimensions - ////////////////////////////////////////////////////////////////////////// - - gridBuilder->setSubDomainBox( - std::make_shared<BoundingBox>(subdomainMinX, subdomainMaxX, yGridMin, yGridMax, zGridMin, zGridMax)); - - ////////////////////////////////////////////////////////////////////////// - // build grids - ////////////////////////////////////////////////////////////////////////// - - gridBuilder->buildGrids(true); // buildGrids() has to be called before setting the BCs!!!! - - ////////////////////////////////////////////////////////////////////////// - // configure communication neighbors - ////////////////////////////////////////////////////////////////////////// - - if (processID != 0) { - gridBuilder->findCommunicationIndices(CommunicationDirections::MX); - gridBuilder->setCommunicationProcess(CommunicationDirections::MX, processID - 1); - } - - if (processID != numberOfProcesses - 1) { - gridBuilder->findCommunicationIndices(CommunicationDirections::PX); - gridBuilder->setCommunicationProcess(CommunicationDirections::PX, processID + 1); - } - - ////////////////////////////////////////////////////////////////////////// - // set boundary conditions - ////////////////////////////////////////////////////////////////////////// - - gridBuilder->setPeriodicBoundaryCondition(false, false, false); - - if (processID == 0) { - gridBuilder->setVelocityBoundaryCondition(SideType::MX, velocityLB, 0.0, 0.0); - } - if (processID == numberOfProcesses - 1) { - gridBuilder->setPressureBoundaryCondition(SideType::PX, - 0.0); // set pressure boundary condition last - bcFactory.setPressureBoundaryCondition(BoundaryConditionFactory::PressureBC::OutflowNonReflective); - } - gridBuilder->setNoSlipBoundaryCondition(SideType::MY); - gridBuilder->setNoSlipBoundaryCondition(SideType::PY); - gridBuilder->setNoSlipBoundaryCondition(SideType::MZ); - gridBuilder->setNoSlipBoundaryCondition(SideType::PZ); - bcFactory.setNoSlipBoundaryCondition(BoundaryConditionFactory::NoSlipBC::NoSlipCompressible); - bcFactory.setVelocityBoundaryCondition( - BoundaryConditionFactory::VelocityBC::VelocityAndPressureCompressible); - } else { - VF_LOG_CRITICAL("This app has no setup for a single GPU"); - } - - ////////////////////////////////////////////////////////////////////////// - // setup to copy mesh to simulation - ////////////////////////////////////////////////////////////////////////// - - auto cudaMemoryManager = std::make_shared<CudaMemoryManager>(para); - SPtr<GridProvider> gridGenerator = - GridProvider::makeGridGenerator(gridBuilder, para, cudaMemoryManager, communicator); - - ////////////////////////////////////////////////////////////////////////// - // run simulation - ////////////////////////////////////////////////////////////////////////// - - Simulation sim(para, cudaMemoryManager, communicator, *gridGenerator, &bcFactory); - sim.run(); - - } catch (const spdlog::spdlog_ex &ex) { - std::cout << "Log initialization failed: " << ex.what() << std::endl; - } catch (const std::bad_alloc &e) { - VF_LOG_CRITICAL("Bad Alloc: {}", e.what()); - } catch (const std::exception &e) { - VF_LOG_CRITICAL("exception: {}", e.what()); - } catch (...) { - VF_LOG_CRITICAL("Unknown exception!"); - } - - return 0; -} diff --git a/apps/gpu/MusselOyster/CMakeLists.txt b/apps/gpu/MusselOyster/CMakeLists.txt deleted file mode 100644 index 2661a46547eb651c23ce48550e571998d414bc34..0000000000000000000000000000000000000000 --- a/apps/gpu/MusselOyster/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -PROJECT(MusselOyster LANGUAGES CXX) - -vf_add_library(BUILDTYPE binary PRIVATE_LINK basics gpu_core GridGenerator FILES MusselOyster.cpp) diff --git a/apps/gpu/MusselOyster/MusselOyster.cpp b/apps/gpu/MusselOyster/MusselOyster.cpp deleted file mode 100644 index a74b4c8f8d0307ca4db9aa56fb1f8c82b7628e4f..0000000000000000000000000000000000000000 --- a/apps/gpu/MusselOyster/MusselOyster.cpp +++ /dev/null @@ -1,595 +0,0 @@ -#define _USE_MATH_DEFINES -#include <exception> -#include <filesystem> -#include <fstream> -#include <iostream> -#include <math.h> -#include <memory> -#include <sstream> -#include <stdexcept> -#include <string> - -#include "mpi.h" - -////////////////////////////////////////////////////////////////////////// - -#include "basics/DataTypes.h" -#include "basics/PointerDefinitions.h" - -#include "basics/StringUtilities/StringUtil.h" -#include "basics/config/ConfigurationFile.h" -#include <logger/Logger.h> - -////////////////////////////////////////////////////////////////////////// - -#include "GridGenerator/grid/BoundaryConditions/Side.h" -#include "GridGenerator/grid/GridBuilder/LevelGridBuilder.h" -#include "GridGenerator/grid/GridBuilder/MultipleGridBuilder.h" - -#include "geometries/Sphere/Sphere.h" -#include "geometries/TriangularMesh/TriangularMesh.h" - -#include "GridGenerator/io/GridVTKWriter/GridVTKWriter.h" -#include "GridGenerator/io/STLReaderWriter/STLReader.h" -#include "GridGenerator/io/STLReaderWriter/STLWriter.h" -#include "GridGenerator/io/SimulationFileWriter/SimulationFileWriter.h" - -////////////////////////////////////////////////////////////////////////// - -#include "gpu/core/DataStructureInitializer/GridProvider.h" -#include "gpu/core/DataStructureInitializer/GridReaderFiles/GridReader.h" -#include "gpu/core/DataStructureInitializer/GridReaderGenerator/GridGenerator.h" -#include "gpu/core/GPU/CudaMemoryManager.h" -#include "gpu/core/LBM/Simulation.h" -#include "gpu/core/Output/FileWriter.h" -#include "gpu/core/Parameter/Parameter.h" -#include "gpu/core/BoundaryCondtions/BoundaryConditionFactory.h" -#include "gpu/core/Kernel/KernelTypes.h" - -////////////////////////////////////////////////////////////////////////// - -#include "utilities/communication.h" -#include <parallel/MPICommunicator.h> - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// U s e r s e t t i n g s -// -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -// Relative Paths -const std::string outPath("./output/MusselOysterResults/"); -const std::string gridPathParent = "./output/MusselOysterResults/grid/"; -const std::string stlPath("./stl/MusselOyster/"); -const std::string simulationName("MusselOyster"); - -// Tesla 03 -// const std::string outPath("E:/temp/MusselOysterResults/"); -// const std::string gridPathParent = "E:/temp/GridMussel/"; -// const std::string stlPath("C:/Users/Master/Documents/MasterAnna/STL/"); -// const std::string simulationName("MusselOyster"); - -// Phoenix -// const std::string outPath("/work/y0078217/Results/MusselOysterResults/"); -// const std::string gridPathParent = "/work/y0078217/Grids/GridMusselOyster/"; -// const std::string stlPath("/home/y0078217/STL/MusselOyster/"); -// const std::string simulationName("MusselOyster"); - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -void runVirtualFluids(const vf::basics::ConfigurationFile& config) -{ - vf::parallel::Communicator &communicator = *vf::parallel::MPICommunicator::getInstance(); - - auto gridBuilder = std::make_shared<MultipleGridBuilder>(); - - SPtr<Parameter> para = - std::make_shared<Parameter>(communicator.getNumberOfProcesses(), communicator.getProcessID(), &config); - BoundaryConditionFactory bcFactory = BoundaryConditionFactory(); - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - bool useGridGenerator = true; - bool useStreams = true; - bool useLevels = true; - para->useReducedCommunicationAfterFtoC = true; - para->setCalcTurbulenceIntensity(true); - - if (para->getNumprocs() == 1) { - para->useReducedCommunicationAfterFtoC = false; - } - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - 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; // 2.0 - // real dxGrid = (real)1.0; // 1.0 - if (para->getNumprocs() == 8) - dxGrid = 0.5; - real vxLB = (real)0.051; // LB units - real Re = (real)300.0; - real referenceLength = 1.0 / dxGrid; // heightBivalve / dxGrid - real viscosityLB = (vxLB * referenceLength) / Re; - - para->setVelocityLB(vxLB); - para->setViscosityLB(viscosityLB); - para->setVelocityRatio((real)58.82352941); - para->setViscosityRatio((real)0.058823529); - para->setDensityRatio((real)998.0); - - // para->setTimestepOut(1000); - // para->setTimestepEnd(10000); - - para->setCalcDragLift(false); - - para->setOutputPrefix(simulationName); - if (para->getOutputPath() == "output/") {para->setOutputPath(outPath);} - - para->setPrintFiles(true); - std::cout << "Write result files to " << para->getFName() << std::endl; - - para->setUseStreams(useStreams); - para->configureMainKernel(vf::collisionKernel::compressible::K17CompressibleNavierStokes); - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - VF_LOG_INFO("LB parameters:"); - VF_LOG_INFO("velocity LB [dx/dt] = {}", vxLB); - VF_LOG_INFO("viscosity LB [dx/dt] = {}", viscosityLB); - VF_LOG_INFO("dxGrid [-] = {}\n", dxGrid); - - VF_LOG_INFO("world parameters:"); - VF_LOG_INFO("velocity [m/s] = {}", vxLB * para->getVelocityRatio()); - VF_LOG_INFO("viscosity [m^2/s] = {}\n", viscosityLB * para->getViscosityRatio()); - - VF_LOG_INFO("simulation parameters:"); - VF_LOG_INFO("useGridGenerator = {}", useGridGenerator); - VF_LOG_INFO("useStreams = {}", para->getUseStreams()); - VF_LOG_INFO("number of processes = {}", para->getNumprocs()); - VF_LOG_INFO("useReducedCommunicationAfterFtoC = {}", para->useReducedCommunicationAfterFtoC); - VF_LOG_INFO("bivalveType = {}", bivalveType); - VF_LOG_INFO("mainKernel = {}\n", para->getMainKernel()); - - ////////////////////////////////////////////////////////////////////////// - - if (useGridGenerator) { - const real xGridMin = -100.0; // -100.0; - const real xGridMax = 470.0; // alt 540.0 // neu 440 // mit groesserem Level 1 470 - const real yGridMin = 1.0; // 1.0; - const real yGridMax = 350.0; // alt 440.0; // neu 350 - const real zGridMin = -85; // -85; - const real zGridMax = 85.0; // 85; - - // height MUSSEL = 35.0 - // height Oyster = 72.0 - - SPtr<TriangularMesh> bivalveSTL = std::make_shared<TriangularMesh>(stlPath + bivalveType + ".stl"); - SPtr<TriangularMesh> bivalveRef_1_STL = nullptr; - if (useLevels) - bivalveRef_1_STL = std::make_shared<TriangularMesh>(stlPath + bivalveType + "_Level1.stl"); - - if (para->getNumprocs() > 1) { - const uint generatePart = communicator.getProcessID(); - - real overlap = (real)8.0 * dxGrid; - gridBuilder->setNumberOfLayers(10, 8); - - if (communicator.getNumberOfProcesses() == 2) { - const real zSplit = 0.0; // round(((double)bbzp + bbzm) * 0.5); - - if (generatePart == 0) { - gridBuilder->addCoarseGrid(xGridMin, yGridMin, zGridMin, xGridMax, yGridMax, zSplit + overlap, - dxGrid); - } - if (generatePart == 1) { - gridBuilder->addCoarseGrid(xGridMin, yGridMin, zSplit - overlap, xGridMax, yGridMax, zGridMax, - dxGrid); - } - - if (useLevels) { - gridBuilder->addGrid(bivalveRef_1_STL, 1); - } - - gridBuilder->addGeometry(bivalveSTL); - - if (generatePart == 0) { - gridBuilder->setSubDomainBox( - std::make_shared<BoundingBox>(xGridMin, xGridMax, yGridMin, yGridMax, zGridMin, zSplit)); - } - if (generatePart == 1) { - gridBuilder->setSubDomainBox( - std::make_shared<BoundingBox>(xGridMin, xGridMax, yGridMin, yGridMax, zSplit, zGridMax)); - } - - gridBuilder->buildGrids(true); // buildGrids() has to be called before setting the BCs!!!! - - if (generatePart == 0) { - gridBuilder->findCommunicationIndices(CommunicationDirections::PZ); - gridBuilder->setCommunicationProcess(CommunicationDirections::PZ, 1); - } - - if (generatePart == 1) { - gridBuilder->findCommunicationIndices(CommunicationDirections::MZ); - gridBuilder->setCommunicationProcess(CommunicationDirections::MZ, 0); - } - - gridBuilder->setPeriodicBoundaryCondition(false, false, false); - ////////////////////////////////////////////////////////////////////////// - if (generatePart == 0) - gridBuilder->setVelocityBoundaryCondition(SideType::MZ, vxLB, 0.0, 0.0); - if (generatePart == 1) - gridBuilder->setVelocityBoundaryCondition(SideType::PZ, vxLB, 0.0, 0.0); - 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::GEOMETRY, 0.0, 0.0, 0.0); - gridBuilder->setPressureBoundaryCondition(SideType::PX, 0.0); // set pressure BC after velocity BCs - ////////////////////////////////////////////////////////////////////////// - } else if (communicator.getNumberOfProcesses() == 4) { - - const real xSplit = 100.0; - const real zSplit = 0.0; - - if (generatePart == 0) { - gridBuilder->addCoarseGrid(xGridMin, yGridMin, zGridMin, xSplit + overlap, yGridMax, - zSplit + overlap, dxGrid); - } - if (generatePart == 1) { - gridBuilder->addCoarseGrid(xSplit - overlap, yGridMin, zGridMin, xGridMax, yGridMax, - zSplit + overlap, dxGrid); - } - if (generatePart == 2) { - gridBuilder->addCoarseGrid(xGridMin, yGridMin, zSplit - overlap, xSplit + overlap, yGridMax, - zGridMax, dxGrid); - } - if (generatePart == 3) { - gridBuilder->addCoarseGrid(xSplit - overlap, yGridMin, zSplit - overlap, xGridMax, yGridMax, - zGridMax, dxGrid); - } - - if (useLevels) { - gridBuilder->addGrid(bivalveRef_1_STL, 1); - } - - gridBuilder->addGeometry(bivalveSTL); - - if (generatePart == 0) - gridBuilder->setSubDomainBox( - std::make_shared<BoundingBox>(xGridMin, xSplit, yGridMin, yGridMax, zGridMin, zSplit)); - if (generatePart == 1) - gridBuilder->setSubDomainBox( - std::make_shared<BoundingBox>(xSplit, xGridMax, yGridMin, yGridMax, zGridMin, zSplit)); - if (generatePart == 2) - gridBuilder->setSubDomainBox( - std::make_shared<BoundingBox>(xGridMin, xSplit, yGridMin, yGridMax, zSplit, zGridMax)); - if (generatePart == 3) - gridBuilder->setSubDomainBox( - std::make_shared<BoundingBox>(xSplit, xGridMax, yGridMin, yGridMax, zSplit, zGridMax)); - - gridBuilder->buildGrids(true); // buildGrids() has to be called before setting the BCs!!!! - - if (generatePart == 0) { - gridBuilder->findCommunicationIndices(CommunicationDirections::PX); - gridBuilder->setCommunicationProcess(CommunicationDirections::PX, 1); - gridBuilder->findCommunicationIndices(CommunicationDirections::PZ); - gridBuilder->setCommunicationProcess(CommunicationDirections::PZ, 2); - } - if (generatePart == 1) { - gridBuilder->findCommunicationIndices(CommunicationDirections::MX); - gridBuilder->setCommunicationProcess(CommunicationDirections::MX, 0); - gridBuilder->findCommunicationIndices(CommunicationDirections::PZ); - gridBuilder->setCommunicationProcess(CommunicationDirections::PZ, 3); - } - if (generatePart == 2) { - gridBuilder->findCommunicationIndices(CommunicationDirections::PX); - gridBuilder->setCommunicationProcess(CommunicationDirections::PX, 3); - gridBuilder->findCommunicationIndices(CommunicationDirections::MZ); - gridBuilder->setCommunicationProcess(CommunicationDirections::MZ, 0); - } - if (generatePart == 3) { - gridBuilder->findCommunicationIndices(CommunicationDirections::MX); - gridBuilder->setCommunicationProcess(CommunicationDirections::MX, 2); - gridBuilder->findCommunicationIndices(CommunicationDirections::MZ); - gridBuilder->setCommunicationProcess(CommunicationDirections::MZ, 1); - } - - gridBuilder->setPeriodicBoundaryCondition(false, false, false); - ////////////////////////////////////////////////////////////////////////// - if (generatePart == 0) { - gridBuilder->setVelocityBoundaryCondition(SideType::MZ, vxLB, 0.0, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::MX, vxLB, 0.0, 0.0); - } - if (generatePart == 2) { - gridBuilder->setVelocityBoundaryCondition(SideType::MX, 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->setVelocityBoundaryCondition(SideType::MY, 0.0, 0.0, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::PY, vxLB, 0.0, 0.0); - if (generatePart == 3) { - gridBuilder->setVelocityBoundaryCondition(SideType::PZ, vxLB, 0.0, 0.0); - gridBuilder->setPressureBoundaryCondition(SideType::PX, 0.0); // set pressure BC after velocity BCs - } - if (generatePart == 1) { - gridBuilder->setVelocityBoundaryCondition(SideType::MZ, vxLB, 0.0, 0.0); - gridBuilder->setPressureBoundaryCondition(SideType::PX, 0.0); // set pressure BC after velocity BCs - } - ////////////////////////////////////////////////////////////////////////// - } else if (communicator.getNumberOfProcesses() == 8) { - real xSplit = 140.0; // 100.0 // mit groesserem Level 1 140.0 - real ySplit = 32.0; // 32.0 - real zSplit = 0.0; - - if (generatePart == 0) { - gridBuilder->addCoarseGrid(xGridMin, yGridMin, zGridMin, xSplit + overlap, ySplit + overlap, - zSplit + overlap, dxGrid); - } - if (generatePart == 1) { - gridBuilder->addCoarseGrid(xGridMin, ySplit - overlap, zGridMin, xSplit + overlap, yGridMax, - zSplit + overlap, dxGrid); - } - if (generatePart == 2) { - gridBuilder->addCoarseGrid(xSplit - overlap, yGridMin, zGridMin, xGridMax, ySplit + overlap, - zSplit + overlap, dxGrid); - } - if (generatePart == 3) { - gridBuilder->addCoarseGrid(xSplit - overlap, ySplit - overlap, zGridMin, xGridMax, yGridMax, - zSplit + overlap, dxGrid); - } - if (generatePart == 4) { - gridBuilder->addCoarseGrid(xGridMin, yGridMin, zSplit - overlap, xSplit + overlap, ySplit + overlap, - zGridMax, dxGrid); - } - if (generatePart == 5) { - gridBuilder->addCoarseGrid(xGridMin, ySplit - overlap, zSplit - overlap, xSplit + overlap, yGridMax, - zGridMax, dxGrid); - } - if (generatePart == 6) { - gridBuilder->addCoarseGrid(xSplit - overlap, yGridMin, zSplit - overlap, xGridMax, ySplit + overlap, - zGridMax, dxGrid); - } - if (generatePart == 7) { - gridBuilder->addCoarseGrid(xSplit - overlap, ySplit - overlap, zSplit - overlap, xGridMax, yGridMax, - zGridMax, dxGrid); - } - - if (useLevels) { - gridBuilder->addGrid(bivalveRef_1_STL, 1); - } - - gridBuilder->addGeometry(bivalveSTL); - - if (generatePart == 0) - gridBuilder->setSubDomainBox( - std::make_shared<BoundingBox>(xGridMin, xSplit, yGridMin, ySplit, zGridMin, zSplit)); - if (generatePart == 1) - gridBuilder->setSubDomainBox( - std::make_shared<BoundingBox>(xGridMin, xSplit, ySplit, yGridMax, zGridMin, zSplit)); - if (generatePart == 2) - gridBuilder->setSubDomainBox( - std::make_shared<BoundingBox>(xSplit, xGridMax, yGridMin, ySplit, zGridMin, zSplit)); - if (generatePart == 3) - gridBuilder->setSubDomainBox( - std::make_shared<BoundingBox>(xSplit, xGridMax, ySplit, yGridMax, zGridMin, zSplit)); - if (generatePart == 4) - gridBuilder->setSubDomainBox( - std::make_shared<BoundingBox>(xGridMin, xSplit, yGridMin, ySplit, zSplit, zGridMax)); - if (generatePart == 5) - gridBuilder->setSubDomainBox( - std::make_shared<BoundingBox>(xGridMin, xSplit, ySplit, yGridMax, zSplit, zGridMax)); - if (generatePart == 6) - gridBuilder->setSubDomainBox( - std::make_shared<BoundingBox>(xSplit, xGridMax, yGridMin, ySplit, zSplit, zGridMax)); - if (generatePart == 7) - gridBuilder->setSubDomainBox( - std::make_shared<BoundingBox>(xSplit, xGridMax, ySplit, yGridMax, zSplit, zGridMax)); - - gridBuilder->buildGrids(true); // buildGrids() has to be called before setting the BCs!!!! - gridBuilder->setPeriodicBoundaryCondition(false, false, false); - - if (generatePart == 0) { - gridBuilder->findCommunicationIndices(CommunicationDirections::PY); - gridBuilder->setCommunicationProcess(CommunicationDirections::PY, 1); - gridBuilder->findCommunicationIndices(CommunicationDirections::PX); - gridBuilder->setCommunicationProcess(CommunicationDirections::PX, 2); - gridBuilder->findCommunicationIndices(CommunicationDirections::PZ); - gridBuilder->setCommunicationProcess(CommunicationDirections::PZ, 4); - } - if (generatePart == 1) { - gridBuilder->findCommunicationIndices(CommunicationDirections::MY); - gridBuilder->setCommunicationProcess(CommunicationDirections::MY, 0); - gridBuilder->findCommunicationIndices(CommunicationDirections::PX); - gridBuilder->setCommunicationProcess(CommunicationDirections::PX, 3); - gridBuilder->findCommunicationIndices(CommunicationDirections::PZ); - gridBuilder->setCommunicationProcess(CommunicationDirections::PZ, 5); - } - if (generatePart == 2) { - gridBuilder->findCommunicationIndices(CommunicationDirections::PY); - gridBuilder->setCommunicationProcess(CommunicationDirections::PY, 3); - gridBuilder->findCommunicationIndices(CommunicationDirections::MX); - gridBuilder->setCommunicationProcess(CommunicationDirections::MX, 0); - gridBuilder->findCommunicationIndices(CommunicationDirections::PZ); - gridBuilder->setCommunicationProcess(CommunicationDirections::PZ, 6); - } - if (generatePart == 3) { - gridBuilder->findCommunicationIndices(CommunicationDirections::MY); - gridBuilder->setCommunicationProcess(CommunicationDirections::MY, 2); - gridBuilder->findCommunicationIndices(CommunicationDirections::MX); - gridBuilder->setCommunicationProcess(CommunicationDirections::MX, 1); - gridBuilder->findCommunicationIndices(CommunicationDirections::PZ); - gridBuilder->setCommunicationProcess(CommunicationDirections::PZ, 7); - } - if (generatePart == 4) { - gridBuilder->findCommunicationIndices(CommunicationDirections::PY); - gridBuilder->setCommunicationProcess(CommunicationDirections::PY, 5); - gridBuilder->findCommunicationIndices(CommunicationDirections::PX); - gridBuilder->setCommunicationProcess(CommunicationDirections::PX, 6); - gridBuilder->findCommunicationIndices(CommunicationDirections::MZ); - gridBuilder->setCommunicationProcess(CommunicationDirections::MZ, 0); - } - if (generatePart == 5) { - gridBuilder->findCommunicationIndices(CommunicationDirections::MY); - gridBuilder->setCommunicationProcess(CommunicationDirections::MY, 4); - gridBuilder->findCommunicationIndices(CommunicationDirections::PX); - gridBuilder->setCommunicationProcess(CommunicationDirections::PX, 7); - gridBuilder->findCommunicationIndices(CommunicationDirections::MZ); - gridBuilder->setCommunicationProcess(CommunicationDirections::MZ, 1); - } - if (generatePart == 6) { - gridBuilder->findCommunicationIndices(CommunicationDirections::PY); - gridBuilder->setCommunicationProcess(CommunicationDirections::PY, 7); - gridBuilder->findCommunicationIndices(CommunicationDirections::MX); - gridBuilder->setCommunicationProcess(CommunicationDirections::MX, 4); - gridBuilder->findCommunicationIndices(CommunicationDirections::MZ); - gridBuilder->setCommunicationProcess(CommunicationDirections::MZ, 2); - } - if (generatePart == 7) { - gridBuilder->findCommunicationIndices(CommunicationDirections::MY); - gridBuilder->setCommunicationProcess(CommunicationDirections::MY, 6); - gridBuilder->findCommunicationIndices(CommunicationDirections::MX); - gridBuilder->setCommunicationProcess(CommunicationDirections::MX, 5); - gridBuilder->findCommunicationIndices(CommunicationDirections::MZ); - gridBuilder->setCommunicationProcess(CommunicationDirections::MZ, 3); - } - - ////////////////////////////////////////////////////////////////////////// - if (generatePart == 0) { - gridBuilder->setVelocityBoundaryCondition(SideType::MX, vxLB, 0.0, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::MY, 0.0, 0.0, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::MZ, vxLB, 0.0, 0.0); - } - if (generatePart == 1) { - gridBuilder->setVelocityBoundaryCondition(SideType::MX, vxLB, 0.0, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::PY, vxLB, 0.0, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::MZ, vxLB, 0.0, 0.0); - } - if (generatePart == 2) { - gridBuilder->setVelocityBoundaryCondition(SideType::MY, 0.0, 0.0, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::MZ, vxLB, 0.0, 0.0); - gridBuilder->setPressureBoundaryCondition(SideType::PX, 0.0); // set pressure BC after velocity BCs - } - if (generatePart == 3) { - gridBuilder->setVelocityBoundaryCondition(SideType::PY, vxLB, 0.0, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::MZ, vxLB, 0.0, 0.0); - gridBuilder->setPressureBoundaryCondition(SideType::PX, 0.0); // set pressure BC after velocity BCs - } - if (generatePart == 4) { - gridBuilder->setVelocityBoundaryCondition(SideType::MX, vxLB, 0.0, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::MY, 0.0, 0.0, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::PZ, vxLB, 0.0, 0.0); - } - if (generatePart == 5) { - gridBuilder->setVelocityBoundaryCondition(SideType::MX, vxLB, 0.0, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::PY, vxLB, 0.0, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::PZ, vxLB, 0.0, 0.0); - } - if (generatePart == 6) { - gridBuilder->setVelocityBoundaryCondition(SideType::MY, 0.0, 0.0, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::PZ, vxLB, 0.0, 0.0); - gridBuilder->setPressureBoundaryCondition(SideType::PX, 0.0); // set pressure BC after velocity BCs - } - if (generatePart == 7) { - gridBuilder->setVelocityBoundaryCondition(SideType::PY, vxLB, 0.0, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::PZ, vxLB, 0.0, 0.0); - gridBuilder->setPressureBoundaryCondition(SideType::PX, 0.0); // set pressure BC after velocity BCs - } - // gridBuilder->setVelocityBoundaryCondition(SideType::GEOMETRY, 0.0, 0.0, 0.0); - ////////////////////////////////////////////////////////////////////////// - } - - // gridBuilder->writeGridsToVtk(outPath + bivalveType + "/grid/part" + std::to_string(generatePart) + "_"); - // gridBuilder->writeArrows(outPath + bivalveType + "/" + std::to_string(generatePart) + " /arrow"); - // SimulationFileWriter::write(gridPath + std::to_string(generatePart) + "/", gridBuilder, - // FILEFORMAT::BINARY); - } else { - - gridBuilder->addCoarseGrid(xGridMin, yGridMin, zGridMin, xGridMax, yGridMax, zGridMax, dxGrid); - - if (useLevels) { - gridBuilder->setNumberOfLayers(10, 8); - gridBuilder->addGrid(bivalveRef_1_STL, 1); - } - - gridBuilder->addGeometry(bivalveSTL); - - gridBuilder->buildGrids(true); // buildGrids() has to be called before setting the BCs!!!! - - gridBuilder->setPeriodicBoundaryCondition(false, false, false); - ////////////////////////////////////////////////////////////////////////// - gridBuilder->setVelocityBoundaryCondition(SideType::MX, vxLB, 0.0, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::PY, vxLB, 0.0, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::MY, 0.0, 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 - - ////////////////////////////////////////////////////////////////////////// - - // gridBuilder->writeGridsToVtk(outPath + bivalveType + "/grid/"); - // gridBuilder->writeArrows ((outPath + bivalveType + "/arrow"); - - SimulationFileWriter::write(gridPath, gridBuilder, FILEFORMAT::BINARY); - } - - bcFactory.setVelocityBoundaryCondition(BoundaryConditionFactory::VelocityBC::VelocityAndPressureCompressible); - bcFactory.setPressureBoundaryCondition(BoundaryConditionFactory::PressureBC::OutflowNonReflective); - bcFactory.setGeometryBoundaryCondition(BoundaryConditionFactory::NoSlipBC::NoSlipCompressible); - } - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - auto cudaMemoryManager = std::make_shared<CudaMemoryManager>(para); - - SPtr<GridProvider> gridGenerator; - if (useGridGenerator) - gridGenerator = GridProvider::makeGridGenerator(gridBuilder, para, cudaMemoryManager, communicator); - else { - gridGenerator = GridProvider::makeGridReader(FILEFORMAT::BINARY, para, cudaMemoryManager); - } - - Simulation sim(para, cudaMemoryManager, communicator, *gridGenerator, &bcFactory); - sim.run(); - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -} - -int main(int argc, char *argv[]) -{ - if (argc > 1) { - - try { - VF_LOG_TRACE("For the default config path to work, execute the app from the project root."); - vf::basics::ConfigurationFile config = vf::basics::loadConfig(argc, argv, "./apps/gpu/MusselOyster/configMusselOyster.txt"); - runVirtualFluids(config); - - ////////////////////////////////////////////////////////////////////////// - } catch (const spdlog::spdlog_ex &ex) { - std::cout << "Log initialization failed: " << ex.what() << std::endl; - } catch (const std::bad_alloc &e) { - VF_LOG_CRITICAL("Bad Alloc: {}", e.what()); - } catch (const std::exception &e) { - VF_LOG_CRITICAL("exception: {}", e.what()); - } catch (...) { - VF_LOG_CRITICAL("Unknown exception!"); - } - } - return 0; -} diff --git a/apps/gpu/MusselOyster/configMusselOyster.txt b/apps/gpu/MusselOyster/configMusselOyster.txt deleted file mode 100644 index ac4208ab273bbcfdf545c1bbfa258817d82cbbee..0000000000000000000000000000000000000000 --- a/apps/gpu/MusselOyster/configMusselOyster.txt +++ /dev/null @@ -1,50 +0,0 @@ -# Tesla 03 -# mpiexec -n 2 "C:/Users/Master/Documents/MasterAnna/VirtualFluids_dev/build/bin/Release/MusselOyster.exe" "C:/Users/Master/Documents/MasterAnna/VirtualFluids_dev/apps/gpu/MusselOyster/configMusselOyster.txt" -# Phoenix -# mpirun -np 2 "./VirtualFluids_dev/build/bin/MusselOyster" "./VirtualFluids_dev/apps/gpu/MusselOyster/configMusselOyster.txt" - -# Phoenix mpich -# mpirun -np 4 nvprof -f -o MusselOyster.%q{PMI_RANK}.nvprof "./VirtualFluids_dev/build/bin/MusselOyster" "./VirtualFluids_dev/apps/gpu/SphereMultiGPU/configPhoenix4GPU.txt" -# Phoenix openmpi -# mpirun -np 4 nvprof -f -o MusselOyster.%q{OMPI_COMM_WORLD_RANK}.nvprof "./VirtualFluids_dev/build/bin/MusselOyster" "./VirtualFluids_dev/apps/gpu/SphereMultiGPU/configPhoenix4GPU.txt" - -# Aragorn - ./bin/MusselOyster "../apps/gpu/MusselOyster/configMusselOyster.txt" - -################################################## -#GPU Mapping -################################################## -Devices="0 1 2 3" -NumberOfDevices=2 - -################################################## -#informations for Writing -################################################## -#Path=/work/y0078217/Results/MusselOysterResults/ -Path=./output/MusselOysterResults/ -#Prefix="MusselOyster" -#WriteGrid=true -################################################## -#informations for reading -################################################## -#GridPath=E:/work/y0078217/Grids/GridMusselOyster/ -GridPath=./output/MusselOysterResults/grid/ -#GridPath="C:" - -################################################## -#number of grid levels -################################################## -#NOGL=1 - -################################################## -#LBM Version -################################################## -#D3Qxx=27 -#MainKernelName=K17CompressibleNavierStokes - -################################################## -#simulation parameter -################################################## -TimeEnd=200000 -TimeOut=10000 -#TimeStartOut=0 \ No newline at end of file diff --git a/apps/gpu/MusselOyster/configPhoenix1GPU.txt b/apps/gpu/MusselOyster/configPhoenix1GPU.txt deleted file mode 100644 index 0f48e6f2cf60369aaf5a1e9116dcc8ffdda84297..0000000000000000000000000000000000000000 --- a/apps/gpu/MusselOyster/configPhoenix1GPU.txt +++ /dev/null @@ -1,36 +0,0 @@ -################################################## -#GPU Mapping -################################################## -Devices="0" -NumberOfDevices=1 - -################################################## -#informations for Writing -################################################## -Path=/work/y0078217/Results/MusselOysterResults/1GPUMussel1/ -#Path="F:/Work/Computations/out/MusselOyster/" -#Prefix="MusselOyster" -#WriteGrid=true -################################################## -#informations for reading -################################################## -GridPath=/work/y0078217/Grids/GridMusselOyster/Mussel1GPU/ -#GridPath="C:" - -################################################## -#number of grid levels -################################################## -#NOGL=1 - -################################################## -#LBM Version -################################################## -#D3Qxx=27 -#MainKernelName=K17CompressibleNavierStokes - -################################################## -#simulation parameter -################################################## -TimeEnd=10000 #400000 / 200000 -TimeOut=5000 #200000 / 100000 -#TimeStartOut=0 \ No newline at end of file diff --git a/apps/gpu/MusselOyster/configPhoenix8GPU.txt b/apps/gpu/MusselOyster/configPhoenix8GPU.txt deleted file mode 100644 index 97b1125a788b79fe4ebef5ed67abb65b6fbbfbfc..0000000000000000000000000000000000000000 --- a/apps/gpu/MusselOyster/configPhoenix8GPU.txt +++ /dev/null @@ -1,42 +0,0 @@ -################################################## -#GPU Mapping -################################################## -Devices="0 1 2 3" -NumberOfDevices=4 - -################################################## -#informations for Writing -################################################## -#Path=/work/y0078217/Results/MusselOysterResults/8GPUOyster05/ -#Path="F:/Work/Computations/out/MusselOyster/" -#Prefix="MusselOyster" -#WriteGrid=true -################################################## -#informations for reading -################################################## -#GridPath=/work/y0078217/Grids/GridMusselOyster/Oyster8GPU/ -#GridPath="C:" - -################################################## -#number of grid levels -################################################## -#NOGL=1 - -################################################## -#LBM Version -################################################## -#D3Qxx=27 -#MainKernelName=K17CompressibleNavierStokes - -################################################## -#simulation parameter -################################################## -TimeEnd=100000 # 800000 -TimeOut=10000 # 400000 -#TimeStartOut=0 - -################################################## -# CUDA Streams and optimized communication (only used for multiple GPUs) -################################################## -useStreams = true -useReducedCommunicationInInterpolation = true \ No newline at end of file diff --git a/apps/gpu/TGV_3D/TGV_3D.cpp b/apps/gpu/TGV_3D/TGV_3D.cpp index f2dcbaac0ecf185b03664bcbbc6796febb471703..d04ba98376a7f282974a89636905795262371e69 100644 --- a/apps/gpu/TGV_3D/TGV_3D.cpp +++ b/apps/gpu/TGV_3D/TGV_3D.cpp @@ -111,11 +111,11 @@ bool cmdOptionExists(char** begin, char** end, const std::string& option) //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// -real Re = 1600.0; +real reynoldsNumber = 1600.0; uint dtPerL = 250; -uint nx = 64; +uint numberOfNodesX = 64; uint gpuIndex = 0; bool useLimiter = false; @@ -143,22 +143,22 @@ void multipleLevel(const std::string& configPath) const real PI = 3.141592653589793238462643383279; - real L = nx / ( 2.0 * PI ); + real length = numberOfNodesX / ( 2.0 * PI ); - const real velocity = 64.0 / ( dtPerL * 2.0 * PI ); + const real velocityLB = 64.0 / ( dtPerL * 2.0 * PI ); - const real viscosity = nx / ( 2.0 * PI ) * velocity / Re; + const real viscosityLB = numberOfNodesX / ( 2.0 * PI ) * velocityLB / reynoldsNumber; - VF_LOG_INFO("velocity = {}", velocity); - VF_LOG_INFO("viscosity = {}", viscosity); + VF_LOG_INFO("velocity = {}", velocityLB); + VF_LOG_INFO("viscosity = {}", viscosityLB); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - real dx = 2.0 * PI / real(nx); + real deltaX = 2.0 * PI / real(numberOfNodesX); auto gridBuilder = std::make_shared<MultipleGridBuilder>(); gridBuilder->addCoarseGrid(-PI, -PI, -PI, - PI, PI, PI, dx); + PI, PI, PI, deltaX); gridBuilder->setPeriodicBoundaryCondition(true, true, true); @@ -205,7 +205,7 @@ void multipleLevel(const std::string& configPath) std::stringstream _simulationName; _simulationName << simulationName; - _simulationName << "_nx_" << nx; + _simulationName << "_nx_" << numberOfNodesX; _simulationName << "_dtPerL_" << dtPerL << "_"; simulationName = _simulationName.str(); @@ -222,14 +222,14 @@ void multipleLevel(const std::string& configPath) para->setPrintFiles(true); - para->setTimestepEnd( 40 * lround(L/velocity) ); - para->setTimestepOut( 5 * lround(L/velocity) ); + para->setTimestepEnd( 40 * lround(length/velocityLB) ); + para->setTimestepOut( 5 * lround(length/velocityLB) ); - para->setVelocityLB( velocity ); + para->setVelocityLB( velocityLB ); - para->setViscosityLB( viscosity ); + para->setViscosityLB( viscosityLB ); - para->setVelocityRatio( 1.0 / velocity ); + para->setVelocityRatio( 1.0 / velocityLB ); para->setInitialCondition( [&]( real coordX, real coordY, real coordZ, real& rho, real& vx, real& vy, real& vz){ @@ -237,9 +237,9 @@ void multipleLevel(const std::string& configPath) real b = 1.0; real c = 1.0; - rho = 3.0 * ((velocity * velocity) / 16.0 * ( cos( 2.0 * a * coordX ) + cos( 2.0 * b * coordY ) ) * ( cos( 2.0 * c * coordZ ) + 2.0 ) ); - vx = velocity * sin( a * coordX ) * cos( b * coordY ) * cos( c * coordZ ); - vy = -velocity * cos( a * coordX ) * sin( b * coordY ) * cos( c * coordZ ); + rho = 3.0 * ((velocityLB * velocityLB) / 16.0 * ( cos( 2.0 * a * coordX ) + cos( 2.0 * b * coordY ) ) * ( cos( 2.0 * c * coordZ ) + 2.0 ) ); + vx = velocityLB * sin( a * coordX ) * cos( b * coordY ) * cos( c * coordZ ); + vy = -velocityLB * cos( a * coordX ) * sin( b * coordY ) * cos( c * coordZ ); vz = 0.0; } ); @@ -292,10 +292,10 @@ int main( int argc, char* argv[]) ////////////////////////////////////////////////////////////////////////// if( cmdOptionExists( argv, argv+argc, "--Re" ) ) - Re = atof( getCmdOption( argv, argv+argc, "--Re" ) ); + reynoldsNumber = atof( getCmdOption( argv, argv+argc, "--Re" ) ); if( cmdOptionExists( argv, argv+argc, "--nx" ) ) - nx = atoi( getCmdOption( argv, argv+argc, "--nx" ) ); + numberOfNodesX = atoi( getCmdOption( argv, argv+argc, "--nx" ) ); if( cmdOptionExists( argv, argv+argc, "--dtPerL" ) ) dtPerL = atoi( getCmdOption( argv, argv+argc, "--dtPerL" ) ); @@ -309,7 +309,7 @@ int main( int argc, char* argv[]) if( cmdOptionExists( argv, argv+argc, "--useLimiter" ) ) useLimiter = true; - multipleLevel(targetPath + "config.txt"); + multipleLevel(targetPath + "tgv3d.cfg"); ////////////////////////////////////////////////////////////////////////// } diff --git a/apps/gpu/TGV_3D/config.txt b/apps/gpu/TGV_3D/tgv3d.cfg similarity index 100% rename from apps/gpu/TGV_3D/config.txt rename to apps/gpu/TGV_3D/tgv3d.cfg diff --git a/apps/gpu/TGV_3D_GridRef/CMakeLists.txt b/apps/gpu/TGV_3D_GridRef/CMakeLists.txt deleted file mode 100644 index 92e125b2d4a1b9239a91a6086bc0b6ec005e0f54..0000000000000000000000000000000000000000 --- a/apps/gpu/TGV_3D_GridRef/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -PROJECT(TGV_3D_GridRef LANGUAGES CUDA CXX) - -vf_add_library(BUILDTYPE binary PRIVATE_LINK basics gpu_core GridGenerator FILES TGV_3D_GridRef.cpp) - -set_source_files_properties(TGV_3D_GridRef.cpp PROPERTIES LANGUAGE CUDA) - -set_target_properties(TGV_3D_GridRef PROPERTIES CUDA_SEPARABLE_COMPILATION ON) \ No newline at end of file diff --git a/apps/gpu/TGV_3D_GridRef/TGV_3D_GridRef.cpp b/apps/gpu/TGV_3D_GridRef/TGV_3D_GridRef.cpp deleted file mode 100644 index 811bd468e0aa9ba43857a4e38435492e7268f893..0000000000000000000000000000000000000000 --- a/apps/gpu/TGV_3D_GridRef/TGV_3D_GridRef.cpp +++ /dev/null @@ -1,375 +0,0 @@ -//======================================================================================= -// ____ ____ __ ______ __________ __ __ __ __ -// \ \ | | | | | _ \ |___ ___| | | | | / \ | | -// \ \ | | | | | |_) | | | | | | | / \ | | -// \ \ | | | | | _ / | | | | | | / /\ \ | | -// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ -// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| -// \ \ | | ________________________________________________________________ -// \ \ | | | ______________________________________________________________| -// \ \| | | | __ __ __ __ ______ _______ -// \ | | |_____ | | | | | | | | | _ \ / _____) -// \ | | _____| | | | | | | | | | | \ \ \_______ -// \ | | | | |_____ | \_/ | | | | |_/ / _____ | -// \ _____| |__| |________| \_______/ |__| |______/ (_______/ -// -// This file is part of VirtualFluids. VirtualFluids is free software: you can -// redistribute it and/or modify it under the terms of the GNU General Public -// License as published by the Free Software Foundation, either version 3 of -// the License, or (at your option) any later version. -// -// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// for more details. -// -// You should have received a copy of the GNU General Public License along -// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. -// -//! \file TGV_3D.cpp -//! \ingroup Applications -//! \author Martin Schoenherr -//======================================================================================= -#define _USE_MATH_DEFINES -#include <exception> -#include <filesystem> -#include <fstream> -#include <iostream> -#include <math.h> -#include <memory> -#include <sstream> -#include <stdexcept> -#include <string> - -#include "mpi.h" - -////////////////////////////////////////////////////////////////////////// - -#include <basics/DataTypes.h> -#include <basics/PointerDefinitions.h> -#include <basics/config/ConfigurationFile.h> - -#include <logger/Logger.h> - -////////////////////////////////////////////////////////////////////////// - -#include "GridGenerator/geometries/Conglomerate/Conglomerate.h" -#include "GridGenerator/geometries/TriangularMesh/TriangularMesh.h" -#include "GridGenerator/grid/BoundaryConditions/BoundaryCondition.h" -#include "GridGenerator/grid/BoundaryConditions/Side.h" -#include "GridGenerator/grid/GridBuilder/LevelGridBuilder.h" -#include "GridGenerator/grid/GridBuilder/MultipleGridBuilder.h" -#include "GridGenerator/grid/GridFactory.h" - -#include "GridGenerator/io/GridVTKWriter/GridVTKWriter.h" -#include "GridGenerator/io/STLReaderWriter/STLReader.h" -#include "GridGenerator/io/STLReaderWriter/STLWriter.h" -#include "GridGenerator/io/SimulationFileWriter/SimulationFileWriter.h" - -////////////////////////////////////////////////////////////////////////// - -#include "parallel/MpiCommunicator.h" -#include "gpu/core/DataStructureInitializer/GridProvider.h" -#include "gpu/core/DataStructureInitializer/GridReaderFiles/GridReader.h" -#include "gpu/core/DataStructureInitializer/GridReaderGenerator/GridGenerator.h" -#include "gpu/core/BoundaryConditions/BoundaryConditionFactory.h" -#include "gpu/core/GridScaling/GridScalingFactory.h" -#include "gpu/core/GPU/CudaMemoryManager.h" -#include "gpu/core/LBM/Simulation.h" -#include "gpu/core/Output/FileWriter.h" -#include "gpu/core/Parameter/Parameter.h" -#include "gpu/core/Kernel/KernelTypes.h" - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// U s e r s e t t i n g s -// -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// from https://stackoverflow.com/questions/865668/how-to-parse-command-line-arguments-in-c -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - -char* getCmdOption(char ** begin, char ** end, const std::string & option) -{ - char ** itr = std::find(begin, end, option); - if (itr != end && ++itr != end) - { - return *itr; - } - return 0; -} - -bool cmdOptionExists(char** begin, char** end, const std::string& option) -{ - return std::find(begin, end, option) != end; -} - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////// -real Re = 1600.0; - -uint dtPerL = 500; - -uint nx = 64; -uint gpuIndex = 0; - -bool useLimiter = false; - -std::string kernel(vf::collisionKernel::compressible::K17CompressibleNavierStokes); - -std::string path("D:/out/TGV_3D/"); //MOLLOK - -std::string simulationName("TGV_3D_Gridref_noSqPress"); -////////////////////////////////////////////////////////////////////////// - -void multipleLevel(const std::string& configPath) -{ - //vf::gpu::Communicator& communicator = vf::gpu::MpiCommunicator::getInstance(); - vf::parallel::Communicator &communicator = *vf::parallel::MPICommunicator::getInstance(); - - vf::basics::ConfigurationFile config; - config.load(configPath); - SPtr<Parameter> para = std::make_shared<Parameter>(communicator.getNumberOfProcesses(), communicator.getProcessID(), &config); - BoundaryConditionFactory bcFactory = BoundaryConditionFactory(); - GridScalingFactory scalingFactory = GridScalingFactory(); - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - const real PI = 3.141592653589793238462643383279; - - real L = nx / ( 2.0 * PI ); - - const real velocity = 64.0 / ( dtPerL * 2.0 * PI ); - - const real viscosity = nx / ( 2.0 * PI ) * velocity / Re; - - VF_LOG_INFO("velocity = {}", velocity); - VF_LOG_INFO("viscosity = {}", viscosity); - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - auto gridBuilder = std::make_shared<MultipleGridBuilder>(); - - real dx = 2.0 * PI / real(nx); - - gridBuilder->addCoarseGrid(-PI, -PI, -PI, - PI, PI, PI, dx); - - gridBuilder->setNumberOfLayers(0, 0); - - auto fineGrid = std::make_shared<Cuboid>(-PI * 0.5, -PI * 0.5, -PI * 0.5, - 0.0, PI * 0.5, 0.0); - - gridBuilder->addGrid(fineGrid, 1); - - gridBuilder->setPeriodicBoundaryCondition(true, true, true); - - gridBuilder->buildGrids(true); // buildGrids() has to be called before setting the BCs!!!! - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - scalingFactory.setScalingFactory(GridScalingFactory::GridScaling::ScaleCompressible); - - //std::stringstream _path; - // std::stringstream _prefix; - - // //_path << "F:/Work/Computations/TaylorGreenVortex_3D/TGV_LBM/" << nx << "_Re_1.6e4"; - // //_path << "F:/Work/Computations/TaylorGreenVortex_3D/TGV_LBM/" << nx << "_neqInit"; - // _path << "F:/Work/Computations/TaylorGreenVortex_3D/TGV_LBM/Re_1600/AA2016/" << nx << "_FD_O8"; - - // //_path << "./results/AA2016/" << nx; - // //_path << "./results/CumOne/" << nx; - // //_path << "./results/F3_2018/" << nx; - - // _prefix << "TGV_3D_" << nx << "_" ; - - // para->setOutputPath(_path.str()); - // para->setOutputPrefix(_prefix.str()); - // para->setPathAndFilename(_path.str() + "/" + _prefix.str()); - - ////////////////////////////////////////////////////////////////////////// - - { - std::stringstream _path; - - _path << path; - _path << kernel; - _path << "SingleGPU"; - - if (useLimiter) _path << "_Limiter"; - - path = _path.str(); - } - - ////////////////////////////////////////////////////////////////////////// - - { - std::stringstream _simulationName; - - _simulationName << simulationName; - _simulationName << "_nx_" << nx; - _simulationName << "_dtPerL_" << dtPerL << "_"; - - simulationName = _simulationName.str(); - } - - ////////////////////////////////////////////////////////////////////////// - - para->setDevices(std::vector<uint>{gpuIndex}); - - ////////////////////////////////////////////////////////////////////////// - - para->setOutputPath( path ); - para->setOutputPrefix( simulationName ); - - para->setPrintFiles(true); - - para->setTimestepEnd(40 * lround(L / velocity)); - para->setTimestepOut(5 * lround(L / velocity)); - //para->setTimestepOut(lround(L / velocity)); - // para->setTimestepEnd(2048); - //para->setTimestepOut(512); - // para->setTimestepStartOut(500); - - para->setVelocityLB( velocity ); - - para->setViscosityLB( viscosity ); - - para->setVelocityRatio( 1.0 / velocity ); - - para->setDensityRatio(1.0); - - para->setInitialCondition( [&]( real coordX, real coordY, real coordZ, real& rho, real& vx, real& vy, real& vz){ - - real a = 1.0; - real b = 1.0; - real c = 1.0; - - rho = 3.0 * ((velocity * velocity) / 16.0 * ( cos( 2.0 * a * coordX ) + cos( 2.0 * b * coordY ) ) * ( cos( 2.0 * c * coordZ ) + 2.0 ) ); - vx = velocity * sin( a * coordX ) * cos( b * coordY ) * cos( c * coordZ ); - vy = -velocity * cos( a * coordX ) * sin( b * coordY ) * cos( c * coordZ ); - vz = 0.0; - - } ); - - para->configureMainKernel( kernel ); - - if( !useLimiter ) - para->setQuadricLimiters( 1000000.0, 1000000.0, 1000000.0 ); - - para->setUseInitNeq( true ); - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - auto cudaMemoryManager = std::make_shared<CudaMemoryManager>(para); - SPtr<GridProvider> gridGenerator = GridProvider::makeGridGenerator(gridBuilder, para, cudaMemoryManager, communicator); - //SPtr<GridProvider> gridGenerator = GridProvider::makeGridReader(FILEFORMAT::BINARY, para, cudaMemoryManager); - - SPtr<FileWriter> fileWriter = SPtr<FileWriter>(new FileWriter()); - Simulation sim(para, cudaMemoryManager, communicator, *gridGenerator, &bcFactory, &scalingFactory); - sim.run(); - - //sim.addKineticEnergyAnalyzer( 10 ); - //sim.addEnstrophyAnalyzer( 10 ); - - //sim.run(); -} - - -int main( int argc, char* argv[]) -{ - MPI_Init(&argc, &argv); - std::string str, str2; - if ( argv != NULL ) - { - //str = static_cast<std::string>(argv[0]); - - try - { - ////////////////////////////////////////////////////////////////////////// - std::string targetPath( __FILE__ ); - -#ifdef _WIN32 - targetPath = targetPath.substr(0, targetPath.find_last_of('\\') + 1); -#else - targetPath = targetPath.substr(0, targetPath.find_last_of('/') + 1); -#endif - - ////////////////////////////////////////////////////////////////////////// - - if( cmdOptionExists( argv, argv+argc, "--Re" ) ) - Re = atof( getCmdOption( argv, argv+argc, "--Re" ) ); - - if( cmdOptionExists( argv, argv+argc, "--nx" ) ) - nx = atoi( getCmdOption( argv, argv+argc, "--nx" ) ); - - if( cmdOptionExists( argv, argv+argc, "--dtPerL" ) ) - dtPerL = atoi( getCmdOption( argv, argv+argc, "--dtPerL" ) ); - - if( cmdOptionExists( argv, argv+argc, "--kernel" ) ) - kernel = getCmdOption( argv, argv+argc, "--kernel" ); - - if( cmdOptionExists( argv, argv+argc, "--gpu" ) ) - gpuIndex = atoi( getCmdOption( argv, argv+argc, "--gpu" ) ); - - if( cmdOptionExists( argv, argv+argc, "--useLimiter" ) ) - useLimiter = true; - - multipleLevel(targetPath + "config.txt"); - - ////////////////////////////////////////////////////////////////////////// - } - catch (const std::bad_alloc& e) - { - std::cout << "Bad alloc: " << e.what() << std::flush; - //MPI_Abort(MPI_COMM_WORLD, -1); - } - catch (const std::exception& e) - { - std::cout << e.what() << std::flush; - //MPI_Abort(MPI_COMM_WORLD, -1); - } - catch (...) - { - std::cout << "unknown exeption" << std::endl; - } - - //std::cout << "\nConfiguration file must be set!: lbmgm <config file>" << std::endl << std::flush; - //MPI_Abort(MPI_COMM_WORLD, -1); - } - - - /* - MPE_Init_log() & MPE_Finish_log() are NOT needed when - liblmpe.a is linked with this program. In that case, - MPI_Init() would have called MPE_Init_log() already. - */ -#if defined( MPI_LOGGING ) - MPE_Init_log(); -#endif - -#if defined( MPI_LOGGING ) - if ( argv != NULL ) - MPE_Finish_log( argv[0] ); - if ( str != "" ) - MPE_Finish_log( str.c_str() ); - else - MPE_Finish_log( "TestLog" ); -#endif - - MPI_Finalize(); - return 0; -} diff --git a/apps/gpu/TGV_3D_GridRef/config.txt b/apps/gpu/TGV_3D_GridRef/config.txt deleted file mode 100644 index ae6d3e9bc4be5403d151f3d59ffb13af7164abf0..0000000000000000000000000000000000000000 --- a/apps/gpu/TGV_3D_GridRef/config.txt +++ /dev/null @@ -1,36 +0,0 @@ -################################################## -#GPU Mapping -################################################## -#Devices="0 1 2 3" -#NumberOfDevices=4 - -################################################## -#informations for Writing -################################################## -#Path="E:/DrivenCavity/results" -#Path="F:/Work/Computations/out/DrivenCavity/" -#Prefix="DrivenCavity" -#WriteGrid=true -################################################## -#informations for reading -################################################## -#GridPath="E:/DrivenCavity/dummy" -GridPath="F:/Work/Computations/out/TaylorGreen3DNew/grid" - -################################################## -#number of grid levels -################################################## -NOGL=2 - -################################################## -#LBM Version -################################################## -#D3Qxx=27 -#MainKernelName=CumulantAA2016CompSP27 - -################################################## -#simulation parameter -################################################## -#TimeEnd=100000 -#TimeOut=1000 -#TimeStartOut=0 \ No newline at end of file diff --git a/apps/gpu/TGV_3D_MultiGPU/CMakeLists.txt b/apps/gpu/TGV_3D_MultiGPU/CMakeLists.txt deleted file mode 100644 index cfa39677e41f8b399eccf441f8752a77cf9327fe..0000000000000000000000000000000000000000 --- a/apps/gpu/TGV_3D_MultiGPU/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -PROJECT(TGV_3D_MultiGPU LANGUAGES CUDA CXX) - -vf_add_library(BUILDTYPE binary PRIVATE_LINK basics gpu_core GridGenerator FILES TGV_3D_MultiGPU.cpp) - -set_source_files_properties(TGV_3D_MultiGPU.cpp PROPERTIES LANGUAGE CUDA) - -set_target_properties(TGV_3D_MultiGPU PROPERTIES CUDA_SEPARABLE_COMPILATION ON) diff --git a/apps/gpu/TGV_3D_MultiGPU/TGV_3D_MultiGPU.cpp b/apps/gpu/TGV_3D_MultiGPU/TGV_3D_MultiGPU.cpp deleted file mode 100644 index 48e72e6382fa7944fb413bb573a980b3cc3085d0..0000000000000000000000000000000000000000 --- a/apps/gpu/TGV_3D_MultiGPU/TGV_3D_MultiGPU.cpp +++ /dev/null @@ -1,463 +0,0 @@ -//======================================================================================= -// ____ ____ __ ______ __________ __ __ __ __ -// \ \ | | | | | _ \ |___ ___| | | | | / \ | | -// \ \ | | | | | |_) | | | | | | | / \ | | -// \ \ | | | | | _ / | | | | | | / /\ \ | | -// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ -// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| -// \ \ | | ________________________________________________________________ -// \ \ | | | ______________________________________________________________| -// \ \| | | | __ __ __ __ ______ _______ -// \ | | |_____ | | | | | | | | | _ \ / _____) -// \ | | _____| | | | | | | | | | | \ \ \_______ -// \ | | | | |_____ | \_/ | | | | |_/ / _____ | -// \ _____| |__| |________| \_______/ |__| |______/ (_______/ -// -// This file is part of VirtualFluids. VirtualFluids is free software: you can -// redistribute it and/or modify it under the terms of the GNU General Public -// License as published by the Free Software Foundation, either version 3 of -// the License, or (at your option) any later version. -// -// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// for more details. -// -// You should have received a copy of the GNU General Public License along -// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. -// -//! \file TGV_3d_MuitiGPU.cpp -//! \ingroup TGV_3D_MultiGPU -//! \author Martin Schoenherr -//======================================================================================= -//#define MPI_LOGGING - -//Martin Branch -#include <mpi.h> -#if defined( MPI_LOGGING ) - #include <mpe.h> -#endif - -#include <string> -#include <sstream> -#include <iostream> -#include <algorithm> -#include <numeric> -#include <stdexcept> -#include <fstream> -#define _USE_MATH_DEFINES -#include <math.h> - -//#include "metis.h" - -#include "StringUtilities/StringUtil.h" -#include "basics/config/ConfigurationFile.h" - -#include "gpu/core/LBM/Simulation.h" -#include "gpu/core/Communication/MpiCommunicator.h" -#include "gpu/core/DataStructureInitializer/GridReaderGenerator/GridGenerator.h" -#include "gpu/core/DataStructureInitializer/GridProvider.h" -#include "gpu/core/DataStructureInitializer/GridReaderFiles/GridReader.h" -#include "gpu/core/Parameter/Parameter.h" -#include "gpu/core/Output/FileWriter.h" - -#include "gpu/core/Kernel/KernelFactory/KernelFactoryImp.h" -#include "gpu/core/PreProcessor/PreProcessorFactory/PreProcessorFactoryImp.h" -#include "gpu/core/BoundaryConditions/BoundaryConditionFactory.h" - -#include "gpu/core/GPU/CudaMemoryManager.h" - -#include "global.h" - -#include "geometries/Sphere/Sphere.h" -#include "geometries/VerticalCylinder/VerticalCylinder.h" -#include "geometries/Cuboid/Cuboid.h" -#include "geometries/TriangularMesh/TriangularMesh.h" -#include "geometries/Conglomerate/Conglomerate.h" -#include "geometries/TriangularMesh/TriangularMeshStrategy.h" - -#include "grid/GridBuilder/LevelGridBuilder.h" -#include "grid/GridBuilder/MultipleGridBuilder.h" -#include "grid/BoundaryConditions/Side.h" -#include "grid/BoundaryConditions/BoundaryCondition.h" -#include "grid/GridFactory.h" - -#include "io/SimulationFileWriter/SimulationFileWriter.h" -#include "io/GridVTKWriter/GridVTKWriter.h" -#include "io/STLReaderWriter/STLReader.h" -#include "io/STLReaderWriter/STLWriter.h" - -#include "utilities/math/Math.h" -#include "utilities/communication.h" -#include "utilities/transformator/TransformatorImp.h" - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// from https://stackoverflow.com/questions/865668/how-to-parse-command-line-arguments-in-c -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - -char* getCmdOption(char ** begin, char ** end, const std::string & option) -{ - char ** itr = std::find(begin, end, option); - if (itr != end && ++itr != end) - { - return *itr; - } - return 0; -} - -bool cmdOptionExists(char** begin, char** end, const std::string& option) -{ - return std::find(begin, end, option) != end; -} - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////// -real Re = 1600.0; - -uint dtPerL = 250; - -uint nx = 64; -uint gpuIndex = 0; - -bool useLimiter = false; - -int mpirank; -int mpiWorldSize; - -std::string kernel( "K17CompressibleNavierStokes" ); - -//std::string path("F:/Work/Computations/out/TaylorGreen3DNew/"); //LEGOLAS -//std::string path("results/"); //PHOENIX -//std::string path("E:/DrivenCavity/results/"); //TESLA03 -std::string path("E:/TaylorGreen3D/"); //AzultecPC - -std::string simulationName("TGV_3D"); -////////////////////////////////////////////////////////////////////////// - -void multipleLevel(const std::string& configPath) -{ - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - int sideLengthX, sideLengthY, sideLengthZ, rankX, rankY, rankZ; - - - if (mpiWorldSize == 1 ) { sideLengthX = 1; sideLengthY = 1; sideLengthZ = 1; } - else if (mpiWorldSize == 2 ) { sideLengthX = 2; sideLengthY = 1; sideLengthZ = 1; } - else if (mpiWorldSize == 4 ) { sideLengthX = 2; sideLengthY = 2; sideLengthZ = 1; } - else if (mpiWorldSize == 8 ) { sideLengthX = 2; sideLengthY = 2; sideLengthZ = 2; } - else if (mpiWorldSize == 16) { sideLengthX = 4; sideLengthY = 2; sideLengthZ = 2; } - else if (mpiWorldSize == 32) { sideLengthX = 4; sideLengthY = 4; sideLengthZ = 2; } - - rankX = mpirank % sideLengthX; - rankY = ( mpirank % ( sideLengthX * sideLengthY ) ) / sideLengthX; - rankZ = mpirank / ( sideLengthY * sideLengthX ); - - vf::gpu::Communicator& communicator = vf::gpu::MpiCommunicator::getInstance(); - - //UbLog::reportingLevel() = UbLog::logLevelFromString("DEBUG5"); - - auto gridFactory = GridFactory::make(); - //gridFactory->setTriangularMeshDiscretizationMethod(TriangularMeshDiscretizationMethod::RAYCASTING); - gridFactory->setTriangularMeshDiscretizationMethod(TriangularMeshDiscretizationMethod::POINT_IN_OBJECT); - //gridFactory->setTriangularMeshDiscretizationMethod(TriangularMeshDiscretizationMethod::POINT_UNDER_TRIANGLE); - - auto gridBuilder = MultipleGridBuilder::makeShared(gridFactory); - - vf::basics::ConfigurationFile config; - config.load(configPath); - SPtr<Parameter> para = std::make_shared<Parameter>(communicator.getNumberOfProcess(), communicator.getPID(), &config); - BoundaryConditionFactory bcFactory = BoundaryConditionFactory(); - - *logging::out << logging::Logger::INFO_HIGH << "SideLength = " << sideLengthX << " " << sideLengthY << " " << sideLengthZ << "\n"; - *logging::out << logging::Logger::INFO_HIGH << "rank = " << rankX << " " << rankY << " " << rankZ << "\n"; - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - const real PI = 3.141592653589793238462643383279; - - real L = nx / ( 2.0 * PI ); - - const real velocity = 64.0 / ( dtPerL * 2.0 * PI ); - - const real viscosity = nx / ( 2.0 * PI ) * velocity / Re; - - *logging::out << logging::Logger::INFO_HIGH << "velocity = " << velocity << " s\n"; - - *logging::out << logging::Logger::INFO_HIGH << "viscosity = " << viscosity << "\n"; - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - real LX = 2.0 * PI / double(sideLengthX); - real LY = 2.0 * PI / double(sideLengthY); - real LZ = 2.0 * PI / double(sideLengthZ); - - *logging::out << logging::Logger::INFO_HIGH << "L = " << LX << " " << LY << " " << LZ << "\n"; - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - real dx = 2.0 * PI / real(nx); - - real xOverlap = ( sideLengthX == 1 ) ? 0.0 : 5.0*dx; - real yOverlap = ( sideLengthY == 1 ) ? 0.0 : 5.0*dx; - real zOverlap = ( sideLengthZ == 1 ) ? 0.0 : 5.0*dx; - - *logging::out << logging::Logger::INFO_HIGH << "Domain = " << rankX*LX - PI - xOverlap << " " << rankY*LY - PI - yOverlap << " " << rankZ*LZ - PI - zOverlap << "\n"; - *logging::out << logging::Logger::INFO_HIGH << "Domain = " << (rankX*LX+1) - PI + xOverlap << " " << (rankY*LY+1) - PI + yOverlap << " " << (rankZ*LZ+1) - PI + zOverlap << "\n"; - - gridBuilder->addCoarseGrid( rankX *LX - PI - xOverlap, rankY *LY - PI - yOverlap, rankZ *LZ - PI - zOverlap, - (rankX+1)*LX - PI + xOverlap, (rankY+1)*LY - PI + yOverlap, (rankZ+1)*LZ - PI + zOverlap, dx); - - gridBuilder->setSubDomainBox( std::make_shared<BoundingBox>( rankX*LX - PI, (rankX+1)*LX - PI, - rankY*LY - PI, (rankY+1)*LY - PI, - rankZ*LZ - PI, (rankZ+1)*LZ - PI ) ); - - gridBuilder->setPeriodicBoundaryCondition(sideLengthX == 1, sideLengthY == 1, sideLengthZ == 1); - - gridBuilder->buildGrids(true); // buildGrids() has to be called before setting the BCs!!!! - - if( mpiWorldSize > 1 ) - { - int rankPX = ( (rankX + 1 + sideLengthX) % sideLengthX ) + rankY * sideLengthX + rankZ * sideLengthX * sideLengthY; - int rankMX = ( (rankX - 1 + sideLengthX) % sideLengthX ) + rankY * sideLengthX + rankZ * sideLengthX * sideLengthY; - int rankPY = rankX + ( (rankY + 1 + sideLengthY) % sideLengthY ) * sideLengthX + rankZ * sideLengthX * sideLengthY; - int rankMY = rankX + ( (rankY - 1 + sideLengthY) % sideLengthY ) * sideLengthX + rankZ * sideLengthX * sideLengthY; - int rankPZ = rankX + rankY * sideLengthX + ( (rankZ + 1 + sideLengthZ) % sideLengthZ ) * sideLengthX * sideLengthY; - int rankMZ = rankX + rankY * sideLengthX + ( (rankZ - 1 + sideLengthZ) % sideLengthZ ) * sideLengthX * sideLengthY; - - if( sideLengthX > 1 ) gridBuilder->findCommunicationIndices( CommunicationDirections::PX ); - if( sideLengthX > 1 ) gridBuilder->findCommunicationIndices( CommunicationDirections::MX ); - if( sideLengthY > 1 ) gridBuilder->findCommunicationIndices( CommunicationDirections::PY ); - if( sideLengthY > 1 ) gridBuilder->findCommunicationIndices( CommunicationDirections::MY ); - if( sideLengthZ > 1 ) gridBuilder->findCommunicationIndices( CommunicationDirections::PZ ); - if( sideLengthZ > 1 ) gridBuilder->findCommunicationIndices( CommunicationDirections::MZ ); - - if( sideLengthX > 1 ) gridBuilder->setCommunicationProcess ( CommunicationDirections::MX, rankMX); - if( sideLengthY > 1 ) gridBuilder->setCommunicationProcess ( CommunicationDirections::MY, rankMY); - if( sideLengthZ > 1 ) gridBuilder->setCommunicationProcess ( CommunicationDirections::MZ, rankMZ); - - if( sideLengthX > 1 && rankMX != rankPX ) gridBuilder->setCommunicationProcess ( CommunicationDirections::PX, rankPX); - if( sideLengthY > 1 && rankMY != rankPY ) gridBuilder->setCommunicationProcess ( CommunicationDirections::PY, rankPY); - if( sideLengthZ > 1 && rankMZ != rankPZ ) gridBuilder->setCommunicationProcess ( CommunicationDirections::PZ, rankPZ); - - if( rankMX == rankPX ) gridBuilder->getGrid(0)->repairCommunicationIndices(CommunicationDirections::MX); - if( rankMY == rankPY ) gridBuilder->getGrid(0)->repairCommunicationIndices(CommunicationDirections::MY); - if( rankMZ == rankPZ ) gridBuilder->getGrid(0)->repairCommunicationIndices(CommunicationDirections::MZ); - - *logging::out << logging::Logger::INFO_HIGH << "neighborRanks = " << rankPX << " " << rankMX << " " << rankPY << " " << rankMY << " " << rankPZ << " " << rankMZ << "\n"; - } - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - ////////////////////////////////////////////////////////////////////////// - - SimulationFileWriter::write(path + "grid/" + std::to_string(mpirank) + "/", gridBuilder, FILEFORMAT::BINARY); - - ////////////////////////////////////////////////////////////////////////// - - std::vector<uint> devices( mpiWorldSize ); - - std::iota(devices.begin(), devices.end(), 0); - - //para->setDevices(std::vector<uint>{0,1}); - para->setDevices(devices); - - para->setMaxDev(mpiWorldSize); - - ////////////////////////////////////////////////////////////////////////// - - para->setOutputPath( path ); - para->setOutputPrefix( simulationName ); - - para->setPrintFiles(true); - - // para->setTimestepEnd( 40 * lround(L/velocity) ); - //para->setTimestepOut( 5 * lround(L/velocity) ); - para->setTimestepOut( 100 ); - - para->setTimestepEnd( 1000 ); - //para->setTimestepOut( 1 ); - - para->setVelocityLB( velocity ); - - para->setViscosityLB( viscosity ); - - para->setVelocityRatio( 1.0 / velocity ); - - para->setInitialCondition( [&]( real coordX, real coordY, real coordZ, real& rho, real& vx, real& vy, real& vz){ - - real a = 1.0; - real b = 1.0; - real c = 1.0; - - rho = 3.0 * ((velocity * velocity) / 16.0 * ( cos( 2.0 * a * coordX ) + cos( 2.0 * b * coordY ) ) * ( cos( 2.0 * c * coordZ ) + 2.0 ) ); - vx = velocity * sin( a * coordX ) * cos( b * coordY ) * cos( c * coordZ ); - vy = -velocity * cos( a * coordX ) * sin( b * coordY ) * cos( c * coordZ ); - vz = 0.0; - - //rho = mpirank; - //vx = 0.0; - //vy = 0.0; - //vz = 0.0; - - } ); - - para->configureMainKernel(kernel); - - if( !useLimiter ) - para->setQuadricLimiters( 1000000.0, 1000000.0, 1000000.0 ); - - para->setUseInitNeq( true ); - - if (kernel == "CumulantK18Comp" || kernel == "CumulantK20Comp") - para->setIsF3(true); - else - para->setIsF3(false); - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - auto cudaMemoryManager = std::make_shared<CudaMemoryManager>(para); - SPtr<GridProvider> gridGenerator = GridProvider::makeGridGenerator(gridBuilder, para, cudaMemoryManager, communicator); - //SPtr<GridProvider> gridGenerator = GridProvider::makeGridReader(FILEFORMAT::BINARY, para, cudaMemoryManager); - - SPtr<FileWriter> fileWriter = SPtr<FileWriter>(new FileWriter()); - Simulation sim(para, cudaMemoryManager, communicator, *gridGenerator, &bcFactory); - sim.run(); - - sim.addKineticEnergyAnalyzer( 10 ); - sim.addEnstrophyAnalyzer( 10 ); - - sim.run(); - - logFile.close(); -} - - -int main( int argc, char* argv[]) -{ - MPI_Init(&argc, &argv); - std::string str, str2; - if ( argv != NULL ) - { - //str = static_cast<std::string>(argv[0]); - - try - { - MPI_Comm_rank(MPI_COMM_WORLD, &mpirank); - MPI_Comm_size(MPI_COMM_WORLD, &mpiWorldSize); - - ////////////////////////////////////////////////////////////////////////// - std::string targetPath( __FILE__ ); - -#ifdef _WIN32 - targetPath = targetPath.substr(0, targetPath.find_last_of('\\') + 1); -#else - targetPath = targetPath.substr(0, targetPath.find_last_of('/') + 1); -#endif - - ////////////////////////////////////////////////////////////////////////// - - if( cmdOptionExists( argv, argv+argc, "--Re" ) ) - Re = atof( getCmdOption( argv, argv+argc, "--Re" ) ); - - if( cmdOptionExists( argv, argv+argc, "--nx" ) ) - nx = atoi( getCmdOption( argv, argv+argc, "--nx" ) ); - - if( cmdOptionExists( argv, argv+argc, "--dtPerL" ) ) - dtPerL = atoi( getCmdOption( argv, argv+argc, "--dtPerL" ) ); - - if( cmdOptionExists( argv, argv+argc, "--kernel" ) ) - kernel = getCmdOption( argv, argv+argc, "--kernel" ); - - if( cmdOptionExists( argv, argv+argc, "--gpu" ) ) - gpuIndex = atoi( getCmdOption( argv, argv+argc, "--gpu" ) ); - - if( cmdOptionExists( argv, argv+argc, "--useLimiter" ) ) - useLimiter = true; - - ////////////////////////////////////////////////////////////////////////// - - { - std::stringstream _path; - - _path << path; - _path << kernel; - _path << "MultiGPU/"; - - if (useLimiter) _path << "_Limiter"; - - path = _path.str(); - } - - ////////////////////////////////////////////////////////////////////////// - - { - std::stringstream _simulationName; - - _simulationName << simulationName; - _simulationName << "_nx_" << nx; - _simulationName << "_dtPerL_" << dtPerL << "_"; - - simulationName = _simulationName.str(); - } - - ////////////////////////////////////////////////////////////////////////// - - multipleLevel(targetPath + "config.txt"); - - ////////////////////////////////////////////////////////////////////////// - } - catch (const std::bad_alloc& e) - { - - *logging::out << logging::Logger::LOGGER_ERROR << "Bad Alloc:" << e.what() << "\n"; - //std::cout << e.what() << std::flush; - //MPI_Abort(MPI_COMM_WORLD, -1); - } - catch (const std::exception& e) - { - - *logging::out << logging::Logger::LOGGER_ERROR << e.what() << "\n"; - //std::cout << e.what() << std::flush; - //MPI_Abort(MPI_COMM_WORLD, -1); - } - catch (...) - { - *logging::out << logging::Logger::LOGGER_ERROR << "Unknown exception!\n"; - //std::cout << "unknown exeption" << std::endl; - } - - //std::cout << "\nConfiguration file must be set!: lbmgm <config file>" << std::endl << std::flush; - //MPI_Abort(MPI_COMM_WORLD, -1); - } - - - /* - MPE_Init_log() & MPE_Finish_log() are NOT needed when - liblmpe.a is linked with this program. In that case, - MPI_Init() would have called MPE_Init_log() already. - */ -#if defined( MPI_LOGGING ) - MPE_Init_log(); -#endif - -#if defined( MPI_LOGGING ) - if ( argv != NULL ) - MPE_Finish_log( argv[0] ); - if ( str != "" ) - MPE_Finish_log( str.c_str() ); - else - MPE_Finish_log( "TestLog" ); -#endif - - MPI_Finalize(); - return 0; -} diff --git a/apps/gpu/TGV_3D_MultiGPU/config.txt b/apps/gpu/TGV_3D_MultiGPU/config.txt deleted file mode 100644 index ca4cd90fb2ac22f2d4b72d3404a02be4a0192770..0000000000000000000000000000000000000000 --- a/apps/gpu/TGV_3D_MultiGPU/config.txt +++ /dev/null @@ -1,36 +0,0 @@ -################################################## -#GPU Mapping -################################################## -#Devices="0 1 2 3" -NumberOfDevices=2 - -################################################## -#informations for Writing -################################################## -#Path="E:/DrivenCavity/results" -#Path="F:/Work/Computations/out/DrivenCavity/" -#Prefix="DrivenCavity" -#WriteGrid=true -################################################## -#informations for reading -################################################## -#GridPath="E:/DrivenCavity/dummy" -GridPath="F:/Work/Computations/out/TaylorGreen3DNew/grid" - -################################################## -#number of grid levels -################################################## -NOGL=2 - -################################################## -#LBM Version -################################################## -#D3Qxx=27 -#MainKernelName=CumulantAA2016CompSP27 - -################################################## -#simulation parameter -################################################## -#TimeEnd=100000 -#TimeOut=1000 -#TimeStartOut=0 \ No newline at end of file diff --git a/apps/gpu/WTG_RUB/CMakeLists.txt b/apps/gpu/WTG_RUB/CMakeLists.txt deleted file mode 100644 index 98cd844fa13fe6220a9bb01eb3e6ecf6f32e01da..0000000000000000000000000000000000000000 --- a/apps/gpu/WTG_RUB/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -PROJECT(WTG_RUB LANGUAGES CUDA CXX) - -vf_add_library(BUILDTYPE binary PRIVATE_LINK basics gpu_core GridGenerator FILES WTG_RUB.cpp) - -set_source_files_properties(WTG_RUB.cpp PROPERTIES LANGUAGE CUDA) - -set_target_properties(WTG_RUB PROPERTIES CUDA_SEPARABLE_COMPILATION ON) diff --git a/apps/gpu/WTG_RUB/WTG_RUB.cpp b/apps/gpu/WTG_RUB/WTG_RUB.cpp deleted file mode 100644 index f13ab7572dd1a3b815a4793b406a037085a3d47f..0000000000000000000000000000000000000000 --- a/apps/gpu/WTG_RUB/WTG_RUB.cpp +++ /dev/null @@ -1,795 +0,0 @@ -//======================================================================================= -// ____ ____ __ ______ __________ __ __ __ __ -// \ \ | | | | | _ \ |___ ___| | | | | / \ | | -// \ \ | | | | | |_) | | | | | | | / \ | | -// \ \ | | | | | _ / | | | | | | / /\ \ | | -// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ -// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| -// \ \ | | ________________________________________________________________ -// \ \ | | | ______________________________________________________________| -// \ \| | | | __ __ __ __ ______ _______ -// \ | | |_____ | | | | | | | | | _ \ / _____) -// \ | | _____| | | | | | | | | | | \ \ \_______ -// \ | | | | |_____ | \_/ | | | | |_/ / _____ | -// \ _____| |__| |________| \_______/ |__| |______/ (_______/ -// -// This file is part of VirtualFluids. VirtualFluids is free software: you can -// redistribute it and/or modify it under the terms of the GNU General Public -// License as published by the Free Software Foundation, either version 3 of -// the License, or (at your option) any later version. -// -// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// for more details. -// -// You should have received a copy of the GNU General Public License along -// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. -// -//! \file WTG_RUB.cpp -//! \ingroup Applications -//! \author Martin Schoenherr -//======================================================================================= -#define _USE_MATH_DEFINES -#include <cmath> -#include <string> -#include <sstream> -#include <iostream> -#include <stdexcept> -#include <fstream> -#include <exception> -#include <memory> -#include <filesystem> - -////////////////////////////////////////////////////////////////////////// - -#include <basics/DataTypes.h> -#include <basics/PointerDefinitions.h> -#include <basics/config/ConfigurationFile.h> - -#include <logger/Logger.h> - -////////////////////////////////////////////////////////////////////////// - -#include "GridGenerator/grid/GridBuilder/LevelGridBuilder.h" -#include "GridGenerator/grid/GridBuilder/MultipleGridBuilder.h" -#include "GridGenerator/grid/BoundaryConditions/Side.h" -#include "GridGenerator/grid/BoundaryConditions/BoundaryCondition.h" -#include "GridGenerator/grid/GridFactory.h" -#include "GridGenerator/geometries/TriangularMesh/TriangularMesh.h" -#include "GridGenerator/geometries/Conglomerate/Conglomerate.h" - -#include "GridGenerator/io/SimulationFileWriter/SimulationFileWriter.h" -#include "GridGenerator/io/GridVTKWriter/GridVTKWriter.h" -#include "GridGenerator/io/STLReaderWriter/STLReader.h" -#include "GridGenerator/io/STLReaderWriter/STLWriter.h" - -////////////////////////////////////////////////////////////////////////// - -#include "gpu/core/LBM/Simulation.h" -#include "gpu/core/DataStructureInitializer/GridReaderGenerator/GridGenerator.h" -#include "gpu/core/DataStructureInitializer/GridProvider.h" -#include "gpu/core/DataStructureInitializer/GridReaderFiles/GridReader.h" -#include "gpu/core/Parameter/Parameter.h" -#include "gpu/core/Output/FileWriter.h" -#include "gpu/core/GPU/CudaMemoryManager.h" -#include "gpu/core/BoundaryConditions/BoundaryConditionFactory.h" -#include "gpu/core/Kernel/KernelTypes.h" - -#include <parallel/MPICommunicator.h> - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// U s e r s e t t i n g s -// -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -// const real L = 1.0; - -const real velocity = 1.0; - -int variant = 1; -real rotationOfCity; -real z_offset = 0.0; // only if baseplate is in use (currently not!! not important) -int dataN; -std::vector<real> dataZ; -std::vector<real> dataVelocity; -std::string simulationName(""); - -// 1: original setup of Lennard Lux (6 level, 4.0 cm -> 1.25 mm) -// 2: setup 1 of MSch (4 level, 1.0 cm -> 1.25 mm) -// 3: setup 2 of MSch (5 level, 1.6 cm -> 1.0 mm) -// 4: setup 3 of MSch (small/test) (3 level, 4.0 cm -> 1.0 cm) -int setupDomain = 4; - -// std::string path("D:/out/WTG_RUB"); // Mollok -// std::string inputPath("D:/out/WTG_RUB/input/"); - -std::string path("/workspaces/VirtualFluids_dev/output/WTG_RUB_Results/"); // Aragorn -std::string inputPath("/workspaces/VirtualFluids_dev/stl/WTG_RUB/"); - -// const uint timeStepStartOut = 0; -const uint timeStepOut = 10000; -const uint timeStepEnd = 100000; - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -void convertMPFile(SPtr <MultipleGridBuilder> gridBuilder, real& phi, std::vector<real>& origin, bool& measureVeloProfilesOnly, uint& maxLevel); - -void addFineGrids(SPtr<MultipleGridBuilder> gridBuilder, uint &maxLevel, real &rotationOfCity); - -void readVelocityProfile(); - -std::string chooseVariation(); - -void multipleLevel(const std::string& configPath) -{ - vf::parallel::Communicator &communicator = *vf::parallel::MPICommunicator::getInstance(); - //auto gridBuilder = MultipleGridBuilder::makeShared(); - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - real dx = 0; - real viscosityLB = (real)1.0e-03; - uint maxLevel = 1; - - if (setupDomain == 1) { - dx = (real)4; - maxLevel = 5; - viscosityLB = (real)3.75e-06; // LB units - } else if (setupDomain == 2) { - dx = (real)1; - maxLevel = 3; - viscosityLB = (real)1.5e-05; // LB units - } else if (setupDomain == 3) { - dx = (real)1.6; - maxLevel = 4; - viscosityLB = (real)9.375e-06; // LB units - } else if (setupDomain == 4) { - dx = (real)4.0; - maxLevel = 2; - viscosityLB = (real)3.75e-06; // LB units - } - - real x_min = 0.0; - real x_max = 1250.0; - real y_min = 0.0; - real y_max = 190.0; - real z_min = 0.0 + z_offset; - real z_max = 160.0 + z_offset; - - //auto RubSTL = std::make_shared<TriangularMesh>(inputPath + "stl/Var02_0deg_FD_b.stl"); - auto RubSTL = std::make_shared<TriangularMesh>(inputPath + "stl/" + chooseVariation() + ".stl"); - std::vector<real> originOfCityXY = { 600.0, y_max / 2, z_offset }; - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // OPTIONS - - int maxLevelAtInflow = maxLevel; - // there are max. 3 levels (0,1,2) at inflow-/x_min-Side if maxLevel >= 3; OTHERWISE: maxLevel - if (maxLevel >= 3) - maxLevelAtInflow = 2; - - // MeasurePoints [MP01-15: lvl maxLevel],[MP16-41: lvl 1]; disable when reducing numberOfLevels --> dx might be too - // large if MP01-15 are used with low resolution dx, MPs might be placed in solid City-geometry - bool useMP = false;//true; - bool measureVeloProfilesOnly = false; - - // Two Components: true->DiffOn, false->DiffOff - // bool diffOnOff = false; - - // Resetting diff or flow field, e.g. after restart, do not reset diff/flow at start of measureRun ;-) - // bool reset_diff = false; - bool reset_flow = false; - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - auto gridBuilder = std::make_shared<MultipleGridBuilder>(); - - gridBuilder->addCoarseGrid(x_min, y_min, z_min, - x_max, y_max, z_max, dx); - - gridBuilder->setNumberOfLayers(0, 0); - - addFineGrids(gridBuilder, maxLevel, rotationOfCity); - - //// adding solid CityGeometry to gridbuilder - gridBuilder->addGeometry(RubSTL); - - gridBuilder->setPeriodicBoundaryCondition(false, false, false); - - gridBuilder->buildGrids(false); // buildGrids() has to be called before setting the BCs!!!! - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - vf::basics::ConfigurationFile config; - config.load(configPath); - - SPtr<Parameter> para = std::make_shared<Parameter>(communicator.getNumberOfProcesses(), communicator.getProcessID(), &config); - BoundaryConditionFactory bcFactory = BoundaryConditionFactory(); - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - const real velocityLB = (real)0.0844; // LB units - - //const real vx = velocityLB / (real)sqrt(2.0); // LB units - //const real vy = velocityLB / (real)sqrt(2.0); // LB units - - VF_LOG_INFO("velocityLB [dx/dt] = {}", velocityLB); - VF_LOG_INFO("viscosityLB [dx^2/dt] = {}", viscosityLB); - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - para->setDevices(std::vector<uint>{(uint)0}); - - para->setOutputPath( path ); - para->setOutputPrefix( "Unified_" + simulationName ); - - para->setPrintFiles(true); - - para->setMaxLevel(maxLevel); - - para->setVelocityLB(velocityLB); - para->setViscosityLB(viscosityLB); - - para->setVelocityRatio(velocity/ velocityLB); - - para->configureMainKernel(vf::collisionKernel::compressible::K17CompressibleNavierStokes); - - para->setInitialCondition([&](real coordX, real coordY, real coordZ, real &rho, real &vx, real &vy, real &vz) { - rho = (real)0.0; - vx = (real)0.0; //(6 * velocityLB * coordZ * (L - coordZ) / (L * L)); - vy = (real)0.0; - vz = (real)0.0; - }); - - para->setTimestepOut( timeStepOut ); - para->setTimestepEnd( timeStepEnd ); - - ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - gridBuilder->setVelocityBoundaryCondition(SideType::MX, velocityLB, 0.0, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::PY, 0.0, 0.0, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::MY, 0.0, 0.0, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::PZ, 0.0, 0.0, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::MZ, 0.0, 0.0, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::GEOMETRY, 0.0, 0.0, 0.0); - - gridBuilder->setPressureBoundaryCondition(SideType::PX, 0.0); - - bcFactory.setVelocityBoundaryCondition(BoundaryConditionFactory::VelocityBC::VelocityWithPressureInterpolatedCompressible); - bcFactory.setPressureBoundaryCondition(BoundaryConditionFactory::PressureBC::OutflowNonReflective); - bcFactory.setGeometryBoundaryCondition(BoundaryConditionFactory::VelocityBC::VelocityInterpolatedCompressible); - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - readVelocityProfile(); - for (int level = 0; level <= maxLevelAtInflow; level++) { - auto inflowBC = std::dynamic_pointer_cast<VelocityBoundaryCondition>( - gridBuilder->getBoundaryCondition(SideType::MX, level)); - - // lambda function [capture list](parameter list){function body} - // for every z, loop is being run; - if (inflowBC) { - inflowBC->setVelocityProfile( - gridBuilder->getGrid(level), [&](real x, real y, real z, real &vx, real &vy, real &vz) { - int i; - for (i = 0; i < dataN; i++) { - if ((z < dataZ[i]) || (z == dataZ[i])) - break; - } // remembers i - - // if z is below current data point --> interpolation between previous and current datapoint - if (z < dataZ[i]) { - vx = velocityLB * (dataVelocity[i] + (dataVelocity[i + 1] - dataVelocity[i]) / - (dataZ[i + 1] - dataZ[i]) * (z - dataZ[i])); - } else if (z == dataZ[i]) { - vx = velocityLB * dataVelocity[i]; - } - - // vx << std::endl; vx = velocityLB; - vy = 0.0; - vz = 0.0; - }); - } - } - - // Resetting Velocity Profile (returning to intial state; do not combine with restart) - if (reset_flow) { - para->setInitialCondition([&](real x, real y, real z, real &rho, real &vx, real &vy, real &vz) { - int i; - for (i = 0; i < dataN; i++) { - if ((z < dataZ[i]) || (z == dataZ[i])) - break; - } - if (z < dataZ[i]) { - vx = velocityLB * 0.588 * - (dataVelocity[i] + - (dataVelocity[i + 1] - dataVelocity[i]) / (dataZ[i + 1] - dataZ[i]) * (z - dataZ[i])); - } else if (z == dataZ[i]) { - vx = velocityLB * 0.588 * dataVelocity[i]; - } - - // std::cout << "LINE : " << __LINE__ << "\tdataZ = " << dataZ[i] << "\tz = " << z << "\tvx = " << vx << - // std::endl; - - // vx = velocityLB; - vy = 0.0; - vz = 0.0; - rho = 0.0; - }); - } - - ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // Intializing MeasurePoints - para->setUseMeasurePoints(useMP); - if (para->getUseMeasurePoints()) { - convertMPFile(gridBuilder, rotationOfCity, originOfCityXY, measureVeloProfilesOnly, maxLevel); - // Number log-Files for each MeasurePoint: numberOfMPFiles = timeStepEnd/ClockCycle - para->setclockCycleForMP(timeStepEnd); - // Number of logged Timesteps for each file - para->settimestepForMP(timeStepOut / 100); - // para->settimestepForMP(timeStepOut); - para->setmeasurePoints(inputPath + "measurePoints.dat"); - } - - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - auto cudaMemoryManager = std::make_shared<CudaMemoryManager>(para); - - auto gridGenerator = GridProvider::makeGridGenerator(gridBuilder, para, cudaMemoryManager, communicator); - - Simulation sim(para, cudaMemoryManager, communicator, *gridGenerator, &bcFactory); - sim.run(); -} - -void readVelocityProfile() -{ - // reads velocityProfile.txt, containing values for relative velocity (u_h) in relation to height (z). also fills - // dataZ,dataVelocity vectors - - std::ifstream inFile; - inFile.open(inputPath + "VeloProfile.txt"); - //inFile.open(inputPath + "velocityProfile.txt"); - - if (inFile.fail()) { - std::cerr << "Error opening File" << std::endl; - exit(1); - } - - int z; - real velocity; - - // read - inFile >> dataN; - for (int k = 0; k < dataN; k++) { - inFile >> z; - dataZ.push_back(z + z_offset); - - inFile >> velocity; - dataVelocity.push_back(velocity); - } - inFile.close(); -} - -void addFineGrids(SPtr<MultipleGridBuilder> gridBuilder, uint &maxLevel, real &rotationOfCity) -{ - if (setupDomain == 1) { - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/ - // creates Cuboids (FG1 to FG3, lvl 1 to lvl 3) and add STLs (FG4 to FG5, lvl 4 to lvl 5) depending on maxLevel - // and rotationOfCity; also adds FineGrids(FGs) to gridbuilder - - // GridList(CG = coarse grid, fg = fine grid) - // CG -> dx = 4 cm; lvl 0 - // FG1 -> dx = 2 cm; lvl 1 - // FG2 -> dx = 1 cm; lvl 2 - // FG3 -> dx = 5 mm; lvl 3 - // FG4 -> dx = 2,5 mm; lvl 4 - // FG5 -> dx = 1,25 mm; lvl 5 - // - // FineGrid Level 1 ->dx = 2 cm; lvl 1 - auto FG1 = std::make_shared<Cuboid>(-20, -20, -5 + z_offset, 800, 200, 75 + z_offset); - - // FineGrid Level 2 -> dx = 1 cm; lvl 2 - auto FG2_1 = std::make_shared<Cuboid>(-20, -20, -5 + z_offset, 760, 200, 10 + z_offset); - auto FG2_2 = std::make_shared<Cuboid>(500, -20, 5 + z_offset, 680, 210, 50 + z_offset); - auto FG2 = std::make_shared<Conglomerate>(); - FG2->add(FG2_1); - FG2->add(FG2_2); - - // FineGrid Level 3 ->dx = 5 mm; lvl 3 - auto FG3_1 = std::make_shared<Cuboid>(517, -20, -5 + z_offset, 665, 200, 30 + z_offset); - auto FG3_2 = std::make_shared<Cuboid>(550, 58, -5 + z_offset, 650, 132, 40 + z_offset); - auto FG3 = std::make_shared<Conglomerate>(); - FG3->add(FG3_1); - FG3->add(FG3_2); - - // Adding FineGrids 1 to 5 depending on maxLevel, FG4 and FG5 require different STL-files depending on - // rotationOfCity - if (maxLevel >= 1) { - gridBuilder->addGrid(FG1, 1); - if (maxLevel >= 2) { - gridBuilder->addGrid(FG2, 2); - if (maxLevel >= 3) { - gridBuilder->addGrid(FG3, 3); - if (maxLevel >= 4) { - if (rotationOfCity == 0.0) { - auto FG4 = std::make_shared<TriangularMesh>(inputPath + "stl/FG4_0deg.stl"); - gridBuilder->addGrid(FG4, 4); - } else { - auto FG4 = std::make_shared<TriangularMesh>(inputPath + "stl/FG4_63deg.stl"); - gridBuilder->addGrid(FG4, 4); - } - - if (maxLevel == 5) { - if (rotationOfCity == 0.0) { - auto FG5 = std::make_shared<TriangularMesh>(inputPath + "stl/FG5_0deg.stl"); - gridBuilder->addGrid(FG5, 5); - } else { - auto FG5 = std::make_shared<TriangularMesh>(inputPath + "stl/FG5_63deg.stl"); - gridBuilder->addGrid(FG5, 5); - } - } - } - } - } - } - } - else if (setupDomain == 2) { - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/ - // creates Cuboids (FG1, lvl 1) and add STLs (FG2 to FG3, lvl 2 to lvl 3) depending on maxLevel - // and rotationOfCity; also adds FineGrids(FGs) to gridbuilder - // - // GridList(CG = coarse grid, fg = fine grid) - // CG -> dx = 1 cm; lvl 0 - // FG1 -> dx = 5 mm; lvl 1 - // FG2 -> dx = 2,5 mm; lvl 2 - // FG3 -> dx = 1,25 mm; lvl 3 - // - // FineGrid Level 1 -> dx = 5 mm; lvl 1 - //auto FG1_1 = std::make_shared<Cuboid>(-20, -20, -5 + z_offset, 760, 200, 10 + z_offset); - auto FG1_1 = std::make_shared<Cuboid>(-20, -20, -5 + z_offset, 760, 200, 20 + z_offset); - auto FG1_2 = std::make_shared<Cuboid>(500, -20, 5 + z_offset, 680, 210, 50 + z_offset); - auto FG1 = std::make_shared<Conglomerate>(); - FG1->add(FG1_1); - FG1->add(FG1_2); - - // Adding FineGrids 1 to 5 depending on maxLevel, FG4 and FG5 require different STL-files depending on - // rotationOfCity - if (maxLevel >= 1) { - gridBuilder->addGrid(FG1, 1); - if (maxLevel >= 2) { - if (rotationOfCity == 0.0) { - auto FG2 = std::make_shared<TriangularMesh>(inputPath + "stl/FG4_0deg.stl"); - gridBuilder->addGrid(FG2, 2); - } else { - auto FG2 = std::make_shared<TriangularMesh>(inputPath + "stl/FG4_63deg.stl"); - gridBuilder->addGrid(FG2, 2); - } - - if (maxLevel == 3) { - if (rotationOfCity == 0.0) { - auto FG3 = std::make_shared<TriangularMesh>(inputPath + "stl/FG5_0deg.stl"); - gridBuilder->addGrid(FG3, 3); - } else { - auto FG3 = std::make_shared<TriangularMesh>(inputPath + "stl/FG5_63deg.stl"); - gridBuilder->addGrid(FG3, 3); - } - } - } - } - } - else if (setupDomain == 3) { - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/ - // creates Cuboids (FG1 to FG2, lvl 1 to lvl 2) and add STLs (FG3 to FG4, lvl 3 to lvl 4) depending on maxLevel - // and rotationOfCity; also adds FineGrids(FGs) to gridbuilder - - // GridList(CG = coarse grid, fg = fine grid) - // CG -> dx = 1.6 cm; lvl 0 - // FG1 -> dx = 8.0 mm; lvl 1 - // FG2 -> dx = 4.0 mm; lvl 2 - // FG3 -> dx = 2.0 mm; lvl 3 - // FG4 -> dx = 1.0 mm; lvl 4 - // - //// FineGrid Level 1 ->dx = 8.0 mm; lvl 1 - // auto FG1 = std::make_shared<Cuboid>(-20, -20, -5 + z_offset, 800, 200, 75 + z_offset); - - // FineGrid Level 1 -> dx = 8.0 mm; lvl 1 - auto FG1_1 = std::make_shared<Cuboid>(-20, -20, -5 + z_offset, 780, 200, 30 + z_offset); - auto FG1_2 = std::make_shared<Cuboid>(500, -20, 5 + z_offset, 720, 210, 75 + z_offset); - auto FG1 = std::make_shared<Conglomerate>(); - FG1->add(FG1_1); - FG1->add(FG1_2); - - // FineGrid Level 2 -> dx = 4.0 mm; lvl 2 - auto FG2_1 = std::make_shared<Cuboid>(-20, -20, -5 + z_offset, 760, 200, 10 + z_offset); - auto FG2_2 = std::make_shared<Cuboid>(520, -20, 5 + z_offset, 700, 210, 50 + z_offset); - auto FG2 = std::make_shared<Conglomerate>(); - FG2->add(FG2_1); - FG2->add(FG2_2); - - // Adding FineGrids 1 to 4 depending on maxLevel, FG3 and FG4 require different STL-files depending on - // rotationOfCity - if (maxLevel >= 1) { - gridBuilder->addGrid(FG1, 1); - if (maxLevel >= 2) { - gridBuilder->addGrid(FG2, 2); - if (maxLevel >= 3) { - if (rotationOfCity == 0.0) { - auto FG3 = std::make_shared<TriangularMesh>(inputPath + "stl/FG4_0deg.stl"); - gridBuilder->addGrid(FG3, 3); - } else { - auto FG3 = std::make_shared<TriangularMesh>(inputPath + "stl/FG4_63deg.stl"); - gridBuilder->addGrid(FG3, 3); - } - - if (maxLevel == 4) { - if (rotationOfCity == 0.0) { - auto FG4 = std::make_shared<TriangularMesh>(inputPath + "stl/FG5_0deg.stl"); - gridBuilder->addGrid(FG4, 4); - } else { - auto FG4 = std::make_shared<TriangularMesh>(inputPath + "stl/FG5_63deg.stl"); - gridBuilder->addGrid(FG4, 4); - } - } - } - } - } - } - else if (setupDomain == 4) { - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/ - // creates Cuboids (FG1 to FG2, lvl 1 to lvl 2) depending on - // maxLevel and rotationOfCity; also adds FineGrids(FGs) to gridbuilder - - // GridList(CG = coarse grid, fg = fine grid) - // CG -> dx = 4 cm; lvl 0 - // FG1 -> dx = 2 cm; lvl 1 - // FG2 -> dx = 1 cm; lvl 2 - // - // FineGrid Level 1 ->dx = 2 cm; lvl 1 - auto FG1 = std::make_shared<Cuboid>(-20, -20, -5 + z_offset, 800, 200, 75 + z_offset); - - // FineGrid Level 2 -> dx = 1 cm; lvl 2 - auto FG2_1 = std::make_shared<Cuboid>(-20, -20, -5 + z_offset, 760, 200, 10 + z_offset); - auto FG2_2 = std::make_shared<Cuboid>(500, -20, 5 + z_offset, 680, 210, 50 + z_offset); - auto FG2 = std::make_shared<Conglomerate>(); - FG2->add(FG2_1); - FG2->add(FG2_2); - - // Adding FineGrids 1 to 2 depending on maxLevel - if (maxLevel >= 1) { - gridBuilder->addGrid(FG1, 1); - if (maxLevel >= 2) { - gridBuilder->addGrid(FG2, 2); - } - } - } - - - -} - -void convertMPFile(SPtr<MultipleGridBuilder> gridBuilder, real &phi, std::vector<real> &originXY, bool &measureVeloProfilesOnly, uint &maxLevel) -{ - // File Reader&Writer for converting MP-Coordinates to Index: MeasurePoint placement requires "measurePoints.dat" - // with name, node-ID and level. This function can read a txt-File containing the name, X-Y-Z-Coordinates and level - // of measurePoints. After reading the txt-File and converting X-Y-Z to the node-ID, it writes "measurePoints.dat". - // Justification for this function: Human Readability and no changes in measurepoint core functions - - // File Opening Procedure - std::ifstream inFile; - if (measureVeloProfilesOnly) - inFile.open(inputPath + "measurePoints_veloProfiles.txt"); - else - inFile.open(inputPath + "measurePoints.txt"); - - // Check for error - if (inFile.fail()) { - std::cerr << "Error opening File" << std::endl; - exit(1); - } - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // Reading Procedure - std::cout << "phi in degrees:" << phi << std::endl; - phi = phi * M_PI / 180; - std::cout << "phi in radians:" << phi << std::endl; - - std::vector<std::string> MP_name; - std::vector<real> MP_X, MP_Y, MP_Z; - std::vector<int> MP_level, MP_k; - - std::string name; - real X, Y, Z; - uint level, numberOfMeasurePoints; - - inFile >> numberOfMeasurePoints; - std::cout << "numberOfMeasurePoints: " << numberOfMeasurePoints << " "; - std::cout << "Coordinates from File\n"; - for (uint k = 0; k < numberOfMeasurePoints; k++) { - inFile >> name; - MP_name.push_back(name); - std::cout << "Name: " << MP_name[k] << " "; - - inFile >> X; - MP_X.push_back(X); - std::cout << "\t\tX: " << MP_X[k] << " "; - - inFile >> Y; - MP_Y.push_back(Y); - std::cout << "\t\tY: " << MP_Y[k] << " "; - - inFile >> Z; - if (((variant > 3 && variant < 7) || (variant > 9 && variant <= 12)) && k == 14) - Z += 2.25; // account for angled roof - MP_Z.push_back(Z); - std::cout << "\t\tZ: " << MP_Z[k] + z_offset << " "; - - inFile >> level; - if (level > maxLevel) - level = maxLevel; - MP_level.push_back(level); - std::cout << "\t\tLevel: " << MP_level[k] << std::endl; - } - inFile.close(); - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - real X_temp, Y_temp; - // Transformation for phi radians around centre of city for MP[1..15] - if (!phi == 0) { - std::cout << "Calculating new Coordinates for MP01 to MP15 after Rotation of " << phi * 180 / M_PI - << "degrees (+: counter-clockwise / -: clockwise)\n"; - for (uint k = 0; k < 15; k++) { - X_temp = originXY[0] + (MP_X[k] - originXY[0]) * cos(phi) - (MP_Y[k] - originXY[1]) * sin(phi); - Y_temp = originXY[1] + (MP_X[k] - originXY[0]) * sin(phi) + (MP_Y[k] - originXY[1]) * cos(phi); - std::cout << "Name: " << MP_name[k] << " "; - std::cout << "\t\tX: " << X_temp << " "; - std::cout << "\t\tY: " << Y_temp << " "; - std::cout << "\t\tZ: " << MP_Z[k] << " " << std::endl; - - MP_X[k] = X_temp; - MP_Y[k] = Y_temp; - } - } - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // Coordinates to Index Procedure - // std::cout << "Converting Coordinates to Index..." << std::endl; - for (uint k = 0; k < numberOfMeasurePoints; k++) { - MP_k.push_back( - gridBuilder->getGrid(MP_level[k]) - ->getSparseIndex(gridBuilder->getGrid(MP_level[k])->transCoordToIndex(MP_X[k], MP_Y[k], MP_Z[k]))); - if (MP_k[k] == -1) { - std::cerr << "Error: Could not convert Coordinate to Sparse Index for MP " << k + 1 << std::endl; - } - std::cout << MP_name[k] << "\tID = " - << gridBuilder->getGrid(MP_level[k]) - ->getSparseIndex( - gridBuilder->getGrid(MP_level[k])->transCoordToIndex(MP_X[k], MP_Y[k], MP_Z[k])) - << std::endl; - // std::cout << "ID = " << - // gridBuilder->getGrid(0)->getSparseIndex(gridBuilder->getGrid(0)->transCoordToIndex(-0.500000, - // -0.500000, 9.500000)) << std::endl; - } - // std::cout << "Done Converting Coordinates to Index..." << std::endl; - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // Writing Procedure - // std::cout << "Writing new file..." << std::endl; - std::ofstream outFile(inputPath + "measurePoints.dat"); - - outFile << numberOfMeasurePoints << std::endl; - for (uint j = 0; j < numberOfMeasurePoints; j++) { - outFile << MP_name[j] << " " << MP_k[j] << " " << MP_level[j] << std::endl; - // std::cout << MP_name[j] << "\t" << MP_k[j] << "\t" << MP_level[j] << std::endl; - } - // std::cout << "Done writing new file..." << std::endl; - outFile.close(); - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -} - -std::string chooseVariation() -{ - switch (variant) { - case 1: - simulationName = "Var01_0deg_FD_a"; - break; - case 2: - simulationName = "Var02_0deg_FD_b"; - break; - case 3: - simulationName = "Var03_0deg_FD_c"; - break; - case 4: - simulationName = "Var04_0deg_SD_a"; - break; - case 5: - simulationName = "Var05_0deg_SD_b"; - break; - case 6: - simulationName = "Var06_0deg_SD_c"; - break; - case 7: - simulationName = "Var07_63deg_FD_a"; - break; - case 8: - simulationName = "Var08_63deg_FD_b"; - break; - case 9: - simulationName = "Var09_63deg_FD_c"; - break; - case 10: - simulationName = "Var10_63deg_SD_a"; - break; - case 11: - simulationName = "Var11_63deg_SD_b"; - break; - case 12: - simulationName = "Var12_63deg_SD_c"; - break; - default: - std::cerr << "Warning: no variant selected. Running with Default variant V01!" << std::endl; - simulationName = "Var01_0deg_FD_a"; - rotationOfCity = 0.0; - return simulationName; - } - - if ((0 < variant) && (variant <= 6)) - rotationOfCity = (real)0.0; - else if ((6 < variant) && (variant <= 12)) - rotationOfCity = (real)63.295; - - std::cout << "Variant selected. Simulation name is: " << simulationName << std::endl; - std::cout << "Rotation selected: " << rotationOfCity << std::endl; - - return simulationName; -} - - -int main( int argc, char* argv[]) -{ - try - { - vf::logging::Logger::initializeLogger(); - - // assuming that the config files is stored parallel to this file. - std::filesystem::path filePath = __FILE__; - filePath.replace_filename("configDrivenCavity.txt"); - - multipleLevel(filePath.string()); - } - catch (const spdlog::spdlog_ex &ex) { - std::cout << "Log initialization failed: " << ex.what() << std::endl; - } - catch (const std::bad_alloc& e) - { - VF_LOG_CRITICAL("Bad Alloc: {}", e.what()); - } - catch (const std::exception& e) - { - VF_LOG_CRITICAL("exception: {}", e.what()); - } - catch (...) - { - VF_LOG_CRITICAL("Unknown exception!"); - } - - return 0; -} diff --git a/apps/gpu/WTG_RUB/configDrivenCavity.txt b/apps/gpu/WTG_RUB/configDrivenCavity.txt deleted file mode 100644 index f6ff6c107d239c11d8c88566795f94ada7226085..0000000000000000000000000000000000000000 --- a/apps/gpu/WTG_RUB/configDrivenCavity.txt +++ /dev/null @@ -1,37 +0,0 @@ -################################################## -#GPU Mapping -################################################## -#Devices="0 1 2 3" -#NumberOfDevices=4 - -################################################## -#informations for Writing -################################################## -#Path="E:/DrivenCavity/results" -#Path="F:/Work/Computations/out/DrivenCavity/" -Path="/" -#Prefix="DrivenCavity" -#WriteGrid=true -################################################## -#informations for reading -################################################## -#GridPath="E:/DrivenCavity/dummy" -GridPath="C:" - -################################################## -#number of grid levels -################################################## -#NOGL=1 - -################################################## -#LBM Version -################################################## -#D3Qxx=27 -#MainKernelName=CumulantAA2016CompSP27 - -################################################## -#simulation parameter -################################################## -#TimeEnd=100000 -#TimeOut=1000 -#TimeStartOut=0 \ No newline at end of file diff --git a/apps/gpu/gridGeneratorTest/CMakeLists.txt b/apps/gpu/gridGeneratorTest/CMakeLists.txt deleted file mode 100644 index 7edf505365cc8b05abbf30ef89c0a127e28d75c3..0000000000000000000000000000000000000000 --- a/apps/gpu/gridGeneratorTest/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -PROJECT(GridGeneratorTest LANGUAGES CXX) - -vf_add_library(BUILDTYPE binary PRIVATE_LINK basics gpu_core GridGenerator MPI::MPI_CXX FILES gridGenerator.cpp) diff --git a/apps/gpu/gridGeneratorTest/config.txt b/apps/gpu/gridGeneratorTest/config.txt deleted file mode 100644 index 5491a5174723a4cedd2141b05fa663213aa0dae6..0000000000000000000000000000000000000000 --- a/apps/gpu/gridGeneratorTest/config.txt +++ /dev/null @@ -1,36 +0,0 @@ -################################################## -#GPU Mapping -################################################## -#Devices="0 1 2 3" -#NumberOfDevices=4 - -################################################## -#informations for Writing -################################################## -#Path="E:/DrivenCavity/results" -#Path="F:/Work/Computations/out/DrivenCavity/" -#Prefix="DrivenCavity" -#WriteGrid=true -################################################## -#informations for reading -################################################## -#GridPath="E:/DrivenCavity/dummy" -GridPath="F:/Work/Computations/out/gridGeneratorTest/grid" - -################################################## -#number of grid levels -################################################## -NOGL=2 - -################################################## -#LBM Version -################################################## -#D3Qxx=27 -#MainKernelName=CumulantAA2016CompSP27 - -################################################## -#simulation parameter -################################################## -#TimeEnd=100000 -#TimeOut=1000 -#TimeStartOut=0 \ No newline at end of file diff --git a/apps/gpu/gridGeneratorTest/gridGenerator.cpp b/apps/gpu/gridGeneratorTest/gridGenerator.cpp deleted file mode 100644 index dcc07c798dcbf8caebbe454485dedb411e05fcca..0000000000000000000000000000000000000000 --- a/apps/gpu/gridGeneratorTest/gridGenerator.cpp +++ /dev/null @@ -1,758 +0,0 @@ -#include <fstream> -#include <iostream> -#include <stdexcept> -#include <string> -#define _USE_MATH_DEFINES -#include <cmath> - -#include "StringUtilities/StringUtil.h" -#include "basics/config/ConfigurationFile.h" - -#include "gpu/core/LBM/Simulation.h" -#include "gpu/core/DataStructureInitializer/GridReaderGenerator/GridGenerator.h" -#include "gpu/core/DataStructureInitializer/GridProvider.h" -#include "gpu/core/DataStructureInitializer/GridReaderFiles/GridReader.h" -#include "gpu/core/Parameter/Parameter.h" -#include "gpu/core/Output/FileWriter.h" - -#include "gpu/core/Kernel/KernelFactory/KernelFactoryImp.h" -#include "gpu/core/PreProcessor/PreProcessorFactory/PreProcessorFactoryImp.h" -#include "gpu/core/BoundaryConditions/BoundaryConditionFactory.h" - -#include "gpu/core/GPU/CudaMemoryManager.h" - -#include "global.h" - -#include "geometries/Sphere/Sphere.h" -#include "geometries/VerticalCylinder/VerticalCylinder.h" -#include "geometries/Cuboid/Cuboid.h" -#include "geometries/TriangularMesh/TriangularMesh.h" -#include "geometries/Conglomerate/Conglomerate.h" -#include "geometries/TriangularMesh/TriangularMeshStrategy.h" - -#include "grid/GridBuilder/LevelGridBuilder.h" -#include "grid/GridBuilder/MultipleGridBuilder.h" -#include "grid/BoundaryConditions/Side.h" -#include "grid/BoundaryConditions/BoundaryCondition.h" -#include "grid/GridFactory.h" - -#include "io/SimulationFileWriter/SimulationFileWriter.h" -#include "io/GridVTKWriter/GridVTKWriter.h" -#include "io/STLReaderWriter/STLReader.h" -#include "io/STLReaderWriter/STLWriter.h" - -#include "utilities/math/Math.h" -#include "utilities/communication.h" -#include "utilities/transformator/TransformatorImp.h" - -#include <parallel/MPICommunicator.h> - -void runVirtualFluids(const vf::basics::ConfigurationFile &config) -{ - vf::parallel::Communicator &communicator = *vf::parallel::MPICommunicator::getInstance(); - auto gridBuilder = std::make_shared<MultipleGridBuilder>(); - - SPtr<Parameter> para = std::make_shared<Parameter>(communicator.getNumberOfProcesses(), communicator.getProcessID(), &config); - BoundaryConditionFactory bcFactory = BoundaryConditionFactory(); - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - bool useGridGenerator = true; - - if (useGridGenerator) { - enum testCase { TGV, TGV3D, SphereTest, DrivAer, PaperPlane, DLC, MultiGPU, StlGroupTest }; - - int testcase = SphereTest; - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - if (testcase == TGV) - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - { - real dx = 1.0; - // real vx = 0.049; - ////////////////////////////////////////////////////////////////////////// - //32 - gridBuilder->addCoarseGrid(-24, -2, -16, - 24, 2, 16, dx); - ////////////////////////////////////////////////////////////////////////// - gridBuilder->setPeriodicBoundaryCondition(true, true, true); - ////////////////////////////////////////////////////////////////////////// - gridBuilder->buildGrids(true); - ////////////////////////////////////////////////////////////////////////// - SPtr<Grid> grid = gridBuilder->getGrid(gridBuilder->getNumberOfLevels() - 1); - ////////////////////////////////////////////////////////////////////////// - gridBuilder->writeGridsToVtk("E:/temp/TaylorGreenVortex/results/32/TGV32turned_Grid"); - gridBuilder->writeArrows("E:/temp/TaylorGreenVortex/results/32/TGV32turned_Grid_arrow"); - ////////////////////////////////////////////////////////////////////////// - SimulationFileWriter::write("E:/temp/TaylorGreenVortex/grids/turned/gridUni48x4x32/", gridBuilder, FILEFORMAT::BINARY); - ////////////////////////////////////////////////////////////////////////// - return; - } - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - if (testcase == TGV3D) - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - { - const real PI = 3.141592653589793238462643383279; - - real dx = 2.0 * PI / 32.0; // 32^3 nodes - //real dx = 2.0 * PI / 64.0; // 64^3 nodes - //real dx = 2.0 * PI / 128.0; // 128^3 nodes - //real dx = 2.0 * PI / 256.0; // 128^3 nodes - // real vx = 0.049; - - gridBuilder->addCoarseGrid(-PI, -PI, -PI, - PI, PI, PI, dx); - - gridBuilder->setPeriodicBoundaryCondition(true, true, true); - - gridBuilder->buildGrids(true); // buildGrids() has to be called before setting the BCs!!!! - - ////////////////////////////////////////////////////////////////////////// - SPtr<Grid> grid = gridBuilder->getGrid(gridBuilder->getNumberOfLevels() - 1); - ////////////////////////////////////////////////////////////////////////// - //32 - gridBuilder->writeGridsToVtk("E:/temp/TaylorGreenVortex/results3D/32/TGV3D_Grid"); - gridBuilder->writeArrows("E:/temp/TaylorGreenVortex/results3D/32/TGV3D_Grid_arrow"); - SimulationFileWriter::write("E:/temp/TaylorGreenVortex/grids3D/gridTGV3D/32/", gridBuilder, FILEFORMAT::BINARY); //FILEFORMAT::ASCII - //256 - //gridBuilder->writeGridsToVtk("E:/temp/TaylorGreenVortex/results3D/256/TGV3D_Grid"); - //gridBuilder->writeArrows("E:/temp/TaylorGreenVortex/results3D/256/TGV3D_Grid_arrow"); - //SimulationFileWriter::write("E:/temp/TaylorGreenVortex/grids3D/gridTGV3D/256/", gridBuilder, FILEFORMAT::BINARY); //FILEFORMAT::ASCII - - return; - - } - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - if( testcase == SphereTest) - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - { - real dx = 1.0 / 16.0; - real vx = 0.05; - - real D = 1.0; - real Re = 100; - - para->setOutputPath( "F:/Work/Computations/out/Sphere/" ); - para->setOutputPrefix( "Sphere" ); - - para->setPrintFiles(true); - - para->setVelocityLB( vx ); - para->setViscosityLB( ( vx * D / dx ) / Re ); - - para->setVelocityRatio(1.0); - - para->setTimestepOut( 1000 ); - para->setTimestepEnd( 100000 ); - - para->setCalcDragLift(true); - - para->configureMainKernel("CumulantK15Comp"); - - ////////////////////////////////////////////////////////////////////////// - - // auto sphereSTL = std::make_shared<TriangularMesh>("F:/Work/Computations/gridGenerator/stl/Sphere/SphereNotOptimal.stl"); - - auto sphereRef_1_STL = std::make_shared<TriangularMesh>("F:/Work/Computations/gridGenerator/stl/Sphere/SphereRef_1.stl"); - - // auto sphereRef_2_STL = std::make_shared<TriangularMesh>("F:/Work/Computations/gridGenerator/stl/Sphere/SphereRef_2.stl"); - - auto sphere = std::make_shared<Sphere>( 0, 0, 0, 0.5*D ); - - gridBuilder->addCoarseGrid(-2.0*D, -2.5*D, -2.5*D, - 9.0*D, 2.5*D, 2.5*D, dx); // DrivAer - - //gridBuilder->setNumberOfLayers(10,8); - //gridBuilder->addGrid(SphereSTL, 2); - - gridBuilder->setNumberOfLayers(4,8); - gridBuilder->addGrid(sphereRef_1_STL, 1); - //gridBuilder->addGrid(sphereRef_2_STL, 4); - - //gridBuilder->setNumberOfLayers(10,8); - //gridBuilder->addGrid(sphere, 5); - - - - //gridBuilder->addGeometry(SphereSTL); - gridBuilder->addGeometry(sphere); - - gridBuilder->setPeriodicBoundaryCondition(false, false, false); - - gridBuilder->buildGrids(true); // buildGrids() has to be called before setting the BCs!!!! - ////////////////////////////////////////////////////////////////////////// - gridBuilder->setVelocityBoundaryCondition(SideType::PY, vx , 0.0, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::MY, vx , 0.0, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::PZ, vx , 0.0, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::MZ, vx , 0.0, 0.0); - - gridBuilder->setPressureBoundaryCondition(SideType::PX, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::MX, vx, 0.0, 0.0); - - gridBuilder->setVelocityBoundaryCondition(SideType::GEOMETRY, 0.0, 0.0, 0.0); - - bcFactory.setVelocityBoundaryCondition(BoundaryConditionFactory::VelocityBC::VelocityInterpolatedCompressible); - bcFactory.setGeometryBoundaryCondition(BoundaryConditionFactory::NoSlipBC::NoSlipInterpolatedCompressible); - bcFactory.setPressureBoundaryCondition(BoundaryConditionFactory::PressureBC::PressureNonEquilibriumCompressible); - - ////////////////////////////////////////////////////////////////////////// - SPtr<Grid> grid = gridBuilder->getGrid(gridBuilder->getNumberOfLevels() - 1); - ////////////////////////////////////////////////////////////////////////// - - //gridBuilder->writeGridsToVtk("F:/Work/Computations/out/Sphere/grid"); - //gridBuilder->writeArrows ("F:/Work/Computations/out/Sphere/arrow"); - - SimulationFileWriter::write("F:/Work/Computations/out/Sphere/grid/", gridBuilder, FILEFORMAT::BINARY); - } - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - if( testcase == DrivAer ) - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - { - - real dx = 0.2; - real vx = 0.05; - - real L = 4.6; - real Re = 1.0e6; - - para->setOutputPath( "F:/Work/Computations/out/DrivAerNew/" ); - para->setOutputPrefix( "DrivAer" ); - - para->setPrintFiles(true); - - para->setVelocityLB( vx ); - para->setViscosityLB( ( vx * L / dx ) / Re ); - - //para->setVelocityRatio(1.0 / velocityLB); - para->setVelocityRatio(1.0); - - para->setTimestepOut( 10000 ); - para->setTimestepEnd( 100000 ); - - para->configureMainKernel("CumulantK20Comp"); - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - auto DrivAerSTL = std::make_shared<TriangularMesh>("F:/Work/Computations/gridGenerator/stl/DrivAer_Fastback_Coarse.stl"); - //auto triangularMesh = std::make_shared<TriangularMesh>("M:/TestGridGeneration/STL/DrivAer_NoSTLGroups.stl"); - //auto triangularMesh = std::make_shared<TriangularMesh>("M:/TestGridGeneration/STL/DrivAer_Coarse.stl"); - //auto DrivAerSTL = std::make_shared<TriangularMesh>("stl/DrivAer_Fastback_Coarse.stl"); - - auto DrivAerRefBoxSTL = std::make_shared<TriangularMesh>("F:/Work/Computations/gridGenerator/stl/DrivAer_REF_BOX_Adrea.stl"); - //auto DrivAerRefBoxSTL = std::make_shared<TriangularMesh>("stl/DrivAer_REF_BOX_Adrea.stl"); - - real z0 = 0.318; - - gridBuilder->addCoarseGrid(- 5.0, -5.0, 0.0 - z0, - 15.0, 5.0, 5.0 - z0, dx); // DrivAer - - //auto floorBox = std::make_shared<Cuboid>( -0.3, -1, -1, 4.0, 1, 0.2 ); - //auto wakeBox = std::make_shared<Cuboid>( 3.5, -1, -1, 5.5, 1, 0.8 ); - - //Conglomerate* refRegion = new Conglomerate(); - - //refRegion->add(floorBox); - //refRegion->add(wakeBox); - //refRegion->add(DrivAerRefBoxSTL); - - gridBuilder->setNumberOfLayers(10,8); - gridBuilder->addGrid(DrivAerRefBoxSTL, 4); - - gridBuilder->setNumberOfLayers(10,8); - gridBuilder->addGrid(DrivAerSTL, 5); - - gridBuilder->addGeometry(DrivAerSTL); - - gridBuilder->setPeriodicBoundaryCondition(false, false, false); - - gridBuilder->buildGrids(true); // buildGrids() has to be called before setting the BCs!!!! - - ////////////////////////////////////////////////////////////////////////// - - gridBuilder->setVelocityBoundaryCondition(SideType::PY, vx , 0.0, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::MY, vx , 0.0, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::PZ, vx , 0.0, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::MZ, vx , 0.0, 0.0); - - gridBuilder->setPressureBoundaryCondition(SideType::PX, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::MX, vx, 0.0, 0.0); - - gridBuilder->setVelocityBoundaryCondition(SideType::GEOMETRY, 0.0, 0.0, 0.0); - - bcFactory.setVelocityBoundaryCondition(BoundaryConditionFactory::VelocityBC::VelocityWithPressureInterpolatedCompressible); - bcFactory.setGeometryBoundaryCondition(BoundaryConditionFactory::VelocityBC::VelocityInterpolatedCompressible); - bcFactory.setPressureBoundaryCondition(BoundaryConditionFactory::PressureBC::OutflowNonReflective); - - ////////////////////////////////////////////////////////////////////////// - - SPtr<Grid> grid = gridBuilder->getGrid(gridBuilder->getNumberOfLevels() - 1); - - gridBuilder->getGeometryBoundaryCondition(gridBuilder->getNumberOfLevels() - 1)->setTangentialVelocityForPatch( grid, 4, 0.0075, -2.0, 0.0, - 0.0075, 2.0, 0.0, -vx, 0.318); - gridBuilder->getGeometryBoundaryCondition(gridBuilder->getNumberOfLevels() - 1)->setTangentialVelocityForPatch( grid, 3, 2.793 , -2.0, 0.0, - 2.793 , 2.0, 0.0, -vx, 0.318); - - ////////////////////////////////////////////////////////////////////////// - - gridBuilder->writeGridsToVtk("F:/Work/Computations/out/DrivAerNew/DrivAer_Grid_"); - gridBuilder->writeArrows ("F:/Work/Computations/out/DrivAerNew/DrivAer_Grid_arrow"); - - //SimulationFileWriter::write("D:/GRIDGENERATION/files/", gridBuilder, FILEFORMAT::ASCII); - //SimulationFileWriter::write("C:/Users/lenz/Desktop/Work/gridGenerator/grid/", gridBuilder, FILEFORMAT::ASCII); - SimulationFileWriter::write("F:/Work/Computations/out/DrivAerNew/grid/", gridBuilder, FILEFORMAT::BINARY); - //SimulationFileWriter::write("grid/", gridBuilder, FILEFORMAT::ASCII); - - //return; - //gridGenerator = GridProvider::makeGridGenerator(gridBuilder, para, cudaMemoryManager, communicator); - } - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - if( testcase == PaperPlane ) - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - { - - real dx = 0.01; - real vx = 0.05; - - real L = 0.3; - real Re = 90000; - - para->setOutputPath( "F:/Work/Computations/out/PaperPlane/" ); - para->setOutputPrefix( "PaperPlaneK17winglet" ); - - para->setPrintFiles(true); - - para->setVelocityLB( vx ); - para->setViscosityLB( ( vx * L / dx ) / Re ); - - para->setVelocityRatio(1.0); - - para->setTimestepOut( 1000 ); - para->setTimestepEnd( 100000 ); - - para->configureMainKernel("CumulantAA2016CompSP27"); - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - auto STL = std::make_shared<TriangularMesh>("F:/Work/Computations/gridGenerator/stl/PaperPlane_1.stl"); - //auto STL = std::make_shared<TriangularMesh>("F:/Work/Computations/gridGenerator/stl/PaperPlane_1_winglet.stl"); - - auto RefBoxSTL = std::make_shared<TriangularMesh>("F:/Work/Computations/gridGenerator/stl/PaperPlane_1_ref.stl"); - //auto RefBoxSTL = std::make_shared<TriangularMesh>("F:/Work/Computations/gridGenerator/stl/PaperPlane_1_winglet_ref.stl"); - - gridBuilder->addCoarseGrid(- 0.5, -0.3, -0.3, - 1.0, 0.3, 0.3, dx); - - gridBuilder->setNumberOfLayers(6,8); - gridBuilder->addGrid(RefBoxSTL, 3); - - gridBuilder->addGeometry(STL); - - gridBuilder->setPeriodicBoundaryCondition(false, false, false); - - gridBuilder->buildGrids(true); // buildGrids() has to be called before setting the BCs!!!! - - ////////////////////////////////////////////////////////////////////////// - - gridBuilder->setVelocityBoundaryCondition(SideType::PY, vx , 0.0, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::MY, vx , 0.0, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::PZ, vx , 0.0, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::MZ, vx , 0.0, 0.0); - - gridBuilder->setPressureBoundaryCondition(SideType::PX, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::MX, vx, 0.0, 0.0); - - gridBuilder->setVelocityBoundaryCondition(SideType::GEOMETRY, 0.0, 0.0, 0.0); - - bcFactory.setVelocityBoundaryCondition(BoundaryConditionFactory::VelocityBC::VelocityWithPressureInterpolatedCompressible); - bcFactory.setGeometryBoundaryCondition(BoundaryConditionFactory::VelocityBC::VelocityInterpolatedCompressible); - bcFactory.setPressureBoundaryCondition(BoundaryConditionFactory::PressureBC::OutflowNonReflective); - - ////////////////////////////////////////////////////////////////////////// - - gridBuilder->writeGridsToVtk("F:/Work/Computations/out/PaperPlane/PaperPlane_Grid_"); - gridBuilder->writeArrows ("F:/Work/Computations/out/PaperPlane/PaperPlane_Grid_arrow"); - - //SimulationFileWriter::write("D:/GRIDGENERATION/files/", gridBuilder, FILEFORMAT::ASCII); - //SimulationFileWriter::write("C:/Users/lenz/Desktop/Work/gridGenerator/grid/", gridBuilder, FILEFORMAT::ASCII); - SimulationFileWriter::write("F:/Work/Computations/out/PaperPlane/grid/", gridBuilder, FILEFORMAT::BINARY); - //SimulationFileWriter::write("grid/", gridBuilder, FILEFORMAT::ASCII); - - //return; - //gridGenerator = GridProvider::makeGridGenerator(gridBuilder, para, cudaMemoryManager, communicator); - } - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - if( testcase == StlGroupTest ) - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - { - - real dx = 0.025; - real vx = 0.05; - - real L = 1.0; - real Re = 100; - - para->setOutputPath( "F:/Work/Computations/out/StlGroupTest/" ); - para->setOutputPrefix( "StlGroupTest" ); - - para->setPrintFiles(true); - - para->setVelocityLB( vx ); - para->setViscosityLB( ( vx * L / dx ) / Re ); - - para->setVelocityRatio(1.0); - - para->setTimestepOut( 1000 ); - para->setTimestepEnd( 100000 ); - - para->configureMainKernel("CumulantAA2016CompSP27"); - //para->configureMainKernel(kernelMapper->getEnum("CumulantOneCompSP27")); - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - auto STL = std::make_shared<TriangularMesh>("F:/Work/Computations/gridGenerator/stl/STL_Group_Test_2_Cylinders.stl"); - - gridBuilder->addCoarseGrid(- 2.0, -4.5, -2.0, - 4.0, 4.5, 2.0, dx); - - gridBuilder->addGeometry(STL); - - gridBuilder->setPeriodicBoundaryCondition(false, false, false); - - gridBuilder->buildGrids(true); // buildGrids() has to be called before setting the BCs!!!! - - ////////////////////////////////////////////////////////////////////////// - - gridBuilder->setVelocityBoundaryCondition(SideType::PY, vx , 0.0, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::MY, vx , 0.0, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::PZ, vx , 0.0, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::MZ, vx , 0.0, 0.0); - - gridBuilder->setPressureBoundaryCondition(SideType::PX, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::MX, vx, 0.0, 0.0); - - gridBuilder->setVelocityBoundaryCondition(SideType::GEOMETRY, 0.0, 0.0, 0.0); - - bcFactory.setVelocityBoundaryCondition(BoundaryConditionFactory::VelocityBC::VelocityInterpolatedCompressible); - bcFactory.setGeometryBoundaryCondition(BoundaryConditionFactory::NoSlipBC::NoSlipInterpolatedCompressible); - bcFactory.setPressureBoundaryCondition(BoundaryConditionFactory::PressureBC::PressureNonEquilibriumCompressible); - - ////////////////////////////////////////////////////////////////////////// - - SPtr<Grid> grid = gridBuilder->getGrid(gridBuilder->getNumberOfLevels() - 1); - - gridBuilder->getGeometryBoundaryCondition(gridBuilder->getNumberOfLevels() - 1)->setTangentialVelocityForPatch( grid, 1, 0.0, -2.0, 0.0, - 0.0, 2.0, 0.0, -vx, 0.5); - - ////////////////////////////////////////////////////////////////////////// - - gridBuilder->writeGridsToVtk("F:/Work/Computations/out/StlGroupTest/StlGroupTest_Grid_"); - gridBuilder->writeArrows ("F:/Work/Computations/out/StlGroupTest/StlGroupTest_Grid_arrow"); - - SimulationFileWriter::write("F:/Work/Computations/out/StlGroupTest/grid/", gridBuilder, FILEFORMAT::BINARY); - - } - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - if( testcase == DLC ) - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - { - real velocityRatio = 594.093427; - - real dx = 0.2; - real vx = 0.065272188; - - real z0 = 0.24395 + 0.5*dx; - - std::vector<uint> ignorePatches = { 152, 153, 154 }; - - //auto VW370_SERIE_STL = std::make_shared<TriangularMesh>("C:/Users/lenz/Desktop/Work/gridGenerator/stl/VW370_SERIE.stl", ignorePatches); - auto VW370_SERIE_STL = std::make_shared<TriangularMesh>("stl/VW370_SERIE.stl", ignorePatches); - - //auto DLC_RefBox = std::make_shared<TriangularMesh>("C:/Users/lenz/Desktop/Work/gridGenerator/stl/DLC_RefBox.stl"); - - //auto DLC_RefBox_1 = std::make_shared<TriangularMesh>("C:/Users/lenz/Desktop/Work/gridGenerator/stl/DLC_RefBox_withWake/DLC_RefBox_withWake_4m.stl"); - //auto DLC_RefBox_2 = std::make_shared<TriangularMesh>("C:/Users/lenz/Desktop/Work/gridGenerator/stl/DLC_RefBox_withWake/DLC_RefBox_withWake_3m.stl"); - //auto DLC_RefBox_3 = std::make_shared<TriangularMesh>("C:/Users/lenz/Desktop/Work/gridGenerator/stl/DLC_RefBox_withWake/DLC_RefBox_withWake_2m.stl"); - //auto DLC_RefBox_4 = std::make_shared<TriangularMesh>("C:/Users/lenz/Desktop/Work/gridGenerator/stl/DLC_RefBox_withWake/DLC_RefBox_withWake_1m.stl"); - - //auto DLC_RefBox_Level_3 = std::make_shared<TriangularMesh>("C:/Users/lenz/Desktop/Work/gridGenerator/stl/DLC/DLC_RefBox_Level_3.stl"); - //auto DLC_RefBox_Level_4 = std::make_shared<TriangularMesh>("C:/Users/lenz/Desktop/Work/gridGenerator/stl/DLC/DLC_RefBox_Level_4.stl"); - //auto DLC_RefBox_Level_5 = std::make_shared<TriangularMesh>("C:/Users/lenz/Desktop/Work/gridGenerator/stl/DLC/DLC_RefBox_Level_5.stl"); - - auto DLC_RefBox_Level_3 = std::make_shared<TriangularMesh>("stl/DLC/DLC_RefBox_Level_3.stl"); - auto DLC_RefBox_Level_4 = std::make_shared<TriangularMesh>("stl/DLC/DLC_RefBox_Level_4.stl"); - auto DLC_RefBox_Level_5 = std::make_shared<TriangularMesh>("stl/DLC/DLC_RefBox_Level_5.stl"); - - //auto VW370_SERIE_STL = std::make_shared<TriangularMesh>("stl/VW370_SERIE.stl", ignorePatches); - //auto DLC_RefBox = std::make_shared<TriangularMesh>("stl/DLC_RefBox.lnx.stl"); - //auto DLC_RefBox_4 = std::make_shared<TriangularMesh>("stl/DLC_RefBox_withWake/DLC_RefBox_withWake_1m.lnx.stl"); - - gridBuilder->addCoarseGrid(-30.0, -20.0, 0.0 - z0, - 50.0, 20.0, 25.0 - z0, dx); - - gridBuilder->setNumberOfLayers(10,8); - gridBuilder->addGrid( std::make_shared<Cuboid>( - 6.6, -6, -0.7, 20.6 , 6, 5.3 ), 1 ); - gridBuilder->addGrid( std::make_shared<Cuboid>( -3.75, -3, -0.7, 11.75, 3, 2.65 ), 2 ); - - gridBuilder->setNumberOfLayers(10,8); - gridBuilder->addGrid(DLC_RefBox_Level_3, 3); - gridBuilder->addGrid(DLC_RefBox_Level_4, 4); - - auto refinement = std::make_shared<Conglomerate>(); - refinement->add(DLC_RefBox_Level_5); - refinement->add(VW370_SERIE_STL); - - gridBuilder->setNumberOfLayers(10,8); - gridBuilder->addGrid(refinement, 5); - - gridBuilder->addGeometry(VW370_SERIE_STL); - - gridBuilder->setPeriodicBoundaryCondition(false, false, false); - - gridBuilder->buildGrids(true); // buildGrids() has to be called before setting the BCs!!!! - - ////////////////////////////////////////////////////////////////////////// - - gridBuilder->setVelocityBoundaryCondition(SideType::PY, vx, 0.0, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::MY, vx, 0.0, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::PZ, vx, 0.0, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::MZ, vx, 0.0, 0.0); - - gridBuilder->setPressureBoundaryCondition(SideType::PX, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::MX, vx, 0.0, 0.0); - - gridBuilder->setVelocityBoundaryCondition(SideType::GEOMETRY, 0.0, 0.0, 0.0); - - bcFactory.setVelocityBoundaryCondition(BoundaryConditionFactory::VelocityBC::VelocityWithPressureInterpolatedCompressible); - bcFactory.setGeometryBoundaryCondition(BoundaryConditionFactory::NoSlipBC::NoSlipInterpolatedCompressible); - bcFactory.setPressureBoundaryCondition(BoundaryConditionFactory::PressureBC::OutflowNonReflective); - - ////////////////////////////////////////////////////////////////////////// - - SPtr<Grid> grid = gridBuilder->getGrid(gridBuilder->getNumberOfLevels() - 1); - - real wheelsFrontX = -0.081; - real wheelsRearX = 2.5486; - - real wheelsFrontZ = 0.0504; - real wheelsRearZ = 0.057; - - real wheelsRadius = 0.318; - - real wheelRotationFrequency = 1170.74376 / 60.0; - - real wheelTangentialVelocity = -2.0 * M_PI * wheelsRadius * wheelRotationFrequency / velocityRatio; - - std::vector<uint> frontWheelPatches = { 71, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 159 }; - std::vector<uint> rearWheelPatches = { 82, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 160 }; - - for( uint patch : frontWheelPatches ){ - gridBuilder->getGeometryBoundaryCondition(gridBuilder->getNumberOfLevels() - 1)->setTangentialVelocityForPatch( grid, patch, wheelsFrontX, -2.0, wheelsFrontZ, - wheelsFrontX, 2.0, wheelsFrontZ, - wheelTangentialVelocity, wheelsRadius); - } - - for( uint patch : rearWheelPatches ){ - gridBuilder->getGeometryBoundaryCondition(gridBuilder->getNumberOfLevels() - 1)->setTangentialVelocityForPatch( grid, patch, wheelsRearX , -2.0, wheelsRearZ , - wheelsRearX , 2.0, wheelsRearZ , - wheelTangentialVelocity, wheelsRadius); - } - - ////////////////////////////////////////////////////////////////////////// - - //gridBuilder->writeGridsToVtk("C:/Users/lenz/Desktop/Work/gridGenerator/grid/DLC_Grid"); - //gridBuilder->writeArrows ("C:/Users/lenz/Desktop/Work/gridGenerator/grid/DLC_Grid_arrow"); - - gridBuilder->writeGridsToVtk("grid/DLC_Grid"); - gridBuilder->writeArrows ("grid/DLC_Grid_arrow"); - - //SimulationFileWriter::write("D:/GRIDGENERATION/files/", gridBuilder, FILEFORMAT::ASCII); - //SimulationFileWriter::write("C:/Users/lenz/Desktop/Work/gridGenerator/grid/", gridBuilder, FILEFORMAT::ASCII); - SimulationFileWriter::write("grid/", gridBuilder, FILEFORMAT::ASCII); - - //gridGenerator = GridProvider::makeGridGenerator(gridBuilder, para, cudaMemoryManager, communicator); - } - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - if( testcase == MultiGPU ) - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - { - - real dx = 1.0 / 40.0; - real vx = 0.05; - - real D = 1.0; - real Re = 100; - - para->setOutputPath( "F:/Work/Computations/out/Sphere/" ); - para->setOutputPrefix( "Sphere" ); - - para->setPrintFiles(true); - - para->setVelocityLB( vx ); - para->setViscosityLB( ( vx * D / dx ) / Re ); - - para->setVelocityRatio(1.0); - - para->setTimestepOut( 1000 ); - para->setTimestepEnd( 100000 ); - - para->setCalcDragLift(true); - - para->configureMainKernel("CumulantK15Comp"); - - para->setDevices( { 0, 1 } ); - para->setMaxDev(2); - - //const uint generatePart = 1; - const uint generatePart = communicator.getProcessID(); - - std::ofstream logFile2; - - if( generatePart == 0 ) - logFile2.open( "F:/Work/Computations/gridGenerator/grid/0/gridGeneratorLog.txt" ); - //logFile2.open( "grid/0/gridGeneratorLog.txt" ); - - if( generatePart == 1 ) - logFile2.open( "F:/Work/Computations/gridGenerator/grid/1/gridGeneratorLog.txt" ); - //logFile2.open( "grid/1/gridGeneratorLog.txt" ); - - - auto triangularMesh = std::make_shared<TriangularMesh>("F:/Work/Computations/gridGenerator/stl/Sphere/SphereNotOptimal.stl"); - //auto triangularMesh = std::make_shared<TriangularMesh>("stl/ShpereNotOptimal.lnx.stl"); - - // all - //gridBuilder->addCoarseGrid(-2, -2, -2, - // 4, 2, 2, dx); - - real overlap = 10.0 * dx; - - if( generatePart == 0 ) - gridBuilder->addCoarseGrid(-2.0 , -2.0, -2.0, - 0.5 + overlap, 2.0, 2.0, dx); - - if( generatePart == 1 ) - gridBuilder->addCoarseGrid( 0.5 - overlap, -2.0, -2.0, - 4.0 , 2.0, 2.0, dx); - - - gridBuilder->setNumberOfLayers(10,8); - gridBuilder->addGrid(triangularMesh, 1); - - gridBuilder->addGeometry(triangularMesh); - - if( generatePart == 0 ) - gridBuilder->setSubDomainBox( std::make_shared<BoundingBox>( -2.0, 0.5, - -2.0, 2.0, - -2.0, 2.0 ) ); - - if( generatePart == 1 ) - gridBuilder->setSubDomainBox( std::make_shared<BoundingBox>( 0.5, 4.0, - -2.0, 2.0, - -2.0, 2.0 ) ); - - gridBuilder->setPeriodicBoundaryCondition(false, false, false); - - gridBuilder->buildGrids(true); // buildGrids() has to be called before setting the BCs!!!! - - if( generatePart == 0 ){ - gridBuilder->findCommunicationIndices(CommunicationDirections::PX); - gridBuilder->setCommunicationProcess(CommunicationDirections::PX, 1); - } - - if( generatePart == 1 ){ - gridBuilder->findCommunicationIndices(CommunicationDirections::MX); - gridBuilder->setCommunicationProcess(CommunicationDirections::MX, 0); - } - - ////////////////////////////////////////////////////////////////////////// - - gridBuilder->setVelocityBoundaryCondition(SideType::PY, vx , 0.0, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::MY, vx , 0.0, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::PZ, vx , 0.0, 0.0); - gridBuilder->setVelocityBoundaryCondition(SideType::MZ, vx , 0.0, 0.0); - - if (generatePart == 0) { - gridBuilder->setVelocityBoundaryCondition(SideType::MX, vx, 0.0, 0.0); - } - if (generatePart == 1) { - gridBuilder->setPressureBoundaryCondition(SideType::PX, 0.0); - } - - gridBuilder->setVelocityBoundaryCondition(SideType::GEOMETRY, 0.0, 0.0, 0.0); - - bcFactory.setVelocityBoundaryCondition(BoundaryConditionFactory::VelocityBC::VelocityInterpolatedCompressible); - bcFactory.setGeometryBoundaryCondition(BoundaryConditionFactory::NoSlipBC::NoSlipInterpolatedCompressible); - bcFactory.setPressureBoundaryCondition(BoundaryConditionFactory::PressureBC::PressureNonEquilibriumCompressible); - - ////////////////////////////////////////////////////////////////////////// - - if (generatePart == 0) { - //gridBuilder->writeGridsToVtk("F:/Work/Computations/gridGenerator/grid/0/Test_"); - //gridBuilder->writeArrows ("F:/Work/Computations/gridGenerator/grid/0/Test_Arrow"); - } - if (generatePart == 1) { - //gridBuilder->writeGridsToVtk("F:/Work/Computations/gridGenerator/grid/1/Test_"); - //gridBuilder->writeArrows ("F:/Work/Computations/gridGenerator/grid/1/Test_Arrow"); - } - - if (generatePart == 0) - SimulationFileWriter::write("F:/Work/Computations/gridGenerator/grid/0/", gridBuilder, FILEFORMAT::ASCII); - //SimulationFileWriter::write("grid/0/", gridBuilder, FILEFORMAT::ASCII); - if (generatePart == 1) - SimulationFileWriter::write("F:/Work/Computations/gridGenerator/grid/1/", gridBuilder, FILEFORMAT::ASCII); - //SimulationFileWriter::write("grid/1/", gridBuilder, FILEFORMAT::ASCII); - - //return; - - //gridGenerator = GridProvider::makeGridGenerator(gridBuilder, para, cudaMemoryManager, communicator); - } - - } else { - //gridGenerator = GridProvider::makeGridGenerator(gridBuilder, para, cudaMemoryManager, communicator); - //gridGenerator = GridProvider::makeGridReader(FILEFORMAT::BINARY, para, cudaMemoryManager); - } - - //return; - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - auto cudaMemoryManager = std::make_shared<CudaMemoryManager>(para); - - SPtr<GridProvider> gridGenerator; - if (useGridGenerator) - gridGenerator = GridProvider::makeGridGenerator(gridBuilder, para, cudaMemoryManager, communicator); - else - gridGenerator = GridProvider::makeGridReader(FILEFORMAT::BINARY, para, cudaMemoryManager); - - Simulation sim(para, cudaMemoryManager, communicator, *gridGenerator, &bcFactory); - sim.run(); -} - -int main(int argc, char *argv[]) -{ - if (argc > 1) { - - try { - VF_LOG_TRACE("For the default config path to work, execute the app from the project root."); - vf::basics::ConfigurationFile config = vf::basics::loadConfig(argc, argv); - runVirtualFluids(config); - - ////////////////////////////////////////////////////////////////////////// - } catch (const spdlog::spdlog_ex &ex) { - std::cout << "Log initialization failed: " << ex.what() << std::endl; - } catch (const std::bad_alloc &e) { - VF_LOG_CRITICAL("Bad Alloc: {}", e.what()); - } catch (const std::exception &e) { - VF_LOG_CRITICAL("exception: {}", e.what()); - } catch (...) { - VF_LOG_CRITICAL("Unknown exception!"); - } - } - return 0; -} diff --git a/apps/gpu/wifi/UniformInflow/configUniformInflow.txt b/apps/gpu/wifi/UniformInflow/configUniformInflow.txt deleted file mode 100755 index 8509a4ef259a168b31781e63e724371f15e0b46e..0000000000000000000000000000000000000000 --- a/apps/gpu/wifi/UniformInflow/configUniformInflow.txt +++ /dev/null @@ -1,34 +0,0 @@ -################################################## -#informations for Writing -################################################## -Path = output/wifi/ -################################################## -#informations for reading -################################################## -GridPath = . -################################################## -Devices = 0 -################################################## -tStartOut = 0 -tOut = 10000 -tEnd = 10000 -################################################## -tStartAveraging = 0 -tStartTmpAveraging = 0 -tAveraging = 10 -tStartOutProbe = 10 -tOutProbe = 10 -################################################## -Ma = 0.05 -nodesPerDiameter = 32 -bodyForce = true -SGSconstant = 0.333 -TurbulenceModel = QR -QuadricLimiterP = 100000.0 -QuadricLimiterM = 100000.0 -QuadricLimiterD = 100000.0 - -################################################## -turbineDiameter = 126 -NumberOfNodesPerAL = 100 -# SmearingWidth = 15 \ No newline at end of file diff --git a/apps/gpu/wifi/UniformInflow/uniform_inflow.py b/apps/gpu/wifi/UniformInflow/uniform_inflow.py deleted file mode 100755 index 1c71d7c362326d2f49166f76350ab4b8d0ccf1c0..0000000000000000000000000000000000000000 --- a/apps/gpu/wifi/UniformInflow/uniform_inflow.py +++ /dev/null @@ -1,150 +0,0 @@ -#%% -import numpy as np -from pathlib import Path -from mpi4py import MPI -from pyfluids import basics, gpu, logger -from wiFI.wind_farm import create_wind_farm_from_json -from wiFI.logging.logger import LoggerConfig -from wiFI.aeroelastics.stiff_rotor import StiffRotorGPU -from wiFI.interfaces.implementations.velocity_provider.VirtualFluids import VFFarm -import multiprocessing as mp - -mp.set_start_method("spawn", force=True) -#%% -def main(): - communicator = gpu.MpiCommunicator.get_instance() - sim_name = "NREL5MW" - sim_dir = Path("/workspaces/VirtualFluids_dev/output/wifi/") - config_file = Path("apps/gpu/wifi/UniformInflow")/"configUniformInflow.txt" - farm_file = Path("/workspaces/VirtualFluids_dev/wifi/resources/turbine_data/NREL5MW")/"SingleTurbine.json" - use_tip_correction = False - tip_speed_ratio = 7.5 - #%% - logger.Logger.initialize_logger() - #%% - grid_builder = gpu.grid_generator.MultipleGridBuilder() - - config = basics.ConfigurationFile() - config.load(str(config_file)) - - para = gpu.Parameter(communicator.get_number_of_process(), communicator.get_pid(), config) - para.set_use_streams(True) - bc_factory = gpu.BoundaryConditionFactory() - - grid_scaling_factory = gpu.GridScalingFactory() - grid_scaling_factory.set_scaling_factory(gpu.GridScaling.ScaleCompressible) - - #%% - turbine_diameter = config.get_float_value("turbineDiameter", 126) - - - viscosity = config.get_float_value("viscosity", 1.56e-5) - - velocity = 8 - mach = config.get_float_value("Ma", 0.05) - nodes_per_diameter = config.get_uint_value("NodesPerDiameter", 32) - - density = config.get_float_value("Density", 1.225) - level = 0 - n_blade_nodes = config.get_int_value("NumberOfNodesPerAL", 32) - - - # all in s - t_start_out = config.get_float_value("tStartOut") - t_out = config.get_float_value("tOut") - t_end = config.get_float_value("tEnd") # total time of simulation - - t_start_averaging = config.get_float_value("tStartAveraging") - t_start_tmp_averaging = config.get_float_value("tStartTmpAveraging") - t_averaging = config.get_float_value("tAveraging") - t_start_out_probe = config.get_float_value("tStartOutProbe") - t_out_probe = config.get_float_value("tOutProbe") - - #%% - length = np.array([4,3,3])*turbine_diameter - dx = turbine_diameter / nodes_per_diameter - dt = dx * mach / (np.sqrt(3) * velocity) - velocity_LB = velocity * dt / dx # LB units - viscosity_LB = viscosity * dt / (dx * dx) # LB units - pressure_gradient = 0 - epsilon = dx*pow(2,-level)*1.5 - - logger.vf_log_info(f"velocity [dx/dt] = {velocity_LB}") - logger.vf_log_info(f"dt = {dt}") - logger.vf_log_info(f"dx = {dx}") - logger.vf_log_info(f"viscosity [10^8 dx^2/dt] = {viscosity_LB*1e8}") - logger.vf_log_info(f"dpdx = {pressure_gradient}") - logger.vf_log_info(f"mach number = {mach}") - - farm = create_wind_farm_from_json(farm_file, sim_dir, tip_speed_ratio, velocity, True, log_turbine=True, logger_config=LoggerConfig(0, 1.0, timesteps_in_buffer=1)) - - farm.turbine.add_blade_forces_logging(True) - farm.turbine.add_blade_coordinate_logging(True) - farm.turbine.add_blade_velocities_logging(True) - - #%% - para.set_output_prefix(sim_name) - para.set_print_files(True) - - para.set_forcing(0, 0, 0) - para.set_velocity_LB(velocity_LB) - para.set_viscosity_LB(viscosity_LB) - para.set_velocity_ratio(dx/dt) - para.set_viscosity_ratio(dx*dx/dt) - - para.set_main_kernel("CumulantK17") - - para.set_timestep_start_out(int(t_start_out)) - # para.set_timestep_out(20) - para.set_timestep_out(int(t_out)) - para.set_timestep_end(int(t_end)) - para.set_is_body_force(True) - #%% - tm_factory = gpu.TurbulenceModelFactory(para) - tm_factory.read_config_file(config) - #%% - grid_builder.add_coarse_grid(-1.*turbine_diameter, -0.5 * length[1], -0.5 * length[2], length[0]-1.*turbine_diameter, 0.5 * length[1], 0.5 * length[2], dx) - grid_builder.set_periodic_boundary_condition(False, True, True) - grid_builder.build_grids(False) - - - - grid_builder.set_velocity_boundary_condition(gpu.SideType.MX, velocity_LB, 0.0, 0.0) - grid_builder.set_pressure_boundary_condition(gpu.SideType.PX, 0) - - bc_factory.set_velocity_boundary_condition(gpu.VelocityBC.VelocityCompressible) - bc_factory.set_pressure_boundary_condition(gpu.PressureBC.OutflowNonReflective) - - #%% - para.set_initial_condition_uniform(velocity_LB, 0, 0) - - coupled_farm = VFFarm(farm, density, epsilon, level, dt, dx, n_blade_nodes, StiffRotorGPU, (density, ), use_tip_correction, 0) - para.add_actuator(coupled_farm) - - # wall_model_probe = gpu.probes.WallModelProbe("wallModelProbe", para.get_output_path(), int(t_start_averaging/dt), int(t_start_tmp_averaging/dt), int(t_averaging/dt), int(t_start_out_probe/dt), int(t_out_probe/dt)) - # wall_model_probe.add_all_available_statistics() - # wall_model_probe.set_file_name_to_n_out() - # wall_model_probe.set_force_output_to_stress(True) - # if para.get_is_body_force(): - # wall_model_probe.set_evaluate_pressure_gradient(True) - # para.add_probe(wall_model_probe) - - # plane_locs = [farm.positions.x[0] + i*turbine_diameter for i in range(-1,6)] - - # for n_probe, probe_pos in enumerate(plane_locs): - # plane_probe = gpu.probes.PlaneProbe(f"planeProbe_{n_probe+1}", para.get_output_path(), int(t_start_averaging/dt), int(t_averaging/dt), int(t_start_out_probe/dt), int(t_out_probe/dt)) - # plane_probe.set_probe_plane(probe_pos, 0, 0, dx, length[1], length[2]) - # plane_probe.add_all_available_statistics() - # para.add_probe(plane_probe) - - #%% - cuda_memory_manager = gpu.CudaMemoryManager(para) - grid_generator = gpu.GridProvider.make_grid_generator(grid_builder, para, cuda_memory_manager, communicator) - #%% - sim = gpu.Simulation(para, cuda_memory_manager, communicator, grid_generator, bc_factory, tm_factory, grid_scaling_factory) - #%% - sim.run() - MPI.Finalize() - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/gpu.cmake b/gpu.cmake index 9e53ff1cf79c092f9fc6bc88fb2be019e8cc49c6..079d87615adbe2a3cf3b475abb80f7d1ce28605f 100644 --- a/gpu.cmake +++ b/gpu.cmake @@ -17,7 +17,7 @@ if(BUILD_VF_ALL_SAMPLES) "apps/gpu/ActuatorLine" "apps/gpu/SphereMultiGPU" "apps/gpu/TGV_3D" - "apps/gpu/gridGeneratorTest") + ) endif() add_subdirectory(apps/gpu/DrivenCavity) diff --git a/pythonbindings/src/gpu/submodules/boundary_conditions.cpp b/pythonbindings/src/gpu/submodules/boundary_conditions.cpp index cd1bba026bbbda4fa83c282b417ac407f5b8a3dc..e7d7e472277a69a15fac1c888542fe0aee5df6a8 100644 --- a/pythonbindings/src/gpu/submodules/boundary_conditions.cpp +++ b/pythonbindings/src/gpu/submodules/boundary_conditions.cpp @@ -74,11 +74,8 @@ namespace boundary_conditions .value("NoSlipInterpolatedCompressible", BoundaryConditionFactory::NoSlipBC::NoSlipInterpolatedCompressible); py::enum_<BoundaryConditionFactory::SlipBC>(parentModule, "SlipBC") - .value("SlipIncompressible", BoundaryConditionFactory::SlipBC::SlipIncompressible) .value("SlipCompressible", BoundaryConditionFactory::SlipBC::SlipCompressible) - .value("SlipBounceBack", BoundaryConditionFactory::SlipBC::SlipBounceBack) - .value("SlipCompressibleTurbulentViscosity", BoundaryConditionFactory::SlipBC::SlipCompressibleTurbulentViscosity) - .value("SlipPressureCompressibleTurbulentViscosity", BoundaryConditionFactory::SlipBC::SlipPressureCompressibleTurbulentViscosity) + .value("SlipTurbulentViscosityCompressible", BoundaryConditionFactory::SlipBC::SlipTurbulentViscosityCompressible) .value("NotSpecified", BoundaryConditionFactory::SlipBC::NotSpecified); py::enum_<BoundaryConditionFactory::PressureBC>(parentModule, "PressureBC") diff --git a/regression-tests/actuator_line_test.sh b/regression-tests/actuator_line_test.sh index 42460c1be56620e12922ade0b63776ffddc25615..b45d452e56902872d364640785c9c37db0b847d4 100755 --- a/regression-tests/actuator_line_test.sh +++ b/regression-tests/actuator_line_test.sh @@ -9,7 +9,7 @@ REFERENCE_DATA_DIR=regression_tests/gpu/ActuatorLine CMAKE_FLAGS="--preset=make_gpu -DCMAKE_BUILD_TYPE=Release -DCMAKE_CUDA_ARCHITECTURES=75 -DUSER_APPS=apps/gpu/ActuatorLine" # 3. define the application to be executed -APPLICATION="./build/bin/ActuatorLine ./apps/gpu/ActuatorLine/configActuatorLineRegression.txt" +APPLICATION="./build/bin/ActuatorLine ./apps/gpu/ActuatorLine/actuatorline_regressiontest.cfg" # 4. set the path to the produced data RESULT_DATA_DIR=output/ActuatorLine diff --git a/regression-tests/atmospheric_boundary_layer_test.sh b/regression-tests/atmospheric_boundary_layer_test.sh index 8c120fb8d4133f4736d87246d85b5818b68d43e9..f78930f271721d8123e3c72fdcbae3d04e0c6ebe 100755 --- a/regression-tests/atmospheric_boundary_layer_test.sh +++ b/regression-tests/atmospheric_boundary_layer_test.sh @@ -9,7 +9,7 @@ REFERENCE_DATA_DIR=regression_tests/gpu/AtmosphericBoundaryLayer CMAKE_FLAGS="--preset=make_gpu -DCMAKE_BUILD_TYPE=Release -DCMAKE_CUDA_ARCHITECTURES=75 -DUSER_APPS=apps/gpu/AtmosphericBoundaryLayer" # 3. define the application to be executed -APPLICATION="./build/bin/AtmosphericBoundaryLayer ./apps/gpu/AtmosphericBoundaryLayer/configAtmosphericBoundaryLayerRegression.txt" +APPLICATION="./build/bin/AtmosphericBoundaryLayer ./apps/gpu/AtmosphericBoundaryLayer/abl_regressiontest.cfg" # 4. set the path to the produced data RESULT_DATA_DIR=output/AtmosphericBoundaryLayer diff --git a/regression-tests/gyroidsrow_test.sh b/regression-tests/gyroidsrow_test.sh new file mode 100644 index 0000000000000000000000000000000000000000..03a54d4413807846d99366d8bc47ae7f51321534 --- /dev/null +++ b/regression-tests/gyroidsrow_test.sh @@ -0,0 +1,19 @@ +#!/bin/bash +source ./regression-tests/__regression_test_executer.sh + + +# 1. set reference data directory (must match the folder structure in https://github.com/irmb/test_data) +REFERENCE_DATA_DIR=regression_tests/cpu/GyroidsRow + +# 2. set cmake flags for the build of VirtualFluids +CMAKE_FLAGS="--preset=make_cpu -DBUILD_USE_BOOST=ON -DCMAKE_BUILD_TYPE=Release" + +# 3. define the application to be executed +APPLICATION="mpiexec -np 8 --allow-run-as-root ./build/bin/GyroidsRow ./apps/cpu/GyroidsRow/GyroidsRow_Re_425_u_001_N_100_compressible_regression.cfg" + +# 4. set the path to the produced data +RESULT_DATA_DIR=output/GyroidsRow + +apt install libboost-all-dev -y + +run_regression_test "$REFERENCE_DATA_DIR" "$CMAKE_FLAGS" "$APPLICATION" "$RESULT_DATA_DIR" diff --git a/src/gpu/core/BoundaryConditions/BoundaryConditionFactory.cpp b/src/gpu/core/BoundaryConditions/BoundaryConditionFactory.cpp index 968b8070cdd34f871fe7f61a7ae060ec0f81db29..fb4dc113ce4524d857897398084f21cd4eedd2b7 100644 --- a/src/gpu/core/BoundaryConditions/BoundaryConditionFactory.cpp +++ b/src/gpu/core/BoundaryConditions/BoundaryConditionFactory.cpp @@ -37,6 +37,7 @@ #include "BoundaryConditions/Pressure/Pressure.h" #include "BoundaryConditions/NoSlip/NoSlip.h" #include "BoundaryConditions/Velocity/Velocity.h" +#include "BoundaryConditions/Slip/Slip.h" #include "GPU/GPU_Interface.h" @@ -131,20 +132,11 @@ boundaryCondition BoundaryConditionFactory::getSlipBoundaryConditionPost(bool is // for descriptions of the boundary conditions refer to the header switch (boundaryCondition) { - case SlipBC::SlipIncompressible: - return QSlipDev27; - break; case SlipBC::SlipCompressible: - return QSlipDevComp27; - break; - case SlipBC::SlipBounceBack: - return BBSlipDevComp27; - break; - case SlipBC::SlipCompressibleTurbulentViscosity: - return QSlipDevCompTurbulentViscosity27; + return SlipCompressible; break; - case SlipBC::SlipPressureCompressibleTurbulentViscosity: - return QSlipPressureDevCompTurbulentViscosity27; + case SlipBC::SlipTurbulentViscosityCompressible: + return SlipTurbulentViscosityCompressible; break; default: return nullptr; diff --git a/src/gpu/core/BoundaryConditions/BoundaryConditionFactory.h b/src/gpu/core/BoundaryConditions/BoundaryConditionFactory.h index 9a7e23b2c63c9810f3bef2fcae360ec8331fd903..745a3b0dcdbaef51848470e734bbf46900dfe3f4 100644 --- a/src/gpu/core/BoundaryConditions/BoundaryConditionFactory.h +++ b/src/gpu/core/BoundaryConditions/BoundaryConditionFactory.h @@ -82,16 +82,10 @@ public: //! \brief An enumeration for selecting a slip boundary condition enum class SlipBC { - //! - SlipIncompressible = interpolated slip boundary condition, based on subgrid distances - SlipIncompressible, //! - SlipCompressible = interpolated slip boundary condition, based on subgrid distances SlipCompressible, - //! - SlipBounceBack = simple bounce-back slip boundary condition. - SlipBounceBack, //! With turbulent viscosity -> para->setUseTurbulentViscosity(true) has to be set to true - SlipCompressibleTurbulentViscosity, - //! With turbulent viscosity -> para->setUseTurbulentViscosity(true) has to be set to true - SlipPressureCompressibleTurbulentViscosity, + SlipTurbulentViscosityCompressible, //! - NotSpecified = the user did not set a boundary condition NotSpecified }; diff --git a/src/gpu/core/BoundaryConditions/BoundaryConditionFactoryTest.cpp b/src/gpu/core/BoundaryConditions/BoundaryConditionFactoryTest.cpp index aaaae38e554f1f1011752c296b0706da602047c1..c936b2ea4bedb285b1726a6ec4f93ff928ba7652 100644 --- a/src/gpu/core/BoundaryConditions/BoundaryConditionFactoryTest.cpp +++ b/src/gpu/core/BoundaryConditions/BoundaryConditionFactoryTest.cpp @@ -8,6 +8,7 @@ #include "BoundaryConditions/Pressure/Pressure.h" #include "BoundaryConditions/NoSlip/NoSlip.h" #include "BoundaryConditions/Velocity/Velocity.h" +#include "BoundaryConditions/Slip/Slip.h" #include "GPU/GPU_Interface.h" using bcFunction = void (*)(LBMSimulationParameter *, QforBoundaryConditions *); @@ -132,16 +133,12 @@ TEST(BoundaryConditionFactoryTest, slipBC) { auto bcFactory = BoundaryConditionFactory(); - bcFactory.setSlipBoundaryCondition(BoundaryConditionFactory::SlipBC::SlipIncompressible); - EXPECT_TRUE( *(getSlipBcTarget(bcFactory)) == QSlipDev27) - << "The returned boundary condition is not the expected function QSlipDev27."; - bcFactory.setSlipBoundaryCondition(BoundaryConditionFactory::SlipBC::SlipCompressible); - EXPECT_TRUE( *(getSlipBcTarget(bcFactory)) == QSlipDevComp27) - << "The returned boundary condition is not the expected function QSlipDevComp27."; + EXPECT_TRUE( *(getSlipBcTarget(bcFactory)) == SlipCompressible) + << "The returned boundary condition is not the expected function SlipCompressible."; - bcFactory.setSlipBoundaryCondition(BoundaryConditionFactory::SlipBC::SlipCompressibleTurbulentViscosity); - EXPECT_TRUE( *(getSlipBcTarget(bcFactory)) == QSlipDevCompTurbulentViscosity27) + bcFactory.setSlipBoundaryCondition(BoundaryConditionFactory::SlipBC::SlipTurbulentViscosityCompressible); + EXPECT_TRUE( *(getSlipBcTarget(bcFactory)) == SlipTurbulentViscosityCompressible) << "The returned boundary condition is not the expected function QSlipDevCompTurbulentViscosity27."; } diff --git a/src/gpu/core/BoundaryConditions/Slip/Slip.cu b/src/gpu/core/BoundaryConditions/Slip/Slip.cu new file mode 100644 index 0000000000000000000000000000000000000000..30308573e16a9b890032f5a55453f42c20f6e8c9 --- /dev/null +++ b/src/gpu/core/BoundaryConditions/Slip/Slip.cu @@ -0,0 +1,79 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \author Martin Schoenherr +//======================================================================================= +#include <cuda_runtime.h> +#include <helper_functions.h> +#include <helper_cuda.h> + +#include "LBM/LB.h" +#include <cuda_helper/CudaGrid.h> + +#include "BoundaryConditions/Slip/Slip_Device.cuh" +#include "Parameter/Parameter.h" + +void SlipCompressible(LBMSimulationParameter* parameterDevice, QforBoundaryConditions* boundaryCondition) +{ + dim3 grid = vf::cuda::getCudaGrid( parameterDevice->numberofthreads, boundaryCondition->numberOfBCnodes); + dim3 threads(parameterDevice->numberofthreads, 1, 1 ); + + SlipCompressible_Device<<< grid, threads >>> ( + parameterDevice->distributions.f[0], + boundaryCondition->k, + boundaryCondition->q27[0], + boundaryCondition->numberOfBCnodes, + parameterDevice->omega, + parameterDevice->neighborX, + parameterDevice->neighborY, + parameterDevice->neighborZ, + parameterDevice->numberOfNodes, + parameterDevice->isEvenTimestep); + getLastCudaError("QSlipDeviceComp27 execution failed"); +} + + +void SlipTurbulentViscosityCompressible(LBMSimulationParameter* parameterDevice, QforBoundaryConditions* boundaryCondition) +{ + dim3 grid = vf::cuda::getCudaGrid( parameterDevice->numberofthreads, boundaryCondition->numberOfBCnodes); + dim3 threads(parameterDevice->numberofthreads, 1, 1 ); + + SlipTurbulentViscosityCompressible_Device<<< grid, threads >>> ( + parameterDevice->distributions.f[0], + boundaryCondition->k, + boundaryCondition->q27[0], + boundaryCondition->numberOfBCnodes, + parameterDevice->omega, + parameterDevice->neighborX, + parameterDevice->neighborY, + parameterDevice->neighborZ, + parameterDevice->turbViscosity, + parameterDevice->numberOfNodes, + parameterDevice->isEvenTimestep); + getLastCudaError("SlipTurbulentViscosityCompressible_Device execution failed"); +} diff --git a/src/gpu/core/BoundaryConditions/Slip/Slip.h b/src/gpu/core/BoundaryConditions/Slip/Slip.h new file mode 100644 index 0000000000000000000000000000000000000000..01397d1f9102f11efbaf4a49e3e64d3a370a1ea2 --- /dev/null +++ b/src/gpu/core/BoundaryConditions/Slip/Slip.h @@ -0,0 +1,43 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \author Martin Schoenherr +//======================================================================================= +#ifndef Slip_H +#define Slip_H + +#include "LBM/LB.h" + +struct LBMSimulationParameter; +class Parameter; + +void SlipCompressible(LBMSimulationParameter* parameterDevice, QforBoundaryConditions* boundaryCondition); + +void SlipTurbulentViscosityCompressible(LBMSimulationParameter* parameterDevice, QforBoundaryConditions* boundaryCondition); + +#endif diff --git a/src/gpu/core/BoundaryConditions/Slip/SlipCompressible.cu b/src/gpu/core/BoundaryConditions/Slip/SlipCompressible.cu new file mode 100644 index 0000000000000000000000000000000000000000..1f80b421a86c041d63bfb313a803175e6037436f --- /dev/null +++ b/src/gpu/core/BoundaryConditions/Slip/SlipCompressible.cu @@ -0,0 +1,546 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file SlipBCs27.cu +//! \ingroup GPU +//! \author Martin Schoenherr, Anna Wellmann +//====================================================================================== +#include "LBM/LB.h" +#include "lbm/constants/D3Q27.h" +#include "basics/constants/NumericConstants.h" +#include "LBM/GPUHelperFunctions/KernelUtilities.h" + +using namespace vf::basics::constant; +using namespace vf::lbm::dir; +using namespace vf::gpu; + +////////////////////////////////////////////////////////////////////////////// +__global__ void SlipCompressible_Device( + real* distributions, + int* subgridDistanceIndices, + real* subgridDistances, + unsigned int numberOfBCnodes, + real omega, + unsigned int* neighborX, + unsigned int* neighborY, + unsigned int* neighborZ, + unsigned long long numberOfLBnodes, + bool isEvenTimestep) +{ + //! The slip boundary condition is executed in the following steps + //! + + //////////////////////////////////////////////////////////////////////////////// + //! - Get node index coordinates from threadIdx, blockIdx, blockDim and gridDim. + //! + const unsigned nodeIndex = getNodeIndex(); + + if(nodeIndex < numberOfBCnodes) + { + ////////////////////////////////////////////////////////////////////////// + //! - Read distributions: style of reading and writing the distributions from/to stored arrays dependent on timestep is based on the esoteric twist algorithm \ref + //! <a href="https://doi.org/10.3390/computation5020019"><b>[ M. Geier et al. (2017), DOI:10.3390/computation5020019 ]</b></a> + //! + Distributions27 dist; + getPointersToDistributions(dist, distributions, numberOfLBnodes, isEvenTimestep); + + //////////////////////////////////////////////////////////////////////////////// + //! - Set local subgrid distances (q's) + //! + SubgridDistances27 subgridD; + getPointersToSubgridDistances(subgridD, subgridDistances, numberOfBCnodes); + + //////////////////////////////////////////////////////////////////////////////// + //! - Set neighbor indices (necessary for indirect addressing) + //! + unsigned int indexOfBCnode = subgridDistanceIndices[nodeIndex]; + unsigned int kzero= indexOfBCnode; + unsigned int ke = indexOfBCnode; + unsigned int kw = neighborX[indexOfBCnode]; + unsigned int kn = indexOfBCnode; + unsigned int ks = neighborY[indexOfBCnode]; + unsigned int kt = indexOfBCnode; + unsigned int kb = neighborZ[indexOfBCnode]; + unsigned int ksw = neighborY[kw]; + unsigned int kne = indexOfBCnode; + unsigned int kse = ks; + unsigned int knw = kw; + unsigned int kbw = neighborZ[kw]; + unsigned int kte = indexOfBCnode; + unsigned int kbe = kb; + unsigned int ktw = kw; + unsigned int kbs = neighborZ[ks]; + unsigned int ktn = indexOfBCnode; + unsigned int kbn = kb; + unsigned int kts = ks; + unsigned int ktse = ks; + unsigned int kbnw = kbw; + unsigned int ktnw = kw; + unsigned int kbse = kbs; + unsigned int ktsw = ksw; + unsigned int kbne = kb; + unsigned int ktne = indexOfBCnode; + unsigned int kbsw = neighborZ[ksw]; + + //////////////////////////////////////////////////////////////////////////////// + //! - Set local distributions + //! + real f_W = (dist.f[dP00])[ke ]; + real f_E = (dist.f[dM00])[kw ]; + real f_S = (dist.f[d0P0])[kn ]; + real f_N = (dist.f[d0M0])[ks ]; + real f_B = (dist.f[d00P])[kt ]; + real f_T = (dist.f[d00M])[kb ]; + real f_SW = (dist.f[dPP0])[kne ]; + real f_NE = (dist.f[dMM0])[ksw ]; + real f_NW = (dist.f[dPM0])[kse ]; + real f_SE = (dist.f[dMP0])[knw ]; + real f_BW = (dist.f[dP0P])[kte ]; + real f_TE = (dist.f[dM0M])[kbw ]; + real f_TW = (dist.f[dP0M])[kbe ]; + real f_BE = (dist.f[dM0P])[ktw ]; + real f_BS = (dist.f[d0PP])[ktn ]; + real f_TN = (dist.f[d0MM])[kbs ]; + real f_TS = (dist.f[d0PM])[kbn ]; + real f_BN = (dist.f[d0MP])[kts ]; + real f_BSW = (dist.f[dPPP])[ktne ]; + real f_BNE = (dist.f[dMMP])[ktsw ]; + real f_BNW = (dist.f[dPMP])[ktse ]; + real f_BSE = (dist.f[dMPP])[ktnw ]; + real f_TSW = (dist.f[dPPM])[kbne ]; + real f_TNE = (dist.f[dMMM])[kbsw ]; + real f_TNW = (dist.f[dPMM])[kbse ]; + real f_TSE = (dist.f[dMPM])[kbnw ]; + + //////////////////////////////////////////////////////////////////////////////// + //! - Calculate macroscopic quantities + //! + real drho = f_TSE + f_TNW + f_TNE + f_TSW + f_BSE + f_BNW + f_BNE + f_BSW + + f_BN + f_TS + f_TN + f_BS + f_BE + f_TW + f_TE + f_BW + f_SE + f_NW + f_NE + f_SW + + f_T + f_B + f_N + f_S + f_E + f_W + ((dist.f[d000])[kzero]); + + real vx1 = (((f_TSE - f_BNW) - (f_TNW - f_BSE)) + ((f_TNE - f_BSW) - (f_TSW - f_BNE)) + + ((f_BE - f_TW) + (f_TE - f_BW)) + ((f_SE - f_NW) + (f_NE - f_SW)) + + (f_E - f_W)) / (c1o1 + drho); + + real vx2 = ((-(f_TSE - f_BNW) + (f_TNW - f_BSE)) + ((f_TNE - f_BSW) - (f_TSW - f_BNE)) + + ((f_BN - f_TS) + (f_TN - f_BS)) + (-(f_SE - f_NW) + (f_NE - f_SW)) + + (f_N - f_S)) / (c1o1 + drho); + + real vx3 = (((f_TSE - f_BNW) + (f_TNW - f_BSE)) + ((f_TNE - f_BSW) + (f_TSW - f_BNE)) + + (-(f_BN - f_TS) + (f_TN - f_BS)) + ((f_TE - f_BW) - (f_BE - f_TW)) + + (f_T - f_B)) / (c1o1 + drho); + + real cu_sq = c3o2 * (vx1 * vx1 + vx2 * vx2 + vx3 * vx3) * (c1o1 + drho); + + //////////////////////////////////////////////////////////////////////////////// + //! - change the pointer to write the results in the correct array + //! + getPointersToDistributions(dist, distributions, numberOfLBnodes, !isEvenTimestep); + + //////////////////////////////////////////////////////////////////////////////// + //! - Multiply the local velocities by the slipLength + //! + real slipLength = c1o1; + real VeloX = slipLength*vx1; + real VeloY = slipLength*vx2; + real VeloZ = slipLength*vx3; + + //////////////////////////////////////////////////////////////////////////////// + //! - Update distributions with subgrid distance (q) between zero and one + //! + real feq, q, velocityLB, velocityBC; + + bool x = false; + bool y = false; + bool z = false; + + q = (subgridD.q[dP00])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) // only update distribution for q between zero and one + { + VeloX = c0o1; + x = true; + + velocityLB = vx1; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c2o27); + velocityBC = VeloX; + (dist.f[dM00])[kw] = getInterpolatedDistributionForVeloBC(q, f_E, f_W, feq, omega, velocityBC, c2o27); + } + + q = (subgridD.q[dM00])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloX = c0o1; + x = true; + + velocityLB = -vx1; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c2o27); + velocityBC = -VeloX; + (dist.f[dP00])[ke] = getInterpolatedDistributionForVeloBC(q, f_W, f_E, feq, omega, velocityBC, c2o27); + } + + q = (subgridD.q[d0P0])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloY = c0o1; + y = true; + + velocityLB = vx2; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c2o27); + velocityBC = VeloY; + (dist.f[d0M0])[ks] = getInterpolatedDistributionForVeloBC(q, f_N, f_S, feq, omega, velocityBC, c2o27); + } + + q = (subgridD.q[d0M0])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloY = c0o1; + y = true; + + velocityLB = -vx2; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c2o27); + velocityBC = -VeloY; + (dist.f[d0P0])[kn] = getInterpolatedDistributionForVeloBC(q, f_S, f_N, feq, omega, velocityBC, c2o27); + } + + q = (subgridD.q[d00P])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloZ = c0o1; + z = true; + + velocityLB = vx3; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c2o27); + velocityBC = VeloZ; + (dist.f[d00M])[kb] = getInterpolatedDistributionForVeloBC(q, f_T, f_B, feq, omega, velocityBC, c2o27); + } + + q = (subgridD.q[d00M])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloZ = c0o1; + z = true; + + velocityLB = -vx3; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c2o27); + velocityBC = -VeloZ; + (dist.f[d00P])[kt] = getInterpolatedDistributionForVeloBC(q, f_B, f_T, feq, omega, velocityBC, c2o27); + } + + q = (subgridD.q[dPP0])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloX = slipLength*vx1; + VeloY = slipLength*vx2; + if (x == true) VeloX = c0o1; + if (y == true) VeloY = c0o1; + + velocityLB = vx1 + vx2; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); + velocityBC = VeloX + VeloY; + (dist.f[dMM0])[ksw] = getInterpolatedDistributionForVeloBC(q, f_NE, f_SW, feq, omega, velocityBC, c1o54); + } + + q = (subgridD.q[dMM0])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloX = slipLength*vx1; + VeloY = slipLength*vx2; + if (x == true) VeloX = c0o1; + if (y == true) VeloY = c0o1; + + velocityLB = -vx1 - vx2; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); + velocityBC = -VeloX - VeloY; + (dist.f[dPP0])[kne] = getInterpolatedDistributionForVeloBC(q, f_SW, f_NE, feq, omega, velocityBC, c1o54); + } + + q = (subgridD.q[dPM0])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloX = slipLength*vx1; + VeloY = slipLength*vx2; + if (x == true) VeloX = c0o1; + if (y == true) VeloY = c0o1; + + velocityLB = vx1 - vx2; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); + velocityBC = VeloX - VeloY; + (dist.f[dMP0])[knw] = getInterpolatedDistributionForVeloBC(q, f_SE, f_NW, feq, omega, velocityBC, c1o54); + } + + q = (subgridD.q[dMP0])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloX = slipLength*vx1; + VeloY = slipLength*vx2; + if (x == true) VeloX = c0o1; + if (y == true) VeloY = c0o1; + + velocityLB = -vx1 + vx2; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); + velocityBC = -VeloX + VeloY; + (dist.f[dPM0])[kse] = getInterpolatedDistributionForVeloBC(q, f_NW, f_SE, feq, omega, velocityBC, c1o54); + } + + q = (subgridD.q[dP0P])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloX = slipLength*vx1; + VeloZ = slipLength*vx3; + if (x == true) VeloX = c0o1; + if (z == true) VeloZ = c0o1; + + velocityLB = vx1 + vx3; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); + velocityBC = VeloX + VeloZ; + (dist.f[dM0M])[kbw] = getInterpolatedDistributionForVeloBC(q, f_TE, f_BW, feq, omega, velocityBC, c1o54); + } + + q = (subgridD.q[dM0M])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloX = slipLength*vx1; + VeloZ = slipLength*vx3; + if (x == true) VeloX = c0o1; + if (z == true) VeloZ = c0o1; + + velocityLB = -vx1 - vx3; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); + velocityBC = -VeloX - VeloZ; + (dist.f[dP0P])[kte] = getInterpolatedDistributionForVeloBC(q, f_BW, f_TE, feq, omega, velocityBC, c1o54); + } + + q = (subgridD.q[dP0M])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloX = slipLength*vx1; + VeloZ = slipLength*vx3; + if (x == true) VeloX = c0o1; + if (z == true) VeloZ = c0o1; + + velocityLB = vx1 - vx3; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); + velocityBC = VeloX - VeloZ; + (dist.f[dM0P])[ktw] = getInterpolatedDistributionForVeloBC(q, f_BE, f_TW, feq, omega, velocityBC, c1o54); + } + + q = (subgridD.q[dM0P])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloX = slipLength*vx1; + VeloZ = slipLength*vx3; + if (x == true) VeloX = c0o1; + if (z == true) VeloZ = c0o1; + + velocityLB = -vx1 + vx3; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); + velocityBC = -VeloX + VeloZ; + (dist.f[dP0M])[kbe] = getInterpolatedDistributionForVeloBC(q, f_TW, f_BE, feq, omega, velocityBC, c1o54); + } + + q = (subgridD.q[d0PP])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloY = slipLength*vx2; + VeloZ = slipLength*vx3; + if (y == true) VeloY = c0o1; + if (z == true) VeloZ = c0o1; + + velocityLB = vx2 + vx3; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); + velocityBC = VeloY + VeloZ; + (dist.f[d0MM])[kbs] = getInterpolatedDistributionForVeloBC(q, f_TN, f_BS, feq, omega, velocityBC, c1o54); + } + + q = (subgridD.q[d0MM])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloY = slipLength*vx2; + VeloZ = slipLength*vx3; + if (y == true) VeloY = c0o1; + if (z == true) VeloZ = c0o1; + + velocityLB = -vx2 - vx3; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); + velocityBC = -VeloY - VeloZ; + (dist.f[d0PP])[ktn] = getInterpolatedDistributionForVeloBC(q, f_BS, f_TN, feq, omega, velocityBC, c1o54); + } + + + q = (subgridD.q[d0PM])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloY = slipLength*vx2; + VeloZ = slipLength*vx3; + if (y == true) VeloY = c0o1; + if (z == true) VeloZ = c0o1; + + velocityLB = vx2 - vx3; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); + velocityBC = VeloY - VeloZ; + (dist.f[d0MP])[kts] = getInterpolatedDistributionForVeloBC(q, f_BN, f_TS, feq, omega, velocityBC, c1o54); + } + + q = (subgridD.q[d0MP])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloY = slipLength*vx2; + VeloZ = slipLength*vx3; + if (y == true) VeloY = c0o1; + if (z == true) VeloZ = c0o1; + + velocityLB = -vx2 + vx3; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); + velocityBC = -VeloY + VeloZ; + (dist.f[d0PM])[kbn] = getInterpolatedDistributionForVeloBC(q, f_TS, f_BN, feq, omega, velocityBC, c1o54); + } + + q = (subgridD.q[dPPP])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloX = slipLength*vx1; + VeloY = slipLength*vx2; + VeloZ = slipLength*vx3; + if (x == true) VeloX = c0o1; + if (y == true) VeloY = c0o1; + if (z == true) VeloZ = c0o1; + velocityLB = vx1 + vx2 + vx3; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o216); + velocityBC = VeloX + VeloY + VeloZ; + (dist.f[dMMM])[kbsw] = getInterpolatedDistributionForVeloBC(q, f_TNE, f_BSW, feq, omega, velocityBC, c1o216); + } + + q = (subgridD.q[dMMM])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloX = slipLength*vx1; + VeloY = slipLength*vx2; + VeloZ = slipLength*vx3; + if (x == true) VeloX = c0o1; + if (y == true) VeloY = c0o1; + if (z == true) VeloZ = c0o1; + velocityLB = -vx1 - vx2 - vx3; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o216); + velocityBC = -VeloX - VeloY - VeloZ; + (dist.f[dPPP])[ktne] = getInterpolatedDistributionForVeloBC(q, f_BSW, f_TNE, feq, omega, velocityBC, c1o216); + } + + + q = (subgridD.q[dPPM])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloX = slipLength*vx1; + VeloY = slipLength*vx2; + VeloZ = slipLength*vx3; + if (x == true) VeloX = c0o1; + if (y == true) VeloY = c0o1; + if (z == true) VeloZ = c0o1; + velocityLB = vx1 + vx2 - vx3; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o216); + velocityBC = VeloX + VeloY - VeloZ; + (dist.f[dMMP])[ktsw] = getInterpolatedDistributionForVeloBC(q, f_BNE, f_TSW, feq, omega, velocityBC, c1o216); + } + + q = (subgridD.q[dMMP])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloX = slipLength*vx1; + VeloY = slipLength*vx2; + VeloZ = slipLength*vx3; + if (x == true) VeloX = c0o1; + if (y == true) VeloY = c0o1; + if (z == true) VeloZ = c0o1; + velocityLB = -vx1 - vx2 + vx3; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o216); + velocityBC = -VeloX - VeloY + VeloZ; + (dist.f[dPPM])[kbne] = getInterpolatedDistributionForVeloBC(q, f_TSW, f_BNE, feq, omega, velocityBC, c1o216); + } + + q = (subgridD.q[dPMP])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloX = slipLength*vx1; + VeloY = slipLength*vx2; + VeloZ = slipLength*vx3; + if (x == true) VeloX = c0o1; + if (y == true) VeloY = c0o1; + if (z == true) VeloZ = c0o1; + velocityLB = vx1 - vx2 + vx3; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o216); + velocityBC = VeloX - VeloY + VeloZ; + (dist.f[dMPM])[kbnw] = getInterpolatedDistributionForVeloBC(q, f_TSE, f_BNW, feq, omega, velocityBC, c1o216); + } + + q = (subgridD.q[dMPM])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloX = slipLength*vx1; + VeloY = slipLength*vx2; + VeloZ = slipLength*vx3; + if (x == true) VeloX = c0o1; + if (y == true) VeloY = c0o1; + if (z == true) VeloZ = c0o1; + velocityLB = -vx1 + vx2 - vx3; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o216); + velocityBC = -VeloX + VeloY - VeloZ; + (dist.f[dPMP])[ktse] = getInterpolatedDistributionForVeloBC(q, f_BNW, f_TSE, feq, omega, velocityBC, c1o216); + } + + q = (subgridD.q[dPMM])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloX = slipLength*vx1; + VeloY = slipLength*vx2; + VeloZ = slipLength*vx3; + if (x == true) VeloX = c0o1; + if (y == true) VeloY = c0o1; + if (z == true) VeloZ = c0o1; + velocityLB = vx1 - vx2 - vx3; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o216); + velocityBC = VeloX - VeloY - VeloZ; + (dist.f[dMPP])[ktnw] = getInterpolatedDistributionForVeloBC(q, f_BSE, f_TNW, feq, omega, velocityBC, c1o216); + } + + q = (subgridD.q[dMPP])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloX = slipLength*vx1; + VeloY = slipLength*vx2; + VeloZ = slipLength*vx3; + if (x == true) VeloX = c0o1; + if (y == true) VeloY = c0o1; + if (z == true) VeloZ = c0o1; + velocityLB = -vx1 + vx2 + vx3; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o216); + velocityBC = -VeloX + VeloY + VeloZ; + (dist.f[dPMM])[kbse] = getInterpolatedDistributionForVeloBC(q, f_TNW, f_BSE, feq, omega, velocityBC, c1o216); + } + } +} +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/gpu/core/BoundaryConditions/Slip/SlipTurbulentViscosityCompressible.cu b/src/gpu/core/BoundaryConditions/Slip/SlipTurbulentViscosityCompressible.cu new file mode 100644 index 0000000000000000000000000000000000000000..03edb52bf7b85397c71c9ed1203ea813a91872e7 --- /dev/null +++ b/src/gpu/core/BoundaryConditions/Slip/SlipTurbulentViscosityCompressible.cu @@ -0,0 +1,550 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file SlipBCs27.cu +//! \ingroup GPU +//! \author Martin Schoenherr, Anna Wellmann +//====================================================================================== +#include "LBM/LB.h" +#include "lbm/constants/D3Q27.h" +#include "basics/constants/NumericConstants.h" +#include "LBM/GPUHelperFunctions/KernelUtilities.h" + +using namespace vf::basics::constant; +using namespace vf::lbm::dir; +using namespace vf::gpu; + +__global__ void SlipTurbulentViscosityCompressible_Device( + real* distributions, + int* subgridDistanceIndices, + real* subgridDistances, + unsigned int numberOfBCnodes, + real omega, + unsigned int* neighborX, + unsigned int* neighborY, + unsigned int* neighborZ, + real* turbViscosity, + unsigned long long numberOfLBnodes, + bool isEvenTimestep) +{ + //! The slip boundary condition is executed in the following steps + //! + + //////////////////////////////////////////////////////////////////////////////// + //! - Get node index coordinates from threadIdx, blockIdx, blockDim and gridDim. + //! + const unsigned nodeIndex = getNodeIndex(); + + if(nodeIndex < numberOfBCnodes) + { + ////////////////////////////////////////////////////////////////////////// + //! - Read distributions: style of reading and writing the distributions from/to stored arrays dependent on timestep is based on the esoteric twist algorithm \ref + //! <a href="https://doi.org/10.3390/computation5020019"><b>[ M. Geier et al. (2017), DOI:10.3390/computation5020019 ]</b></a> + //! + Distributions27 dist; + getPointersToDistributions(dist, distributions, numberOfLBnodes, isEvenTimestep); + + //////////////////////////////////////////////////////////////////////////////// + //! - Set local subgrid distances (q's) + //! + SubgridDistances27 subgridD; + getPointersToSubgridDistances(subgridD, subgridDistances, numberOfBCnodes); + + //////////////////////////////////////////////////////////////////////////////// + //! - Set neighbor indices (necessary for indirect addressing) + //! + unsigned int indexOfBCnode = subgridDistanceIndices[nodeIndex]; + unsigned int kzero= indexOfBCnode; + unsigned int ke = indexOfBCnode; + unsigned int kw = neighborX[indexOfBCnode]; + unsigned int kn = indexOfBCnode; + unsigned int ks = neighborY[indexOfBCnode]; + unsigned int kt = indexOfBCnode; + unsigned int kb = neighborZ[indexOfBCnode]; + unsigned int ksw = neighborY[kw]; + unsigned int kne = indexOfBCnode; + unsigned int kse = ks; + unsigned int knw = kw; + unsigned int kbw = neighborZ[kw]; + unsigned int kte = indexOfBCnode; + unsigned int kbe = kb; + unsigned int ktw = kw; + unsigned int kbs = neighborZ[ks]; + unsigned int ktn = indexOfBCnode; + unsigned int kbn = kb; + unsigned int kts = ks; + unsigned int ktse = ks; + unsigned int kbnw = kbw; + unsigned int ktnw = kw; + unsigned int kbse = kbs; + unsigned int ktsw = ksw; + unsigned int kbne = kb; + unsigned int ktne = indexOfBCnode; + unsigned int kbsw = neighborZ[ksw]; + + //////////////////////////////////////////////////////////////////////////////// + //! - Set local distributions + //! + real f_W = (dist.f[dP00])[ke ]; + real f_E = (dist.f[dM00])[kw ]; + real f_S = (dist.f[d0P0])[kn ]; + real f_N = (dist.f[d0M0])[ks ]; + real f_B = (dist.f[d00P])[kt ]; + real f_T = (dist.f[d00M])[kb ]; + real f_SW = (dist.f[dPP0])[kne ]; + real f_NE = (dist.f[dMM0])[ksw ]; + real f_NW = (dist.f[dPM0])[kse ]; + real f_SE = (dist.f[dMP0])[knw ]; + real f_BW = (dist.f[dP0P])[kte ]; + real f_TE = (dist.f[dM0M])[kbw ]; + real f_TW = (dist.f[dP0M])[kbe ]; + real f_BE = (dist.f[dM0P])[ktw ]; + real f_BS = (dist.f[d0PP])[ktn ]; + real f_TN = (dist.f[d0MM])[kbs ]; + real f_TS = (dist.f[d0PM])[kbn ]; + real f_BN = (dist.f[d0MP])[kts ]; + real f_BSW = (dist.f[dPPP])[ktne ]; + real f_BNE = (dist.f[dMMP])[ktsw ]; + real f_BNW = (dist.f[dPMP])[ktse ]; + real f_BSE = (dist.f[dMPP])[ktnw ]; + real f_TSW = (dist.f[dPPM])[kbne ]; + real f_TNE = (dist.f[dMMM])[kbsw ]; + real f_TNW = (dist.f[dPMM])[kbse ]; + real f_TSE = (dist.f[dMPM])[kbnw ]; + + //////////////////////////////////////////////////////////////////////////////// + //! - Calculate macroscopic quantities + //! + real drho = f_TSE + f_TNW + f_TNE + f_TSW + f_BSE + f_BNW + f_BNE + f_BSW + + f_BN + f_TS + f_TN + f_BS + f_BE + f_TW + f_TE + f_BW + f_SE + f_NW + f_NE + f_SW + + f_T + f_B + f_N + f_S + f_E + f_W + ((dist.f[d000])[kzero]); + + real vx1 = (((f_TSE - f_BNW) - (f_TNW - f_BSE)) + ((f_TNE - f_BSW) - (f_TSW - f_BNE)) + + ((f_BE - f_TW) + (f_TE - f_BW)) + ((f_SE - f_NW) + (f_NE - f_SW)) + + (f_E - f_W)) / (c1o1 + drho); + + real vx2 = ((-(f_TSE - f_BNW) + (f_TNW - f_BSE)) + ((f_TNE - f_BSW) - (f_TSW - f_BNE)) + + ((f_BN - f_TS) + (f_TN - f_BS)) + (-(f_SE - f_NW) + (f_NE - f_SW)) + + (f_N - f_S)) / (c1o1 + drho); + + real vx3 = (((f_TSE - f_BNW) + (f_TNW - f_BSE)) + ((f_TNE - f_BSW) + (f_TSW - f_BNE)) + + (-(f_BN - f_TS) + (f_TN - f_BS)) + ((f_TE - f_BW) - (f_BE - f_TW)) + + (f_T - f_B)) / (c1o1 + drho); + + real cu_sq = c3o2 * (vx1 * vx1 + vx2 * vx2 + vx3 * vx3) * (c1o1 + drho); + + //////////////////////////////////////////////////////////////////////////////// + //! - change the pointer to write the results in the correct array + //! + getPointersToDistributions(dist, distributions, numberOfLBnodes, !isEvenTimestep); + + //////////////////////////////////////////////////////////////////////////////// + //! - compute local relaxation rate + //! + real om_turb = omega / (c1o1 + c3o1* omega* max(c0o1, turbViscosity[indexOfBCnode]) ); + + //////////////////////////////////////////////////////////////////////////////// + //! - Multiply the local velocities by the slipLength + //! + real slipLength = c1o1; + real VeloX = slipLength*vx1; + real VeloY = slipLength*vx2; + real VeloZ = slipLength*vx3; + + //////////////////////////////////////////////////////////////////////////////// + //! - Update distributions with subgrid distance (q) between zero and one + //! + real feq, q, velocityLB, velocityBC; + + bool x = false; + bool y = false; + bool z = false; + + q = (subgridD.q[dP00])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) // only update distribution for q between zero and one + { + VeloX = c0o1; + x = true; + + velocityLB = vx1; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c2o27); + velocityBC = VeloX; + (dist.f[dM00])[kw] = getInterpolatedDistributionForVeloBC(q, f_E, f_W, feq, om_turb, velocityBC, c2o27); + } + + q = (subgridD.q[dM00])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloX = c0o1; + x = true; + + velocityLB = -vx1; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c2o27); + velocityBC = -VeloX; + (dist.f[dP00])[ke] = getInterpolatedDistributionForVeloBC(q, f_W, f_E, feq, om_turb, velocityBC, c2o27); + } + + q = (subgridD.q[d0P0])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloY = c0o1; + y = true; + + velocityLB = vx2; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c2o27); + velocityBC = VeloY; + (dist.f[d0M0])[ks] = getInterpolatedDistributionForVeloBC(q, f_N, f_S, feq, om_turb, velocityBC, c2o27); + } + + q = (subgridD.q[d0M0])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloY = c0o1; + y = true; + + velocityLB = -vx2; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c2o27); + velocityBC = -VeloY; + (dist.f[d0P0])[kn] = getInterpolatedDistributionForVeloBC(q, f_S, f_N, feq, om_turb, velocityBC, c2o27); + } + + q = (subgridD.q[d00P])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloZ = c0o1; + z = true; + + velocityLB = vx3; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c2o27); + velocityBC = VeloZ; + (dist.f[d00M])[kb] = getInterpolatedDistributionForVeloBC(q, f_T, f_B, feq, om_turb, velocityBC, c2o27); + } + + q = (subgridD.q[d00M])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloZ = c0o1; + z = true; + + velocityLB = -vx3; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c2o27); + velocityBC = -VeloZ; + (dist.f[d00P])[kt] = getInterpolatedDistributionForVeloBC(q, f_B, f_T, feq, om_turb, velocityBC, c2o27); + } + + q = (subgridD.q[dPP0])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloX = slipLength*vx1; + VeloY = slipLength*vx2; + if (x == true) VeloX = c0o1; + if (y == true) VeloY = c0o1; + + velocityLB = vx1 + vx2; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); + velocityBC = VeloX + VeloY; + (dist.f[dMM0])[ksw] = getInterpolatedDistributionForVeloBC(q, f_NE, f_SW, feq, om_turb, velocityBC, c1o54); + } + + q = (subgridD.q[dMM0])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloX = slipLength*vx1; + VeloY = slipLength*vx2; + if (x == true) VeloX = c0o1; + if (y == true) VeloY = c0o1; + + velocityLB = -vx1 - vx2; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); + velocityBC = -VeloX - VeloY; + (dist.f[dPP0])[kne] = getInterpolatedDistributionForVeloBC(q, f_SW, f_NE, feq, om_turb, velocityBC, c1o54); + } + + q = (subgridD.q[dPM0])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloX = slipLength*vx1; + VeloY = slipLength*vx2; + if (x == true) VeloX = c0o1; + if (y == true) VeloY = c0o1; + + velocityLB = vx1 - vx2; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); + velocityBC = VeloX - VeloY; + (dist.f[dMP0])[knw] = getInterpolatedDistributionForVeloBC(q, f_SE, f_NW, feq, om_turb, velocityBC, c1o54); + } + + q = (subgridD.q[dMP0])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloX = slipLength*vx1; + VeloY = slipLength*vx2; + if (x == true) VeloX = c0o1; + if (y == true) VeloY = c0o1; + + velocityLB = -vx1 + vx2; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); + velocityBC = -VeloX + VeloY; + (dist.f[dPM0])[kse] = getInterpolatedDistributionForVeloBC(q, f_NW, f_SE, feq, om_turb, velocityBC, c1o54); + } + + q = (subgridD.q[dP0P])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloX = slipLength*vx1; + VeloZ = slipLength*vx3; + if (x == true) VeloX = c0o1; + if (z == true) VeloZ = c0o1; + + velocityLB = vx1 + vx3; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); + velocityBC = VeloX + VeloZ; + (dist.f[dM0M])[kbw] = getInterpolatedDistributionForVeloBC(q, f_TE, f_BW, feq, om_turb, velocityBC, c1o54); + } + + q = (subgridD.q[dM0M])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloX = slipLength*vx1; + VeloZ = slipLength*vx3; + if (x == true) VeloX = c0o1; + if (z == true) VeloZ = c0o1; + + velocityLB = -vx1 - vx3; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); + velocityBC = -VeloX - VeloZ; + (dist.f[dP0P])[kte] = getInterpolatedDistributionForVeloBC(q, f_BW, f_TE, feq, om_turb, velocityBC, c1o54); + } + + q = (subgridD.q[dP0M])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloX = slipLength*vx1; + VeloZ = slipLength*vx3; + if (x == true) VeloX = c0o1; + if (z == true) VeloZ = c0o1; + + velocityLB = vx1 - vx3; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); + velocityBC = VeloX - VeloZ; + (dist.f[dM0P])[ktw] = getInterpolatedDistributionForVeloBC(q, f_BE, f_TW, feq, om_turb, velocityBC, c1o54); + } + + q = (subgridD.q[dM0P])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloX = slipLength*vx1; + VeloZ = slipLength*vx3; + if (x == true) VeloX = c0o1; + if (z == true) VeloZ = c0o1; + + velocityLB = -vx1 + vx3; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); + velocityBC = -VeloX + VeloZ; + (dist.f[dP0M])[kbe] = getInterpolatedDistributionForVeloBC(q, f_TW, f_BE, feq, om_turb, velocityBC, c1o54); + } + + q = (subgridD.q[d0PP])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloY = slipLength*vx2; + VeloZ = slipLength*vx3; + if (y == true) VeloY = c0o1; + if (z == true) VeloZ = c0o1; + + velocityLB = vx2 + vx3; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); + velocityBC = VeloY + VeloZ; + (dist.f[d0MM])[kbs] = getInterpolatedDistributionForVeloBC(q, f_TN, f_BS, feq, om_turb, velocityBC, c1o54); + } + + q = (subgridD.q[d0MM])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloY = slipLength*vx2; + VeloZ = slipLength*vx3; + if (y == true) VeloY = c0o1; + if (z == true) VeloZ = c0o1; + + velocityLB = -vx2 - vx3; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); + velocityBC = -VeloY - VeloZ; + (dist.f[d0PP])[ktn] = getInterpolatedDistributionForVeloBC(q, f_BS, f_TN, feq, om_turb, velocityBC, c1o54); + } + + + q = (subgridD.q[d0PM])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloY = slipLength*vx2; + VeloZ = slipLength*vx3; + if (y == true) VeloY = c0o1; + if (z == true) VeloZ = c0o1; + + velocityLB = vx2 - vx3; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); + velocityBC = VeloY - VeloZ; + (dist.f[d0MP])[kts] = getInterpolatedDistributionForVeloBC(q, f_BN, f_TS, feq, om_turb, velocityBC, c1o54); + } + + q = (subgridD.q[d0MP])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloY = slipLength*vx2; + VeloZ = slipLength*vx3; + if (y == true) VeloY = c0o1; + if (z == true) VeloZ = c0o1; + + velocityLB = -vx2 + vx3; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); + velocityBC = -VeloY + VeloZ; + (dist.f[d0PM])[kbn] = getInterpolatedDistributionForVeloBC(q, f_TS, f_BN, feq, om_turb, velocityBC, c1o54); + } + + q = (subgridD.q[dPPP])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloX = slipLength*vx1; + VeloY = slipLength*vx2; + VeloZ = slipLength*vx3; + if (x == true) VeloX = c0o1; + if (y == true) VeloY = c0o1; + if (z == true) VeloZ = c0o1; + velocityLB = vx1 + vx2 + vx3; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o216); + velocityBC = VeloX + VeloY + VeloZ; + (dist.f[dMMM])[kbsw] = getInterpolatedDistributionForVeloBC(q, f_TNE, f_BSW, feq, om_turb, velocityBC, c1o216); + } + + q = (subgridD.q[dMMM])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloX = slipLength*vx1; + VeloY = slipLength*vx2; + VeloZ = slipLength*vx3; + if (x == true) VeloX = c0o1; + if (y == true) VeloY = c0o1; + if (z == true) VeloZ = c0o1; + velocityLB = -vx1 - vx2 - vx3; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o216); + velocityBC = -VeloX - VeloY - VeloZ; + (dist.f[dPPP])[ktne] = getInterpolatedDistributionForVeloBC(q, f_BSW, f_TNE, feq, om_turb, velocityBC, c1o216); + } + + + q = (subgridD.q[dPPM])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloX = slipLength*vx1; + VeloY = slipLength*vx2; + VeloZ = slipLength*vx3; + if (x == true) VeloX = c0o1; + if (y == true) VeloY = c0o1; + if (z == true) VeloZ = c0o1; + velocityLB = vx1 + vx2 - vx3; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o216); + velocityBC = VeloX + VeloY - VeloZ; + (dist.f[dMMP])[ktsw] = getInterpolatedDistributionForVeloBC(q, f_BNE, f_TSW, feq, om_turb, velocityBC, c1o216); + } + + q = (subgridD.q[dMMP])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloX = slipLength*vx1; + VeloY = slipLength*vx2; + VeloZ = slipLength*vx3; + if (x == true) VeloX = c0o1; + if (y == true) VeloY = c0o1; + if (z == true) VeloZ = c0o1; + velocityLB = -vx1 - vx2 + vx3; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o216); + velocityBC = -VeloX - VeloY + VeloZ; + (dist.f[dPPM])[kbne] = getInterpolatedDistributionForVeloBC(q, f_TSW, f_BNE, feq, om_turb, velocityBC, c1o216); + } + + q = (subgridD.q[dPMP])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloX = slipLength*vx1; + VeloY = slipLength*vx2; + VeloZ = slipLength*vx3; + if (x == true) VeloX = c0o1; + if (y == true) VeloY = c0o1; + if (z == true) VeloZ = c0o1; + velocityLB = vx1 - vx2 + vx3; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o216); + velocityBC = VeloX - VeloY + VeloZ; + (dist.f[dMPM])[kbnw] = getInterpolatedDistributionForVeloBC(q, f_TSE, f_BNW, feq, om_turb, velocityBC, c1o216); + } + + q = (subgridD.q[dMPM])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloX = slipLength*vx1; + VeloY = slipLength*vx2; + VeloZ = slipLength*vx3; + if (x == true) VeloX = c0o1; + if (y == true) VeloY = c0o1; + if (z == true) VeloZ = c0o1; + velocityLB = -vx1 + vx2 - vx3; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o216); + velocityBC = -VeloX + VeloY - VeloZ; + (dist.f[dPMP])[ktse] = getInterpolatedDistributionForVeloBC(q, f_BNW, f_TSE, feq, om_turb, velocityBC, c1o216); + } + + q = (subgridD.q[dPMM])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloX = slipLength*vx1; + VeloY = slipLength*vx2; + VeloZ = slipLength*vx3; + if (x == true) VeloX = c0o1; + if (y == true) VeloY = c0o1; + if (z == true) VeloZ = c0o1; + velocityLB = vx1 - vx2 - vx3; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o216); + velocityBC = VeloX - VeloY - VeloZ; + (dist.f[dMPP])[ktnw] = getInterpolatedDistributionForVeloBC(q, f_BSE, f_TNW, feq, om_turb, velocityBC, c1o216); + } + + q = (subgridD.q[dMPP])[nodeIndex]; + if (q>=c0o1 && q<=c1o1) + { + VeloX = slipLength*vx1; + VeloY = slipLength*vx2; + VeloZ = slipLength*vx3; + if (x == true) VeloX = c0o1; + if (y == true) VeloY = c0o1; + if (z == true) VeloZ = c0o1; + velocityLB = -vx1 + vx2 + vx3; + feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o216); + velocityBC = -VeloX + VeloY + VeloZ; + (dist.f[dPMM])[kbse] = getInterpolatedDistributionForVeloBC(q, f_TNW, f_BSE, feq, om_turb, velocityBC, c1o216); + } + } +} diff --git a/src/gpu/core/BoundaryConditions/Slip/Slip_Device.cuh b/src/gpu/core/BoundaryConditions/Slip/Slip_Device.cuh new file mode 100644 index 0000000000000000000000000000000000000000..91dd365bf9cddd6280d5f5a38ee7654872661599 --- /dev/null +++ b/src/gpu/core/BoundaryConditions/Slip/Slip_Device.cuh @@ -0,0 +1,61 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \author Martin Schoenherr +//======================================================================================= +#ifndef Slip_Device_H +#define Slip_Device_H + +#include "LBM/LB.h" + +__global__ void SlipCompressible_Device( + real* DD, + int* k_Q, + real* QQ, + unsigned int numberOfBCnodes, + real om1, + unsigned int* neighborX, + unsigned int* neighborY, + unsigned int* neighborZ, + unsigned long long numberOfLBnodes, + bool isEvenTimestep); + +__global__ void SlipTurbulentViscosityCompressible_Device( + real* distributions, + int* subgridDistanceIndices, + real* subgridDistances, + unsigned int numberOfBCnodes, + real omega, + unsigned int* neighborX, + unsigned int* neighborY, + unsigned int* neighborZ, + real* turbViscosity, + unsigned long long numberOfLBnodes, + bool isEvenTimestep); + +#endif diff --git a/src/gpu/core/GPU/GPU_Interface.h b/src/gpu/core/GPU/GPU_Interface.h index e6825d7b0494e2bfdf8808f300688b46d48dea0f..2823ae42dd440850b77c74b891473b96cd1569fa 100644 --- a/src/gpu/core/GPU/GPU_Interface.h +++ b/src/gpu/core/GPU/GPU_Interface.h @@ -310,59 +310,6 @@ void LBCalcMeasurePoints27(real* vxMP, unsigned int numberOfThreads, bool isEvenTimestep); -void BcPress27(int nx, - int ny, - int tz, - unsigned int grid_nx, - unsigned int grid_ny, - unsigned int* bcMatD, - unsigned int* neighborX, - unsigned int* neighborY, - unsigned int* neighborZ, - real* DD, - unsigned long long numberOfLBnodes, - bool isEvenTimestep); - -void QSlipDev27(LBMSimulationParameter* parameterDevice, QforBoundaryConditions* boundaryCondition); - -void QSlipDevComp27(LBMSimulationParameter* parameterDevice, QforBoundaryConditions* boundaryCondition); - -void BBSlipDevComp27(LBMSimulationParameter* parameterDevice, QforBoundaryConditions* boundaryCondition); - -void QSlipDevCompTurbulentViscosity27(LBMSimulationParameter* parameterDevice, QforBoundaryConditions* boundaryCondition); - -void QSlipPressureDevCompTurbulentViscosity27(LBMSimulationParameter* parameterDevice, QforBoundaryConditions* boundaryCondition); - -void QSlipGeomDevComp27( unsigned int numberOfThreads, - real* DD, - int* k_Q, - real* QQ, - unsigned int numberOfBCnodes, - real om1, - real* NormalX, - real* NormalY, - real* NormalZ, - unsigned int* neighborX, - unsigned int* neighborY, - unsigned int* neighborZ, - unsigned long long numberOfLBnodes, - bool isEvenTimestep); - -void QSlipNormDevComp27(unsigned int numberOfThreads, - real* DD, - int* k_Q, - real* QQ, - unsigned int numberOfBCnodes, - real om1, - real* NormalX, - real* NormalY, - real* NormalZ, - unsigned int* neighborX, - unsigned int* neighborY, - unsigned int* neighborZ, - unsigned long long numberOfLBnodes, - bool isEvenTimestep); - void QStressDevComp27(Parameter *para, QforBoundaryConditions* boundaryCondition, const int level); void BBStressDev27(Parameter *para, QforBoundaryConditions* boundaryCondition, const int level); diff --git a/src/gpu/core/GPU/GPU_Kernels.cuh b/src/gpu/core/GPU/GPU_Kernels.cuh index 842edadf9c605f707f81c19886b86309d7bb07cf..808860cd353fb85553599b91b8d21e8b350b60e5 100644 --- a/src/gpu/core/GPU/GPU_Kernels.cuh +++ b/src/gpu/core/GPU/GPU_Kernels.cuh @@ -271,94 +271,6 @@ __global__ void LBCalcMeasurePoints(real* vxMP, real* DD, bool isEvenTimestep); -//Slip BCs -__global__ void QSlipDevice27(real* DD, - int* k_Q, - real* QQ, - unsigned int numberOfBCnodes, - real om1, - unsigned int* neighborX, - unsigned int* neighborY, - unsigned int* neighborZ, - unsigned long long numberOfLBnodes, - bool isEvenTimestep); - -__global__ void QSlipDeviceComp27(real* DD, - int* k_Q, - real* QQ, - unsigned int numberOfBCnodes, - real om1, - unsigned int* neighborX, - unsigned int* neighborY, - unsigned int* neighborZ, - unsigned long long numberOfLBnodes, - bool isEvenTimestep); - -__global__ void QSlipDeviceComp27TurbViscosity( - real* distributions, - int* subgridDistanceIndices, - real* subgridDistances, - unsigned int numberOfBCnodes, - real omega, - unsigned int* neighborX, - unsigned int* neighborY, - unsigned int* neighborZ, - real* turbViscosity, - unsigned long long numberOfLBnodes, - bool isEvenTimestep); - -__global__ void QSlipPressureDeviceComp27TurbViscosity( - real* distributions, - int* subgridDistanceIndices, - real* subgridDistances, - unsigned int numberOfBCnodes, - real omega, - unsigned int* neighborX, - unsigned int* neighborY, - unsigned int* neighborZ, - real* turbViscosity, - unsigned long long numberOfLBnodes, - bool isEvenTimestep); - -__global__ void QSlipGeomDeviceComp27(real* DD, - int* k_Q, - real* QQ, - unsigned int numberOfBCnodes, - real om1, - real* NormalX, - real* NormalY, - real* NormalZ, - unsigned int* neighborX, - unsigned int* neighborY, - unsigned int* neighborZ, - unsigned long long numberOfLBnodes, - bool isEvenTimestep); - -__global__ void QSlipNormDeviceComp27(real* DD, - int* k_Q, - real* QQ, - unsigned int numberOfBCnodes, - real om1, - real* NormalX, - real* NormalY, - real* NormalZ, - unsigned int* neighborX, - unsigned int* neighborY, - unsigned int* neighborZ, - unsigned long long numberOfLBnodes, - bool isEvenTimestep); - -__global__ void BBSlipDeviceComp27( - real* distributions, - int* subgridDistanceIndices, - real* subgridDistances, - unsigned int numberOfBCnodes, - unsigned int* neighborX, - unsigned int* neighborY, - unsigned int* neighborZ, - unsigned long long numberOfLBnodes, - bool isEvenTimestep); - // Stress BCs (wall model) __global__ void QStressDeviceComp27(real* DD, int* k_Q, diff --git a/src/gpu/core/GPU/LBMKernel.cu b/src/gpu/core/GPU/LBMKernel.cu index 501fdc5bb220c5f33dca7ec20105ba377b39b0b4..df9a99dcc58696c3cfebdc48508de19ae4335f22 100644 --- a/src/gpu/core/GPU/LBMKernel.cu +++ b/src/gpu/core/GPU/LBMKernel.cu @@ -1216,172 +1216,6 @@ void QADPressIncompDev27( getLastCudaError("QADPressIncomp27 execution failed"); } ////////////////////////////////////////////////////////////////////////// -void QSlipDev27(LBMSimulationParameter* parameterDevice, QforBoundaryConditions* boundaryCondition) -{ - dim3 grid = vf::cuda::getCudaGrid( parameterDevice->numberofthreads, boundaryCondition->numberOfBCnodes); - dim3 threads(parameterDevice->numberofthreads, 1, 1 ); - - QSlipDevice27<<< grid, threads >>> ( - parameterDevice->distributions.f[0], - boundaryCondition->k, - boundaryCondition->q27[0], - boundaryCondition->numberOfBCnodes, - parameterDevice->omega, - parameterDevice->neighborX, - parameterDevice->neighborY, - parameterDevice->neighborZ, - parameterDevice->numberOfNodes, - parameterDevice->isEvenTimestep); - getLastCudaError("QSlipDevice27 execution failed"); -} -////////////////////////////////////////////////////////////////////////// -void QSlipDevCompTurbulentViscosity27(LBMSimulationParameter* parameterDevice, QforBoundaryConditions* boundaryCondition) -{ - dim3 grid = vf::cuda::getCudaGrid( parameterDevice->numberofthreads, boundaryCondition->numberOfBCnodes); - dim3 threads(parameterDevice->numberofthreads, 1, 1 ); - - QSlipDeviceComp27TurbViscosity<<< grid, threads >>> ( - parameterDevice->distributions.f[0], - boundaryCondition->k, - boundaryCondition->q27[0], - boundaryCondition->numberOfBCnodes, - parameterDevice->omega, - parameterDevice->neighborX, - parameterDevice->neighborY, - parameterDevice->neighborZ, - parameterDevice->turbViscosity, - parameterDevice->numberOfNodes, - parameterDevice->isEvenTimestep); - getLastCudaError("QSlipDeviceComp27TurbViscosity execution failed"); -} -////////////////////////////////////////////////////////////////////////// -void QSlipPressureDevCompTurbulentViscosity27(LBMSimulationParameter* parameterDevice, QforBoundaryConditions* boundaryCondition) -{ - dim3 grid = vf::cuda::getCudaGrid( parameterDevice->numberofthreads, boundaryCondition->numberOfBCnodes); - dim3 threads(parameterDevice->numberofthreads, 1, 1 ); - - QSlipPressureDeviceComp27TurbViscosity<<< grid, threads >>> ( - parameterDevice->distributions.f[0], - boundaryCondition->k, - boundaryCondition->q27[0], - boundaryCondition->numberOfBCnodes, - parameterDevice->omega, - parameterDevice->neighborX, - parameterDevice->neighborY, - parameterDevice->neighborZ, - parameterDevice->turbViscosity, - parameterDevice->numberOfNodes, - parameterDevice->isEvenTimestep); - getLastCudaError("QSlipDeviceComp27TurbViscosity execution failed"); -} -////////////////////////////////////////////////////////////////////////// -void QSlipDevComp27(LBMSimulationParameter* parameterDevice, QforBoundaryConditions* boundaryCondition) -{ - dim3 grid = vf::cuda::getCudaGrid( parameterDevice->numberofthreads, boundaryCondition->numberOfBCnodes); - dim3 threads(parameterDevice->numberofthreads, 1, 1 ); - - QSlipDeviceComp27<<< grid, threads >>> ( - parameterDevice->distributions.f[0], - boundaryCondition->k, - boundaryCondition->q27[0], - boundaryCondition->numberOfBCnodes, - parameterDevice->omega, - parameterDevice->neighborX, - parameterDevice->neighborY, - parameterDevice->neighborZ, - parameterDevice->numberOfNodes, - parameterDevice->isEvenTimestep); - getLastCudaError("QSlipDeviceComp27 execution failed"); -} -////////////////////////////////////////////////////////////////////////// -void BBSlipDevComp27(LBMSimulationParameter* parameterDevice, QforBoundaryConditions* boundaryCondition) -{ - dim3 grid = vf::cuda::getCudaGrid( parameterDevice->numberofthreads, boundaryCondition->numberOfBCnodes); - dim3 threads(parameterDevice->numberofthreads, 1, 1 ); - - BBSlipDeviceComp27<<< grid, threads >>> ( - parameterDevice->distributions.f[0], - boundaryCondition->k, - boundaryCondition->q27[0], - boundaryCondition->numberOfBCnodes, - parameterDevice->neighborX, - parameterDevice->neighborY, - parameterDevice->neighborZ, - parameterDevice->numberOfNodes, - parameterDevice->isEvenTimestep); - getLastCudaError("BBSlipDeviceComp27 execution failed"); -} -////////////////////////////////////////////////////////////////////////// -void QSlipGeomDevComp27( - unsigned int numberOfThreads, - real* DD, - int* k_Q, - real* QQ, - unsigned int numberOfBCnodes, - real om1, - real* NormalX, - real* NormalY, - real* NormalZ, - unsigned int* neighborX, - unsigned int* neighborY, - unsigned int* neighborZ, - unsigned long long numberOfLBnodes, - bool isEvenTimestep) -{ - vf::cuda::CudaGrid grid(numberOfThreads, numberOfBCnodes); - - QSlipGeomDeviceComp27<<< grid.grid, grid.threads >>> ( - DD, - k_Q, - QQ, - numberOfBCnodes, - om1, - NormalX, - NormalY, - NormalZ, - neighborX, - neighborY, - neighborZ, - numberOfLBnodes, - isEvenTimestep); - getLastCudaError("QSlipGeomDeviceComp27 execution failed"); -} -////////////////////////////////////////////////////////////////////////// -void QSlipNormDevComp27( - unsigned int numberOfThreads, - real* DD, - int* k_Q, - real* QQ, - unsigned int numberOfBCnodes, - real om1, - real* NormalX, - real* NormalY, - real* NormalZ, - unsigned int* neighborX, - unsigned int* neighborY, - unsigned int* neighborZ, - unsigned long long numberOfLBnodes, - bool isEvenTimestep) -{ - vf::cuda::CudaGrid grid = vf::cuda::CudaGrid(numberOfThreads, numberOfBCnodes); - - QSlipNormDeviceComp27<<< grid.grid, grid.threads >>> ( - DD, - k_Q, - QQ, - numberOfBCnodes, - om1, - NormalX, - NormalY, - NormalZ, - neighborX, - neighborY, - neighborZ, - numberOfLBnodes, - isEvenTimestep); - getLastCudaError("QSlipNormDeviceComp27 execution failed"); -} -////////////////////////////////////////////////////////////////////////// void QStressDevComp27(Parameter *para, QforBoundaryConditions* boundaryCondition, const int level) { dim3 grid = vf::cuda::getCudaGrid( para->getParD(level)->numberofthreads, boundaryCondition->numberOfBCnodes); diff --git a/src/gpu/core/GPU/SlipBCs27.cu b/src/gpu/core/GPU/SlipBCs27.cu deleted file mode 100644 index 71d36ffd50cb4eaf010e6fef2f1d7e79f31e5eb2..0000000000000000000000000000000000000000 --- a/src/gpu/core/GPU/SlipBCs27.cu +++ /dev/null @@ -1,5102 +0,0 @@ -//======================================================================================= -// ____ ____ __ ______ __________ __ __ __ __ -// \ \ | | | | | _ \ |___ ___| | | | | / \ | | -// \ \ | | | | | |_) | | | | | | | / \ | | -// \ \ | | | | | _ / | | | | | | / /\ \ | | -// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ -// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| -// \ \ | | ________________________________________________________________ -// \ \ | | | ______________________________________________________________| -// \ \| | | | __ __ __ __ ______ _______ -// \ | | |_____ | | | | | | | | | _ \ / _____) -// \ | | _____| | | | | | | | | | | \ \ \_______ -// \ | | | | |_____ | \_/ | | | | |_/ / _____ | -// \ _____| |__| |________| \_______/ |__| |______/ (_______/ -// -// This file is part of VirtualFluids. VirtualFluids is free software: you can -// redistribute it and/or modify it under the terms of the GNU General Public -// License as published by the Free Software Foundation, either version 3 of -// the License, or (at your option) any later version. -// -// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// for more details. -// -// You should have received a copy of the GNU General Public License along -// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. -// -//! \file SlipBCs27.cu -//! \ingroup GPU -//! \author Martin Schoenherr, Anna Wellmann -//====================================================================================== -#include "LBM/LB.h" -#include "lbm/constants/D3Q27.h" -#include "basics/constants/NumericConstants.h" -#include "LBM/GPUHelperFunctions/KernelUtilities.h" - -using namespace vf::basics::constant; -using namespace vf::lbm::dir; -using namespace vf::gpu; - -////////////////////////////////////////////////////////////////////////////// -__global__ void QSlipDevice27( - real* DD, - int* k_Q, - real* QQ, - unsigned int numberOfBCnodes, - real om1, - unsigned int* neighborX, - unsigned int* neighborY, - unsigned int* neighborZ, - unsigned long long numberOfLBnodes, - bool isEvenTimestep) -{ - Distributions27 D = vf::gpu::getDistributionReferences27(DD, numberOfLBnodes, isEvenTimestep); - - //////////////////////////////////////////////////////////////////////////////// - const unsigned x = threadIdx.x; // Globaler x-Index - const unsigned y = blockIdx.x; // Globaler y-Index - const unsigned z = blockIdx.y; // Globaler z-Index - - const unsigned nx = blockDim.x; - const unsigned ny = gridDim.x; - - const unsigned k = nx*(ny*z + y) + x; - ////////////////////////////////////////////////////////////////////////// - - if(k<numberOfBCnodes) - { - //////////////////////////////////////////////////////////////////////////////// - real *q_dirE, *q_dirW, *q_dirN, *q_dirS, *q_dirT, *q_dirB, - *q_dirNE, *q_dirSW, *q_dirSE, *q_dirNW, *q_dirTE, *q_dirBW, - *q_dirBE, *q_dirTW, *q_dirTN, *q_dirBS, *q_dirBN, *q_dirTS, - *q_dirTNE, *q_dirTSW, *q_dirTSE, *q_dirTNW, *q_dirBNE, *q_dirBSW, - *q_dirBSE, *q_dirBNW; - q_dirE = &QQ[dP00 * numberOfBCnodes]; - q_dirW = &QQ[dM00 * numberOfBCnodes]; - q_dirN = &QQ[d0P0 * numberOfBCnodes]; - q_dirS = &QQ[d0M0 * numberOfBCnodes]; - q_dirT = &QQ[d00P * numberOfBCnodes]; - q_dirB = &QQ[d00M * numberOfBCnodes]; - q_dirNE = &QQ[dPP0 * numberOfBCnodes]; - q_dirSW = &QQ[dMM0 * numberOfBCnodes]; - q_dirSE = &QQ[dPM0 * numberOfBCnodes]; - q_dirNW = &QQ[dMP0 * numberOfBCnodes]; - q_dirTE = &QQ[dP0P * numberOfBCnodes]; - q_dirBW = &QQ[dM0M * numberOfBCnodes]; - q_dirBE = &QQ[dP0M * numberOfBCnodes]; - q_dirTW = &QQ[dM0P * numberOfBCnodes]; - q_dirTN = &QQ[d0PP * numberOfBCnodes]; - q_dirBS = &QQ[d0MM * numberOfBCnodes]; - q_dirBN = &QQ[d0PM * numberOfBCnodes]; - q_dirTS = &QQ[d0MP * numberOfBCnodes]; - q_dirTNE = &QQ[dPPP * numberOfBCnodes]; - q_dirTSW = &QQ[dMMP * numberOfBCnodes]; - q_dirTSE = &QQ[dPMP * numberOfBCnodes]; - q_dirTNW = &QQ[dMPP * numberOfBCnodes]; - q_dirBNE = &QQ[dPPM * numberOfBCnodes]; - q_dirBSW = &QQ[dMMM * numberOfBCnodes]; - q_dirBSE = &QQ[dPMM * numberOfBCnodes]; - q_dirBNW = &QQ[dMPM * numberOfBCnodes]; - //////////////////////////////////////////////////////////////////////////////// - //index - unsigned int KQK = k_Q[k]; - unsigned int kzero= KQK; - unsigned int ke = KQK; - unsigned int kw = neighborX[KQK]; - unsigned int kn = KQK; - unsigned int ks = neighborY[KQK]; - unsigned int kt = KQK; - unsigned int kb = neighborZ[KQK]; - unsigned int ksw = neighborY[kw]; - unsigned int kne = KQK; - unsigned int kse = ks; - unsigned int knw = kw; - unsigned int kbw = neighborZ[kw]; - unsigned int kte = KQK; - unsigned int kbe = kb; - unsigned int ktw = kw; - unsigned int kbs = neighborZ[ks]; - unsigned int ktn = KQK; - unsigned int kbn = kb; - unsigned int kts = ks; - unsigned int ktse = ks; - unsigned int kbnw = kbw; - unsigned int ktnw = kw; - unsigned int kbse = kbs; - unsigned int ktsw = ksw; - unsigned int kbne = kb; - unsigned int ktne = KQK; - unsigned int kbsw = neighborZ[ksw]; - //////////////////////////////////////////////////////////////////////////////// - real f_W = (D.f[dP00])[ke ]; - real f_E = (D.f[dM00])[kw ]; - real f_S = (D.f[d0P0])[kn ]; - real f_N = (D.f[d0M0])[ks ]; - real f_B = (D.f[d00P])[kt ]; - real f_T = (D.f[d00M])[kb ]; - real f_SW = (D.f[dPP0])[kne ]; - real f_NE = (D.f[dMM0])[ksw ]; - real f_NW = (D.f[dPM0])[kse ]; - real f_SE = (D.f[dMP0])[knw ]; - real f_BW = (D.f[dP0P])[kte ]; - real f_TE = (D.f[dM0M])[kbw ]; - real f_TW = (D.f[dP0M])[kbe ]; - real f_BE = (D.f[dM0P])[ktw ]; - real f_BS = (D.f[d0PP])[ktn ]; - real f_TN = (D.f[d0MM])[kbs ]; - real f_TS = (D.f[d0PM])[kbn ]; - real f_BN = (D.f[d0MP])[kts ]; - real f_BSW = (D.f[dPPP])[ktne ]; - real f_BNE = (D.f[dMMP])[ktsw ]; - real f_BNW = (D.f[dPMP])[ktse ]; - real f_BSE = (D.f[dMPP])[ktnw ]; - real f_TSW = (D.f[dPPM])[kbne ]; - real f_TNE = (D.f[dMMM])[kbsw ]; - real f_TNW = (D.f[dPMM])[kbse ]; - real f_TSE = (D.f[dMPM])[kbnw ]; - //////////////////////////////////////////////////////////////////////////////// - real vx1, vx2, vx3, drho, feq, q; - drho = f_TSE + f_TNW + f_TNE + f_TSW + f_BSE + f_BNW + f_BNE + f_BSW + - f_BN + f_TS + f_TN + f_BS + f_BE + f_TW + f_TE + f_BW + f_SE + f_NW + f_NE + f_SW + - f_T + f_B + f_N + f_S + f_E + f_W + ((D.f[d000])[kzero]); - - vx1 = ((f_TSE - f_BNW) - (f_TNW - f_BSE)) + ((f_TNE - f_BSW) - (f_TSW - f_BNE)) + - ((f_BE - f_TW) + (f_TE - f_BW)) + ((f_SE - f_NW) + (f_NE - f_SW)) + - (f_E - f_W); - - - vx2 = (-(f_TSE - f_BNW) + (f_TNW - f_BSE)) + ((f_TNE - f_BSW) - (f_TSW - f_BNE)) + - ((f_BN - f_TS) + (f_TN - f_BS)) + (-(f_SE - f_NW) + (f_NE - f_SW)) + - (f_N - f_S); - - vx3 = ((f_TSE - f_BNW) + (f_TNW - f_BSE)) + ((f_TNE - f_BSW) + (f_TSW - f_BNE)) + - (-(f_BN - f_TS) + (f_TN - f_BS)) + ((f_TE - f_BW) - (f_BE - f_TW)) + - (f_T - f_B); - - real cu_sq=c3o2*(vx1*vx1+vx2*vx2+vx3*vx3); - - ////////////////////////////////////////////////////////////////////////// - - D = vf::gpu::getDistributionReferences27(DD, numberOfLBnodes, !isEvenTimestep); - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //Test - //(D.f[d000])[k]=c1o10; - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - real fac = c1o1;//c99o100; - real VeloX = fac*vx1; - real VeloY = fac*vx2; - real VeloZ = fac*vx3; - bool x = false; - bool y = false; - bool z = false; - - q = q_dirE[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = c0o1; - VeloY = fac*vx2; - VeloZ = fac*vx3; - x = true; - feq=c2o27* (drho+c3o1*( vx1 )+c9o2*( vx1 )*( vx1 )-cu_sq); - (D.f[dM00])[kw]=(c1o1-q)/(c1o1+q)*(f_E-feq*om1)/(c1o1-om1)+(q*(f_E+f_W)-c6o1*c2o27*( VeloX ))/(c1o1+q); - //(D.f[dM00])[kw]=zero; - } - - q = q_dirW[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = c0o1; - VeloY = fac*vx2; - VeloZ = fac*vx3; - x = true; - feq=c2o27* (drho+c3o1*(-vx1 )+c9o2*(-vx1 )*(-vx1 )-cu_sq); - (D.f[dP00])[ke]=(c1o1-q)/(c1o1+q)*(f_W-feq*om1)/(c1o1-om1)+(q*(f_W+f_E)-c6o1*c2o27*(-VeloX ))/(c1o1+q); - //(D.f[dP00])[ke]=zero; - } - - q = q_dirN[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = fac*vx1; - VeloY = c0o1; - VeloZ = fac*vx3; - y = true; - feq=c2o27* (drho+c3o1*( vx2 )+c9o2*( vx2 )*( vx2 )-cu_sq); - (D.f[d0M0])[ks]=(c1o1-q)/(c1o1+q)*(f_N-feq*om1)/(c1o1-om1)+(q*(f_N+f_S)-c6o1*c2o27*( VeloY ))/(c1o1+q); - //(D.f[d0M0])[ks]=zero; - } - - q = q_dirS[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = fac*vx1; - VeloY = c0o1; - VeloZ = fac*vx3; - y = true; - feq=c2o27* (drho+c3o1*( -vx2 )+c9o2*( -vx2 )*( -vx2 )-cu_sq); - (D.f[d0P0])[kn]=(c1o1-q)/(c1o1+q)*(f_S-feq*om1)/(c1o1-om1)+(q*(f_S+f_N)-c6o1*c2o27*(-VeloY ))/(c1o1+q); - //(D.f[d0P0])[kn]=zero; - } - - q = q_dirT[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = fac*vx1; - VeloY = fac*vx2; - VeloZ = c0o1; - z = true; - feq=c2o27* (drho+c3o1*( vx3)+c9o2*( vx3)*( vx3)-cu_sq); - (D.f[d00M])[kb]=(c1o1-q)/(c1o1+q)*(f_T-feq*om1)/(c1o1-om1)+(q*(f_T+f_B)-c6o1*c2o27*( VeloZ ))/(c1o1+q); - //(D.f[d00M])[kb]=one; - } - - q = q_dirB[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = fac*vx1; - VeloY = fac*vx2; - VeloZ = c0o1; - z = true; - feq=c2o27* (drho+c3o1*( -vx3)+c9o2*( -vx3)*( -vx3)-cu_sq); - (D.f[d00P])[kt]=(c1o1-q)/(c1o1+q)*(f_B-feq*om1)/(c1o1-om1)+(q*(f_B+f_T)-c6o1*c2o27*(-VeloZ ))/(c1o1+q); - //(D.f[d00P])[kt]=zero; - } - - q = q_dirNE[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = fac*vx1; - VeloY = fac*vx2; - VeloZ = fac*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - feq=c1o54* (drho+c3o1*( vx1+vx2 )+c9o2*( vx1+vx2 )*( vx1+vx2 )-cu_sq); - (D.f[dMM0])[ksw]=(c1o1-q)/(c1o1+q)*(f_NE-feq*om1)/(c1o1-om1)+(q*(f_NE+f_SW)-c6o1*c1o54*(VeloX+VeloY))/(c1o1+q); - //(D.f[dMM0])[ksw]=zero; - } - - q = q_dirSW[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = fac*vx1; - VeloY = fac*vx2; - VeloZ = fac*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - feq=c1o54* (drho+c3o1*(-vx1-vx2 )+c9o2*(-vx1-vx2 )*(-vx1-vx2 )-cu_sq); - (D.f[dPP0])[kne]=(c1o1-q)/(c1o1+q)*(f_SW-feq*om1)/(c1o1-om1)+(q*(f_SW+f_NE)-c6o1*c1o54*(-VeloX-VeloY))/(c1o1+q); - //(D.f[dPP0])[kne]=zero; - } - - q = q_dirSE[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = fac*vx1; - VeloY = fac*vx2; - VeloZ = fac*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - feq=c1o54* (drho+c3o1*( vx1-vx2 )+c9o2*( vx1-vx2 )*( vx1-vx2 )-cu_sq); - (D.f[dMP0])[knw]=(c1o1-q)/(c1o1+q)*(f_SE-feq*om1)/(c1o1-om1)+(q*(f_SE+f_NW)-c6o1*c1o54*( VeloX-VeloY))/(c1o1+q); - //(D.f[dMP0])[knw]=zero; - } - - q = q_dirNW[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = fac*vx1; - VeloY = fac*vx2; - VeloZ = fac*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - feq=c1o54* (drho+c3o1*(-vx1+vx2 )+c9o2*(-vx1+vx2 )*(-vx1+vx2 )-cu_sq); - (D.f[dPM0])[kse]=(c1o1-q)/(c1o1+q)*(f_NW-feq*om1)/(c1o1-om1)+(q*(f_NW+f_SE)-c6o1*c1o54*(-VeloX+VeloY))/(c1o1+q); - //(D.f[dPM0])[kse]=zero; - } - - q = q_dirTE[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = fac*vx1; - VeloY = fac*vx2; - VeloZ = fac*vx3; - if (x == true) VeloX = c0o1; - if (z == true) VeloZ = c0o1; - feq=c1o54* (drho+c3o1*( vx1 +vx3)+c9o2*( vx1 +vx3)*( vx1 +vx3)-cu_sq); - (D.f[dM0M])[kbw]=(c1o1-q)/(c1o1+q)*(f_TE-feq*om1)/(c1o1-om1)+(q*(f_TE+f_BW)-c6o1*c1o54*( VeloX+VeloZ))/(c1o1+q); - //(D.f[dM0M])[kbw]=zero; - } - - q = q_dirBW[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = fac*vx1; - VeloY = fac*vx2; - VeloZ = fac*vx3; - if (x == true) VeloX = c0o1; - if (z == true) VeloZ = c0o1; - feq=c1o54* (drho+c3o1*(-vx1 -vx3)+c9o2*(-vx1 -vx3)*(-vx1 -vx3)-cu_sq); - (D.f[dP0P])[kte]=(c1o1-q)/(c1o1+q)*(f_BW-feq*om1)/(c1o1-om1)+(q*(f_BW+f_TE)-c6o1*c1o54*(-VeloX-VeloZ))/(c1o1+q); - //(D.f[dP0P])[kte]=zero; - } - - q = q_dirBE[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = fac*vx1; - VeloY = fac*vx2; - VeloZ = fac*vx3; - if (x == true) VeloX = c0o1; - if (z == true) VeloZ = c0o1; - feq=c1o54* (drho+c3o1*( vx1 -vx3)+c9o2*( vx1 -vx3)*( vx1 -vx3)-cu_sq); - (D.f[dM0P])[ktw]=(c1o1-q)/(c1o1+q)*(f_BE-feq*om1)/(c1o1-om1)+(q*(f_BE+f_TW)-c6o1*c1o54*( VeloX-VeloZ))/(c1o1+q); - //(D.f[dM0P])[ktw]=zero; - } - - q = q_dirTW[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = fac*vx1; - VeloY = fac*vx2; - VeloZ = fac*vx3; - if (x == true) VeloX = c0o1; - if (z == true) VeloZ = c0o1; - feq=c1o54* (drho+c3o1*(-vx1 +vx3)+c9o2*(-vx1 +vx3)*(-vx1 +vx3)-cu_sq); - (D.f[dP0M])[kbe]=(c1o1-q)/(c1o1+q)*(f_TW-feq*om1)/(c1o1-om1)+(q*(f_TW+f_BE)-c6o1*c1o54*(-VeloX+VeloZ))/(c1o1+q); - //(D.f[dP0M])[kbe]=zero; - } - - q = q_dirTN[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = fac*vx1; - VeloY = fac*vx2; - VeloZ = fac*vx3; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - feq=c1o54* (drho+c3o1*( vx2+vx3)+c9o2*( vx2+vx3)*( vx2+vx3)-cu_sq); - (D.f[d0MM])[kbs]=(c1o1-q)/(c1o1+q)*(f_TN-feq*om1)/(c1o1-om1)+(q*(f_TN+f_BS)-c6o1*c1o54*( VeloY+VeloZ))/(c1o1+q); - //(D.f[d0MM])[kbs]=zero; - } - - q = q_dirBS[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = fac*vx1; - VeloY = fac*vx2; - VeloZ = fac*vx3; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - feq=c1o54* (drho+c3o1*( -vx2-vx3)+c9o2*( -vx2-vx3)*( -vx2-vx3)-cu_sq); - (D.f[d0PP])[ktn]=(c1o1-q)/(c1o1+q)*(f_BS-feq*om1)/(c1o1-om1)+(q*(f_BS+f_TN)-c6o1*c1o54*( -VeloY-VeloZ))/(c1o1+q); - //(D.f[d0PP])[ktn]=zero; - } - - q = q_dirBN[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = fac*vx1; - VeloY = fac*vx2; - VeloZ = fac*vx3; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - feq=c1o54* (drho+c3o1*( vx2-vx3)+c9o2*( vx2-vx3)*( vx2-vx3)-cu_sq); - (D.f[d0MP])[kts]=(c1o1-q)/(c1o1+q)*(f_BN-feq*om1)/(c1o1-om1)+(q*(f_BN+f_TS)-c6o1*c1o54*( VeloY-VeloZ))/(c1o1+q); - //(D.f[d0MP])[kts]=zero; - } - - q = q_dirTS[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = fac*vx1; - VeloY = fac*vx2; - VeloZ = fac*vx3; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - feq=c1o54* (drho+c3o1*( -vx2+vx3)+c9o2*( -vx2+vx3)*( -vx2+vx3)-cu_sq); - (D.f[d0PM])[kbn]=(c1o1-q)/(c1o1+q)*(f_TS-feq*om1)/(c1o1-om1)+(q*(f_TS+f_BN)-c6o1*c1o54*( -VeloY+VeloZ))/(c1o1+q); - //(D.f[d0PM])[kbn]=zero; - } - - q = q_dirTNE[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = fac*vx1; - VeloY = fac*vx2; - VeloZ = fac*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - feq=c1o216*(drho+c3o1*( vx1+vx2+vx3)+c9o2*( vx1+vx2+vx3)*( vx1+vx2+vx3)-cu_sq); - (D.f[dMMM])[kbsw]=(c1o1-q)/(c1o1+q)*(f_TNE-feq*om1)/(c1o1-om1)+(q*(f_TNE+f_BSW)-c6o1*c1o216*( VeloX+VeloY+VeloZ))/(c1o1+q); - //(D.f[dMMM])[kbsw]=zero; - } - - q = q_dirBSW[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = fac*vx1; - VeloY = fac*vx2; - VeloZ = fac*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - feq=c1o216*(drho+c3o1*(-vx1-vx2-vx3)+c9o2*(-vx1-vx2-vx3)*(-vx1-vx2-vx3)-cu_sq); - (D.f[dPPP])[ktne]=(c1o1-q)/(c1o1+q)*(f_BSW-feq*om1)/(c1o1-om1)+(q*(f_BSW+f_TNE)-c6o1*c1o216*(-VeloX-VeloY-VeloZ))/(c1o1+q); - //(D.f[dPPP])[ktne]=zero; - } - - q = q_dirBNE[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = fac*vx1; - VeloY = fac*vx2; - VeloZ = fac*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - feq=c1o216*(drho+c3o1*( vx1+vx2-vx3)+c9o2*( vx1+vx2-vx3)*( vx1+vx2-vx3)-cu_sq); - (D.f[dMMP])[ktsw]=(c1o1-q)/(c1o1+q)*(f_BNE-feq*om1)/(c1o1-om1)+(q*(f_BNE+f_TSW)-c6o1*c1o216*( VeloX+VeloY-VeloZ))/(c1o1+q); - //(D.f[dMMP])[ktsw]=zero; - } - - q = q_dirTSW[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = fac*vx1; - VeloY = fac*vx2; - VeloZ = fac*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - feq=c1o216*(drho+c3o1*(-vx1-vx2+vx3)+c9o2*(-vx1-vx2+vx3)*(-vx1-vx2+vx3)-cu_sq); - (D.f[dPPM])[kbne]=(c1o1-q)/(c1o1+q)*(f_TSW-feq*om1)/(c1o1-om1)+(q*(f_TSW+f_BNE)-c6o1*c1o216*(-VeloX-VeloY+VeloZ))/(c1o1+q); - //(D.f[dPPM])[kbne]=zero; - } - - q = q_dirTSE[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = fac*vx1; - VeloY = fac*vx2; - VeloZ = fac*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - feq=c1o216*(drho+c3o1*( vx1-vx2+vx3)+c9o2*( vx1-vx2+vx3)*( vx1-vx2+vx3)-cu_sq); - (D.f[dMPM])[kbnw]=(c1o1-q)/(c1o1+q)*(f_TSE-feq*om1)/(c1o1-om1)+(q*(f_TSE+f_BNW)-c6o1*c1o216*( VeloX-VeloY+VeloZ))/(c1o1+q); - //(D.f[dMPM])[kbnw]=zero; - } - - q = q_dirBNW[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = fac*vx1; - VeloY = fac*vx2; - VeloZ = fac*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - feq=c1o216*(drho+c3o1*(-vx1+vx2-vx3)+c9o2*(-vx1+vx2-vx3)*(-vx1+vx2-vx3)-cu_sq); - (D.f[dPMP])[ktse]=(c1o1-q)/(c1o1+q)*(f_BNW-feq*om1)/(c1o1-om1)+(q*(f_BNW+f_TSE)-c6o1*c1o216*(-VeloX+VeloY-VeloZ))/(c1o1+q); - //(D.f[dPMP])[ktse]=zero; - } - - q = q_dirBSE[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = fac*vx1; - VeloY = fac*vx2; - VeloZ = fac*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - feq=c1o216*(drho+c3o1*( vx1-vx2-vx3)+c9o2*( vx1-vx2-vx3)*( vx1-vx2-vx3)-cu_sq); - (D.f[dMPP])[ktnw]=(c1o1-q)/(c1o1+q)*(f_BSE-feq*om1)/(c1o1-om1)+(q*(f_BSE+f_TNW)-c6o1*c1o216*( VeloX-VeloY-VeloZ))/(c1o1+q); - //(D.f[dMPP])[ktnw]=zero; - } - - q = q_dirTNW[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = fac*vx1; - VeloY = fac*vx2; - VeloZ = fac*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - feq=c1o216*(drho+c3o1*(-vx1+vx2+vx3)+c9o2*(-vx1+vx2+vx3)*(-vx1+vx2+vx3)-cu_sq); - (D.f[dPMM])[kbse]=(c1o1-q)/(c1o1+q)*(f_TNW-feq*om1)/(c1o1-om1)+(q*(f_TNW+f_BSE)-c6o1*c1o216*(-VeloX+VeloY+VeloZ))/(c1o1+q); - //(D.f[dPMM])[kbse]=zero; - } - } -} -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -////////////////////////////////////////////////////////////////////////////// -__global__ void QSlipDeviceComp27( - real* distributions, - int* subgridDistanceIndices, - real* subgridDistances, - unsigned int numberOfBCnodes, - real omega, - unsigned int* neighborX, - unsigned int* neighborY, - unsigned int* neighborZ, - unsigned long long numberOfLBnodes, - bool isEvenTimestep) -{ - //! The slip boundary condition is executed in the following steps - //! - - //////////////////////////////////////////////////////////////////////////////// - //! - Get node index coordinates from threadIdx, blockIdx, blockDim and gridDim. - //! - const unsigned nodeIndex = getNodeIndex(); - - if(nodeIndex < numberOfBCnodes) - { - ////////////////////////////////////////////////////////////////////////// - //! - Read distributions: style of reading and writing the distributions from/to stored arrays dependent on timestep is based on the esoteric twist algorithm \ref - //! <a href="https://doi.org/10.3390/computation5020019"><b>[ M. Geier et al. (2017), DOI:10.3390/computation5020019 ]</b></a> - //! - Distributions27 dist; - getPointersToDistributions(dist, distributions, numberOfLBnodes, isEvenTimestep); - - //////////////////////////////////////////////////////////////////////////////// - //! - Set local subgrid distances (q's) - //! - SubgridDistances27 subgridD; - getPointersToSubgridDistances(subgridD, subgridDistances, numberOfBCnodes); - - //////////////////////////////////////////////////////////////////////////////// - //! - Set neighbor indices (necessary for indirect addressing) - //! - unsigned int indexOfBCnode = subgridDistanceIndices[nodeIndex]; - unsigned int kzero= indexOfBCnode; - unsigned int ke = indexOfBCnode; - unsigned int kw = neighborX[indexOfBCnode]; - unsigned int kn = indexOfBCnode; - unsigned int ks = neighborY[indexOfBCnode]; - unsigned int kt = indexOfBCnode; - unsigned int kb = neighborZ[indexOfBCnode]; - unsigned int ksw = neighborY[kw]; - unsigned int kne = indexOfBCnode; - unsigned int kse = ks; - unsigned int knw = kw; - unsigned int kbw = neighborZ[kw]; - unsigned int kte = indexOfBCnode; - unsigned int kbe = kb; - unsigned int ktw = kw; - unsigned int kbs = neighborZ[ks]; - unsigned int ktn = indexOfBCnode; - unsigned int kbn = kb; - unsigned int kts = ks; - unsigned int ktse = ks; - unsigned int kbnw = kbw; - unsigned int ktnw = kw; - unsigned int kbse = kbs; - unsigned int ktsw = ksw; - unsigned int kbne = kb; - unsigned int ktne = indexOfBCnode; - unsigned int kbsw = neighborZ[ksw]; - - //////////////////////////////////////////////////////////////////////////////// - //! - Set local distributions - //! - real f_W = (dist.f[dP00])[ke ]; - real f_E = (dist.f[dM00])[kw ]; - real f_S = (dist.f[d0P0])[kn ]; - real f_N = (dist.f[d0M0])[ks ]; - real f_B = (dist.f[d00P])[kt ]; - real f_T = (dist.f[d00M])[kb ]; - real f_SW = (dist.f[dPP0])[kne ]; - real f_NE = (dist.f[dMM0])[ksw ]; - real f_NW = (dist.f[dPM0])[kse ]; - real f_SE = (dist.f[dMP0])[knw ]; - real f_BW = (dist.f[dP0P])[kte ]; - real f_TE = (dist.f[dM0M])[kbw ]; - real f_TW = (dist.f[dP0M])[kbe ]; - real f_BE = (dist.f[dM0P])[ktw ]; - real f_BS = (dist.f[d0PP])[ktn ]; - real f_TN = (dist.f[d0MM])[kbs ]; - real f_TS = (dist.f[d0PM])[kbn ]; - real f_BN = (dist.f[d0MP])[kts ]; - real f_BSW = (dist.f[dPPP])[ktne ]; - real f_BNE = (dist.f[dMMP])[ktsw ]; - real f_BNW = (dist.f[dPMP])[ktse ]; - real f_BSE = (dist.f[dMPP])[ktnw ]; - real f_TSW = (dist.f[dPPM])[kbne ]; - real f_TNE = (dist.f[dMMM])[kbsw ]; - real f_TNW = (dist.f[dPMM])[kbse ]; - real f_TSE = (dist.f[dMPM])[kbnw ]; - - //////////////////////////////////////////////////////////////////////////////// - //! - Calculate macroscopic quantities - //! - real drho = f_TSE + f_TNW + f_TNE + f_TSW + f_BSE + f_BNW + f_BNE + f_BSW + - f_BN + f_TS + f_TN + f_BS + f_BE + f_TW + f_TE + f_BW + f_SE + f_NW + f_NE + f_SW + - f_T + f_B + f_N + f_S + f_E + f_W + ((dist.f[d000])[kzero]); - - real vx1 = (((f_TSE - f_BNW) - (f_TNW - f_BSE)) + ((f_TNE - f_BSW) - (f_TSW - f_BNE)) + - ((f_BE - f_TW) + (f_TE - f_BW)) + ((f_SE - f_NW) + (f_NE - f_SW)) + - (f_E - f_W)) / (c1o1 + drho); - - real vx2 = ((-(f_TSE - f_BNW) + (f_TNW - f_BSE)) + ((f_TNE - f_BSW) - (f_TSW - f_BNE)) + - ((f_BN - f_TS) + (f_TN - f_BS)) + (-(f_SE - f_NW) + (f_NE - f_SW)) + - (f_N - f_S)) / (c1o1 + drho); - - real vx3 = (((f_TSE - f_BNW) + (f_TNW - f_BSE)) + ((f_TNE - f_BSW) + (f_TSW - f_BNE)) + - (-(f_BN - f_TS) + (f_TN - f_BS)) + ((f_TE - f_BW) - (f_BE - f_TW)) + - (f_T - f_B)) / (c1o1 + drho); - - real cu_sq = c3o2 * (vx1 * vx1 + vx2 * vx2 + vx3 * vx3) * (c1o1 + drho); - - //////////////////////////////////////////////////////////////////////////////// - //! - change the pointer to write the results in the correct array - //! - getPointersToDistributions(dist, distributions, numberOfLBnodes, !isEvenTimestep); - - //////////////////////////////////////////////////////////////////////////////// - //! - Multiply the local velocities by the slipLength - //! - real slipLength = c1o1; - real VeloX = slipLength*vx1; - real VeloY = slipLength*vx2; - real VeloZ = slipLength*vx3; - - //////////////////////////////////////////////////////////////////////////////// - //! - Update distributions with subgrid distance (q) between zero and one - //! - real feq, q, velocityLB, velocityBC; - - bool x = false; - bool y = false; - bool z = false; - - q = (subgridD.q[dP00])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) // only update distribution for q between zero and one - { - VeloX = c0o1; - x = true; - - velocityLB = vx1; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c2o27); - velocityBC = VeloX; - (dist.f[dM00])[kw] = getInterpolatedDistributionForVeloBC(q, f_E, f_W, feq, omega, velocityBC, c2o27); - } - - q = (subgridD.q[dM00])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = c0o1; - x = true; - - velocityLB = -vx1; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c2o27); - velocityBC = -VeloX; - (dist.f[dP00])[ke] = getInterpolatedDistributionForVeloBC(q, f_W, f_E, feq, omega, velocityBC, c2o27); - } - - q = (subgridD.q[d0P0])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloY = c0o1; - y = true; - - velocityLB = vx2; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c2o27); - velocityBC = VeloY; - (dist.f[d0M0])[ks] = getInterpolatedDistributionForVeloBC(q, f_N, f_S, feq, omega, velocityBC, c2o27); - } - - q = (subgridD.q[d0M0])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloY = c0o1; - y = true; - - velocityLB = -vx2; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c2o27); - velocityBC = -VeloY; - (dist.f[d0P0])[kn] = getInterpolatedDistributionForVeloBC(q, f_S, f_N, feq, omega, velocityBC, c2o27); - } - - q = (subgridD.q[d00P])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloZ = c0o1; - z = true; - - velocityLB = vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c2o27); - velocityBC = VeloZ; - (dist.f[d00M])[kb] = getInterpolatedDistributionForVeloBC(q, f_T, f_B, feq, omega, velocityBC, c2o27); - } - - q = (subgridD.q[d00M])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloZ = c0o1; - z = true; - - velocityLB = -vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c2o27); - velocityBC = -VeloZ; - (dist.f[d00P])[kt] = getInterpolatedDistributionForVeloBC(q, f_B, f_T, feq, omega, velocityBC, c2o27); - } - - q = (subgridD.q[dPP0])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - - velocityLB = vx1 + vx2; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); - velocityBC = VeloX + VeloY; - (dist.f[dMM0])[ksw] = getInterpolatedDistributionForVeloBC(q, f_NE, f_SW, feq, omega, velocityBC, c1o54); - } - - q = (subgridD.q[dMM0])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - - velocityLB = -vx1 - vx2; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); - velocityBC = -VeloX - VeloY; - (dist.f[dPP0])[kne] = getInterpolatedDistributionForVeloBC(q, f_SW, f_NE, feq, omega, velocityBC, c1o54); - } - - q = (subgridD.q[dPM0])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - - velocityLB = vx1 - vx2; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); - velocityBC = VeloX - VeloY; - (dist.f[dMP0])[knw] = getInterpolatedDistributionForVeloBC(q, f_SE, f_NW, feq, omega, velocityBC, c1o54); - } - - q = (subgridD.q[dMP0])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - - velocityLB = -vx1 + vx2; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); - velocityBC = -VeloX + VeloY; - (dist.f[dPM0])[kse] = getInterpolatedDistributionForVeloBC(q, f_NW, f_SE, feq, omega, velocityBC, c1o54); - } - - q = (subgridD.q[dP0P])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (z == true) VeloZ = c0o1; - - velocityLB = vx1 + vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); - velocityBC = VeloX + VeloZ; - (dist.f[dM0M])[kbw] = getInterpolatedDistributionForVeloBC(q, f_TE, f_BW, feq, omega, velocityBC, c1o54); - } - - q = (subgridD.q[dM0M])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (z == true) VeloZ = c0o1; - - velocityLB = -vx1 - vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); - velocityBC = -VeloX - VeloZ; - (dist.f[dP0P])[kte] = getInterpolatedDistributionForVeloBC(q, f_BW, f_TE, feq, omega, velocityBC, c1o54); - } - - q = (subgridD.q[dP0M])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (z == true) VeloZ = c0o1; - - velocityLB = vx1 - vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); - velocityBC = VeloX - VeloZ; - (dist.f[dM0P])[ktw] = getInterpolatedDistributionForVeloBC(q, f_BE, f_TW, feq, omega, velocityBC, c1o54); - } - - q = (subgridD.q[dM0P])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (z == true) VeloZ = c0o1; - - velocityLB = -vx1 + vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); - velocityBC = -VeloX + VeloZ; - (dist.f[dP0M])[kbe] = getInterpolatedDistributionForVeloBC(q, f_TW, f_BE, feq, omega, velocityBC, c1o54); - } - - q = (subgridD.q[d0PP])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - - velocityLB = vx2 + vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); - velocityBC = VeloY + VeloZ; - (dist.f[d0MM])[kbs] = getInterpolatedDistributionForVeloBC(q, f_TN, f_BS, feq, omega, velocityBC, c1o54); - } - - q = (subgridD.q[d0MM])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - - velocityLB = -vx2 - vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); - velocityBC = -VeloY - VeloZ; - (dist.f[d0PP])[ktn] = getInterpolatedDistributionForVeloBC(q, f_BS, f_TN, feq, omega, velocityBC, c1o54); - } - - - q = (subgridD.q[d0PM])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - - velocityLB = vx2 - vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); - velocityBC = VeloY - VeloZ; - (dist.f[d0MP])[kts] = getInterpolatedDistributionForVeloBC(q, f_BN, f_TS, feq, omega, velocityBC, c1o54); - } - - q = (subgridD.q[d0MP])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - - velocityLB = -vx2 + vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); - velocityBC = -VeloY + VeloZ; - (dist.f[d0PM])[kbn] = getInterpolatedDistributionForVeloBC(q, f_TS, f_BN, feq, omega, velocityBC, c1o54); - } - - q = (subgridD.q[dPPP])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - velocityLB = vx1 + vx2 + vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o216); - velocityBC = VeloX + VeloY + VeloZ; - (dist.f[dMMM])[kbsw] = getInterpolatedDistributionForVeloBC(q, f_TNE, f_BSW, feq, omega, velocityBC, c1o216); - } - - q = (subgridD.q[dMMM])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - velocityLB = -vx1 - vx2 - vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o216); - velocityBC = -VeloX - VeloY - VeloZ; - (dist.f[dPPP])[ktne] = getInterpolatedDistributionForVeloBC(q, f_BSW, f_TNE, feq, omega, velocityBC, c1o216); - } - - - q = (subgridD.q[dPPM])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - velocityLB = vx1 + vx2 - vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o216); - velocityBC = VeloX + VeloY - VeloZ; - (dist.f[dMMP])[ktsw] = getInterpolatedDistributionForVeloBC(q, f_BNE, f_TSW, feq, omega, velocityBC, c1o216); - } - - q = (subgridD.q[dMMP])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - velocityLB = -vx1 - vx2 + vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o216); - velocityBC = -VeloX - VeloY + VeloZ; - (dist.f[dPPM])[kbne] = getInterpolatedDistributionForVeloBC(q, f_TSW, f_BNE, feq, omega, velocityBC, c1o216); - } - - q = (subgridD.q[dPMP])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - velocityLB = vx1 - vx2 + vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o216); - velocityBC = VeloX - VeloY + VeloZ; - (dist.f[dMPM])[kbnw] = getInterpolatedDistributionForVeloBC(q, f_TSE, f_BNW, feq, omega, velocityBC, c1o216); - } - - q = (subgridD.q[dMPM])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - velocityLB = -vx1 + vx2 - vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o216); - velocityBC = -VeloX + VeloY - VeloZ; - (dist.f[dPMP])[ktse] = getInterpolatedDistributionForVeloBC(q, f_BNW, f_TSE, feq, omega, velocityBC, c1o216); - } - - q = (subgridD.q[dPMM])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - velocityLB = vx1 - vx2 - vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o216); - velocityBC = VeloX - VeloY - VeloZ; - (dist.f[dMPP])[ktnw] = getInterpolatedDistributionForVeloBC(q, f_BSE, f_TNW, feq, omega, velocityBC, c1o216); - } - - q = (subgridD.q[dMPP])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - velocityLB = -vx1 + vx2 + vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o216); - velocityBC = -VeloX + VeloY + VeloZ; - (dist.f[dPMM])[kbse] = getInterpolatedDistributionForVeloBC(q, f_TNW, f_BSE, feq, omega, velocityBC, c1o216); - } - } -} -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - - - - - - - - - - - - - - - - - - - - - - - - - - -////////////////////////////////////////////////////////////////////////////// -__global__ void BBSlipDeviceComp27( - real* distributions, - int* subgridDistanceIndices, - real* subgridDistances, - unsigned int numberOfBCnodes, - unsigned int* neighborX, - unsigned int* neighborY, - unsigned int* neighborZ, - unsigned long long numberOfLBnodes, - bool isEvenTimestep) -{ - //! The slip boundary condition is executed in the following steps - //! - - //////////////////////////////////////////////////////////////////////////////// - //! - Get node index coordinates from threadIdx, blockIdx, blockDim and gridDim. - //! - const unsigned nodeIndex = getNodeIndex(); - - if(nodeIndex < numberOfBCnodes) - { - ////////////////////////////////////////////////////////////////////////// - //! - Read distributions: style of reading and writing the distributions from/to stored arrays dependent on timestep is based on the esoteric twist algorithm \ref - //! <a href="https://doi.org/10.3390/computation5020019"><b>[ M. Geier et al. (2017), DOI:10.3390/computation5020019 ]</b></a> - //! - Distributions27 dist = vf::gpu::getDistributionReferences27(distributions, numberOfLBnodes, isEvenTimestep); - //////////////////////////////////////////////////////////////////////////////// - //! - Set local subgrid distances (q's) - //! - SubgridDistances27 subgridD; - getPointersToSubgridDistances(subgridD, subgridDistances, numberOfBCnodes); - - //////////////////////////////////////////////////////////////////////////////// - //! - Set neighbor indices (necessary for indirect addressing) - //! - unsigned int indexOfBCnode = subgridDistanceIndices[nodeIndex]; - unsigned int kzero= indexOfBCnode; - unsigned int ke = indexOfBCnode; - unsigned int kw = neighborX[indexOfBCnode]; - unsigned int kn = indexOfBCnode; - unsigned int ks = neighborY[indexOfBCnode]; - unsigned int kt = indexOfBCnode; - unsigned int kb = neighborZ[indexOfBCnode]; - unsigned int ksw = neighborY[kw]; - unsigned int kne = indexOfBCnode; - unsigned int kse = ks; - unsigned int knw = kw; - unsigned int kbw = neighborZ[kw]; - unsigned int kte = indexOfBCnode; - unsigned int kbe = kb; - unsigned int ktw = kw; - unsigned int kbs = neighborZ[ks]; - unsigned int ktn = indexOfBCnode; - unsigned int kbn = kb; - unsigned int kts = ks; - unsigned int ktse = ks; - unsigned int kbnw = kbw; - unsigned int ktnw = kw; - unsigned int kbse = kbs; - unsigned int ktsw = ksw; - unsigned int kbne = kb; - unsigned int ktne = indexOfBCnode; - unsigned int kbsw = neighborZ[ksw]; - - //////////////////////////////////////////////////////////////////////////////// - //! - Set local distributions - //! - real f_W = (dist.f[dP00])[ke ]; - real f_E = (dist.f[dM00])[kw ]; - real f_S = (dist.f[d0P0])[kn ]; - real f_N = (dist.f[d0M0])[ks ]; - real f_B = (dist.f[d00P])[kt ]; - real f_T = (dist.f[d00M])[kb ]; - real f_SW = (dist.f[dPP0])[kne ]; - real f_NE = (dist.f[dMM0])[ksw ]; - real f_NW = (dist.f[dPM0])[kse ]; - real f_SE = (dist.f[dMP0])[knw ]; - real f_BW = (dist.f[dP0P])[kte ]; - real f_TE = (dist.f[dM0M])[kbw ]; - real f_TW = (dist.f[dP0M])[kbe ]; - real f_BE = (dist.f[dM0P])[ktw ]; - real f_BS = (dist.f[d0PP])[ktn ]; - real f_TN = (dist.f[d0MM])[kbs ]; - real f_TS = (dist.f[d0PM])[kbn ]; - real f_BN = (dist.f[d0MP])[kts ]; - real f_BSW = (dist.f[dPPP])[ktne ]; - real f_BNE = (dist.f[dMMP])[ktsw ]; - real f_BNW = (dist.f[dPMP])[ktse ]; - real f_BSE = (dist.f[dMPP])[ktnw ]; - real f_TSW = (dist.f[dPPM])[kbne ]; - real f_TNE = (dist.f[dMMM])[kbsw ]; - real f_TNW = (dist.f[dPMM])[kbse ]; - real f_TSE = (dist.f[dMPM])[kbnw ]; - - //////////////////////////////////////////////////////////////////////////////// - //! - Calculate macroscopic quantities - //! - real drho = f_TSE + f_TNW + f_TNE + f_TSW + f_BSE + f_BNW + f_BNE + f_BSW + - f_BN + f_TS + f_TN + f_BS + f_BE + f_TW + f_TE + f_BW + f_SE + f_NW + f_NE + f_SW + - f_T + f_B + f_N + f_S + f_E + f_W + ((dist.f[d000])[kzero]); - - real vx1 = (((f_TSE - f_BNW) - (f_TNW - f_BSE)) + ((f_TNE - f_BSW) - (f_TSW - f_BNE)) + - ((f_BE - f_TW) + (f_TE - f_BW)) + ((f_SE - f_NW) + (f_NE - f_SW)) + - (f_E - f_W)) / (c1o1 + drho); - - real vx2 = ((-(f_TSE - f_BNW) + (f_TNW - f_BSE)) + ((f_TNE - f_BSW) - (f_TSW - f_BNE)) + - ((f_BN - f_TS) + (f_TN - f_BS)) + (-(f_SE - f_NW) + (f_NE - f_SW)) + - (f_N - f_S)) / (c1o1 + drho); - - real vx3 = (((f_TSE - f_BNW) + (f_TNW - f_BSE)) + ((f_TNE - f_BSW) + (f_TSW - f_BNE)) + - (-(f_BN - f_TS) + (f_TN - f_BS)) + ((f_TE - f_BW) - (f_BE - f_TW)) + - (f_T - f_B)) / (c1o1 + drho); - - // real cu_sq = c3o2 * (vx1 * vx1 + vx2 * vx2 + vx3 * vx3) * (c1o1 + drho); - - //////////////////////////////////////////////////////////////////////////////// - //! - change the pointer to write the results in the correct array - //! - - dist = vf::gpu::getDistributionReferences27(distributions, numberOfLBnodes, !isEvenTimestep); - //////////////////////////////////////////////////////////////////////////////// - //! - Multiply the local velocities by the slipLength - //! - real slipLength = c1o1; - real VeloX = slipLength*vx1; - real VeloY = slipLength*vx2; - real VeloZ = slipLength*vx3; - - //////////////////////////////////////////////////////////////////////////////// - //! - Update distributions with subgrid distance (q) between zero and one - //! - real q, velocityBC; - - bool x = false; - bool y = false; - bool z = false; - - q = (subgridD.q[dP00])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) // only update distribution for q between zero and one - { - VeloX = c0o1; - x = true; - - velocityBC = VeloX; - (dist.f[dM00])[kw] = getBounceBackDistributionForVeloBC(f_W, velocityBC, c2o27); - } - - q = (subgridD.q[dM00])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = c0o1; - x = true; - - velocityBC = -VeloX; - (dist.f[dP00])[ke] = getBounceBackDistributionForVeloBC(f_E, velocityBC, c2o27); - } - - q = (subgridD.q[d0P0])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloY = c0o1; - y = true; - - velocityBC = VeloY; - (dist.f[d0M0])[ks] = getBounceBackDistributionForVeloBC(f_S, velocityBC, c2o27); - } - - q = (subgridD.q[d0M0])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloY = c0o1; - y = true; - - velocityBC = -VeloY; - (dist.f[d0P0])[kn] = getBounceBackDistributionForVeloBC(f_N, velocityBC, c2o27); - } - - q = (subgridD.q[d00P])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloZ = c0o1; - z = true; - - velocityBC = VeloZ; - (dist.f[d00M])[kb] = getBounceBackDistributionForVeloBC(f_B, velocityBC, c2o27); - } - - q = (subgridD.q[d00M])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloZ = c0o1; - z = true; - - velocityBC = -VeloZ; - (dist.f[d00P])[kt] = getBounceBackDistributionForVeloBC(f_T, velocityBC, c2o27); - } - - q = (subgridD.q[dPP0])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - - velocityBC = VeloX + VeloY; - (dist.f[dMM0])[ksw] = getBounceBackDistributionForVeloBC(f_SW, velocityBC, c1o54); - } - - q = (subgridD.q[dMM0])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - - velocityBC = -VeloX - VeloY; - (dist.f[dPP0])[kne] = getBounceBackDistributionForVeloBC(f_NE, velocityBC, c1o54); - } - - q = (subgridD.q[dPM0])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - - velocityBC = VeloX - VeloY; - (dist.f[dMP0])[knw] = getBounceBackDistributionForVeloBC(f_NW, velocityBC, c1o54); - } - - q = (subgridD.q[dMP0])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - - velocityBC = -VeloX + VeloY; - (dist.f[dPM0])[kse] = getBounceBackDistributionForVeloBC(f_SE, velocityBC, c1o54); - } - - q = (subgridD.q[dP0P])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (z == true) VeloZ = c0o1; - - velocityBC = VeloX + VeloZ; - (dist.f[dM0M])[kbw] = getBounceBackDistributionForVeloBC(f_BW, velocityBC, c1o54); - } - - q = (subgridD.q[dM0M])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (z == true) VeloZ = c0o1; - - velocityBC = -VeloX - VeloZ; - (dist.f[dP0P])[kte] = getBounceBackDistributionForVeloBC(f_TE, velocityBC, c1o54); - } - - q = (subgridD.q[dP0M])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (z == true) VeloZ = c0o1; - - velocityBC = VeloX - VeloZ; - (dist.f[dM0P])[ktw] = getBounceBackDistributionForVeloBC(f_TW, velocityBC, c1o54); - } - - q = (subgridD.q[dM0P])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (z == true) VeloZ = c0o1; - - velocityBC = -VeloX + VeloZ; - (dist.f[dP0M])[kbe] = getBounceBackDistributionForVeloBC(f_BE, velocityBC, c1o54); - } - - q = (subgridD.q[d0PP])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - - velocityBC = VeloY + VeloZ; - (dist.f[d0MM])[kbs] = getBounceBackDistributionForVeloBC(f_BS, velocityBC, c1o54); - } - - q = (subgridD.q[d0MM])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - - velocityBC = -VeloY - VeloZ; - (dist.f[d0PP])[ktn] = getBounceBackDistributionForVeloBC(f_TN, velocityBC, c1o54); - } - - - q = (subgridD.q[d0PM])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - - velocityBC = VeloY - VeloZ; - (dist.f[d0MP])[kts] = getBounceBackDistributionForVeloBC(f_TS, velocityBC, c1o54); - } - - q = (subgridD.q[d0MP])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - - velocityBC = -VeloY + VeloZ; - (dist.f[d0PM])[kbn] = getBounceBackDistributionForVeloBC(f_BN, velocityBC, c1o54); - } - - q = (subgridD.q[dPPP])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - - velocityBC = VeloX + VeloY + VeloZ; - (dist.f[dMMM])[kbsw] = getBounceBackDistributionForVeloBC(f_TNE, velocityBC, c1o216); - } - - q = (subgridD.q[dMMM])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - - velocityBC = -VeloX - VeloY - VeloZ; - (dist.f[dPPP])[ktne] = getBounceBackDistributionForVeloBC(f_TNE, velocityBC, c1o216); - } - - - q = (subgridD.q[dPPM])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - - velocityBC = VeloX + VeloY - VeloZ; - (dist.f[dMMP])[ktsw] = getBounceBackDistributionForVeloBC(f_TSW, velocityBC, c1o216); - } - - q = (subgridD.q[dMMP])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - - velocityBC = -VeloX - VeloY + VeloZ; - (dist.f[dPPM])[kbne] = getBounceBackDistributionForVeloBC(f_BNE, velocityBC, c1o216); - } - - q = (subgridD.q[dPMP])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - - velocityBC = VeloX - VeloY + VeloZ; - (dist.f[dMPM])[kbnw] = getBounceBackDistributionForVeloBC(f_BNW, velocityBC, c1o216); - } - - q = (subgridD.q[dMPM])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - - velocityBC = -VeloX + VeloY - VeloZ; - (dist.f[dPMP])[ktse] = getBounceBackDistributionForVeloBC(f_TSE, velocityBC, c1o216); - } - - q = (subgridD.q[dPMM])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - - velocityBC = VeloX - VeloY - VeloZ; - (dist.f[dMPP])[ktnw] = getBounceBackDistributionForVeloBC(f_TNW, velocityBC, c1o216); - } - - q = (subgridD.q[dMPP])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - - velocityBC = -VeloX + VeloY + VeloZ; - (dist.f[dPMM])[kbse] = getBounceBackDistributionForVeloBC(f_BSE, velocityBC, c1o216); - } - } -} -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - - - - - - - - - - - - - - - - - - - - - - - - - - - -//////////////////////////////////////////////////////////////////////////// -__global__ void QSlipDeviceComp27TurbViscosity( - real* distributions, - int* subgridDistanceIndices, - real* subgridDistances, - unsigned int numberOfBCnodes, - real omega, - unsigned int* neighborX, - unsigned int* neighborY, - unsigned int* neighborZ, - real* turbViscosity, - unsigned long long numberOfLBnodes, - bool isEvenTimestep) -{ - //! The slip boundary condition is executed in the following steps - //! - - //////////////////////////////////////////////////////////////////////////////// - //! - Get node index coordinates from threadIdx, blockIdx, blockDim and gridDim. - //! - const unsigned nodeIndex = getNodeIndex(); - - if(nodeIndex < numberOfBCnodes) - { - ////////////////////////////////////////////////////////////////////////// - //! - Read distributions: style of reading and writing the distributions from/to stored arrays dependent on timestep is based on the esoteric twist algorithm \ref - //! <a href="https://doi.org/10.3390/computation5020019"><b>[ M. Geier et al. (2017), DOI:10.3390/computation5020019 ]</b></a> - //! - Distributions27 dist; - getPointersToDistributions(dist, distributions, numberOfLBnodes, isEvenTimestep); - - //////////////////////////////////////////////////////////////////////////////// - //! - Set local subgrid distances (q's) - //! - SubgridDistances27 subgridD; - getPointersToSubgridDistances(subgridD, subgridDistances, numberOfBCnodes); - - //////////////////////////////////////////////////////////////////////////////// - //! - Set neighbor indices (necessary for indirect addressing) - //! - unsigned int indexOfBCnode = subgridDistanceIndices[nodeIndex]; - unsigned int kzero= indexOfBCnode; - unsigned int ke = indexOfBCnode; - unsigned int kw = neighborX[indexOfBCnode]; - unsigned int kn = indexOfBCnode; - unsigned int ks = neighborY[indexOfBCnode]; - unsigned int kt = indexOfBCnode; - unsigned int kb = neighborZ[indexOfBCnode]; - unsigned int ksw = neighborY[kw]; - unsigned int kne = indexOfBCnode; - unsigned int kse = ks; - unsigned int knw = kw; - unsigned int kbw = neighborZ[kw]; - unsigned int kte = indexOfBCnode; - unsigned int kbe = kb; - unsigned int ktw = kw; - unsigned int kbs = neighborZ[ks]; - unsigned int ktn = indexOfBCnode; - unsigned int kbn = kb; - unsigned int kts = ks; - unsigned int ktse = ks; - unsigned int kbnw = kbw; - unsigned int ktnw = kw; - unsigned int kbse = kbs; - unsigned int ktsw = ksw; - unsigned int kbne = kb; - unsigned int ktne = indexOfBCnode; - unsigned int kbsw = neighborZ[ksw]; - - //////////////////////////////////////////////////////////////////////////////// - //! - Set local distributions - //! - real f_W = (dist.f[dP00])[ke ]; - real f_E = (dist.f[dM00])[kw ]; - real f_S = (dist.f[d0P0])[kn ]; - real f_N = (dist.f[d0M0])[ks ]; - real f_B = (dist.f[d00P])[kt ]; - real f_T = (dist.f[d00M])[kb ]; - real f_SW = (dist.f[dPP0])[kne ]; - real f_NE = (dist.f[dMM0])[ksw ]; - real f_NW = (dist.f[dPM0])[kse ]; - real f_SE = (dist.f[dMP0])[knw ]; - real f_BW = (dist.f[dP0P])[kte ]; - real f_TE = (dist.f[dM0M])[kbw ]; - real f_TW = (dist.f[dP0M])[kbe ]; - real f_BE = (dist.f[dM0P])[ktw ]; - real f_BS = (dist.f[d0PP])[ktn ]; - real f_TN = (dist.f[d0MM])[kbs ]; - real f_TS = (dist.f[d0PM])[kbn ]; - real f_BN = (dist.f[d0MP])[kts ]; - real f_BSW = (dist.f[dPPP])[ktne ]; - real f_BNE = (dist.f[dMMP])[ktsw ]; - real f_BNW = (dist.f[dPMP])[ktse ]; - real f_BSE = (dist.f[dMPP])[ktnw ]; - real f_TSW = (dist.f[dPPM])[kbne ]; - real f_TNE = (dist.f[dMMM])[kbsw ]; - real f_TNW = (dist.f[dPMM])[kbse ]; - real f_TSE = (dist.f[dMPM])[kbnw ]; - - //////////////////////////////////////////////////////////////////////////////// - //! - Calculate macroscopic quantities - //! - real drho = f_TSE + f_TNW + f_TNE + f_TSW + f_BSE + f_BNW + f_BNE + f_BSW + - f_BN + f_TS + f_TN + f_BS + f_BE + f_TW + f_TE + f_BW + f_SE + f_NW + f_NE + f_SW + - f_T + f_B + f_N + f_S + f_E + f_W + ((dist.f[d000])[kzero]); - - real vx1 = (((f_TSE - f_BNW) - (f_TNW - f_BSE)) + ((f_TNE - f_BSW) - (f_TSW - f_BNE)) + - ((f_BE - f_TW) + (f_TE - f_BW)) + ((f_SE - f_NW) + (f_NE - f_SW)) + - (f_E - f_W)) / (c1o1 + drho); - - real vx2 = ((-(f_TSE - f_BNW) + (f_TNW - f_BSE)) + ((f_TNE - f_BSW) - (f_TSW - f_BNE)) + - ((f_BN - f_TS) + (f_TN - f_BS)) + (-(f_SE - f_NW) + (f_NE - f_SW)) + - (f_N - f_S)) / (c1o1 + drho); - - real vx3 = (((f_TSE - f_BNW) + (f_TNW - f_BSE)) + ((f_TNE - f_BSW) + (f_TSW - f_BNE)) + - (-(f_BN - f_TS) + (f_TN - f_BS)) + ((f_TE - f_BW) - (f_BE - f_TW)) + - (f_T - f_B)) / (c1o1 + drho); - - real cu_sq = c3o2 * (vx1 * vx1 + vx2 * vx2 + vx3 * vx3) * (c1o1 + drho); - - //////////////////////////////////////////////////////////////////////////////// - //! - change the pointer to write the results in the correct array - //! - getPointersToDistributions(dist, distributions, numberOfLBnodes, !isEvenTimestep); - - //////////////////////////////////////////////////////////////////////////////// - //! - compute local relaxation rate - //! - real om_turb = omega / (c1o1 + c3o1* omega* max(c0o1, turbViscosity[indexOfBCnode]) ); - - //////////////////////////////////////////////////////////////////////////////// - //! - Multiply the local velocities by the slipLength - //! - real slipLength = c1o1; - real VeloX = slipLength*vx1; - real VeloY = slipLength*vx2; - real VeloZ = slipLength*vx3; - - //////////////////////////////////////////////////////////////////////////////// - //! - Update distributions with subgrid distance (q) between zero and one - //! - real feq, q, velocityLB, velocityBC; - - bool x = false; - bool y = false; - bool z = false; - - q = (subgridD.q[dP00])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) // only update distribution for q between zero and one - { - VeloX = c0o1; - x = true; - - velocityLB = vx1; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c2o27); - velocityBC = VeloX; - (dist.f[dM00])[kw] = getInterpolatedDistributionForVeloBC(q, f_E, f_W, feq, om_turb, velocityBC, c2o27); - } - - q = (subgridD.q[dM00])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = c0o1; - x = true; - - velocityLB = -vx1; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c2o27); - velocityBC = -VeloX; - (dist.f[dP00])[ke] = getInterpolatedDistributionForVeloBC(q, f_W, f_E, feq, om_turb, velocityBC, c2o27); - } - - q = (subgridD.q[d0P0])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloY = c0o1; - y = true; - - velocityLB = vx2; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c2o27); - velocityBC = VeloY; - (dist.f[d0M0])[ks] = getInterpolatedDistributionForVeloBC(q, f_N, f_S, feq, om_turb, velocityBC, c2o27); - } - - q = (subgridD.q[d0M0])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloY = c0o1; - y = true; - - velocityLB = -vx2; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c2o27); - velocityBC = -VeloY; - (dist.f[d0P0])[kn] = getInterpolatedDistributionForVeloBC(q, f_S, f_N, feq, om_turb, velocityBC, c2o27); - } - - q = (subgridD.q[d00P])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloZ = c0o1; - z = true; - - velocityLB = vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c2o27); - velocityBC = VeloZ; - (dist.f[d00M])[kb] = getInterpolatedDistributionForVeloBC(q, f_T, f_B, feq, om_turb, velocityBC, c2o27); - } - - q = (subgridD.q[d00M])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloZ = c0o1; - z = true; - - velocityLB = -vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c2o27); - velocityBC = -VeloZ; - (dist.f[d00P])[kt] = getInterpolatedDistributionForVeloBC(q, f_B, f_T, feq, om_turb, velocityBC, c2o27); - } - - q = (subgridD.q[dPP0])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - - velocityLB = vx1 + vx2; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); - velocityBC = VeloX + VeloY; - (dist.f[dMM0])[ksw] = getInterpolatedDistributionForVeloBC(q, f_NE, f_SW, feq, om_turb, velocityBC, c1o54); - } - - q = (subgridD.q[dMM0])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - - velocityLB = -vx1 - vx2; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); - velocityBC = -VeloX - VeloY; - (dist.f[dPP0])[kne] = getInterpolatedDistributionForVeloBC(q, f_SW, f_NE, feq, om_turb, velocityBC, c1o54); - } - - q = (subgridD.q[dPM0])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - - velocityLB = vx1 - vx2; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); - velocityBC = VeloX - VeloY; - (dist.f[dMP0])[knw] = getInterpolatedDistributionForVeloBC(q, f_SE, f_NW, feq, om_turb, velocityBC, c1o54); - } - - q = (subgridD.q[dMP0])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - - velocityLB = -vx1 + vx2; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); - velocityBC = -VeloX + VeloY; - (dist.f[dPM0])[kse] = getInterpolatedDistributionForVeloBC(q, f_NW, f_SE, feq, om_turb, velocityBC, c1o54); - } - - q = (subgridD.q[dP0P])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (z == true) VeloZ = c0o1; - - velocityLB = vx1 + vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); - velocityBC = VeloX + VeloZ; - (dist.f[dM0M])[kbw] = getInterpolatedDistributionForVeloBC(q, f_TE, f_BW, feq, om_turb, velocityBC, c1o54); - } - - q = (subgridD.q[dM0M])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (z == true) VeloZ = c0o1; - - velocityLB = -vx1 - vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); - velocityBC = -VeloX - VeloZ; - (dist.f[dP0P])[kte] = getInterpolatedDistributionForVeloBC(q, f_BW, f_TE, feq, om_turb, velocityBC, c1o54); - } - - q = (subgridD.q[dP0M])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (z == true) VeloZ = c0o1; - - velocityLB = vx1 - vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); - velocityBC = VeloX - VeloZ; - (dist.f[dM0P])[ktw] = getInterpolatedDistributionForVeloBC(q, f_BE, f_TW, feq, om_turb, velocityBC, c1o54); - } - - q = (subgridD.q[dM0P])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (z == true) VeloZ = c0o1; - - velocityLB = -vx1 + vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); - velocityBC = -VeloX + VeloZ; - (dist.f[dP0M])[kbe] = getInterpolatedDistributionForVeloBC(q, f_TW, f_BE, feq, om_turb, velocityBC, c1o54); - } - - q = (subgridD.q[d0PP])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - - velocityLB = vx2 + vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); - velocityBC = VeloY + VeloZ; - (dist.f[d0MM])[kbs] = getInterpolatedDistributionForVeloBC(q, f_TN, f_BS, feq, om_turb, velocityBC, c1o54); - } - - q = (subgridD.q[d0MM])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - - velocityLB = -vx2 - vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); - velocityBC = -VeloY - VeloZ; - (dist.f[d0PP])[ktn] = getInterpolatedDistributionForVeloBC(q, f_BS, f_TN, feq, om_turb, velocityBC, c1o54); - } - - - q = (subgridD.q[d0PM])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - - velocityLB = vx2 - vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); - velocityBC = VeloY - VeloZ; - (dist.f[d0MP])[kts] = getInterpolatedDistributionForVeloBC(q, f_BN, f_TS, feq, om_turb, velocityBC, c1o54); - } - - q = (subgridD.q[d0MP])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - - velocityLB = -vx2 + vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); - velocityBC = -VeloY + VeloZ; - (dist.f[d0PM])[kbn] = getInterpolatedDistributionForVeloBC(q, f_TS, f_BN, feq, om_turb, velocityBC, c1o54); - } - - q = (subgridD.q[dPPP])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - velocityLB = vx1 + vx2 + vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o216); - velocityBC = VeloX + VeloY + VeloZ; - (dist.f[dMMM])[kbsw] = getInterpolatedDistributionForVeloBC(q, f_TNE, f_BSW, feq, om_turb, velocityBC, c1o216); - } - - q = (subgridD.q[dMMM])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - velocityLB = -vx1 - vx2 - vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o216); - velocityBC = -VeloX - VeloY - VeloZ; - (dist.f[dPPP])[ktne] = getInterpolatedDistributionForVeloBC(q, f_BSW, f_TNE, feq, om_turb, velocityBC, c1o216); - } - - - q = (subgridD.q[dPPM])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - velocityLB = vx1 + vx2 - vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o216); - velocityBC = VeloX + VeloY - VeloZ; - (dist.f[dMMP])[ktsw] = getInterpolatedDistributionForVeloBC(q, f_BNE, f_TSW, feq, om_turb, velocityBC, c1o216); - } - - q = (subgridD.q[dMMP])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - velocityLB = -vx1 - vx2 + vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o216); - velocityBC = -VeloX - VeloY + VeloZ; - (dist.f[dPPM])[kbne] = getInterpolatedDistributionForVeloBC(q, f_TSW, f_BNE, feq, om_turb, velocityBC, c1o216); - } - - q = (subgridD.q[dPMP])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - velocityLB = vx1 - vx2 + vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o216); - velocityBC = VeloX - VeloY + VeloZ; - (dist.f[dMPM])[kbnw] = getInterpolatedDistributionForVeloBC(q, f_TSE, f_BNW, feq, om_turb, velocityBC, c1o216); - } - - q = (subgridD.q[dMPM])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - velocityLB = -vx1 + vx2 - vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o216); - velocityBC = -VeloX + VeloY - VeloZ; - (dist.f[dPMP])[ktse] = getInterpolatedDistributionForVeloBC(q, f_BNW, f_TSE, feq, om_turb, velocityBC, c1o216); - } - - q = (subgridD.q[dPMM])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - velocityLB = vx1 - vx2 - vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o216); - velocityBC = VeloX - VeloY - VeloZ; - (dist.f[dMPP])[ktnw] = getInterpolatedDistributionForVeloBC(q, f_BSE, f_TNW, feq, om_turb, velocityBC, c1o216); - } - - q = (subgridD.q[dMPP])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - velocityLB = -vx1 + vx2 + vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o216); - velocityBC = -VeloX + VeloY + VeloZ; - (dist.f[dPMM])[kbse] = getInterpolatedDistributionForVeloBC(q, f_TNW, f_BSE, feq, om_turb, velocityBC, c1o216); - } - } -} -//////////////////////////////////////////////////////////////////////////// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -//////////////////////////////////////////////////////////////////////////// -__global__ void QSlipPressureDeviceComp27TurbViscosity( - real* distributions, - int* subgridDistanceIndices, - real* subgridDistances, - unsigned int numberOfBCnodes, - real omega, - unsigned int* neighborX, - unsigned int* neighborY, - unsigned int* neighborZ, - real* turbViscosity, - unsigned long long numberOfLBnodes, - bool isEvenTimestep) -{ - //! The slip boundary condition is executed in the following steps - //! - //////////////////////////////////////////////////////////////////////////////// - //! - Get node index coordinates from threadIdx, blockIdx, blockDim and gridDim. - //! - const unsigned nodeIndex = getNodeIndex(); - - if(nodeIndex < numberOfBCnodes) - { - ////////////////////////////////////////////////////////////////////////// - //! - Read distributions: style of reading and writing the distributions from/to stored arrays dependent on timestep is based on the esoteric twist algorithm \ref - //! <a href="https://doi.org/10.3390/computation5020019"><b>[ M. Geier et al. (2017), DOI:10.3390/computation5020019 ]</b></a> - //! - Distributions27 dist; - getPointersToDistributions(dist, distributions, numberOfLBnodes, isEvenTimestep); - - //////////////////////////////////////////////////////////////////////////////// - //! - Set local subgrid distances (q's) - //! - SubgridDistances27 subgridD; - getPointersToSubgridDistances(subgridD, subgridDistances, numberOfBCnodes); - - //////////////////////////////////////////////////////////////////////////////// - //! - Set neighbor indices (necessary for indirect addressing) - //! - unsigned int indexOfBCnode = subgridDistanceIndices[nodeIndex]; - unsigned int kzero= indexOfBCnode; - unsigned int ke = indexOfBCnode; - unsigned int kw = neighborX[indexOfBCnode]; - unsigned int kn = indexOfBCnode; - unsigned int ks = neighborY[indexOfBCnode]; - unsigned int kt = indexOfBCnode; - unsigned int kb = neighborZ[indexOfBCnode]; - unsigned int ksw = neighborY[kw]; - unsigned int kne = indexOfBCnode; - unsigned int kse = ks; - unsigned int knw = kw; - unsigned int kbw = neighborZ[kw]; - unsigned int kte = indexOfBCnode; - unsigned int kbe = kb; - unsigned int ktw = kw; - unsigned int kbs = neighborZ[ks]; - unsigned int ktn = indexOfBCnode; - unsigned int kbn = kb; - unsigned int kts = ks; - unsigned int ktse = ks; - unsigned int kbnw = kbw; - unsigned int ktnw = kw; - unsigned int kbse = kbs; - unsigned int ktsw = ksw; - unsigned int kbne = kb; - unsigned int ktne = indexOfBCnode; - unsigned int kbsw = neighborZ[ksw]; - - //////////////////////////////////////////////////////////////////////////////// - //! - Set local distributions - //! - real f_W = (dist.f[dP00])[ke ]; - real f_E = (dist.f[dM00])[kw ]; - real f_S = (dist.f[d0P0])[kn ]; - real f_N = (dist.f[d0M0])[ks ]; - real f_B = (dist.f[d00P])[kt ]; - real f_T = (dist.f[d00M])[kb ]; - real f_SW = (dist.f[dPP0])[kne ]; - real f_NE = (dist.f[dMM0])[ksw ]; - real f_NW = (dist.f[dPM0])[kse ]; - real f_SE = (dist.f[dMP0])[knw ]; - real f_BW = (dist.f[dP0P])[kte ]; - real f_TE = (dist.f[dM0M])[kbw ]; - real f_TW = (dist.f[dP0M])[kbe ]; - real f_BE = (dist.f[dM0P])[ktw ]; - real f_BS = (dist.f[d0PP])[ktn ]; - real f_TN = (dist.f[d0MM])[kbs ]; - real f_TS = (dist.f[d0PM])[kbn ]; - real f_BN = (dist.f[d0MP])[kts ]; - real f_BSW = (dist.f[dPPP])[ktne ]; - real f_BNE = (dist.f[dMMP])[ktsw ]; - real f_BNW = (dist.f[dPMP])[ktse ]; - real f_BSE = (dist.f[dMPP])[ktnw ]; - real f_TSW = (dist.f[dPPM])[kbne ]; - real f_TNE = (dist.f[dMMM])[kbsw ]; - real f_TNW = (dist.f[dPMM])[kbse ]; - real f_TSE = (dist.f[dMPM])[kbnw ]; - - //////////////////////////////////////////////////////////////////////////////// - //! - Calculate macroscopic quantities - //! - real drho = f_TSE + f_TNW + f_TNE + f_TSW + f_BSE + f_BNW + f_BNE + f_BSW + - f_BN + f_TS + f_TN + f_BS + f_BE + f_TW + f_TE + f_BW + f_SE + f_NW + f_NE + f_SW + - f_T + f_B + f_N + f_S + f_E + f_W + ((dist.f[d000])[kzero]); - - real vx1 = (((f_TSE - f_BNW) - (f_TNW - f_BSE)) + ((f_TNE - f_BSW) - (f_TSW - f_BNE)) + - ((f_BE - f_TW) + (f_TE - f_BW)) + ((f_SE - f_NW) + (f_NE - f_SW)) + - (f_E - f_W)) / (c1o1 + drho); - - real vx2 = ((-(f_TSE - f_BNW) + (f_TNW - f_BSE)) + ((f_TNE - f_BSW) - (f_TSW - f_BNE)) + - ((f_BN - f_TS) + (f_TN - f_BS)) + (-(f_SE - f_NW) + (f_NE - f_SW)) + - (f_N - f_S)) / (c1o1 + drho); - - real vx3 = (((f_TSE - f_BNW) + (f_TNW - f_BSE)) + ((f_TNE - f_BSW) + (f_TSW - f_BNE)) + - (-(f_BN - f_TS) + (f_TN - f_BS)) + ((f_TE - f_BW) - (f_BE - f_TW)) + - (f_T - f_B)) / (c1o1 + drho); - - real cu_sq = c3o2 * (vx1 * vx1 + vx2 * vx2 + vx3 * vx3) * (c1o1 + drho); - - //////////////////////////////////////////////////////////////////////////////// - //! - change the pointer to write the results in the correct array - //! - getPointersToDistributions(dist, distributions, numberOfLBnodes, !isEvenTimestep); - - //////////////////////////////////////////////////////////////////////////////// - //! - compute local relaxation rate - //! - real om_turb = omega / (c1o1 + c3o1* omega* max(c0o1, turbViscosity[indexOfBCnode]) ); - - //////////////////////////////////////////////////////////////////////////////// - //! - Multiply the local velocities by the slipLength - //! - real slipLength = c1o1; - real VeloX = slipLength*vx1; - real VeloY = slipLength*vx2; - real VeloZ = slipLength*vx3; - - //////////////////////////////////////////////////////////////////////////////// - //! - Update distributions with subgrid distance (q) between zero and one - //! - real feq, q, velocityLB, velocityBC; - - bool x = false; - bool y = false; - bool z = false; - - q = (subgridD.q[dP00])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) // only update distribution for q between zero and one - { - VeloX = c0o1; - x = true; - - velocityLB = vx1; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c2o27); - velocityBC = VeloX; - (dist.f[dM00])[kw] = getInterpolatedDistributionForVeloWithPressureBC(q, f_E, f_W, feq, om_turb, drho, velocityBC, c2o27); - } - - q = (subgridD.q[dM00])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = c0o1; - x = true; - - velocityLB = -vx1; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c2o27); - velocityBC = -VeloX; - (dist.f[dP00])[ke] = getInterpolatedDistributionForVeloWithPressureBC(q, f_W, f_E, feq, om_turb, drho, velocityBC, c2o27); - } - - q = (subgridD.q[d0P0])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloY = c0o1; - y = true; - - velocityLB = vx2; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c2o27); - velocityBC = VeloY; - (dist.f[d0M0])[ks] = getInterpolatedDistributionForVeloWithPressureBC(q, f_N, f_S, feq, om_turb, drho, velocityBC, c2o27); - } - - q = (subgridD.q[d0M0])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloY = c0o1; - y = true; - - velocityLB = -vx2; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c2o27); - velocityBC = -VeloY; - (dist.f[d0P0])[kn] = getInterpolatedDistributionForVeloWithPressureBC(q, f_S, f_N, feq, om_turb, drho, velocityBC, c2o27); - } - - q = (subgridD.q[d00P])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloZ = c0o1; - z = true; - - velocityLB = vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c2o27); - velocityBC = VeloZ; - (dist.f[d00M])[kb] = getInterpolatedDistributionForVeloWithPressureBC(q, f_T, f_B, feq, om_turb, drho, velocityBC, c2o27); - } - - q = (subgridD.q[d00M])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloZ = c0o1; - z = true; - - velocityLB = -vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c2o27); - velocityBC = -VeloZ; - (dist.f[d00P])[kt] = getInterpolatedDistributionForVeloWithPressureBC(q, f_B, f_T, feq, om_turb, drho, velocityBC, c2o27); - } - - q = (subgridD.q[dPP0])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - - velocityLB = vx1 + vx2; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); - velocityBC = VeloX + VeloY; - (dist.f[dMM0])[ksw] = getInterpolatedDistributionForVeloWithPressureBC(q, f_NE, f_SW, feq, om_turb, drho, velocityBC, c1o54); - } - - q = (subgridD.q[dMM0])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - - velocityLB = -vx1 - vx2; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); - velocityBC = -VeloX - VeloY; - (dist.f[dPP0])[kne] = getInterpolatedDistributionForVeloWithPressureBC(q, f_SW, f_NE, feq, om_turb, drho, velocityBC, c1o54); - } - - q = (subgridD.q[dPM0])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - - velocityLB = vx1 - vx2; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); - velocityBC = VeloX - VeloY; - (dist.f[dMP0])[knw] = getInterpolatedDistributionForVeloWithPressureBC(q, f_SE, f_NW, feq, om_turb, drho, velocityBC, c1o54); - } - - q = (subgridD.q[dMP0])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - - velocityLB = -vx1 + vx2; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); - velocityBC = -VeloX + VeloY; - (dist.f[dPM0])[kse] = getInterpolatedDistributionForVeloWithPressureBC(q, f_NW, f_SE, feq, om_turb, drho, velocityBC, c1o54); - } - - q = (subgridD.q[dP0P])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (z == true) VeloZ = c0o1; - - velocityLB = vx1 + vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); - velocityBC = VeloX + VeloZ; - (dist.f[dM0M])[kbw] = getInterpolatedDistributionForVeloWithPressureBC(q, f_TE, f_BW, feq, om_turb, drho, velocityBC, c1o54); - } - - q = (subgridD.q[dM0M])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (z == true) VeloZ = c0o1; - - velocityLB = -vx1 - vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); - velocityBC = -VeloX - VeloZ; - (dist.f[dP0P])[kte] = getInterpolatedDistributionForVeloWithPressureBC(q, f_BW, f_TE, feq, om_turb, drho, velocityBC, c1o54); - } - - q = (subgridD.q[dP0M])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (z == true) VeloZ = c0o1; - - velocityLB = vx1 - vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); - velocityBC = VeloX - VeloZ; - (dist.f[dM0P])[ktw] = getInterpolatedDistributionForVeloWithPressureBC(q, f_BE, f_TW, feq, om_turb, drho, velocityBC, c1o54); - } - - q = (subgridD.q[dM0P])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (z == true) VeloZ = c0o1; - - velocityLB = -vx1 + vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); - velocityBC = -VeloX + VeloZ; - (dist.f[dP0M])[kbe] = getInterpolatedDistributionForVeloWithPressureBC(q, f_TW, f_BE, feq, om_turb, drho, velocityBC, c1o54); - } - - q = (subgridD.q[d0PP])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - - velocityLB = vx2 + vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); - velocityBC = VeloY + VeloZ; - (dist.f[d0MM])[kbs] = getInterpolatedDistributionForVeloWithPressureBC(q, f_TN, f_BS, feq, om_turb, drho, velocityBC, c1o54); - } - - q = (subgridD.q[d0MM])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - - velocityLB = -vx2 - vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); - velocityBC = -VeloY - VeloZ; - (dist.f[d0PP])[ktn] = getInterpolatedDistributionForVeloWithPressureBC(q, f_BS, f_TN, feq, om_turb, drho, velocityBC, c1o54); - } - - - q = (subgridD.q[d0PM])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - - velocityLB = vx2 - vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); - velocityBC = VeloY - VeloZ; - (dist.f[d0MP])[kts] = getInterpolatedDistributionForVeloWithPressureBC(q, f_BN, f_TS, feq, om_turb, drho, velocityBC, c1o54); - } - - q = (subgridD.q[d0MP])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - - velocityLB = -vx2 + vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o54); - velocityBC = -VeloY + VeloZ; - (dist.f[d0PM])[kbn] = getInterpolatedDistributionForVeloWithPressureBC(q, f_TS, f_BN, feq, om_turb, drho, velocityBC, c1o54); - } - - q = (subgridD.q[dPPP])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - velocityLB = vx1 + vx2 + vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o216); - velocityBC = VeloX + VeloY + VeloZ; - (dist.f[dMMM])[kbsw] = getInterpolatedDistributionForVeloWithPressureBC(q, f_TNE, f_BSW, feq, om_turb, drho, velocityBC, c1o216); - } - - q = (subgridD.q[dMMM])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - velocityLB = -vx1 - vx2 - vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o216); - velocityBC = -VeloX - VeloY - VeloZ; - (dist.f[dPPP])[ktne] = getInterpolatedDistributionForVeloWithPressureBC(q, f_BSW, f_TNE, feq, om_turb, drho, velocityBC, c1o216); - } - - - q = (subgridD.q[dPPM])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - velocityLB = vx1 + vx2 - vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o216); - velocityBC = VeloX + VeloY - VeloZ; - (dist.f[dMMP])[ktsw] = getInterpolatedDistributionForVeloWithPressureBC(q, f_BNE, f_TSW, feq, om_turb, drho, velocityBC, c1o216); - } - - q = (subgridD.q[dMMP])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - velocityLB = -vx1 - vx2 + vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o216); - velocityBC = -VeloX - VeloY + VeloZ; - (dist.f[dPPM])[kbne] = getInterpolatedDistributionForVeloWithPressureBC(q, f_TSW, f_BNE, feq, om_turb, drho, velocityBC, c1o216); - } - - q = (subgridD.q[dPMP])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - velocityLB = vx1 - vx2 + vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o216); - velocityBC = VeloX - VeloY + VeloZ; - (dist.f[dMPM])[kbnw] = getInterpolatedDistributionForVeloWithPressureBC(q, f_TSE, f_BNW, feq, om_turb, drho, velocityBC, c1o216); - } - - q = (subgridD.q[dMPM])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - velocityLB = -vx1 + vx2 - vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o216); - velocityBC = -VeloX + VeloY - VeloZ; - (dist.f[dPMP])[ktse] = getInterpolatedDistributionForVeloWithPressureBC(q, f_BNW, f_TSE, feq, om_turb, drho, velocityBC, c1o216); - } - - q = (subgridD.q[dPMM])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - velocityLB = vx1 - vx2 - vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o216); - velocityBC = VeloX - VeloY - VeloZ; - (dist.f[dMPP])[ktnw] = getInterpolatedDistributionForVeloWithPressureBC(q, f_BSE, f_TNW, feq, om_turb, drho, velocityBC, c1o216); - } - - q = (subgridD.q[dMPP])[nodeIndex]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = slipLength*vx1; - VeloY = slipLength*vx2; - VeloZ = slipLength*vx3; - if (x == true) VeloX = c0o1; - if (y == true) VeloY = c0o1; - if (z == true) VeloZ = c0o1; - velocityLB = -vx1 + vx2 + vx3; - feq = getEquilibriumForBC(drho, velocityLB, cu_sq, c1o216); - velocityBC = -VeloX + VeloY + VeloZ; - (dist.f[dPMM])[kbse] = getInterpolatedDistributionForVeloWithPressureBC(q, f_TNW, f_BSE, feq, om_turb, drho, velocityBC, c1o216); - } - } -} - -// __global__ void QSlipDeviceComp27TurbViscosity(real* DD, -// int* k_Q, -// real* QQ, -// unsigned int numberOfBCnodes, -// real om1, -// unsigned int* neighborX, -// unsigned int* neighborY, -// unsigned int* neighborZ, -// real* turbViscosity, -// unsigned int size_Mat, -// bool isEvenTimestep) -// { -// Distributions27 D; -// if (isEvenTimestep==true) -// { -// D.f[dP00] = &DD[dP00 * size_Mat]; -// D.f[dM00] = &DD[dM00 * size_Mat]; -// D.f[d0P0] = &DD[d0P0 * size_Mat]; -// D.f[d0M0] = &DD[d0M0 * size_Mat]; -// D.f[d00P] = &DD[d00P * size_Mat]; -// D.f[d00M] = &DD[d00M * size_Mat]; -// D.f[dPP0] = &DD[dPP0 * size_Mat]; -// D.f[dMM0] = &DD[dMM0 * size_Mat]; -// D.f[dPM0] = &DD[dPM0 * size_Mat]; -// D.f[dMP0] = &DD[dMP0 * size_Mat]; -// D.f[dP0P] = &DD[dP0P * size_Mat]; -// D.f[dM0M] = &DD[dM0M * size_Mat]; -// D.f[dP0M] = &DD[dP0M * size_Mat]; -// D.f[dM0P] = &DD[dM0P * size_Mat]; -// D.f[d0PP] = &DD[d0PP * size_Mat]; -// D.f[d0MM] = &DD[d0MM * size_Mat]; -// D.f[d0PM] = &DD[d0PM * size_Mat]; -// D.f[d0MP] = &DD[d0MP * size_Mat]; -// D.f[d000] = &DD[d000 * size_Mat]; -// D.f[dPPP] = &DD[dPPP * size_Mat]; -// D.f[dMMP] = &DD[dMMP * size_Mat]; -// D.f[dPMP] = &DD[dPMP * size_Mat]; -// D.f[dMPP] = &DD[dMPP * size_Mat]; -// D.f[dPPM] = &DD[dPPM * size_Mat]; -// D.f[dMMM] = &DD[dMMM * size_Mat]; -// D.f[dPMM] = &DD[dPMM * size_Mat]; -// D.f[dMPM] = &DD[dMPM * size_Mat]; -// } -// else -// { -// D.f[dM00] = &DD[dP00 * size_Mat]; -// D.f[dP00] = &DD[dM00 * size_Mat]; -// D.f[d0M0] = &DD[d0P0 * size_Mat]; -// D.f[d0P0] = &DD[d0M0 * size_Mat]; -// D.f[d00M] = &DD[d00P * size_Mat]; -// D.f[d00P] = &DD[d00M * size_Mat]; -// D.f[dMM0] = &DD[dPP0 * size_Mat]; -// D.f[dPP0] = &DD[dMM0 * size_Mat]; -// D.f[dMP0] = &DD[dPM0 * size_Mat]; -// D.f[dPM0] = &DD[dMP0 * size_Mat]; -// D.f[dM0M] = &DD[dP0P * size_Mat]; -// D.f[dP0P] = &DD[dM0M * size_Mat]; -// D.f[dM0P] = &DD[dP0M * size_Mat]; -// D.f[dP0M] = &DD[dM0P * size_Mat]; -// D.f[d0MM] = &DD[d0PP * size_Mat]; -// D.f[d0PP] = &DD[d0MM * size_Mat]; -// D.f[d0MP] = &DD[d0PM * size_Mat]; -// D.f[d0PM] = &DD[d0MP * size_Mat]; -// D.f[d000] = &DD[d000 * size_Mat]; -// D.f[dPPP] = &DD[dMMM * size_Mat]; -// D.f[dMMP] = &DD[dPPM * size_Mat]; -// D.f[dPMP] = &DD[dMPM * size_Mat]; -// D.f[dMPP] = &DD[dPMM * size_Mat]; -// D.f[dPPM] = &DD[dMMP * size_Mat]; -// D.f[dMMM] = &DD[dPPP * size_Mat]; -// D.f[dPMM] = &DD[dMPP * size_Mat]; -// D.f[dMPM] = &DD[dPMP * size_Mat]; -// } -// //////////////////////////////////////////////////////////////////////////////// -// const unsigned x = threadIdx.x; // Globaler x-Index -// const unsigned y = blockIdx.x; // Globaler y-Index -// const unsigned z = blockIdx.y; // Globaler z-Index - -// const unsigned nx = blockDim.x; -// const unsigned ny = gridDim.x; - -// const unsigned k = nx*(ny*z + y) + x; -// ////////////////////////////////////////////////////////////////////////// - -// if(k<numberOfBCnodes) -// { -// //////////////////////////////////////////////////////////////////////////////// -// real *q_dirE, *q_dirW, *q_dirN, *q_dirS, *q_dirT, *q_dirB, -// *q_dirNE, *q_dirSW, *q_dirSE, *q_dirNW, *q_dirTE, *q_dirBW, -// *q_dirBE, *q_dirTW, *q_dirTN, *q_dirBS, *q_dirBN, *q_dirTS, -// *q_dirTNE, *q_dirTSW, *q_dirTSE, *q_dirTNW, *q_dirBNE, *q_dirBSW, -// *q_dirBSE, *q_dirBNW; -// q_dirE = &QQ[dP00 * numberOfBCnodes]; -// q_dirW = &QQ[dM00 * numberOfBCnodes]; -// q_dirN = &QQ[d0P0 * numberOfBCnodes]; -// q_dirS = &QQ[d0M0 * numberOfBCnodes]; -// q_dirT = &QQ[d00P * numberOfBCnodes]; -// q_dirB = &QQ[d00M * numberOfBCnodes]; -// q_dirNE = &QQ[dPP0 * numberOfBCnodes]; -// q_dirSW = &QQ[dMM0 * numberOfBCnodes]; -// q_dirSE = &QQ[dPM0 * numberOfBCnodes]; -// q_dirNW = &QQ[dMP0 * numberOfBCnodes]; -// q_dirTE = &QQ[dP0P * numberOfBCnodes]; -// q_dirBW = &QQ[dM0M * numberOfBCnodes]; -// q_dirBE = &QQ[dP0M * numberOfBCnodes]; -// q_dirTW = &QQ[dM0P * numberOfBCnodes]; -// q_dirTN = &QQ[d0PP * numberOfBCnodes]; -// q_dirBS = &QQ[d0MM * numberOfBCnodes]; -// q_dirBN = &QQ[d0PM * numberOfBCnodes]; -// q_dirTS = &QQ[d0MP * numberOfBCnodes]; -// q_dirTNE = &QQ[dPPP * numberOfBCnodes]; -// q_dirTSW = &QQ[dMMP * numberOfBCnodes]; -// q_dirTSE = &QQ[dPMP * numberOfBCnodes]; -// q_dirTNW = &QQ[dMPP * numberOfBCnodes]; -// q_dirBNE = &QQ[dPPM * numberOfBCnodes]; -// q_dirBSW = &QQ[dMMM * numberOfBCnodes]; -// q_dirBSE = &QQ[dPMM * numberOfBCnodes]; -// q_dirBNW = &QQ[dMPM * numberOfBCnodes]; -// //////////////////////////////////////////////////////////////////////////////// -// //index -// unsigned int KQK = k_Q[k]; -// unsigned int kzero= KQK; -// unsigned int ke = KQK; -// unsigned int kw = neighborX[KQK]; -// unsigned int kn = KQK; -// unsigned int ks = neighborY[KQK]; -// unsigned int kt = KQK; -// unsigned int kb = neighborZ[KQK]; -// unsigned int ksw = neighborY[kw]; -// unsigned int kne = KQK; -// unsigned int kse = ks; -// unsigned int knw = kw; -// unsigned int kbw = neighborZ[kw]; -// unsigned int kte = KQK; -// unsigned int kbe = kb; -// unsigned int ktw = kw; -// unsigned int kbs = neighborZ[ks]; -// unsigned int ktn = KQK; -// unsigned int kbn = kb; -// unsigned int kts = ks; -// unsigned int ktse = ks; -// unsigned int kbnw = kbw; -// unsigned int ktnw = kw; -// unsigned int kbse = kbs; -// unsigned int ktsw = ksw; -// unsigned int kbne = kb; -// unsigned int ktne = KQK; -// unsigned int kbsw = neighborZ[ksw]; - -// //////////////////////////////////////////////////////////////////////////////// -// real f_W = (D.f[dP00])[ke ]; -// real f_E = (D.f[dM00])[kw ]; -// real f_S = (D.f[d0P0])[kn ]; -// real f_N = (D.f[d0M0])[ks ]; -// real f_B = (D.f[d00P])[kt ]; -// real f_T = (D.f[d00M])[kb ]; -// real f_SW = (D.f[dPP0])[kne ]; -// real f_NE = (D.f[dMM0])[ksw ]; -// real f_NW = (D.f[dPM0])[kse ]; -// real f_SE = (D.f[dMP0])[knw ]; -// real f_BW = (D.f[dP0P])[kte ]; -// real f_TE = (D.f[dM0M])[kbw ]; -// real f_TW = (D.f[dP0M])[kbe ]; -// real f_BE = (D.f[dM0P])[ktw ]; -// real f_BS = (D.f[d0PP])[ktn ]; -// real f_TN = (D.f[d0MM])[kbs ]; -// real f_TS = (D.f[d0PM])[kbn ]; -// real f_BN = (D.f[d0MP])[kts ]; -// real f_BSW = (D.f[dPPP])[ktne ]; -// real f_BNE = (D.f[dMMP])[ktsw ]; -// real f_BNW = (D.f[dPMP])[ktse ]; -// real f_BSE = (D.f[dMPP])[ktnw ]; -// real f_TSW = (D.f[dPPM])[kbne ]; -// real f_TNE = (D.f[dMMM])[kbsw ]; -// real f_TNW = (D.f[dPMM])[kbse ]; -// real f_TSE = (D.f[dMPM])[kbnw ]; -// //////////////////////////////////////////////////////////////////////////////// -// real vx1, vx2, vx3, drho, feq, q; -// drho = f_TSE + f_TNW + f_TNE + f_TSW + f_BSE + f_BNW + f_BNE + f_BSW + -// f_BN + f_TS + f_TN + f_BS + f_BE + f_TW + f_TE + f_BW + f_SE + f_NW + f_NE + f_SW + -// f_T + f_B + f_N + f_S + f_E + f_W + ((D.f[d000])[kzero]); - -// vx1 = (((f_TSE - f_BNW) - (f_TNW - f_BSE)) + ((f_TNE - f_BSW) - (f_TSW - f_BNE)) + -// ((f_BE - f_TW) + (f_TE - f_BW)) + ((f_SE - f_NW) + (f_NE - f_SW)) + -// (f_E - f_W)) / (c1o1 + drho); - - -// vx2 = ((-(f_TSE - f_BNW) + (f_TNW - f_BSE)) + ((f_TNE - f_BSW) - (f_TSW - f_BNE)) + -// ((f_BN - f_TS) + (f_TN - f_BS)) + (-(f_SE - f_NW) + (f_NE - f_SW)) + -// (f_N - f_S)) / (c1o1 + drho); - -// vx3 = (((f_TSE - f_BNW) + (f_TNW - f_BSE)) + ((f_TNE - f_BSW) + (f_TSW - f_BNE)) + -// (-(f_BN - f_TS) + (f_TN - f_BS)) + ((f_TE - f_BW) - (f_BE - f_TW)) + -// (f_T - f_B)) / (c1o1 + drho); - -// real cu_sq=c3o2*(vx1*vx1+vx2*vx2+vx3*vx3) * (c1o1 + drho); - -// ////////////////////////////////////////////////////////////////////////// -// if (isEvenTimestep==false) -// { -// D.f[dP00] = &DD[dP00 * size_Mat]; -// D.f[dM00] = &DD[dM00 * size_Mat]; -// D.f[d0P0] = &DD[d0P0 * size_Mat]; -// D.f[d0M0] = &DD[d0M0 * size_Mat]; -// D.f[d00P] = &DD[d00P * size_Mat]; -// D.f[d00M] = &DD[d00M * size_Mat]; -// D.f[dPP0] = &DD[dPP0 * size_Mat]; -// D.f[dMM0] = &DD[dMM0 * size_Mat]; -// D.f[dPM0] = &DD[dPM0 * size_Mat]; -// D.f[dMP0] = &DD[dMP0 * size_Mat]; -// D.f[dP0P] = &DD[dP0P * size_Mat]; -// D.f[dM0M] = &DD[dM0M * size_Mat]; -// D.f[dP0M] = &DD[dP0M * size_Mat]; -// D.f[dM0P] = &DD[dM0P * size_Mat]; -// D.f[d0PP] = &DD[d0PP * size_Mat]; -// D.f[d0MM] = &DD[d0MM * size_Mat]; -// D.f[d0PM] = &DD[d0PM * size_Mat]; -// D.f[d0MP] = &DD[d0MP * size_Mat]; -// D.f[d000] = &DD[d000 * size_Mat]; -// D.f[dPPP] = &DD[dPPP * size_Mat]; -// D.f[dMMP] = &DD[dMMP * size_Mat]; -// D.f[dPMP] = &DD[dPMP * size_Mat]; -// D.f[dMPP] = &DD[dMPP * size_Mat]; -// D.f[dPPM] = &DD[dPPM * size_Mat]; -// D.f[dMMM] = &DD[dMMM * size_Mat]; -// D.f[dPMM] = &DD[dPMM * size_Mat]; -// D.f[dMPM] = &DD[dMPM * size_Mat]; -// } -// else -// { -// D.f[dM00] = &DD[dP00 * size_Mat]; -// D.f[dP00] = &DD[dM00 * size_Mat]; -// D.f[d0M0] = &DD[d0P0 * size_Mat]; -// D.f[d0P0] = &DD[d0M0 * size_Mat]; -// D.f[d00M] = &DD[d00P * size_Mat]; -// D.f[d00P] = &DD[d00M * size_Mat]; -// D.f[dMM0] = &DD[dPP0 * size_Mat]; -// D.f[dPP0] = &DD[dMM0 * size_Mat]; -// D.f[dMP0] = &DD[dPM0 * size_Mat]; -// D.f[dPM0] = &DD[dMP0 * size_Mat]; -// D.f[dM0M] = &DD[dP0P * size_Mat]; -// D.f[dP0P] = &DD[dM0M * size_Mat]; -// D.f[dM0P] = &DD[dP0M * size_Mat]; -// D.f[dP0M] = &DD[dM0P * size_Mat]; -// D.f[d0MM] = &DD[d0PP * size_Mat]; -// D.f[d0PP] = &DD[d0MM * size_Mat]; -// D.f[d0MP] = &DD[d0PM * size_Mat]; -// D.f[d0PM] = &DD[d0MP * size_Mat]; -// D.f[d000] = &DD[d000 * size_Mat]; -// D.f[dPPP] = &DD[dMMM * size_Mat]; -// D.f[dMMP] = &DD[dPPM * size_Mat]; -// D.f[dPMP] = &DD[dMPM * size_Mat]; -// D.f[dMPP] = &DD[dPMM * size_Mat]; -// D.f[dPPM] = &DD[dMMP * size_Mat]; -// D.f[dMMM] = &DD[dPPP * size_Mat]; -// D.f[dPMM] = &DD[dMPP * size_Mat]; -// D.f[dMPM] = &DD[dPMP * size_Mat]; -// } -// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// //Test -// //(D.f[d000])[k]=c1o10; -// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// real om_turb = om1 / (c1o1 + c3o1*om1*max(c0o1, turbViscosity[k_Q[k]])); - -// real fac = c1o1;//c99o100; -// real VeloX = fac*vx1; -// real VeloY = fac*vx2; -// real VeloZ = fac*vx3; -// bool x = false; -// bool y = false; -// bool z = false; - -// q = q_dirE[k]; -// if (q>=c0o1 && q<=c1o1) -// { -// VeloX = c0o1; -// VeloY = fac*vx2; -// VeloZ = fac*vx3; -// x = true; -// feq=c2o27* (drho/*+three*( vx1 )*/+c9o2*( vx1 )*( vx1 ) * (c1o1 + drho)-cu_sq); -// (D.f[dM00])[kw]=(c1o1-q)/(c1o1+q)*(f_E-f_W+(f_E+f_W-c2o1*feq*om_turb)/(c1o1-om_turb))*c1o2+(q*(f_E+f_W)-c6o1*c2o27*( VeloX ))/(c1o1+q) - c2o27 * drho; -// //feq=c2over27* (drho+three*( vx1 )+c9over2*( vx1 )*( vx1 )-cu_sq); -// //(D.f[dM00])[kw]=(one-q)/(one+q)*(f_E-feq*om1)/(one-om1)+(q*(f_E+f_W)-six*c2over27*( VeloX ))/(one+q); -// //(D.f[dM00])[kw]=zero; -// } - -// q = q_dirW[k]; -// if (q>=c0o1 && q<=c1o1) -// { -// VeloX = c0o1; -// VeloY = fac*vx2; -// VeloZ = fac*vx3; -// x = true; -// feq=c2o27* (drho/*+three*(-vx1 )*/+c9o2*(-vx1 )*(-vx1 ) * (c1o1 + drho)-cu_sq); -// (D.f[dP00])[ke]=(c1o1-q)/(c1o1+q)*(f_W-f_E+(f_W+f_E-c2o1*feq*om_turb)/(c1o1-om_turb))*c1o2+(q*(f_W+f_E)-c6o1*c2o27*(-VeloX ))/(c1o1+q) - c2o27 * drho; -// //feq=c2over27* (drho+three*(-vx1 )+c9over2*(-vx1 )*(-vx1 )-cu_sq); -// //(D.f[dP00])[ke]=(one-q)/(one+q)*(f_W-feq*om_turb)/(one-om_turb)+(q*(f_W+f_E)-six*c2over27*(-VeloX ))/(one+q); -// //(D.f[dP00])[ke]=zero; -// } - -// q = q_dirN[k]; -// if (q>=c0o1 && q<=c1o1) -// { -// VeloX = fac*vx1; -// VeloY = c0o1; -// VeloZ = fac*vx3; -// y = true; -// feq=c2o27* (drho/*+three*( vx2 )*/+c9o2*( vx2 )*( vx2 ) * (c1o1 + drho)-cu_sq); -// (D.f[d0M0])[ks]=(c1o1-q)/(c1o1+q)*(f_N-f_S+(f_N+f_S-c2o1*feq*om_turb)/(c1o1-om_turb))*c1o2+(q*(f_N+f_S)-c6o1*c2o27*( VeloY ))/(c1o1+q) - c2o27 * drho; -// //feq=c2over27* (drho+three*( vx2 )+c9over2*( vx2 )*( vx2 )-cu_sq); -// //(D.f[d0M0])[ks]=(one-q)/(one+q)*(f_N-feq*om_turb)/(one-om_turb)+(q*(f_N+f_S)-six*c2over27*( VeloY ))/(one+q); -// //(D.f[d0M0])[ks]=zero; -// } - -// q = q_dirS[k]; -// if (q>=c0o1 && q<=c1o1) -// { -// VeloX = fac*vx1; -// VeloY = c0o1; -// VeloZ = fac*vx3; -// y = true; -// feq=c2o27* (drho/*+three*( -vx2 )*/+c9o2*( -vx2 )*( -vx2 ) * (c1o1 + drho)-cu_sq); -// (D.f[d0P0])[kn]=(c1o1-q)/(c1o1+q)*(f_S-f_N+(f_S+f_N-c2o1*feq*om_turb)/(c1o1-om_turb))*c1o2+(q*(f_S+f_N)-c6o1*c2o27*(-VeloY ))/(c1o1+q) - c2o27 * drho; -// //feq=c2over27* (drho+three*( -vx2 )+c9over2*( -vx2 )*( -vx2 )-cu_sq); -// //(D.f[d0P0])[kn]=(one-q)/(one+q)*(f_S-feq*om_turb)/(one-om_turb)+(q*(f_S+f_N)-six*c2over27*(-VeloY ))/(one+q); -// //(D.f[d0P0])[kn]=zero; -// } - -// q = q_dirT[k]; -// if (q>=c0o1 && q<=c1o1) -// { -// VeloX = fac*vx1; -// VeloY = fac*vx2; -// VeloZ = c0o1; -// z = true; -// feq=c2o27* (drho/*+three*( vx3)*/+c9o2*( vx3)*( vx3) * (c1o1 + drho)-cu_sq); -// (D.f[d00M])[kb]=(c1o1-q)/(c1o1+q)*(f_T-f_B+(f_T+f_B-c2o1*feq*om_turb)/(c1o1-om_turb))*c1o2+(q*(f_T+f_B)-c6o1*c2o27*( VeloZ ))/(c1o1+q) - c2o27 * drho; -// //feq=c2over27* (drho+three*( vx3)+c9over2*( vx3)*( vx3)-cu_sq); -// //(D.f[d00M])[kb]=(one-q)/(one+q)*(f_T-feq*om_turb)/(one-om_turb)+(q*(f_T+f_B)-six*c2over27*( VeloZ ))/(one+q); -// //(D.f[d00M])[kb]=one; -// } - -// q = q_dirB[k]; -// if (q>=c0o1 && q<=c1o1) -// { -// VeloX = fac*vx1; -// VeloY = fac*vx2; -// VeloZ = c0o1; -// z = true; -// feq=c2o27* (drho/*+three*( -vx3)*/+c9o2*( -vx3)*( -vx3) * (c1o1 + drho)-cu_sq); -// (D.f[d00P])[kt]=(c1o1-q)/(c1o1+q)*(f_B-f_T+(f_B+f_T-c2o1*feq*om_turb)/(c1o1-om_turb))*c1o2+(q*(f_B+f_T)-c6o1*c2o27*(-VeloZ ))/(c1o1+q) - c2o27 * drho; -// //feq=c2over27* (drho+three*( -vx3)+c9over2*( -vx3)*( -vx3)-cu_sq); -// //(D.f[d00P])[kt]=(one-q)/(one+q)*(f_B-feq*om_turb)/(one-om_turb)+(q*(f_B+f_T)-six*c2over27*(-VeloZ ))/(one+q); -// //(D.f[d00P])[kt]=zero; -// } - -// q = q_dirNE[k]; -// if (q>=c0o1 && q<=c1o1) -// { -// VeloX = fac*vx1; -// VeloY = fac*vx2; -// VeloZ = fac*vx3; -// if (x == true) VeloX = c0o1; -// if (y == true) VeloY = c0o1; -// feq=c1o54* (drho/*+three*( vx1+vx2 )*/+c9o2*( vx1+vx2 )*( vx1+vx2 ) * (c1o1 + drho)-cu_sq); -// (D.f[dMM0])[ksw]=(c1o1-q)/(c1o1+q)*(f_NE-f_SW+(f_NE+f_SW-c2o1*feq*om_turb)/(c1o1-om_turb))*c1o2+(q*(f_NE+f_SW)-c6o1*c1o54*(VeloX+VeloY))/(c1o1+q) - c1o54 * drho; -// //feq=c1over54* (drho+three*( vx1+vx2 )+c9over2*( vx1+vx2 )*( vx1+vx2 )-cu_sq); -// //(D.f[dMM0])[ksw]=(one-q)/(one+q)*(f_NE-feq*om_turb)/(one-om_turb)+(q*(f_NE+f_SW)-six*c1over54*(VeloX+VeloY))/(one+q); -// //(D.f[dMM0])[ksw]=zero; -// } - -// q = q_dirSW[k]; -// if (q>=c0o1 && q<=c1o1) -// { -// VeloX = fac*vx1; -// VeloY = fac*vx2; -// VeloZ = fac*vx3; -// if (x == true) VeloX = c0o1; -// if (y == true) VeloY = c0o1; -// feq=c1o54* (drho/*+three*(-vx1-vx2 )*/+c9o2*(-vx1-vx2 )*(-vx1-vx2 ) * (c1o1 + drho)-cu_sq); -// (D.f[dPP0])[kne]=(c1o1-q)/(c1o1+q)*(f_SW-f_NE+(f_SW+f_NE-c2o1*feq*om_turb)/(c1o1-om_turb))*c1o2+(q*(f_SW+f_NE)-c6o1*c1o54*(-VeloX-VeloY))/(c1o1+q) - c1o54 * drho; -// //feq=c1over54* (drho+three*(-vx1-vx2 )+c9over2*(-vx1-vx2 )*(-vx1-vx2 )-cu_sq); -// //(D.f[dPP0])[kne]=(one-q)/(one+q)*(f_SW-feq*om_turb)/(one-om_turb)+(q*(f_SW+f_NE)-six*c1over54*(-VeloX-VeloY))/(one+q); -// //(D.f[dPP0])[kne]=zero; -// } - -// q = q_dirSE[k]; -// if (q>=c0o1 && q<=c1o1) -// { -// VeloX = fac*vx1; -// VeloY = fac*vx2; -// VeloZ = fac*vx3; -// if (x == true) VeloX = c0o1; -// if (y == true) VeloY = c0o1; -// feq=c1o54* (drho/*+three*( vx1-vx2 )*/+c9o2*( vx1-vx2 )*( vx1-vx2 ) * (c1o1 + drho)-cu_sq); -// (D.f[dMP0])[knw]=(c1o1-q)/(c1o1+q)*(f_SE-f_NW+(f_SE+f_NW-c2o1*feq*om_turb)/(c1o1-om_turb))*c1o2+(q*(f_SE+f_NW)-c6o1*c1o54*( VeloX-VeloY))/(c1o1+q) - c1o54 * drho; -// //feq=c1over54* (drho+three*( vx1-vx2 )+c9over2*( vx1-vx2 )*( vx1-vx2 )-cu_sq); -// //(D.f[dMP0])[knw]=(one-q)/(one+q)*(f_SE-feq*om_turb)/(one-om_turb)+(q*(f_SE+f_NW)-six*c1over54*( VeloX-VeloY))/(one+q); -// //(D.f[dMP0])[knw]=zero; -// } - -// q = q_dirNW[k]; -// if (q>=c0o1 && q<=c1o1) -// { -// VeloX = fac*vx1; -// VeloY = fac*vx2; -// VeloZ = fac*vx3; -// if (x == true) VeloX = c0o1; -// if (y == true) VeloY = c0o1; -// feq=c1o54* (drho/*+three*(-vx1+vx2 )*/+c9o2*(-vx1+vx2 )*(-vx1+vx2 ) * (c1o1 + drho)-cu_sq); -// (D.f[dPM0])[kse]=(c1o1-q)/(c1o1+q)*(f_NW-f_SE+(f_NW+f_SE-c2o1*feq*om_turb)/(c1o1-om_turb))*c1o2+(q*(f_NW+f_SE)-c6o1*c1o54*(-VeloX+VeloY))/(c1o1+q) - c1o54 * drho; -// //feq=c1over54* (drho+three*(-vx1+vx2 )+c9over2*(-vx1+vx2 )*(-vx1+vx2 )-cu_sq); -// //(D.f[dPM0])[kse]=(one-q)/(one+q)*(f_NW-feq*om_turb)/(one-om_turb)+(q*(f_NW+f_SE)-six*c1over54*(-VeloX+VeloY))/(one+q); -// //(D.f[dPM0])[kse]=zero; -// } - -// q = q_dirTE[k]; -// if (q>=c0o1 && q<=c1o1) -// { -// VeloX = fac*vx1; -// VeloY = fac*vx2; -// VeloZ = fac*vx3; -// if (x == true) VeloX = c0o1; -// if (z == true) VeloZ = c0o1; -// // if (k==10000) printf("AFTER x: %u \t y: %u \t z: %u \n VeloX: %f \t VeloY: %f \t VeloZ: %f \n\n", x,y,z, VeloX,VeloY,VeloZ); -// feq=c1o54* (drho/*+three*( vx1 +vx3)*/+c9o2*( vx1 +vx3)*( vx1 +vx3) * (c1o1 + drho)-cu_sq); -// (D.f[dM0M])[kbw]=(c1o1-q)/(c1o1+q)*(f_TE-f_BW+(f_TE+f_BW-c2o1*feq*om_turb)/(c1o1-om_turb))*c1o2+(q*(f_TE+f_BW)-c6o1*c1o54*( VeloX+VeloZ))/(c1o1+q) - c1o54 * drho; -// //feq=c1over54* (drho+three*( vx1 +vx3)+c9over2*( vx1 +vx3)*( vx1 +vx3)-cu_sq); -// //(D.f[dM0M])[kbw]=(one-q)/(one+q)*(f_TE-feq*om_turb)/(one-om_turb)+(q*(f_TE+f_BW)-six*c1over54*( VeloX+VeloZ))/(one+q); -// //(D.f[dM0M])[kbw]=zero; -// } - -// q = q_dirBW[k]; -// if (q>=c0o1 && q<=c1o1) -// { -// VeloX = fac*vx1; -// VeloY = fac*vx2; -// VeloZ = fac*vx3; -// if (x == true) VeloX = c0o1; -// if (z == true) VeloZ = c0o1; -// feq=c1o54* (drho/*+three*(-vx1 -vx3)*/+c9o2*(-vx1 -vx3)*(-vx1 -vx3) * (c1o1 + drho)-cu_sq); -// (D.f[dP0P])[kte]=(c1o1-q)/(c1o1+q)*(f_BW-f_TE+(f_BW+f_TE-c2o1*feq*om_turb)/(c1o1-om_turb))*c1o2+(q*(f_BW+f_TE)-c6o1*c1o54*(-VeloX-VeloZ))/(c1o1+q) - c1o54 * drho; -// //feq=c1over54* (drho+three*(-vx1 -vx3)+c9over2*(-vx1 -vx3)*(-vx1 -vx3)-cu_sq); -// //(D.f[dP0P])[kte]=(one-q)/(one+q)*(f_BW-feq*om_turb)/(one-om_turb)+(q*(f_BW+f_TE)-six*c1over54*(-VeloX-VeloZ))/(one+q); -// //(D.f[dP0P])[kte]=zero; -// } - -// q = q_dirBE[k]; -// if (q>=c0o1 && q<=c1o1) -// { -// VeloX = fac*vx1; -// VeloY = fac*vx2; -// VeloZ = fac*vx3; -// if (x == true) VeloX = c0o1; -// if (z == true) VeloZ = c0o1; -// feq=c1o54* (drho/*+three*( vx1 -vx3)*/+c9o2*( vx1 -vx3)*( vx1 -vx3) * (c1o1 + drho)-cu_sq); -// (D.f[dM0P])[ktw]=(c1o1-q)/(c1o1+q)*(f_BE-f_TW+(f_BE+f_TW-c2o1*feq*om_turb)/(c1o1-om_turb))*c1o2+(q*(f_BE+f_TW)-c6o1*c1o54*( VeloX-VeloZ))/(c1o1+q) - c1o54 * drho; -// //feq=c1over54* (drho+three*( vx1 -vx3)+c9over2*( vx1 -vx3)*( vx1 -vx3)-cu_sq); -// //(D.f[dM0P])[ktw]=(one-q)/(one+q)*(f_BE-feq*om_turb)/(one-om_turb)+(q*(f_BE+f_TW)-six*c1over54*( VeloX-VeloZ))/(one+q); -// //(D.f[dM0P])[ktw]=zero; -// } - -// q = q_dirTW[k]; -// if (q>=c0o1 && q<=c1o1) -// { -// VeloX = fac*vx1; -// VeloY = fac*vx2; -// VeloZ = fac*vx3; -// if (x == true) VeloX = c0o1; -// if (z == true) VeloZ = c0o1; -// feq=c1o54* (drho/*+three*(-vx1 +vx3)*/+c9o2*(-vx1 +vx3)*(-vx1 +vx3) * (c1o1 + drho)-cu_sq); -// (D.f[dP0M])[kbe]=(c1o1-q)/(c1o1+q)*(f_TW-f_BE+(f_TW+f_BE-c2o1*feq*om_turb)/(c1o1-om_turb))*c1o2+(q*(f_TW+f_BE)-c6o1*c1o54*(-VeloX+VeloZ))/(c1o1+q) - c1o54 * drho; -// //feq=c1over54* (drho+three*(-vx1 +vx3)+c9over2*(-vx1 +vx3)*(-vx1 +vx3)-cu_sq); -// //(D.f[dP0M])[kbe]=(one-q)/(one+q)*(f_TW-feq*om_turb)/(one-om_turb)+(q*(f_TW+f_BE)-six*c1over54*(-VeloX+VeloZ))/(one+q); -// //(D.f[dP0M])[kbe]=zero; -// } - -// q = q_dirTN[k]; -// if (q>=c0o1 && q<=c1o1) -// { -// VeloX = fac*vx1; -// VeloY = fac*vx2; -// VeloZ = fac*vx3; -// if (y == true) VeloY = c0o1; -// if (z == true) VeloZ = c0o1; -// feq=c1o54* (drho/*+three*( vx2+vx3)*/+c9o2*( vx2+vx3)*( vx2+vx3) * (c1o1 + drho)-cu_sq); -// (D.f[d0MM])[kbs]=(c1o1-q)/(c1o1+q)*(f_TN-f_BS+(f_TN+f_BS-c2o1*feq*om_turb)/(c1o1-om_turb))*c1o2+(q*(f_TN+f_BS)-c6o1*c1o54*( VeloY+VeloZ))/(c1o1+q) - c1o54 * drho; -// //feq=c1over54* (drho+three*( vx2+vx3)+c9over2*( vx2+vx3)*( vx2+vx3)-cu_sq); -// //(D.f[d0MM])[kbs]=(one-q)/(one+q)*(f_TN-feq*om_turb)/(one-om_turb)+(q*(f_TN+f_BS)-six*c1over54*( VeloY+VeloZ))/(one+q); -// //(D.f[d0MM])[kbs]=zero; -// } - -// q = q_dirBS[k]; -// if (q>=c0o1 && q<=c1o1) -// { -// VeloX = fac*vx1; -// VeloY = fac*vx2; -// VeloZ = fac*vx3; -// if (y == true) VeloY = c0o1; -// if (z == true) VeloZ = c0o1; -// feq=c1o54* (drho/*+three*( -vx2-vx3)*/+c9o2*( -vx2-vx3)*( -vx2-vx3) * (c1o1 + drho)-cu_sq); -// (D.f[d0PP])[ktn]=(c1o1-q)/(c1o1+q)*(f_BS-f_TN+(f_BS+f_TN-c2o1*feq*om_turb)/(c1o1-om_turb))*c1o2+(q*(f_BS+f_TN)-c6o1*c1o54*( -VeloY-VeloZ))/(c1o1+q) - c1o54 * drho; -// //feq=c1over54* (drho+three*( -vx2-vx3)+c9over2*( -vx2-vx3)*( -vx2-vx3)-cu_sq); -// //(D.f[d0PP])[ktn]=(one-q)/(one+q)*(f_BS-feq*om_turb)/(one-om_turb)+(q*(f_BS+f_TN)-six*c1over54*( -VeloY-VeloZ))/(one+q); -// //(D.f[d0PP])[ktn]=zero; -// } - -// q = q_dirBN[k]; -// if (q>=c0o1 && q<=c1o1) -// { -// VeloX = fac*vx1; -// VeloY = fac*vx2; -// VeloZ = fac*vx3; -// if (y == true) VeloY = c0o1; -// if (z == true) VeloZ = c0o1; -// feq=c1o54* (drho/*+three*( vx2-vx3)*/+c9o2*( vx2-vx3)*( vx2-vx3) * (c1o1 + drho)-cu_sq); -// (D.f[d0MP])[kts]=(c1o1-q)/(c1o1+q)*(f_BN-f_TS+(f_BN+f_TS-c2o1*feq*om_turb)/(c1o1-om_turb))*c1o2+(q*(f_BN+f_TS)-c6o1*c1o54*( VeloY-VeloZ))/(c1o1+q) - c1o54 * drho; -// //feq=c1over54* (drho+three*( vx2-vx3)+c9over2*( vx2-vx3)*( vx2-vx3)-cu_sq); -// //(D.f[d0MP])[kts]=(one-q)/(one+q)*(f_BN-feq*om_turb)/(one-om_turb)+(q*(f_BN+f_TS)-six*c1over54*( VeloY-VeloZ))/(one+q); -// //(D.f[d0MP])[kts]=zero; -// } - -// q = q_dirTS[k]; -// if (q>=c0o1 && q<=c1o1) -// { -// VeloX = fac*vx1; -// VeloY = fac*vx2; -// VeloZ = fac*vx3; -// if (y == true) VeloY = c0o1; -// if (z == true) VeloZ = c0o1; -// feq=c1o54* (drho/*+three*( -vx2+vx3)*/+c9o2*( -vx2+vx3)*( -vx2+vx3) * (c1o1 + drho)-cu_sq); -// (D.f[d0PM])[kbn]=(c1o1-q)/(c1o1+q)*(f_TS-f_BN+(f_TS+f_BN-c2o1*feq*om_turb)/(c1o1-om_turb))*c1o2+(q*(f_TS+f_BN)-c6o1*c1o54*( -VeloY+VeloZ))/(c1o1+q) - c1o54 * drho; -// //feq=c1over54* (drho+three*( -vx2+vx3)+c9over2*( -vx2+vx3)*( -vx2+vx3)-cu_sq); -// //(D.f[d0PM])[kbn]=(one-q)/(one+q)*(f_TS-feq*om_turb)/(one-om_turb)+(q*(f_TS+f_BN)-six*c1over54*( -VeloY+VeloZ))/(one+q); -// //(D.f[d0PM])[kbn]=zero; -// } - -// q = q_dirTNE[k]; -// if (q>=c0o1 && q<=c1o1) -// { -// VeloX = fac*vx1; -// VeloY = fac*vx2; -// VeloZ = fac*vx3; -// if (x == true) VeloX = c0o1; -// if (y == true) VeloY = c0o1; -// if (z == true) VeloZ = c0o1; -// feq=c1o216*(drho/*+three*( vx1+vx2+vx3)*/+c9o2*( vx1+vx2+vx3)*( vx1+vx2+vx3) * (c1o1 + drho)-cu_sq); -// (D.f[dMMM])[kbsw]=(c1o1-q)/(c1o1+q)*(f_TNE-f_BSW+(f_TNE+f_BSW-c2o1*feq*om_turb)/(c1o1-om_turb))*c1o2+(q*(f_TNE+f_BSW)-c6o1*c1o216*( VeloX+VeloY+VeloZ))/(c1o1+q) - c1o216 * drho; -// //feq=c1over216*(drho+three*( vx1+vx2+vx3)+c9over2*( vx1+vx2+vx3)*( vx1+vx2+vx3)-cu_sq); -// //(D.f[dMMM])[kbsw]=(one-q)/(one+q)*(f_TNE-feq*om_turb)/(one-om_turb)+(q*(f_TNE+f_BSW)-six*c1over216*( VeloX+VeloY+VeloZ))/(one+q); -// //(D.f[dMMM])[kbsw]=zero; -// } - -// q = q_dirBSW[k]; -// if (q>=c0o1 && q<=c1o1) -// { -// VeloX = fac*vx1; -// VeloY = fac*vx2; -// VeloZ = fac*vx3; -// if (x == true) VeloX = c0o1; -// if (y == true) VeloY = c0o1; -// if (z == true) VeloZ = c0o1; -// feq=c1o216*(drho/*+three*(-vx1-vx2-vx3)*/+c9o2*(-vx1-vx2-vx3)*(-vx1-vx2-vx3) * (c1o1 + drho)-cu_sq); -// (D.f[dPPP])[ktne]=(c1o1-q)/(c1o1+q)*(f_BSW-f_TNE+(f_BSW+f_TNE-c2o1*feq*om_turb)/(c1o1-om_turb))*c1o2+(q*(f_BSW+f_TNE)-c6o1*c1o216*(-VeloX-VeloY-VeloZ))/(c1o1+q) - c1o216 * drho; -// //feq=c1over216*(drho+three*(-vx1-vx2-vx3)+c9over2*(-vx1-vx2-vx3)*(-vx1-vx2-vx3)-cu_sq); -// //(D.f[dPPP])[ktne]=(one-q)/(one+q)*(f_BSW-feq*om_turb)/(one-om_turb)+(q*(f_BSW+f_TNE)-six*c1over216*(-VeloX-VeloY-VeloZ))/(one+q); -// //(D.f[dPPP])[ktne]=zero; -// } - -// q = q_dirBNE[k]; -// if (q>=c0o1 && q<=c1o1) -// { -// VeloX = fac*vx1; -// VeloY = fac*vx2; -// VeloZ = fac*vx3; -// if (x == true) VeloX = c0o1; -// if (y == true) VeloY = c0o1; -// if (z == true) VeloZ = c0o1; -// feq=c1o216*(drho/*+three*( vx1+vx2-vx3)*/+c9o2*( vx1+vx2-vx3)*( vx1+vx2-vx3) * (c1o1 + drho)-cu_sq); -// (D.f[dMMP])[ktsw]=(c1o1-q)/(c1o1+q)*(f_BNE-f_TSW+(f_BNE+f_TSW-c2o1*feq*om_turb)/(c1o1-om_turb))*c1o2+(q*(f_BNE+f_TSW)-c6o1*c1o216*( VeloX+VeloY-VeloZ))/(c1o1+q) - c1o216 * drho; -// //feq=c1over216*(drho+three*( vx1+vx2-vx3)+c9over2*( vx1+vx2-vx3)*( vx1+vx2-vx3)-cu_sq); -// //(D.f[dMMP])[ktsw]=(one-q)/(one+q)*(f_BNE-feq*om_turb)/(one-om_turb)+(q*(f_BNE+f_TSW)-six*c1over216*( VeloX+VeloY-VeloZ))/(one+q); -// //(D.f[dMMP])[ktsw]=zero; -// } - -// q = q_dirTSW[k]; -// if (q>=c0o1 && q<=c1o1) -// { -// VeloX = fac*vx1; -// VeloY = fac*vx2; -// VeloZ = fac*vx3; -// if (x == true) VeloX = c0o1; -// if (y == true) VeloY = c0o1; -// if (z == true) VeloZ = c0o1; -// feq=c1o216*(drho/*+three*(-vx1-vx2+vx3)*/+c9o2*(-vx1-vx2+vx3)*(-vx1-vx2+vx3) * (c1o1 + drho)-cu_sq); -// (D.f[dPPM])[kbne]=(c1o1-q)/(c1o1+q)*(f_TSW-f_BNE+(f_TSW+f_BNE-c2o1*feq*om_turb)/(c1o1-om_turb))*c1o2+(q*(f_TSW+f_BNE)-c6o1*c1o216*(-VeloX-VeloY+VeloZ))/(c1o1+q) - c1o216 * drho; -// //feq=c1over216*(drho+three*(-vx1-vx2+vx3)+c9over2*(-vx1-vx2+vx3)*(-vx1-vx2+vx3)-cu_sq); -// //(D.f[dPPM])[kbne]=(one-q)/(one+q)*(f_TSW-feq*om_turb)/(one-om_turb)+(q*(f_TSW+f_BNE)-six*c1over216*(-VeloX-VeloY+VeloZ))/(one+q); -// //(D.f[dPPM])[kbne]=zero; -// } - -// q = q_dirTSE[k]; -// if (q>=c0o1 && q<=c1o1) -// { -// VeloX = fac*vx1; -// VeloY = fac*vx2; -// VeloZ = fac*vx3; -// if (x == true) VeloX = c0o1; -// if (y == true) VeloY = c0o1; -// if (z == true) VeloZ = c0o1; -// feq=c1o216*(drho/*+three*( vx1-vx2+vx3)*/+c9o2*( vx1-vx2+vx3)*( vx1-vx2+vx3) * (c1o1 + drho)-cu_sq); -// (D.f[dMPM])[kbnw]=(c1o1-q)/(c1o1+q)*(f_TSE-f_BNW+(f_TSE+f_BNW-c2o1*feq*om_turb)/(c1o1-om_turb))*c1o2+(q*(f_TSE+f_BNW)-c6o1*c1o216*( VeloX-VeloY+VeloZ))/(c1o1+q) - c1o216 * drho; -// //feq=c1over216*(drho+three*( vx1-vx2+vx3)+c9over2*( vx1-vx2+vx3)*( vx1-vx2+vx3)-cu_sq); -// //(D.f[dMPM])[kbnw]=(one-q)/(one+q)*(f_TSE-feq*om_turb)/(one-om_turb)+(q*(f_TSE+f_BNW)-six*c1over216*( VeloX-VeloY+VeloZ))/(one+q); -// //(D.f[dMPM])[kbnw]=zero; -// } - -// q = q_dirBNW[k]; -// if (q>=c0o1 && q<=c1o1) -// { -// VeloX = fac*vx1; -// VeloY = fac*vx2; -// VeloZ = fac*vx3; -// if (x == true) VeloX = c0o1; -// if (y == true) VeloY = c0o1; -// if (z == true) VeloZ = c0o1; -// feq=c1o216*(drho/*+three*(-vx1+vx2-vx3)*/+c9o2*(-vx1+vx2-vx3)*(-vx1+vx2-vx3) * (c1o1 + drho)-cu_sq); -// (D.f[dPMP])[ktse]=(c1o1-q)/(c1o1+q)*(f_BNW-f_TSE+(f_BNW+f_TSE-c2o1*feq*om_turb)/(c1o1-om_turb))*c1o2+(q*(f_BNW+f_TSE)-c6o1*c1o216*(-VeloX+VeloY-VeloZ))/(c1o1+q) - c1o216 * drho; -// //feq=c1over216*(drho+three*(-vx1+vx2-vx3)+c9over2*(-vx1+vx2-vx3)*(-vx1+vx2-vx3)-cu_sq); -// //(D.f[dPMP])[ktse]=(one-q)/(one+q)*(f_BNW-feq*om_turb)/(one-om_turb)+(q*(f_BNW+f_TSE)-six*c1over216*(-VeloX+VeloY-VeloZ))/(one+q); -// //(D.f[dPMP])[ktse]=zero; -// } - -// q = q_dirBSE[k]; -// if (q>=c0o1 && q<=c1o1) -// { -// VeloX = fac*vx1; -// VeloY = fac*vx2; -// VeloZ = fac*vx3; -// if (x == true) VeloX = c0o1; -// if (y == true) VeloY = c0o1; -// if (z == true) VeloZ = c0o1; -// feq=c1o216*(drho/*+three*( vx1-vx2-vx3)*/+c9o2*( vx1-vx2-vx3)*( vx1-vx2-vx3) * (c1o1 + drho)-cu_sq); -// (D.f[dMPP])[ktnw]=(c1o1-q)/(c1o1+q)*(f_BSE-f_TNW+(f_BSE+f_TNW-c2o1*feq*om_turb)/(c1o1-om_turb))*c1o2+(q*(f_BSE+f_TNW)-c6o1*c1o216*( VeloX-VeloY-VeloZ))/(c1o1+q) - c1o216 * drho; -// //feq=c1over216*(drho+three*( vx1-vx2-vx3)+c9over2*( vx1-vx2-vx3)*( vx1-vx2-vx3)-cu_sq); -// //(D.f[dMPP])[ktnw]=(one-q)/(one+q)*(f_BSE-feq*om_turb)/(one-om_turb)+(q*(f_BSE+f_TNW)-six*c1over216*( VeloX-VeloY-VeloZ))/(one+q); -// //(D.f[dMPP])[ktnw]=zero; -// } - -// q = q_dirTNW[k]; -// if (q>=c0o1 && q<=c1o1) -// { -// VeloX = fac*vx1; -// VeloY = fac*vx2; -// VeloZ = fac*vx3; -// if (x == true) VeloX = c0o1; -// if (y == true) VeloY = c0o1; -// if (z == true) VeloZ = c0o1; -// feq=c1o216*(drho/*+three*(-vx1+vx2+vx3)*/+c9o2*(-vx1+vx2+vx3)*(-vx1+vx2+vx3) * (c1o1 + drho)-cu_sq); -// (D.f[dPMM])[kbse]=(c1o1-q)/(c1o1+q)*(f_TNW-f_BSE+(f_TNW+f_BSE-c2o1*feq*om_turb)/(c1o1-om_turb))*c1o2+(q*(f_TNW+f_BSE)-c6o1*c1o216*(-VeloX+VeloY+VeloZ))/(c1o1+q) - c1o216 * drho; -// //feq=c1over216*(drho+three*(-vx1+vx2+vx3)+c9over2*(-vx1+vx2+vx3)*(-vx1+vx2+vx3)-cu_sq); -// //(D.f[dPMM])[kbse]=(one-q)/(one+q)*(f_TNW-feq*om_turb)/(one-om_turb)+(q*(f_TNW+f_BSE)-six*c1over216*(-VeloX+VeloY+VeloZ))/(one+q); -// //(D.f[dPMM])[kbse]=zero; -// } -// } -// } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -////////////////////////////////////////////////////////////////////////////// -__global__ void QSlipGeomDeviceComp27( - real* DD, - int* k_Q, - real* QQ, - unsigned int numberOfBCnodes, - real om1, - real* NormalX, - real* NormalY, - real* NormalZ, - unsigned int* neighborX, - unsigned int* neighborY, - unsigned int* neighborZ, - unsigned long long numberOfLBnodes, - bool isEvenTimestep) -{ - Distributions27 D; - if (isEvenTimestep==true) - { - D.f[dP00] = &DD[dP00 * numberOfLBnodes]; - D.f[dM00] = &DD[dM00 * numberOfLBnodes]; - D.f[d0P0] = &DD[d0P0 * numberOfLBnodes]; - D.f[d0M0] = &DD[d0M0 * numberOfLBnodes]; - D.f[d00P] = &DD[d00P * numberOfLBnodes]; - D.f[d00M] = &DD[d00M * numberOfLBnodes]; - D.f[dPP0] = &DD[dPP0 * numberOfLBnodes]; - D.f[dMM0] = &DD[dMM0 * numberOfLBnodes]; - D.f[dPM0] = &DD[dPM0 * numberOfLBnodes]; - D.f[dMP0] = &DD[dMP0 * numberOfLBnodes]; - D.f[dP0P] = &DD[dP0P * numberOfLBnodes]; - D.f[dM0M] = &DD[dM0M * numberOfLBnodes]; - D.f[dP0M] = &DD[dP0M * numberOfLBnodes]; - D.f[dM0P] = &DD[dM0P * numberOfLBnodes]; - D.f[d0PP] = &DD[d0PP * numberOfLBnodes]; - D.f[d0MM] = &DD[d0MM * numberOfLBnodes]; - D.f[d0PM] = &DD[d0PM * numberOfLBnodes]; - D.f[d0MP] = &DD[d0MP * numberOfLBnodes]; - D.f[d000] = &DD[d000 * numberOfLBnodes]; - D.f[dPPP] = &DD[dPPP * numberOfLBnodes]; - D.f[dMMP] = &DD[dMMP * numberOfLBnodes]; - D.f[dPMP] = &DD[dPMP * numberOfLBnodes]; - D.f[dMPP] = &DD[dMPP * numberOfLBnodes]; - D.f[dPPM] = &DD[dPPM * numberOfLBnodes]; - D.f[dMMM] = &DD[dMMM * numberOfLBnodes]; - D.f[dPMM] = &DD[dPMM * numberOfLBnodes]; - D.f[dMPM] = &DD[dMPM * numberOfLBnodes]; - } - else - { - D.f[dM00] = &DD[dP00 * numberOfLBnodes]; - D.f[dP00] = &DD[dM00 * numberOfLBnodes]; - D.f[d0M0] = &DD[d0P0 * numberOfLBnodes]; - D.f[d0P0] = &DD[d0M0 * numberOfLBnodes]; - D.f[d00M] = &DD[d00P * numberOfLBnodes]; - D.f[d00P] = &DD[d00M * numberOfLBnodes]; - D.f[dMM0] = &DD[dPP0 * numberOfLBnodes]; - D.f[dPP0] = &DD[dMM0 * numberOfLBnodes]; - D.f[dMP0] = &DD[dPM0 * numberOfLBnodes]; - D.f[dPM0] = &DD[dMP0 * numberOfLBnodes]; - D.f[dM0M] = &DD[dP0P * numberOfLBnodes]; - D.f[dP0P] = &DD[dM0M * numberOfLBnodes]; - D.f[dM0P] = &DD[dP0M * numberOfLBnodes]; - D.f[dP0M] = &DD[dM0P * numberOfLBnodes]; - D.f[d0MM] = &DD[d0PP * numberOfLBnodes]; - D.f[d0PP] = &DD[d0MM * numberOfLBnodes]; - D.f[d0MP] = &DD[d0PM * numberOfLBnodes]; - D.f[d0PM] = &DD[d0MP * numberOfLBnodes]; - D.f[d000] = &DD[d000 * numberOfLBnodes]; - D.f[dPPP] = &DD[dMMM * numberOfLBnodes]; - D.f[dMMP] = &DD[dPPM * numberOfLBnodes]; - D.f[dPMP] = &DD[dMPM * numberOfLBnodes]; - D.f[dMPP] = &DD[dPMM * numberOfLBnodes]; - D.f[dPPM] = &DD[dMMP * numberOfLBnodes]; - D.f[dMMM] = &DD[dPPP * numberOfLBnodes]; - D.f[dPMM] = &DD[dMPP * numberOfLBnodes]; - D.f[dMPM] = &DD[dPMP * numberOfLBnodes]; - } - //////////////////////////////////////////////////////////////////////////////// - const unsigned x = threadIdx.x; // Globaler x-Index - const unsigned y = blockIdx.x; // Globaler y-Index - const unsigned z = blockIdx.y; // Globaler z-Index - - const unsigned nx = blockDim.x; - const unsigned ny = gridDim.x; - - const unsigned k = nx*(ny*z + y) + x; - ////////////////////////////////////////////////////////////////////////// - - if(k< numberOfBCnodes) - { - //////////////////////////////////////////////////////////////////////////////// - real *q_dirE, *q_dirW, *q_dirN, *q_dirS, *q_dirT, *q_dirB, - *q_dirNE, *q_dirSW, *q_dirSE, *q_dirNW, *q_dirTE, *q_dirBW, - *q_dirBE, *q_dirTW, *q_dirTN, *q_dirBS, *q_dirBN, *q_dirTS, - *q_dirTNE, *q_dirTSW, *q_dirTSE, *q_dirTNW, *q_dirBNE, *q_dirBSW, - *q_dirBSE, *q_dirBNW; - q_dirE = &QQ[dP00 * numberOfBCnodes]; - q_dirW = &QQ[dM00 * numberOfBCnodes]; - q_dirN = &QQ[d0P0 * numberOfBCnodes]; - q_dirS = &QQ[d0M0 * numberOfBCnodes]; - q_dirT = &QQ[d00P * numberOfBCnodes]; - q_dirB = &QQ[d00M * numberOfBCnodes]; - q_dirNE = &QQ[dPP0 * numberOfBCnodes]; - q_dirSW = &QQ[dMM0 * numberOfBCnodes]; - q_dirSE = &QQ[dPM0 * numberOfBCnodes]; - q_dirNW = &QQ[dMP0 * numberOfBCnodes]; - q_dirTE = &QQ[dP0P * numberOfBCnodes]; - q_dirBW = &QQ[dM0M * numberOfBCnodes]; - q_dirBE = &QQ[dP0M * numberOfBCnodes]; - q_dirTW = &QQ[dM0P * numberOfBCnodes]; - q_dirTN = &QQ[d0PP * numberOfBCnodes]; - q_dirBS = &QQ[d0MM * numberOfBCnodes]; - q_dirBN = &QQ[d0PM * numberOfBCnodes]; - q_dirTS = &QQ[d0MP * numberOfBCnodes]; - q_dirTNE = &QQ[dPPP * numberOfBCnodes]; - q_dirTSW = &QQ[dMMP * numberOfBCnodes]; - q_dirTSE = &QQ[dPMP * numberOfBCnodes]; - q_dirTNW = &QQ[dMPP * numberOfBCnodes]; - q_dirBNE = &QQ[dPPM * numberOfBCnodes]; - q_dirBSW = &QQ[dMMM * numberOfBCnodes]; - q_dirBSE = &QQ[dPMM * numberOfBCnodes]; - q_dirBNW = &QQ[dMPM * numberOfBCnodes]; - //////////////////////////////////////////////////////////////////////////////// - real *nx_dirE, *nx_dirW, *nx_dirN, *nx_dirS, *nx_dirT, *nx_dirB, - *nx_dirNE, *nx_dirSW, *nx_dirSE, *nx_dirNW, *nx_dirTE, *nx_dirBW, - *nx_dirBE, *nx_dirTW, *nx_dirTN, *nx_dirBS, *nx_dirBN, *nx_dirTS, - *nx_dirTNE, *nx_dirTSW, *nx_dirTSE, *nx_dirTNW, *nx_dirBNE, *nx_dirBSW, - *nx_dirBSE, *nx_dirBNW; - nx_dirE = &NormalX[dP00 * numberOfBCnodes]; - nx_dirW = &NormalX[dM00 * numberOfBCnodes]; - nx_dirN = &NormalX[d0P0 * numberOfBCnodes]; - nx_dirS = &NormalX[d0M0 * numberOfBCnodes]; - nx_dirT = &NormalX[d00P * numberOfBCnodes]; - nx_dirB = &NormalX[d00M * numberOfBCnodes]; - nx_dirNE = &NormalX[dPP0 * numberOfBCnodes]; - nx_dirSW = &NormalX[dMM0 * numberOfBCnodes]; - nx_dirSE = &NormalX[dPM0 * numberOfBCnodes]; - nx_dirNW = &NormalX[dMP0 * numberOfBCnodes]; - nx_dirTE = &NormalX[dP0P * numberOfBCnodes]; - nx_dirBW = &NormalX[dM0M * numberOfBCnodes]; - nx_dirBE = &NormalX[dP0M * numberOfBCnodes]; - nx_dirTW = &NormalX[dM0P * numberOfBCnodes]; - nx_dirTN = &NormalX[d0PP * numberOfBCnodes]; - nx_dirBS = &NormalX[d0MM * numberOfBCnodes]; - nx_dirBN = &NormalX[d0PM * numberOfBCnodes]; - nx_dirTS = &NormalX[d0MP * numberOfBCnodes]; - nx_dirTNE = &NormalX[dPPP * numberOfBCnodes]; - nx_dirTSW = &NormalX[dMMP * numberOfBCnodes]; - nx_dirTSE = &NormalX[dPMP * numberOfBCnodes]; - nx_dirTNW = &NormalX[dMPP * numberOfBCnodes]; - nx_dirBNE = &NormalX[dPPM * numberOfBCnodes]; - nx_dirBSW = &NormalX[dMMM * numberOfBCnodes]; - nx_dirBSE = &NormalX[dPMM * numberOfBCnodes]; - nx_dirBNW = &NormalX[dMPM * numberOfBCnodes]; - //////////////////////////////////////////////////////////////////////////////// - real *ny_dirE, *ny_dirW, *ny_dirN, *ny_dirS, *ny_dirT, *ny_dirB, - *ny_dirNE, *ny_dirSW, *ny_dirSE, *ny_dirNW, *ny_dirTE, *ny_dirBW, - *ny_dirBE, *ny_dirTW, *ny_dirTN, *ny_dirBS, *ny_dirBN, *ny_dirTS, - *ny_dirTNE, *ny_dirTSW, *ny_dirTSE, *ny_dirTNW, *ny_dirBNE, *ny_dirBSW, - *ny_dirBSE, *ny_dirBNW; - ny_dirE = &NormalY[dP00 * numberOfBCnodes]; - ny_dirW = &NormalY[dM00 * numberOfBCnodes]; - ny_dirN = &NormalY[d0P0 * numberOfBCnodes]; - ny_dirS = &NormalY[d0M0 * numberOfBCnodes]; - ny_dirT = &NormalY[d00P * numberOfBCnodes]; - ny_dirB = &NormalY[d00M * numberOfBCnodes]; - ny_dirNE = &NormalY[dPP0 * numberOfBCnodes]; - ny_dirSW = &NormalY[dMM0 * numberOfBCnodes]; - ny_dirSE = &NormalY[dPM0 * numberOfBCnodes]; - ny_dirNW = &NormalY[dMP0 * numberOfBCnodes]; - ny_dirTE = &NormalY[dP0P * numberOfBCnodes]; - ny_dirBW = &NormalY[dM0M * numberOfBCnodes]; - ny_dirBE = &NormalY[dP0M * numberOfBCnodes]; - ny_dirTW = &NormalY[dM0P * numberOfBCnodes]; - ny_dirTN = &NormalY[d0PP * numberOfBCnodes]; - ny_dirBS = &NormalY[d0MM * numberOfBCnodes]; - ny_dirBN = &NormalY[d0PM * numberOfBCnodes]; - ny_dirTS = &NormalY[d0MP * numberOfBCnodes]; - ny_dirTNE = &NormalY[dPPP * numberOfBCnodes]; - ny_dirTSW = &NormalY[dMMP * numberOfBCnodes]; - ny_dirTSE = &NormalY[dPMP * numberOfBCnodes]; - ny_dirTNW = &NormalY[dMPP * numberOfBCnodes]; - ny_dirBNE = &NormalY[dPPM * numberOfBCnodes]; - ny_dirBSW = &NormalY[dMMM * numberOfBCnodes]; - ny_dirBSE = &NormalY[dPMM * numberOfBCnodes]; - ny_dirBNW = &NormalY[dMPM * numberOfBCnodes]; - //////////////////////////////////////////////////////////////////////////////// - real *nz_dirE, *nz_dirW, *nz_dirN, *nz_dirS, *nz_dirT, *nz_dirB, - *nz_dirNE, *nz_dirSW, *nz_dirSE, *nz_dirNW, *nz_dirTE, *nz_dirBW, - *nz_dirBE, *nz_dirTW, *nz_dirTN, *nz_dirBS, *nz_dirBN, *nz_dirTS, - *nz_dirTNE, *nz_dirTSW, *nz_dirTSE, *nz_dirTNW, *nz_dirBNE, *nz_dirBSW, - *nz_dirBSE, *nz_dirBNW; - nz_dirE = &NormalZ[dP00 * numberOfBCnodes]; - nz_dirW = &NormalZ[dM00 * numberOfBCnodes]; - nz_dirN = &NormalZ[d0P0 * numberOfBCnodes]; - nz_dirS = &NormalZ[d0M0 * numberOfBCnodes]; - nz_dirT = &NormalZ[d00P * numberOfBCnodes]; - nz_dirB = &NormalZ[d00M * numberOfBCnodes]; - nz_dirNE = &NormalZ[dPP0 * numberOfBCnodes]; - nz_dirSW = &NormalZ[dMM0 * numberOfBCnodes]; - nz_dirSE = &NormalZ[dPM0 * numberOfBCnodes]; - nz_dirNW = &NormalZ[dMP0 * numberOfBCnodes]; - nz_dirTE = &NormalZ[dP0P * numberOfBCnodes]; - nz_dirBW = &NormalZ[dM0M * numberOfBCnodes]; - nz_dirBE = &NormalZ[dP0M * numberOfBCnodes]; - nz_dirTW = &NormalZ[dM0P * numberOfBCnodes]; - nz_dirTN = &NormalZ[d0PP * numberOfBCnodes]; - nz_dirBS = &NormalZ[d0MM * numberOfBCnodes]; - nz_dirBN = &NormalZ[d0PM * numberOfBCnodes]; - nz_dirTS = &NormalZ[d0MP * numberOfBCnodes]; - nz_dirTNE = &NormalZ[dPPP * numberOfBCnodes]; - nz_dirTSW = &NormalZ[dMMP * numberOfBCnodes]; - nz_dirTSE = &NormalZ[dPMP * numberOfBCnodes]; - nz_dirTNW = &NormalZ[dMPP * numberOfBCnodes]; - nz_dirBNE = &NormalZ[dPPM * numberOfBCnodes]; - nz_dirBSW = &NormalZ[dMMM * numberOfBCnodes]; - nz_dirBSE = &NormalZ[dPMM * numberOfBCnodes]; - nz_dirBNW = &NormalZ[dMPM * numberOfBCnodes]; - //////////////////////////////////////////////////////////////////////////////// - //index - unsigned int KQK = k_Q[k]; - unsigned int kzero= KQK; - unsigned int ke = KQK; - unsigned int kw = neighborX[KQK]; - unsigned int kn = KQK; - unsigned int ks = neighborY[KQK]; - unsigned int kt = KQK; - unsigned int kb = neighborZ[KQK]; - unsigned int ksw = neighborY[kw]; - unsigned int kne = KQK; - unsigned int kse = ks; - unsigned int knw = kw; - unsigned int kbw = neighborZ[kw]; - unsigned int kte = KQK; - unsigned int kbe = kb; - unsigned int ktw = kw; - unsigned int kbs = neighborZ[ks]; - unsigned int ktn = KQK; - unsigned int kbn = kb; - unsigned int kts = ks; - unsigned int ktse = ks; - unsigned int kbnw = kbw; - unsigned int ktnw = kw; - unsigned int kbse = kbs; - unsigned int ktsw = ksw; - unsigned int kbne = kb; - unsigned int ktne = KQK; - unsigned int kbsw = neighborZ[ksw]; - //////////////////////////////////////////////////////////////////////////////// - real f_W = (D.f[dP00])[ke ]; - real f_E = (D.f[dM00])[kw ]; - real f_S = (D.f[d0P0])[kn ]; - real f_N = (D.f[d0M0])[ks ]; - real f_B = (D.f[d00P])[kt ]; - real f_T = (D.f[d00M])[kb ]; - real f_SW = (D.f[dPP0])[kne ]; - real f_NE = (D.f[dMM0])[ksw ]; - real f_NW = (D.f[dPM0])[kse ]; - real f_SE = (D.f[dMP0])[knw ]; - real f_BW = (D.f[dP0P])[kte ]; - real f_TE = (D.f[dM0M])[kbw ]; - real f_TW = (D.f[dP0M])[kbe ]; - real f_BE = (D.f[dM0P])[ktw ]; - real f_BS = (D.f[d0PP])[ktn ]; - real f_TN = (D.f[d0MM])[kbs ]; - real f_TS = (D.f[d0PM])[kbn ]; - real f_BN = (D.f[d0MP])[kts ]; - real f_BSW = (D.f[dPPP])[ktne ]; - real f_BNE = (D.f[dMMP])[ktsw ]; - real f_BNW = (D.f[dPMP])[ktse ]; - real f_BSE = (D.f[dMPP])[ktnw ]; - real f_TSW = (D.f[dPPM])[kbne ]; - real f_TNE = (D.f[dMMM])[kbsw ]; - real f_TNW = (D.f[dPMM])[kbse ]; - real f_TSE = (D.f[dMPM])[kbnw ]; - //////////////////////////////////////////////////////////////////////////////// - real vx1, vx2, vx3, drho, feq, q; - drho = f_TSE + f_TNW + f_TNE + f_TSW + f_BSE + f_BNW + f_BNE + f_BSW + - f_BN + f_TS + f_TN + f_BS + f_BE + f_TW + f_TE + f_BW + f_SE + f_NW + f_NE + f_SW + - f_T + f_B + f_N + f_S + f_E + f_W + ((D.f[d000])[kzero]); - - vx1 = (((f_TSE - f_BNW) - (f_TNW - f_BSE)) + ((f_TNE - f_BSW) - (f_TSW - f_BNE)) + - ((f_BE - f_TW) + (f_TE - f_BW)) + ((f_SE - f_NW) + (f_NE - f_SW)) + - (f_E - f_W)) / (c1o1 + drho); - - - vx2 = ((-(f_TSE - f_BNW) + (f_TNW - f_BSE)) + ((f_TNE - f_BSW) - (f_TSW - f_BNE)) + - ((f_BN - f_TS) + (f_TN - f_BS)) + (-(f_SE - f_NW) + (f_NE - f_SW)) + - (f_N - f_S)) / (c1o1 + drho); - - vx3 = (((f_TSE - f_BNW) + (f_TNW - f_BSE)) + ((f_TNE - f_BSW) + (f_TSW - f_BNE)) + - (-(f_BN - f_TS) + (f_TN - f_BS)) + ((f_TE - f_BW) - (f_BE - f_TW)) + - (f_T - f_B)) / (c1o1 + drho); - - real cu_sq=c3o2*(vx1*vx1+vx2*vx2+vx3*vx3) * (c1o1 + drho); - - ////////////////////////////////////////////////////////////////////////// - if (isEvenTimestep==false) - { - D.f[dP00] = &DD[dP00 * numberOfLBnodes]; - D.f[dM00] = &DD[dM00 * numberOfLBnodes]; - D.f[d0P0] = &DD[d0P0 * numberOfLBnodes]; - D.f[d0M0] = &DD[d0M0 * numberOfLBnodes]; - D.f[d00P] = &DD[d00P * numberOfLBnodes]; - D.f[d00M] = &DD[d00M * numberOfLBnodes]; - D.f[dPP0] = &DD[dPP0 * numberOfLBnodes]; - D.f[dMM0] = &DD[dMM0 * numberOfLBnodes]; - D.f[dPM0] = &DD[dPM0 * numberOfLBnodes]; - D.f[dMP0] = &DD[dMP0 * numberOfLBnodes]; - D.f[dP0P] = &DD[dP0P * numberOfLBnodes]; - D.f[dM0M] = &DD[dM0M * numberOfLBnodes]; - D.f[dP0M] = &DD[dP0M * numberOfLBnodes]; - D.f[dM0P] = &DD[dM0P * numberOfLBnodes]; - D.f[d0PP] = &DD[d0PP * numberOfLBnodes]; - D.f[d0MM] = &DD[d0MM * numberOfLBnodes]; - D.f[d0PM] = &DD[d0PM * numberOfLBnodes]; - D.f[d0MP] = &DD[d0MP * numberOfLBnodes]; - D.f[d000] = &DD[d000 * numberOfLBnodes]; - D.f[dPPP] = &DD[dPPP * numberOfLBnodes]; - D.f[dMMP] = &DD[dMMP * numberOfLBnodes]; - D.f[dPMP] = &DD[dPMP * numberOfLBnodes]; - D.f[dMPP] = &DD[dMPP * numberOfLBnodes]; - D.f[dPPM] = &DD[dPPM * numberOfLBnodes]; - D.f[dMMM] = &DD[dMMM * numberOfLBnodes]; - D.f[dPMM] = &DD[dPMM * numberOfLBnodes]; - D.f[dMPM] = &DD[dMPM * numberOfLBnodes]; - } - else - { - D.f[dM00] = &DD[dP00 * numberOfLBnodes]; - D.f[dP00] = &DD[dM00 * numberOfLBnodes]; - D.f[d0M0] = &DD[d0P0 * numberOfLBnodes]; - D.f[d0P0] = &DD[d0M0 * numberOfLBnodes]; - D.f[d00M] = &DD[d00P * numberOfLBnodes]; - D.f[d00P] = &DD[d00M * numberOfLBnodes]; - D.f[dMM0] = &DD[dPP0 * numberOfLBnodes]; - D.f[dPP0] = &DD[dMM0 * numberOfLBnodes]; - D.f[dMP0] = &DD[dPM0 * numberOfLBnodes]; - D.f[dPM0] = &DD[dMP0 * numberOfLBnodes]; - D.f[dM0M] = &DD[dP0P * numberOfLBnodes]; - D.f[dP0P] = &DD[dM0M * numberOfLBnodes]; - D.f[dM0P] = &DD[dP0M * numberOfLBnodes]; - D.f[dP0M] = &DD[dM0P * numberOfLBnodes]; - D.f[d0MM] = &DD[d0PP * numberOfLBnodes]; - D.f[d0PP] = &DD[d0MM * numberOfLBnodes]; - D.f[d0MP] = &DD[d0PM * numberOfLBnodes]; - D.f[d0PM] = &DD[d0MP * numberOfLBnodes]; - D.f[d000] = &DD[d000 * numberOfLBnodes]; - D.f[dPPP] = &DD[dMMM * numberOfLBnodes]; - D.f[dMMP] = &DD[dPPM * numberOfLBnodes]; - D.f[dPMP] = &DD[dMPM * numberOfLBnodes]; - D.f[dMPP] = &DD[dPMM * numberOfLBnodes]; - D.f[dPPM] = &DD[dMMP * numberOfLBnodes]; - D.f[dMMM] = &DD[dPPP * numberOfLBnodes]; - D.f[dPMM] = &DD[dMPP * numberOfLBnodes]; - D.f[dMPM] = &DD[dPMP * numberOfLBnodes]; - } - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - real VeloX = vx1; - real VeloY = vx2; - real VeloZ = vx3; - real fac = c0o1;//0.5; - real phi = c0o1; - //real alpha = c1o100; - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - real kxyFromfcNEQ = -(c3o1 * om1 / (c1o1-om1))*((f_SW+f_BSW+f_TSW-f_NW-f_BNW-f_TNW-f_SE-f_BSE-f_TSE+f_NE+f_BNE+f_TNE ) / (c1o1 + drho) - ((vx1*vx2))); - real kyzFromfcNEQ = -(c3o1 * om1 / (c1o1-om1))*((f_BS+f_BSE+f_BSW-f_TS-f_TSE-f_TSW-f_BN-f_BNE-f_BNW+f_TN+f_TNE+f_TNW ) / (c1o1 + drho) - ((vx2*vx3))); - real kxzFromfcNEQ = -(c3o1 * om1 / (c1o1-om1))*((f_BW+f_BSW+f_BNW-f_TW-f_TSW-f_TNW-f_BE-f_BSE-f_BNE+f_TE+f_TSE+f_TNE ) / (c1o1 + drho) - ((vx1*vx3))); - - real kxxFromfcNEQ = -(c3o1 * om1 / (c1o1-om1))*((f_E+f_NE+f_SE+f_TE+f_BE+f_W+f_NW+f_SW+f_TW+f_BW+ f_TNE+f_TSE+f_BNE+f_TNE+ f_TNW+f_TSW+f_BNW+f_TNW ) / (c1o1 + drho) - ((c1o3*drho + vx1*vx1))); - real kyyFromfcNEQ = -(c3o1 * om1 / (c1o1-om1))*((f_N+f_NE+f_NW+f_TN+f_BN+f_S+f_SE+f_SW+f_TS+f_BS+ f_TNE+f_TSE+f_BNE+f_TNE+ f_TNW+f_TSW+f_BNW+f_TNW ) / (c1o1 + drho) - ((c1o3*drho + vx2*vx2))); - real kzzFromfcNEQ = -(c3o1 * om1 / (c1o1-om1))*((f_T+f_TE+f_TW+f_TN+f_BS+f_B+f_BE+f_BW+f_BN+f_BS+ f_TNE+f_TSE+f_BNE+f_TNE+ f_TNW+f_TSW+f_BNW+f_TNW ) / (c1o1 + drho) - ((c1o3*drho + vx3*vx3))); - - real magS = sqrtf(kxyFromfcNEQ*kxyFromfcNEQ + kyzFromfcNEQ*kyzFromfcNEQ + kxzFromfcNEQ*kxzFromfcNEQ + kxxFromfcNEQ*kxxFromfcNEQ + kyyFromfcNEQ*kyyFromfcNEQ + kzzFromfcNEQ*kzzFromfcNEQ); - - //fac = fac * magS / (c1o3 * (one / om1 - c1o2)); - // //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //real *facAst = &QQ[d000 * numberOfBCnodes]; - - //fac = fac * alpha + facAst[k] * (one - alpha); - //facAst[k] = fac; - //(&QQ[d000 * numberOfBCnodes])[KQK] = fac; - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - ////real uk = sqrtf(vx1*vx1 + vx2*vx2 + vx3*vx3); - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //real phi = expf(magS/0.01f) - one; - //phi = (phi > one) ? one:phi; - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //real C = five; - //real kappa = 0.41f; - //real phi = (C * kappa * c1o2 * logf(magS / (c1o3 * (one / om1 - c1o2))) - one) / (C * kappa * c1o2 * logf(magS / (c1o3 * (one / om1 - c1o2)))); - //phi = (phi < zero) ? zero:phi; - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //real sum = zero, count = zero; - // q = q_dirE [k]; if (q>=zero && q<=one) sum += (q * nx_dirE[k] ); count += one; - // q = q_dirW [k]; if (q>=zero && q<=one) sum += (q * (-nx_dirW[k])); count += one; - // q = q_dirN [k]; if (q>=zero && q<=one) sum += (q * nx_dirN[k] ); count += one; - // q = q_dirS [k]; if (q>=zero && q<=one) sum += (q * (-nx_dirS[k])); count += one; - // q = q_dirT [k]; if (q>=zero && q<=one) sum += (q * nx_dirT[k] ); count += one; - // q = q_dirB [k]; if (q>=zero && q<=one) sum += (q * (-nx_dirB[k])); count += one; - // q = q_dirNE [k]; if (q>=zero && q<=one) sum += (q * ( nx_dirNE[k] + ny_dirNE[k])/(sqrtf(two))); count += one; - // q = q_dirSW [k]; if (q>=zero && q<=one) sum += (q * ((-nx_dirSW[k]) - ny_dirSW[k])/(sqrtf(two))); count += one; - // q = q_dirSE [k]; if (q>=zero && q<=one) sum += (q * ( nx_dirSE[k] - ny_dirSE[k])/(sqrtf(two))); count += one; - // q = q_dirNW [k]; if (q>=zero && q<=one) sum += (q * ((-nx_dirNW[k]) + ny_dirNW[k])/(sqrtf(two))); count += one; - // q = q_dirTE [k]; if (q>=zero && q<=one) sum += (q * ( nx_dirTE[k] + nz_dirTE[k])/(sqrtf(two))); count += one; - // q = q_dirBW [k]; if (q>=zero && q<=one) sum += (q * ((-nx_dirBW[k]) - nz_dirBW[k])/(sqrtf(two))); count += one; - // q = q_dirBE [k]; if (q>=zero && q<=one) sum += (q * ( nx_dirBE[k] - nz_dirBE[k])/(sqrtf(two))); count += one; - // q = q_dirTW [k]; if (q>=zero && q<=one) sum += (q * ((-nx_dirTW[k]) + nz_dirTW[k])/(sqrtf(two))); count += one; - // q = q_dirTN [k]; if (q>=zero && q<=one) sum += (q * ( ny_dirTN[k] + nz_dirTN[k])/(sqrtf(two))); count += one; - // q = q_dirBS [k]; if (q>=zero && q<=one) sum += (q * ((-ny_dirBS[k]) - nz_dirBS[k])/(sqrtf(two))); count += one; - // q = q_dirBN [k]; if (q>=zero && q<=one) sum += (q * ( ny_dirBN[k] - nz_dirBN[k])/(sqrtf(two))); count += one; - // q = q_dirTS [k]; if (q>=zero && q<=one) sum += (q * ((-ny_dirTS[k]) + nz_dirTS[k])/(sqrtf(two))); count += one; - // q = q_dirTNE [k]; if (q>=zero && q<=one) sum += (q * ( nx_dirTNE[k] + ny_dirTNE[k] + nz_dirTNE[k])/(sqrtf(three))); count += one; - // q = q_dirTSW [k]; if (q>=zero && q<=one) sum += (q * ((-nx_dirTSW[k])- ny_dirTSW[k] + nz_dirTSW[k])/(sqrtf(three))); count += one; - // q = q_dirTSE [k]; if (q>=zero && q<=one) sum += (q * ( nx_dirTSE[k] - ny_dirTSE[k] + nz_dirTSE[k])/(sqrtf(three))); count += one; - // q = q_dirTNW [k]; if (q>=zero && q<=one) sum += (q * ((-nx_dirTNW[k])+ ny_dirTNW[k] + nz_dirTNW[k])/(sqrtf(three))); count += one; - // q = q_dirBNE [k]; if (q>=zero && q<=one) sum += (q * ( nx_dirBNE[k] + ny_dirBNE[k] - nz_dirBNE[k])/(sqrtf(three))); count += one; - // q = q_dirBSW [k]; if (q>=zero && q<=one) sum += (q * ((-nx_dirBSW[k])- ny_dirBSW[k] - nz_dirBSW[k])/(sqrtf(three))); count += one; - // q = q_dirBSE [k]; if (q>=zero && q<=one) sum += (q * ( nx_dirBSE[k] - ny_dirBSE[k] - nz_dirBSE[k])/(sqrtf(three))); count += one; - // q = q_dirBNW [k]; if (q>=zero && q<=one) sum += (q * ((-nx_dirBNW[k])+ ny_dirBNW[k] - nz_dirBNW[k])/(sqrtf(three))); count += one; - //real qMed = sum/count; - //real phi = fac / (qMed + fac); - //phi = (phi > one) ? one:one; - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - real testQ = c2o1; - - q = q_dirE[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = vx1 - (vx1 * nx_dirE[k] + vx2 * ny_dirE[k] + vx3 * nz_dirE[k]) * nx_dirE[k]; - //phi = fac * (one + magS / (c0p0000002+uk) * (one-q)); - //phi = phi > one ? one:phi; - //phi = fac; //Test - q = testQ; //AAAAHHHHHH bitte wieder raus nehmen!!!! - phi = fac / (q * fabs( nx_dirE[k]) + fac); - VeloX *= phi; - feq=c2o27* (drho/*+three*( vx1 )*/+c9o2*( vx1 )*( vx1 ) * (c1o1 + drho)-cu_sq); - (D.f[dM00])[kw]=(c1o1-q)/(c1o1+q)*(f_E-f_W+(f_E+f_W-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_E+f_W)-c6o1*c2o27*( VeloX ))/(c1o1+q) - c2o27 * drho; - } - - q = q_dirW[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = vx1 - (vx1 * nx_dirW[k] + vx2 * ny_dirW[k] + vx3 * nz_dirW[k]) * nx_dirW[k]; - //phi = fac * (one + magS / (c0p0000002+uk) * (one-q)); - //phi = phi > one ? one:phi; - //phi = fac; //Test - q = testQ; //AAAAHHHHHH bitte wieder raus nehmen!!!! - phi = fac / (q * fabs(-nx_dirW[k]) + fac); - VeloX *= phi; - feq=c2o27* (drho/*+three*(-vx1 )*/+c9o2*(-vx1 )*(-vx1 ) * (c1o1 + drho)-cu_sq); - (D.f[dP00])[ke]=(c1o1-q)/(c1o1+q)*(f_W-f_E+(f_W+f_E-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_W+f_E)-c6o1*c2o27*(-VeloX ))/(c1o1+q) - c2o27 * drho; - } - - q = q_dirN[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloY = vx2 - (vx1 * nx_dirN[k] + vx2 * ny_dirN[k] + vx3 * nz_dirN[k]) * ny_dirN[k]; - //phi = fac * (one + magS / (c0p0000002+uk) * (one-q)); - //phi = phi > one ? one:phi; - //phi = fac; //Test - q = testQ; //AAAAHHHHHH bitte wieder raus nehmen!!!! - phi = fac / (q * fabs( ny_dirN[k]) + fac); - VeloY *= phi; - feq=c2o27* (drho/*+three*( vx2 )*/+c9o2*( vx2 )*( vx2 ) * (c1o1 + drho)-cu_sq); - (D.f[d0M0])[ks]=(c1o1-q)/(c1o1+q)*(f_N-f_S+(f_N+f_S-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_N+f_S)-c6o1*c2o27*( VeloY ))/(c1o1+q) - c2o27 * drho; - } - - q = q_dirS[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloY = vx2 - (vx1 * nx_dirS[k] + vx2 * ny_dirS[k] + vx3 * nz_dirS[k]) * ny_dirS[k]; - //phi = fac * (one + magS / (c0p0000002+uk) * (one-q)); - //phi = phi > one ? one:phi; - //phi = fac; //Test - q = testQ; //AAAAHHHHHH bitte wieder raus nehmen!!!! - phi = fac / (q * fabs(-ny_dirS[k]) + fac); - VeloY *= phi; - feq=c2o27* (drho/*+three*( -vx2 )*/+c9o2*( -vx2 )*( -vx2 ) * (c1o1 + drho)-cu_sq); - (D.f[d0P0])[kn]=(c1o1-q)/(c1o1+q)*(f_S-f_N+(f_S+f_N-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_S+f_N)-c6o1*c2o27*(-VeloY ))/(c1o1+q) - c2o27 * drho; - } - - q = q_dirT[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloZ = vx3 - (vx1 * nx_dirT[k] + vx2 * ny_dirT[k] + vx3 * nz_dirT[k]) * nz_dirT[k]; - //phi = fac * (one + magS / (c0p0000002+uk) * (one-q)); - //phi = phi > one ? one:phi; - //phi = fac; //Test - q = testQ; //AAAAHHHHHH bitte wieder raus nehmen!!!! - phi = fac / (q * fabs( nz_dirT[k]) + fac); - VeloZ *= phi; - feq=c2o27* (drho/*+three*( vx3)*/+c9o2*( vx3)*( vx3) * (c1o1 + drho)-cu_sq); - (D.f[d00M])[kb]=(c1o1-q)/(c1o1+q)*(f_T-f_B+(f_T+f_B-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_T+f_B)-c6o1*c2o27*( VeloZ ))/(c1o1+q) - c2o27 * drho; - } - - q = q_dirB[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloZ = vx3 - (vx1 * nx_dirB[k] + vx2 * ny_dirB[k] + vx3 * nz_dirB[k]) * nz_dirB[k]; - //phi = fac * (one + magS / (c0p0000002+uk) * (one-q)); - //phi = phi > one ? one:phi; - //phi = fac; //Test - q = testQ; //AAAAHHHHHH bitte wieder raus nehmen!!!! - phi = fac / (q * fabs(-nz_dirB[k]) + fac); - VeloZ *= phi; - feq=c2o27* (drho/*+three*( -vx3)*/+c9o2*( -vx3)*( -vx3) * (c1o1 + drho)-cu_sq); - (D.f[d00P])[kt]=(c1o1-q)/(c1o1+q)*(f_B-f_T+(f_B+f_T-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_B+f_T)-c6o1*c2o27*(-VeloZ ))/(c1o1+q) - c2o27 * drho; - } - - q = q_dirNE[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = vx1 - (vx1 * nx_dirNE[k] + vx2 * ny_dirNE[k] + vx3 * nz_dirNE[k]) * nx_dirNE[k]; - VeloY = vx2 - (vx1 * nx_dirNE[k] + vx2 * ny_dirNE[k] + vx3 * nz_dirNE[k]) * ny_dirNE[k]; - //phi = fac * (one + magS / (c0p0000002+uk) * (one-q)); - //phi = phi > one ? one:phi; - //phi = fac; //Test - q = testQ; //AAAAHHHHHH bitte wieder raus nehmen!!!! - phi = fac / (q * fabs( nx_dirNE[k] + ny_dirNE[k]) + fac); - VeloX *= phi; - VeloY *= phi; - feq=c1o54* (drho/*+three*( vx1+vx2 )*/+c9o2*( vx1+vx2 )*( vx1+vx2 ) * (c1o1 + drho)-cu_sq); - (D.f[dMM0])[ksw]=(c1o1-q)/(c1o1+q)*(f_NE-f_SW+(f_NE+f_SW-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_NE+f_SW)-c6o1*c1o54*(VeloX+VeloY))/(c1o1+q) - c1o54 * drho; - } - - q = q_dirSW[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = vx1 - (vx1 * nx_dirSW[k] + vx2 * ny_dirSW[k] + vx3 * nz_dirSW[k]) * nx_dirSW[k]; - VeloY = vx2 - (vx1 * nx_dirSW[k] + vx2 * ny_dirSW[k] + vx3 * nz_dirSW[k]) * ny_dirSW[k]; - //phi = fac * (one + magS / (c0p0000002+uk) * (one-q)); - //phi = phi > one ? one:phi; - //phi = fac; //Test - q = testQ; //AAAAHHHHHH bitte wieder raus nehmen!!!! - phi = fac / (q * fabs(-nx_dirSW[k] - ny_dirSW[k]) + fac); - VeloX *= phi; - VeloY *= phi; - feq=c1o54* (drho/*+three*(-vx1-vx2 )*/+c9o2*(-vx1-vx2 )*(-vx1-vx2 ) * (c1o1 + drho)-cu_sq); - (D.f[dPP0])[kne]=(c1o1-q)/(c1o1+q)*(f_SW-f_NE+(f_SW+f_NE-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_SW+f_NE)-c6o1*c1o54*(-VeloX-VeloY))/(c1o1+q) - c1o54 * drho; - } - - q = q_dirSE[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = vx1 - (vx1 * nx_dirSE[k] + vx2 * ny_dirSE[k] + vx3 * nz_dirSE[k]) * nx_dirSE[k]; - VeloY = vx2 - (vx1 * nx_dirSE[k] + vx2 * ny_dirSE[k] + vx3 * nz_dirSE[k]) * ny_dirSE[k]; - //phi = fac * (one + magS / (c0p0000002+uk) * (one-q)); - //phi = phi > one ? one:phi; - //phi = fac; //Test - q = testQ; //AAAAHHHHHH bitte wieder raus nehmen!!!! - phi = fac / (q * fabs( nx_dirSE[k] - ny_dirSE[k]) + fac); - VeloX *= phi; - VeloY *= phi; - feq=c1o54* (drho/*+three*( vx1-vx2 )*/+c9o2*( vx1-vx2 )*( vx1-vx2 ) * (c1o1 + drho)-cu_sq); - (D.f[dMP0])[knw]=(c1o1-q)/(c1o1+q)*(f_SE-f_NW+(f_SE+f_NW-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_SE+f_NW)-c6o1*c1o54*( VeloX-VeloY))/(c1o1+q) - c1o54 * drho; - } - - q = q_dirNW[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = vx1 - (vx1 * nx_dirNW[k] + vx2 * ny_dirNW[k] + vx3 * nz_dirNW[k]) * nx_dirNW[k]; - VeloY = vx2 - (vx1 * nx_dirNW[k] + vx2 * ny_dirNW[k] + vx3 * nz_dirNW[k]) * ny_dirNW[k]; - //phi = fac * (one + magS / (c0p0000002+uk) * (one-q)); - //phi = phi > one ? one:phi; - //phi = fac; //Test - q = testQ; //AAAAHHHHHH bitte wieder raus nehmen!!!! - phi = fac / (q * fabs(-nx_dirNW[k] + ny_dirNW[k]) + fac); - VeloX *= phi; - VeloY *= phi; - feq=c1o54* (drho/*+three*(-vx1+vx2 )*/+c9o2*(-vx1+vx2 )*(-vx1+vx2 ) * (c1o1 + drho)-cu_sq); - (D.f[dPM0])[kse]=(c1o1-q)/(c1o1+q)*(f_NW-f_SE+(f_NW+f_SE-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_NW+f_SE)-c6o1*c1o54*(-VeloX+VeloY))/(c1o1+q) - c1o54 * drho; - } - - q = q_dirTE[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = vx1 - (vx1 * nx_dirTE[k] + vx2 * ny_dirTE[k] + vx3 * nz_dirTE[k]) * nx_dirTE[k]; - VeloZ = vx3 - (vx1 * nx_dirTE[k] + vx2 * ny_dirTE[k] + vx3 * nz_dirTE[k]) * nz_dirTE[k]; - //phi = fac * (one + magS / (c0p0000002+uk) * (one-q)); - //phi = phi > one ? one:phi; - //phi = fac; //Test - q = testQ; //AAAAHHHHHH bitte wieder raus nehmen!!!! - phi = fac / (q * fabs( nx_dirTE[k] + nz_dirTE[k]) + fac); - VeloX *= phi; - VeloZ *= phi; - feq=c1o54* (drho/*+three*( vx1 +vx3)*/+c9o2*( vx1 +vx3)*( vx1 +vx3) * (c1o1 + drho)-cu_sq); - (D.f[dM0M])[kbw]=(c1o1-q)/(c1o1+q)*(f_TE-f_BW+(f_TE+f_BW-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_TE+f_BW)-c6o1*c1o54*( VeloX+VeloZ))/(c1o1+q) - c1o54 * drho; - } - - q = q_dirBW[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = vx1 - (vx1 * nx_dirBW[k] + vx2 * ny_dirBW[k] + vx3 * nz_dirBW[k]) * nx_dirBW[k]; - VeloZ = vx3 - (vx1 * nx_dirBW[k] + vx2 * ny_dirBW[k] + vx3 * nz_dirBW[k]) * nz_dirBW[k]; - //phi = fac * (one + magS / (c0p0000002+uk) * (one-q)); - //phi = phi > one ? one:phi; - //phi = fac; //Test - q = testQ; //AAAAHHHHHH bitte wieder raus nehmen!!!! - phi = fac / (q * fabs(-nx_dirBW[k] - nz_dirBW[k]) + fac); - VeloX *= phi; - VeloZ *= phi; - feq=c1o54* (drho/*+three*(-vx1 -vx3)*/+c9o2*(-vx1 -vx3)*(-vx1 -vx3) * (c1o1 + drho)-cu_sq); - (D.f[dP0P])[kte]=(c1o1-q)/(c1o1+q)*(f_BW-f_TE+(f_BW+f_TE-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_BW+f_TE)-c6o1*c1o54*(-VeloX-VeloZ))/(c1o1+q) - c1o54 * drho; - } - - q = q_dirBE[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = vx1 - (vx1 * nx_dirBE[k] + vx2 * ny_dirBE[k] + vx3 * nz_dirBE[k]) * nx_dirBE[k]; - VeloZ = vx3 - (vx1 * nx_dirBE[k] + vx2 * ny_dirBE[k] + vx3 * nz_dirBE[k]) * nz_dirBE[k]; - //phi = fac * (one + magS / (c0p0000002+uk) * (one-q)); - //phi = phi > one ? one:phi; - //phi = fac; //Test - q = testQ; //AAAAHHHHHH bitte wieder raus nehmen!!!! - phi = fac / (q * fabs( nx_dirBE[k] - nz_dirBE[k]) + fac); - VeloX *= phi; - VeloZ *= phi; - feq=c1o54* (drho/*+three*( vx1 -vx3)*/+c9o2*( vx1 -vx3)*( vx1 -vx3) * (c1o1 + drho)-cu_sq); - (D.f[dM0P])[ktw]=(c1o1-q)/(c1o1+q)*(f_BE-f_TW+(f_BE+f_TW-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_BE+f_TW)-c6o1*c1o54*( VeloX-VeloZ))/(c1o1+q) - c1o54 * drho; - } - - q = q_dirTW[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = vx1 - (vx1 * nx_dirTW[k] + vx2 * ny_dirTW[k] + vx3 * nz_dirTW[k]) * nx_dirTW[k]; - VeloZ = vx3 - (vx1 * nx_dirTW[k] + vx2 * ny_dirTW[k] + vx3 * nz_dirTW[k]) * nz_dirTW[k]; - //phi = fac * (one + magS / (c0p0000002+uk) * (one-q)); - //phi = phi > one ? one:phi; - //phi = fac; //Test - q = testQ; //AAAAHHHHHH bitte wieder raus nehmen!!!! - phi = fac / (q * fabs(-nx_dirTW[k] + nz_dirTW[k]) + fac); - VeloX *= phi; - VeloZ *= phi; - feq=c1o54* (drho/*+three*(-vx1 +vx3)*/+c9o2*(-vx1 +vx3)*(-vx1 +vx3) * (c1o1 + drho)-cu_sq); - (D.f[dP0M])[kbe]=(c1o1-q)/(c1o1+q)*(f_TW-f_BE+(f_TW+f_BE-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_TW+f_BE)-c6o1*c1o54*(-VeloX+VeloZ))/(c1o1+q) - c1o54 * drho; - } - - q = q_dirTN[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloY = vx2 - (vx1 * nx_dirTN[k] + vx2 * ny_dirTN[k] + vx3 * nz_dirTN[k]) * ny_dirTN[k]; - VeloZ = vx3 - (vx1 * nx_dirTN[k] + vx2 * ny_dirTN[k] + vx3 * nz_dirTN[k]) * nz_dirTN[k]; - //phi = fac * (one + magS / (c0p0000002+uk) * (one-q)); - //phi = phi > one ? one:phi; - //phi = fac; //Test - q = testQ; //AAAAHHHHHH bitte wieder raus nehmen!!!! - phi = fac / (q * fabs( ny_dirTN[k] + nz_dirTN[k]) + fac); - VeloY *= phi; - VeloZ *= phi; - feq=c1o54* (drho/*+three*( vx2+vx3)*/+c9o2*( vx2+vx3)*( vx2+vx3) * (c1o1 + drho)-cu_sq); - (D.f[d0MM])[kbs]=(c1o1-q)/(c1o1+q)*(f_TN-f_BS+(f_TN+f_BS-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_TN+f_BS)-c6o1*c1o54*( VeloY+VeloZ))/(c1o1+q) - c1o54 * drho; - } - - q = q_dirBS[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloY = vx2 - (vx1 * nx_dirBS[k] + vx2 * ny_dirBS[k] + vx3 * nz_dirBS[k]) * ny_dirBS[k]; - VeloZ = vx3 - (vx1 * nx_dirBS[k] + vx2 * ny_dirBS[k] + vx3 * nz_dirBS[k]) * nz_dirBS[k]; - //phi = fac * (one + magS / (c0p0000002+uk) * (one-q)); - //phi = phi > one ? one:phi; - //phi = fac; //Test - q = testQ; //AAAAHHHHHH bitte wieder raus nehmen!!!! - phi = fac / (q * fabs(-ny_dirBS[k] - nz_dirBS[k]) + fac); - VeloY *= phi; - VeloZ *= phi; - feq=c1o54* (drho/*+three*( -vx2-vx3)*/+c9o2*( -vx2-vx3)*( -vx2-vx3) * (c1o1 + drho)-cu_sq); - (D.f[d0PP])[ktn]=(c1o1-q)/(c1o1+q)*(f_BS-f_TN+(f_BS+f_TN-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_BS+f_TN)-c6o1*c1o54*( -VeloY-VeloZ))/(c1o1+q) - c1o54 * drho; - } - - q = q_dirBN[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloY = vx2 - (vx1 * nx_dirBN[k] + vx2 * ny_dirBN[k] + vx3 * nz_dirBN[k]) * ny_dirBN[k]; - VeloZ = vx3 - (vx1 * nx_dirBN[k] + vx2 * ny_dirBN[k] + vx3 * nz_dirBN[k]) * nz_dirBN[k]; - //phi = fac * (one + magS / (c0p0000002+uk) * (one-q)); - //phi = phi > one ? one:phi; - //phi = fac; //Test - q = testQ; //AAAAHHHHHH bitte wieder raus nehmen!!!! - phi = fac / (q * fabs( ny_dirBN[k] - nz_dirBN[k]) + fac); - VeloY *= phi; - VeloZ *= phi; - feq=c1o54* (drho/*+three*( vx2-vx3)*/+c9o2*( vx2-vx3)*( vx2-vx3) * (c1o1 + drho)-cu_sq); - (D.f[d0MP])[kts]=(c1o1-q)/(c1o1+q)*(f_BN-f_TS+(f_BN+f_TS-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_BN+f_TS)-c6o1*c1o54*( VeloY-VeloZ))/(c1o1+q) - c1o54 * drho; - } - - q = q_dirTS[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloY = vx2 - (vx1 * nx_dirTS[k] + vx2 * ny_dirTS[k] + vx3 * nz_dirTS[k]) * ny_dirTS[k]; - VeloZ = vx3 - (vx1 * nx_dirTS[k] + vx2 * ny_dirTS[k] + vx3 * nz_dirTS[k]) * nz_dirTS[k]; - //phi = fac * (one + magS / (c0p0000002+uk) * (one-q)); - //phi = phi > one ? one:phi; - //phi = fac; //Test - q = testQ; //AAAAHHHHHH bitte wieder raus nehmen!!!! - phi = fac / (q * fabs(-ny_dirTS[k] + nz_dirTS[k]) + fac); - VeloY *= phi; - VeloZ *= phi; - feq=c1o54* (drho/*+three*( -vx2+vx3)*/+c9o2*( -vx2+vx3)*( -vx2+vx3) * (c1o1 + drho)-cu_sq); - (D.f[d0PM])[kbn]=(c1o1-q)/(c1o1+q)*(f_TS-f_BN+(f_TS+f_BN-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_TS+f_BN)-c6o1*c1o54*( -VeloY+VeloZ))/(c1o1+q) - c1o54 * drho; - } - - q = q_dirTNE[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = vx1 - (vx1 * nx_dirTNE[k] + vx2 * ny_dirTNE[k] + vx3 * nz_dirTNE[k]) * nx_dirTNE[k]; - VeloY = vx2 - (vx1 * nx_dirTNE[k] + vx2 * ny_dirTNE[k] + vx3 * nz_dirTNE[k]) * ny_dirTNE[k]; - VeloZ = vx3 - (vx1 * nx_dirTNE[k] + vx2 * ny_dirTNE[k] + vx3 * nz_dirTNE[k]) * nz_dirTNE[k]; - //phi = fac * (one + magS / (c0p0000002+uk) * (one-q)); - //phi = phi > one ? one:phi; - //phi = fac; //Test - q = testQ; //AAAAHHHHHH bitte wieder raus nehmen!!!! - phi = fac / (q * fabs( nx_dirTNE[k] + ny_dirTNE[k] + nz_dirTNE[k]) + fac); - VeloX *= phi; - VeloY *= phi; - VeloZ *= phi; - feq=c1o216*(drho/*+three*( vx1+vx2+vx3)*/+c9o2*( vx1+vx2+vx3)*( vx1+vx2+vx3) * (c1o1 + drho)-cu_sq); - (D.f[dMMM])[kbsw]=(c1o1-q)/(c1o1+q)*(f_TNE-f_BSW+(f_TNE+f_BSW-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_TNE+f_BSW)-c6o1*c1o216*( VeloX+VeloY+VeloZ))/(c1o1+q) - c1o216 * drho; - } - - q = q_dirBSW[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = vx1 - (vx1 * nx_dirBSW[k] + vx2 * ny_dirBSW[k] + vx3 * nz_dirBSW[k]) * nx_dirBSW[k]; - VeloY = vx2 - (vx1 * nx_dirBSW[k] + vx2 * ny_dirBSW[k] + vx3 * nz_dirBSW[k]) * ny_dirBSW[k]; - VeloZ = vx3 - (vx1 * nx_dirBSW[k] + vx2 * ny_dirBSW[k] + vx3 * nz_dirBSW[k]) * nz_dirBSW[k]; - //phi = fac * (one + magS / (c0p0000002+uk) * (one-q)); - //phi = phi > one ? one:phi; - //phi = fac; //Test - q = testQ; //AAAAHHHHHH bitte wieder raus nehmen!!!! - phi = fac / (q * fabs(-nx_dirBSW[k] - ny_dirBSW[k] - nz_dirBSW[k]) + fac); - VeloX *= phi; - VeloY *= phi; - VeloZ *= phi; - feq=c1o216*(drho/*+three*(-vx1-vx2-vx3)*/+c9o2*(-vx1-vx2-vx3)*(-vx1-vx2-vx3) * (c1o1 + drho)-cu_sq); - (D.f[dPPP])[ktne]=(c1o1-q)/(c1o1+q)*(f_BSW-f_TNE+(f_BSW+f_TNE-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_BSW+f_TNE)-c6o1*c1o216*(-VeloX-VeloY-VeloZ))/(c1o1+q) - c1o216 * drho; - } - - q = q_dirBNE[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = vx1 - (vx1 * nx_dirBNE[k] + vx2 * ny_dirBNE[k] + vx3 * nz_dirBNE[k]) * nx_dirBNE[k]; - VeloY = vx2 - (vx1 * nx_dirBNE[k] + vx2 * ny_dirBNE[k] + vx3 * nz_dirBNE[k]) * ny_dirBNE[k]; - VeloZ = vx3 - (vx1 * nx_dirBNE[k] + vx2 * ny_dirBNE[k] + vx3 * nz_dirBNE[k]) * nz_dirBNE[k]; - //phi = fac * (one + magS / (c0p0000002+uk) * (one-q)); - //phi = phi > one ? one:phi; - //phi = fac; //Test - q = testQ; //AAAAHHHHHH bitte wieder raus nehmen!!!! - phi = fac / (q * fabs( nx_dirBNE[k] + ny_dirBNE[k] - nz_dirBNE[k]) + fac); - VeloX *= phi; - VeloY *= phi; - VeloZ *= phi; - feq=c1o216*(drho/*+three*( vx1+vx2-vx3)*/+c9o2*( vx1+vx2-vx3)*( vx1+vx2-vx3) * (c1o1 + drho)-cu_sq); - (D.f[dMMP])[ktsw]=(c1o1-q)/(c1o1+q)*(f_BNE-f_TSW+(f_BNE+f_TSW-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_BNE+f_TSW)-c6o1*c1o216*( VeloX+VeloY-VeloZ))/(c1o1+q) - c1o216 * drho; - } - - q = q_dirTSW[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = vx1 - (vx1 * nx_dirTSW[k] + vx2 * ny_dirTSW[k] + vx3 * nz_dirTSW[k]) * nx_dirTSW[k]; - VeloY = vx2 - (vx1 * nx_dirTSW[k] + vx2 * ny_dirTSW[k] + vx3 * nz_dirTSW[k]) * ny_dirTSW[k]; - VeloZ = vx3 - (vx1 * nx_dirTSW[k] + vx2 * ny_dirTSW[k] + vx3 * nz_dirTSW[k]) * nz_dirTSW[k]; - //phi = fac * (one + magS / (c0p0000002+uk) * (one-q)); - //phi = phi > one ? one:phi; - //phi = fac; //Test - q = testQ; //AAAAHHHHHH bitte wieder raus nehmen!!!! - phi = fac / (q * fabs(-nx_dirTSW[k] - ny_dirTSW[k] + nz_dirTSW[k]) + fac); - VeloX *= phi; - VeloY *= phi; - VeloZ *= phi; - feq=c1o216*(drho/*+three*(-vx1-vx2+vx3)*/+c9o2*(-vx1-vx2+vx3)*(-vx1-vx2+vx3) * (c1o1 + drho)-cu_sq); - (D.f[dPPM])[kbne]=(c1o1-q)/(c1o1+q)*(f_TSW-f_BNE+(f_TSW+f_BNE-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_TSW+f_BNE)-c6o1*c1o216*(-VeloX-VeloY+VeloZ))/(c1o1+q) - c1o216 * drho; - } - - q = q_dirTSE[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = vx1 - (vx1 * nx_dirTSE[k] + vx2 * ny_dirTSE[k] + vx3 * nz_dirTSE[k]) * nx_dirTSE[k]; - VeloY = vx2 - (vx1 * nx_dirTSE[k] + vx2 * ny_dirTSE[k] + vx3 * nz_dirTSE[k]) * ny_dirTSE[k]; - VeloZ = vx3 - (vx1 * nx_dirTSE[k] + vx2 * ny_dirTSE[k] + vx3 * nz_dirTSE[k]) * nz_dirTSE[k]; - //phi = fac * (one + magS / (c0p0000002+uk) * (one-q)); - //phi = phi > one ? one:phi; - //phi = fac; //Test - q = testQ; //AAAAHHHHHH bitte wieder raus nehmen!!!! - phi = fac / (q * fabs( nx_dirTSE[k] - ny_dirTSE[k] + nz_dirTSE[k]) + fac); - VeloX *= phi; - VeloY *= phi; - VeloZ *= phi; - feq=c1o216*(drho/*+three*( vx1-vx2+vx3)*/+c9o2*( vx1-vx2+vx3)*( vx1-vx2+vx3) * (c1o1 + drho)-cu_sq); - (D.f[dMPM])[kbnw]=(c1o1-q)/(c1o1+q)*(f_TSE-f_BNW+(f_TSE+f_BNW-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_TSE+f_BNW)-c6o1*c1o216*( VeloX-VeloY+VeloZ))/(c1o1+q) - c1o216 * drho; - } - - q = q_dirBNW[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = vx1 - (vx1 * nx_dirBNW[k] + vx2 * ny_dirBNW[k] + vx3 * nz_dirBNW[k]) * nx_dirBNW[k]; - VeloY = vx2 - (vx1 * nx_dirBNW[k] + vx2 * ny_dirBNW[k] + vx3 * nz_dirBNW[k]) * ny_dirBNW[k]; - VeloZ = vx3 - (vx1 * nx_dirBNW[k] + vx2 * ny_dirBNW[k] + vx3 * nz_dirBNW[k]) * nz_dirBNW[k]; - //phi = fac * (one + magS / (c0p0000002+uk) * (one-q)); - //phi = phi > one ? one:phi; - //phi = fac; //Test - q = testQ; //AAAAHHHHHH bitte wieder raus nehmen!!!! - phi = fac / (q * fabs(-nx_dirBNW[k] + ny_dirBNW[k] - nz_dirBNW[k]) + fac); - VeloX *= phi; - VeloY *= phi; - VeloZ *= phi; - feq=c1o216*(drho/*+three*(-vx1+vx2-vx3)*/+c9o2*(-vx1+vx2-vx3)*(-vx1+vx2-vx3) * (c1o1 + drho)-cu_sq); - (D.f[dPMP])[ktse]=(c1o1-q)/(c1o1+q)*(f_BNW-f_TSE+(f_BNW+f_TSE-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_BNW+f_TSE)-c6o1*c1o216*(-VeloX+VeloY-VeloZ))/(c1o1+q) - c1o216 * drho; - } - - q = q_dirBSE[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = vx1 - (vx1 * nx_dirBSE[k] + vx2 * ny_dirBSE[k] + vx3 * nz_dirBSE[k]) * nx_dirBSE[k]; - VeloY = vx2 - (vx1 * nx_dirBSE[k] + vx2 * ny_dirBSE[k] + vx3 * nz_dirBSE[k]) * ny_dirBSE[k]; - VeloZ = vx3 - (vx1 * nx_dirBSE[k] + vx2 * ny_dirBSE[k] + vx3 * nz_dirBSE[k]) * nz_dirBSE[k]; - //phi = fac * (one + magS / (c0p0000002+uk) * (one-q)); - //phi = (phi > one) ? one:phi; - //phi = fac; //Test - q = testQ; //AAAAHHHHHH bitte wieder raus nehmen!!!! - phi = fac / (q * fabs( nx_dirBSE[k] - ny_dirBSE[k] - nz_dirBSE[k]) + fac); - VeloX *= phi; - VeloY *= phi; - VeloZ *= phi; - feq=c1o216*(drho/*+three*( vx1-vx2-vx3)*/+c9o2*( vx1-vx2-vx3)*( vx1-vx2-vx3) * (c1o1 + drho)-cu_sq); - (D.f[dMPP])[ktnw]=(c1o1-q)/(c1o1+q)*(f_BSE-f_TNW+(f_BSE+f_TNW-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_BSE+f_TNW)-c6o1*c1o216*( VeloX-VeloY-VeloZ))/(c1o1+q) - c1o216 * drho; - } - - q = q_dirTNW[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = vx1 - (vx1 * nx_dirTNW[k] + vx2 * ny_dirTNW[k] + vx3 * nz_dirTNW[k]) * nx_dirTNW[k]; - VeloY = vx2 - (vx1 * nx_dirTNW[k] + vx2 * ny_dirTNW[k] + vx3 * nz_dirTNW[k]) * ny_dirTNW[k]; - VeloZ = vx3 - (vx1 * nx_dirTNW[k] + vx2 * ny_dirTNW[k] + vx3 * nz_dirTNW[k]) * nz_dirTNW[k]; - //phi = fac * (one + magS / (c0p0000002+uk) * (one-q)); - //phi = phi > one ? one:phi; - //phi = fac; //Test - q = testQ; //AAAAHHHHHH bitte wieder raus nehmen!!!! - phi = fac / (q * fabs(-nx_dirTNW[k] + ny_dirTNW[k] + nz_dirTNW[k]) + fac); - VeloX *= phi; - VeloY *= phi; - VeloZ *= phi; - feq=c1o216*(drho/*+three*(-vx1+vx2+vx3)*/+c9o2*(-vx1+vx2+vx3)*(-vx1+vx2+vx3) * (c1o1 + drho)-cu_sq); - (D.f[dPMM])[kbse]=(c1o1-q)/(c1o1+q)*(f_TNW-f_BSE+(f_TNW+f_BSE-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_TNW+f_BSE)-c6o1*c1o216*(-VeloX+VeloY+VeloZ))/(c1o1+q) - c1o216 * drho; - } - } -} -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -////////////////////////////////////////////////////////////////////////////// -__global__ void QSlipNormDeviceComp27( - real* DD, - int* k_Q, - real* QQ, - unsigned int numberOfBCnodes, - real om1, - real* NormalX, - real* NormalY, - real* NormalZ, - unsigned int* neighborX, - unsigned int* neighborY, - unsigned int* neighborZ, - unsigned long long numberOfLBnodes, - bool isEvenTimestep) -{ - Distributions27 D; - if (isEvenTimestep==true) - { - D.f[dP00] = &DD[dP00 * numberOfLBnodes]; - D.f[dM00] = &DD[dM00 * numberOfLBnodes]; - D.f[d0P0] = &DD[d0P0 * numberOfLBnodes]; - D.f[d0M0] = &DD[d0M0 * numberOfLBnodes]; - D.f[d00P] = &DD[d00P * numberOfLBnodes]; - D.f[d00M] = &DD[d00M * numberOfLBnodes]; - D.f[dPP0] = &DD[dPP0 * numberOfLBnodes]; - D.f[dMM0] = &DD[dMM0 * numberOfLBnodes]; - D.f[dPM0] = &DD[dPM0 * numberOfLBnodes]; - D.f[dMP0] = &DD[dMP0 * numberOfLBnodes]; - D.f[dP0P] = &DD[dP0P * numberOfLBnodes]; - D.f[dM0M] = &DD[dM0M * numberOfLBnodes]; - D.f[dP0M] = &DD[dP0M * numberOfLBnodes]; - D.f[dM0P] = &DD[dM0P * numberOfLBnodes]; - D.f[d0PP] = &DD[d0PP * numberOfLBnodes]; - D.f[d0MM] = &DD[d0MM * numberOfLBnodes]; - D.f[d0PM] = &DD[d0PM * numberOfLBnodes]; - D.f[d0MP] = &DD[d0MP * numberOfLBnodes]; - D.f[d000] = &DD[d000 * numberOfLBnodes]; - D.f[dPPP] = &DD[dPPP * numberOfLBnodes]; - D.f[dMMP] = &DD[dMMP * numberOfLBnodes]; - D.f[dPMP] = &DD[dPMP * numberOfLBnodes]; - D.f[dMPP] = &DD[dMPP * numberOfLBnodes]; - D.f[dPPM] = &DD[dPPM * numberOfLBnodes]; - D.f[dMMM] = &DD[dMMM * numberOfLBnodes]; - D.f[dPMM] = &DD[dPMM * numberOfLBnodes]; - D.f[dMPM] = &DD[dMPM * numberOfLBnodes]; - } - else - { - D.f[dM00] = &DD[dP00 * numberOfLBnodes]; - D.f[dP00] = &DD[dM00 * numberOfLBnodes]; - D.f[d0M0] = &DD[d0P0 * numberOfLBnodes]; - D.f[d0P0] = &DD[d0M0 * numberOfLBnodes]; - D.f[d00M] = &DD[d00P * numberOfLBnodes]; - D.f[d00P] = &DD[d00M * numberOfLBnodes]; - D.f[dMM0] = &DD[dPP0 * numberOfLBnodes]; - D.f[dPP0] = &DD[dMM0 * numberOfLBnodes]; - D.f[dMP0] = &DD[dPM0 * numberOfLBnodes]; - D.f[dPM0] = &DD[dMP0 * numberOfLBnodes]; - D.f[dM0M] = &DD[dP0P * numberOfLBnodes]; - D.f[dP0P] = &DD[dM0M * numberOfLBnodes]; - D.f[dM0P] = &DD[dP0M * numberOfLBnodes]; - D.f[dP0M] = &DD[dM0P * numberOfLBnodes]; - D.f[d0MM] = &DD[d0PP * numberOfLBnodes]; - D.f[d0PP] = &DD[d0MM * numberOfLBnodes]; - D.f[d0MP] = &DD[d0PM * numberOfLBnodes]; - D.f[d0PM] = &DD[d0MP * numberOfLBnodes]; - D.f[d000] = &DD[d000 * numberOfLBnodes]; - D.f[dPPP] = &DD[dMMM * numberOfLBnodes]; - D.f[dMMP] = &DD[dPPM * numberOfLBnodes]; - D.f[dPMP] = &DD[dMPM * numberOfLBnodes]; - D.f[dMPP] = &DD[dPMM * numberOfLBnodes]; - D.f[dPPM] = &DD[dMMP * numberOfLBnodes]; - D.f[dMMM] = &DD[dPPP * numberOfLBnodes]; - D.f[dPMM] = &DD[dMPP * numberOfLBnodes]; - D.f[dMPM] = &DD[dPMP * numberOfLBnodes]; - } - //////////////////////////////////////////////////////////////////////////////// - const unsigned x = threadIdx.x; // Globaler x-Index - const unsigned y = blockIdx.x; // Globaler y-Index - const unsigned z = blockIdx.y; // Globaler z-Index - - const unsigned nx = blockDim.x; - const unsigned ny = gridDim.x; - - const unsigned k = nx*(ny*z + y) + x; - ////////////////////////////////////////////////////////////////////////// - - if(k< numberOfBCnodes) - { - //////////////////////////////////////////////////////////////////////////////// - real *q_dirE, *q_dirW, *q_dirN, *q_dirS, *q_dirT, *q_dirB, - *q_dirNE, *q_dirSW, *q_dirSE, *q_dirNW, *q_dirTE, *q_dirBW, - *q_dirBE, *q_dirTW, *q_dirTN, *q_dirBS, *q_dirBN, *q_dirTS, - *q_dirTNE, *q_dirTSW, *q_dirTSE, *q_dirTNW, *q_dirBNE, *q_dirBSW, - *q_dirBSE, *q_dirBNW; - q_dirE = &QQ[dP00 * numberOfBCnodes]; - q_dirW = &QQ[dM00 * numberOfBCnodes]; - q_dirN = &QQ[d0P0 * numberOfBCnodes]; - q_dirS = &QQ[d0M0 * numberOfBCnodes]; - q_dirT = &QQ[d00P * numberOfBCnodes]; - q_dirB = &QQ[d00M * numberOfBCnodes]; - q_dirNE = &QQ[dPP0 * numberOfBCnodes]; - q_dirSW = &QQ[dMM0 * numberOfBCnodes]; - q_dirSE = &QQ[dPM0 * numberOfBCnodes]; - q_dirNW = &QQ[dMP0 * numberOfBCnodes]; - q_dirTE = &QQ[dP0P * numberOfBCnodes]; - q_dirBW = &QQ[dM0M * numberOfBCnodes]; - q_dirBE = &QQ[dP0M * numberOfBCnodes]; - q_dirTW = &QQ[dM0P * numberOfBCnodes]; - q_dirTN = &QQ[d0PP * numberOfBCnodes]; - q_dirBS = &QQ[d0MM * numberOfBCnodes]; - q_dirBN = &QQ[d0PM * numberOfBCnodes]; - q_dirTS = &QQ[d0MP * numberOfBCnodes]; - q_dirTNE = &QQ[dPPP * numberOfBCnodes]; - q_dirTSW = &QQ[dMMP * numberOfBCnodes]; - q_dirTSE = &QQ[dPMP * numberOfBCnodes]; - q_dirTNW = &QQ[dMPP * numberOfBCnodes]; - q_dirBNE = &QQ[dPPM * numberOfBCnodes]; - q_dirBSW = &QQ[dMMM * numberOfBCnodes]; - q_dirBSE = &QQ[dPMM * numberOfBCnodes]; - q_dirBNW = &QQ[dMPM * numberOfBCnodes]; - //////////////////////////////////////////////////////////////////////////////// - real *nx_dirE, *nx_dirW, *nx_dirN, *nx_dirS, *nx_dirT, *nx_dirB, - *nx_dirNE, *nx_dirSW, *nx_dirSE, *nx_dirNW, *nx_dirTE, *nx_dirBW, - *nx_dirBE, *nx_dirTW, *nx_dirTN, *nx_dirBS, *nx_dirBN, *nx_dirTS, - *nx_dirTNE, *nx_dirTSW, *nx_dirTSE, *nx_dirTNW, *nx_dirBNE, *nx_dirBSW, - *nx_dirBSE, *nx_dirBNW; - nx_dirE = &NormalX[dP00 * numberOfBCnodes]; - nx_dirW = &NormalX[dM00 * numberOfBCnodes]; - nx_dirN = &NormalX[d0P0 * numberOfBCnodes]; - nx_dirS = &NormalX[d0M0 * numberOfBCnodes]; - nx_dirT = &NormalX[d00P * numberOfBCnodes]; - nx_dirB = &NormalX[d00M * numberOfBCnodes]; - nx_dirNE = &NormalX[dPP0 * numberOfBCnodes]; - nx_dirSW = &NormalX[dMM0 * numberOfBCnodes]; - nx_dirSE = &NormalX[dPM0 * numberOfBCnodes]; - nx_dirNW = &NormalX[dMP0 * numberOfBCnodes]; - nx_dirTE = &NormalX[dP0P * numberOfBCnodes]; - nx_dirBW = &NormalX[dM0M * numberOfBCnodes]; - nx_dirBE = &NormalX[dP0M * numberOfBCnodes]; - nx_dirTW = &NormalX[dM0P * numberOfBCnodes]; - nx_dirTN = &NormalX[d0PP * numberOfBCnodes]; - nx_dirBS = &NormalX[d0MM * numberOfBCnodes]; - nx_dirBN = &NormalX[d0PM * numberOfBCnodes]; - nx_dirTS = &NormalX[d0MP * numberOfBCnodes]; - nx_dirTNE = &NormalX[dPPP * numberOfBCnodes]; - nx_dirTSW = &NormalX[dMMP * numberOfBCnodes]; - nx_dirTSE = &NormalX[dPMP * numberOfBCnodes]; - nx_dirTNW = &NormalX[dMPP * numberOfBCnodes]; - nx_dirBNE = &NormalX[dPPM * numberOfBCnodes]; - nx_dirBSW = &NormalX[dMMM * numberOfBCnodes]; - nx_dirBSE = &NormalX[dPMM * numberOfBCnodes]; - nx_dirBNW = &NormalX[dMPM * numberOfBCnodes]; - //////////////////////////////////////////////////////////////////////////////// - real *ny_dirE, *ny_dirW, *ny_dirN, *ny_dirS, *ny_dirT, *ny_dirB, - *ny_dirNE, *ny_dirSW, *ny_dirSE, *ny_dirNW, *ny_dirTE, *ny_dirBW, - *ny_dirBE, *ny_dirTW, *ny_dirTN, *ny_dirBS, *ny_dirBN, *ny_dirTS, - *ny_dirTNE, *ny_dirTSW, *ny_dirTSE, *ny_dirTNW, *ny_dirBNE, *ny_dirBSW, - *ny_dirBSE, *ny_dirBNW; - ny_dirE = &NormalY[dP00 * numberOfBCnodes]; - ny_dirW = &NormalY[dM00 * numberOfBCnodes]; - ny_dirN = &NormalY[d0P0 * numberOfBCnodes]; - ny_dirS = &NormalY[d0M0 * numberOfBCnodes]; - ny_dirT = &NormalY[d00P * numberOfBCnodes]; - ny_dirB = &NormalY[d00M * numberOfBCnodes]; - ny_dirNE = &NormalY[dPP0 * numberOfBCnodes]; - ny_dirSW = &NormalY[dMM0 * numberOfBCnodes]; - ny_dirSE = &NormalY[dPM0 * numberOfBCnodes]; - ny_dirNW = &NormalY[dMP0 * numberOfBCnodes]; - ny_dirTE = &NormalY[dP0P * numberOfBCnodes]; - ny_dirBW = &NormalY[dM0M * numberOfBCnodes]; - ny_dirBE = &NormalY[dP0M * numberOfBCnodes]; - ny_dirTW = &NormalY[dM0P * numberOfBCnodes]; - ny_dirTN = &NormalY[d0PP * numberOfBCnodes]; - ny_dirBS = &NormalY[d0MM * numberOfBCnodes]; - ny_dirBN = &NormalY[d0PM * numberOfBCnodes]; - ny_dirTS = &NormalY[d0MP * numberOfBCnodes]; - ny_dirTNE = &NormalY[dPPP * numberOfBCnodes]; - ny_dirTSW = &NormalY[dMMP * numberOfBCnodes]; - ny_dirTSE = &NormalY[dPMP * numberOfBCnodes]; - ny_dirTNW = &NormalY[dMPP * numberOfBCnodes]; - ny_dirBNE = &NormalY[dPPM * numberOfBCnodes]; - ny_dirBSW = &NormalY[dMMM * numberOfBCnodes]; - ny_dirBSE = &NormalY[dPMM * numberOfBCnodes]; - ny_dirBNW = &NormalY[dMPM * numberOfBCnodes]; - //////////////////////////////////////////////////////////////////////////////// - real *nz_dirE, *nz_dirW, *nz_dirN, *nz_dirS, *nz_dirT, *nz_dirB, - *nz_dirNE, *nz_dirSW, *nz_dirSE, *nz_dirNW, *nz_dirTE, *nz_dirBW, - *nz_dirBE, *nz_dirTW, *nz_dirTN, *nz_dirBS, *nz_dirBN, *nz_dirTS, - *nz_dirTNE, *nz_dirTSW, *nz_dirTSE, *nz_dirTNW, *nz_dirBNE, *nz_dirBSW, - *nz_dirBSE, *nz_dirBNW; - nz_dirE = &NormalZ[dP00 * numberOfBCnodes]; - nz_dirW = &NormalZ[dM00 * numberOfBCnodes]; - nz_dirN = &NormalZ[d0P0 * numberOfBCnodes]; - nz_dirS = &NormalZ[d0M0 * numberOfBCnodes]; - nz_dirT = &NormalZ[d00P * numberOfBCnodes]; - nz_dirB = &NormalZ[d00M * numberOfBCnodes]; - nz_dirNE = &NormalZ[dPP0 * numberOfBCnodes]; - nz_dirSW = &NormalZ[dMM0 * numberOfBCnodes]; - nz_dirSE = &NormalZ[dPM0 * numberOfBCnodes]; - nz_dirNW = &NormalZ[dMP0 * numberOfBCnodes]; - nz_dirTE = &NormalZ[dP0P * numberOfBCnodes]; - nz_dirBW = &NormalZ[dM0M * numberOfBCnodes]; - nz_dirBE = &NormalZ[dP0M * numberOfBCnodes]; - nz_dirTW = &NormalZ[dM0P * numberOfBCnodes]; - nz_dirTN = &NormalZ[d0PP * numberOfBCnodes]; - nz_dirBS = &NormalZ[d0MM * numberOfBCnodes]; - nz_dirBN = &NormalZ[d0PM * numberOfBCnodes]; - nz_dirTS = &NormalZ[d0MP * numberOfBCnodes]; - nz_dirTNE = &NormalZ[dPPP * numberOfBCnodes]; - nz_dirTSW = &NormalZ[dMMP * numberOfBCnodes]; - nz_dirTSE = &NormalZ[dPMP * numberOfBCnodes]; - nz_dirTNW = &NormalZ[dMPP * numberOfBCnodes]; - nz_dirBNE = &NormalZ[dPPM * numberOfBCnodes]; - nz_dirBSW = &NormalZ[dMMM * numberOfBCnodes]; - nz_dirBSE = &NormalZ[dPMM * numberOfBCnodes]; - nz_dirBNW = &NormalZ[dMPM * numberOfBCnodes]; - //////////////////////////////////////////////////////////////////////////////// - //index - unsigned int KQK = k_Q[k]; - unsigned int kzero= KQK; - unsigned int ke = KQK; - unsigned int kw = neighborX[KQK]; - unsigned int kn = KQK; - unsigned int ks = neighborY[KQK]; - unsigned int kt = KQK; - unsigned int kb = neighborZ[KQK]; - unsigned int ksw = neighborY[kw]; - unsigned int kne = KQK; - unsigned int kse = ks; - unsigned int knw = kw; - unsigned int kbw = neighborZ[kw]; - unsigned int kte = KQK; - unsigned int kbe = kb; - unsigned int ktw = kw; - unsigned int kbs = neighborZ[ks]; - unsigned int ktn = KQK; - unsigned int kbn = kb; - unsigned int kts = ks; - unsigned int ktse = ks; - unsigned int kbnw = kbw; - unsigned int ktnw = kw; - unsigned int kbse = kbs; - unsigned int ktsw = ksw; - unsigned int kbne = kb; - unsigned int ktne = KQK; - unsigned int kbsw = neighborZ[ksw]; - //////////////////////////////////////////////////////////////////////////////// - real f_W = (D.f[dP00])[ke ]; - real f_E = (D.f[dM00])[kw ]; - real f_S = (D.f[d0P0])[kn ]; - real f_N = (D.f[d0M0])[ks ]; - real f_B = (D.f[d00P])[kt ]; - real f_T = (D.f[d00M])[kb ]; - real f_SW = (D.f[dPP0])[kne ]; - real f_NE = (D.f[dMM0])[ksw ]; - real f_NW = (D.f[dPM0])[kse ]; - real f_SE = (D.f[dMP0])[knw ]; - real f_BW = (D.f[dP0P])[kte ]; - real f_TE = (D.f[dM0M])[kbw ]; - real f_TW = (D.f[dP0M])[kbe ]; - real f_BE = (D.f[dM0P])[ktw ]; - real f_BS = (D.f[d0PP])[ktn ]; - real f_TN = (D.f[d0MM])[kbs ]; - real f_TS = (D.f[d0PM])[kbn ]; - real f_BN = (D.f[d0MP])[kts ]; - real f_BSW = (D.f[dPPP])[ktne ]; - real f_BNE = (D.f[dMMP])[ktsw ]; - real f_BNW = (D.f[dPMP])[ktse ]; - real f_BSE = (D.f[dMPP])[ktnw ]; - real f_TSW = (D.f[dPPM])[kbne ]; - real f_TNE = (D.f[dMMM])[kbsw ]; - real f_TNW = (D.f[dPMM])[kbse ]; - real f_TSE = (D.f[dMPM])[kbnw ]; - //////////////////////////////////////////////////////////////////////////////// - real vx1, vx2, vx3, drho, feq, q; - drho = f_TSE + f_TNW + f_TNE + f_TSW + f_BSE + f_BNW + f_BNE + f_BSW + - f_BN + f_TS + f_TN + f_BS + f_BE + f_TW + f_TE + f_BW + f_SE + f_NW + f_NE + f_SW + - f_T + f_B + f_N + f_S + f_E + f_W + ((D.f[d000])[kzero]); - - vx1 = (((f_TSE - f_BNW) - (f_TNW - f_BSE)) + ((f_TNE - f_BSW) - (f_TSW - f_BNE)) + - ((f_BE - f_TW) + (f_TE - f_BW)) + ((f_SE - f_NW) + (f_NE - f_SW)) + - (f_E - f_W)) / (c1o1 + drho); - - - vx2 = ((-(f_TSE - f_BNW) + (f_TNW - f_BSE)) + ((f_TNE - f_BSW) - (f_TSW - f_BNE)) + - ((f_BN - f_TS) + (f_TN - f_BS)) + (-(f_SE - f_NW) + (f_NE - f_SW)) + - (f_N - f_S)) / (c1o1 + drho); - - vx3 = (((f_TSE - f_BNW) + (f_TNW - f_BSE)) + ((f_TNE - f_BSW) + (f_TSW - f_BNE)) + - (-(f_BN - f_TS) + (f_TN - f_BS)) + ((f_TE - f_BW) - (f_BE - f_TW)) + - (f_T - f_B)) / (c1o1 + drho); - - real cu_sq=c3o2*(vx1*vx1+vx2*vx2+vx3*vx3) * (c1o1 + drho); - - ////////////////////////////////////////////////////////////////////////// - if (isEvenTimestep==false) - { - D.f[dP00] = &DD[dP00 * numberOfLBnodes]; - D.f[dM00] = &DD[dM00 * numberOfLBnodes]; - D.f[d0P0] = &DD[d0P0 * numberOfLBnodes]; - D.f[d0M0] = &DD[d0M0 * numberOfLBnodes]; - D.f[d00P] = &DD[d00P * numberOfLBnodes]; - D.f[d00M] = &DD[d00M * numberOfLBnodes]; - D.f[dPP0] = &DD[dPP0 * numberOfLBnodes]; - D.f[dMM0] = &DD[dMM0 * numberOfLBnodes]; - D.f[dPM0] = &DD[dPM0 * numberOfLBnodes]; - D.f[dMP0] = &DD[dMP0 * numberOfLBnodes]; - D.f[dP0P] = &DD[dP0P * numberOfLBnodes]; - D.f[dM0M] = &DD[dM0M * numberOfLBnodes]; - D.f[dP0M] = &DD[dP0M * numberOfLBnodes]; - D.f[dM0P] = &DD[dM0P * numberOfLBnodes]; - D.f[d0PP] = &DD[d0PP * numberOfLBnodes]; - D.f[d0MM] = &DD[d0MM * numberOfLBnodes]; - D.f[d0PM] = &DD[d0PM * numberOfLBnodes]; - D.f[d0MP] = &DD[d0MP * numberOfLBnodes]; - D.f[d000] = &DD[d000 * numberOfLBnodes]; - D.f[dPPP] = &DD[dPPP * numberOfLBnodes]; - D.f[dMMP] = &DD[dMMP * numberOfLBnodes]; - D.f[dPMP] = &DD[dPMP * numberOfLBnodes]; - D.f[dMPP] = &DD[dMPP * numberOfLBnodes]; - D.f[dPPM] = &DD[dPPM * numberOfLBnodes]; - D.f[dMMM] = &DD[dMMM * numberOfLBnodes]; - D.f[dPMM] = &DD[dPMM * numberOfLBnodes]; - D.f[dMPM] = &DD[dMPM * numberOfLBnodes]; - } - else - { - D.f[dM00] = &DD[dP00 * numberOfLBnodes]; - D.f[dP00] = &DD[dM00 * numberOfLBnodes]; - D.f[d0M0] = &DD[d0P0 * numberOfLBnodes]; - D.f[d0P0] = &DD[d0M0 * numberOfLBnodes]; - D.f[d00M] = &DD[d00P * numberOfLBnodes]; - D.f[d00P] = &DD[d00M * numberOfLBnodes]; - D.f[dMM0] = &DD[dPP0 * numberOfLBnodes]; - D.f[dPP0] = &DD[dMM0 * numberOfLBnodes]; - D.f[dMP0] = &DD[dPM0 * numberOfLBnodes]; - D.f[dPM0] = &DD[dMP0 * numberOfLBnodes]; - D.f[dM0M] = &DD[dP0P * numberOfLBnodes]; - D.f[dP0P] = &DD[dM0M * numberOfLBnodes]; - D.f[dM0P] = &DD[dP0M * numberOfLBnodes]; - D.f[dP0M] = &DD[dM0P * numberOfLBnodes]; - D.f[d0MM] = &DD[d0PP * numberOfLBnodes]; - D.f[d0PP] = &DD[d0MM * numberOfLBnodes]; - D.f[d0MP] = &DD[d0PM * numberOfLBnodes]; - D.f[d0PM] = &DD[d0MP * numberOfLBnodes]; - D.f[d000] = &DD[d000 * numberOfLBnodes]; - D.f[dPPP] = &DD[dMMM * numberOfLBnodes]; - D.f[dMMP] = &DD[dPPM * numberOfLBnodes]; - D.f[dPMP] = &DD[dMPM * numberOfLBnodes]; - D.f[dMPP] = &DD[dPMM * numberOfLBnodes]; - D.f[dPPM] = &DD[dMMP * numberOfLBnodes]; - D.f[dMMM] = &DD[dPPP * numberOfLBnodes]; - D.f[dPMM] = &DD[dMPP * numberOfLBnodes]; - D.f[dMPM] = &DD[dPMP * numberOfLBnodes]; - } - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - real VeloX = vx1; - real VeloY = vx2; - real VeloZ = vx3; - real fac = c1o100;//0.5; - //real phi = c0o1; - real alpha = c1o100; - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - real kxyFromfcNEQ = -(c3o1 * om1 / (c1o1-om1))*((f_SW+f_BSW+f_TSW-f_NW-f_BNW-f_TNW-f_SE-f_BSE-f_TSE+f_NE+f_BNE+f_TNE ) / (c1o1 + drho) - ((vx1*vx2))); - real kyzFromfcNEQ = -(c3o1 * om1 / (c1o1-om1))*((f_BS+f_BSE+f_BSW-f_TS-f_TSE-f_TSW-f_BN-f_BNE-f_BNW+f_TN+f_TNE+f_TNW ) / (c1o1 + drho) - ((vx2*vx3))); - real kxzFromfcNEQ = -(c3o1 * om1 / (c1o1-om1))*((f_BW+f_BSW+f_BNW-f_TW-f_TSW-f_TNW-f_BE-f_BSE-f_BNE+f_TE+f_TSE+f_TNE ) / (c1o1 + drho) - ((vx1*vx3))); - - real kxxFromfcNEQ = -(c3o1 * om1 / (c1o1-om1))*((f_E+f_NE+f_SE+f_TE+f_BE+f_W+f_NW+f_SW+f_TW+f_BW+ f_TNE+f_TSE+f_BNE+f_TNE+ f_TNW+f_TSW+f_BNW+f_TNW ) / (c1o1 + drho) - ((c1o3*drho + vx1*vx1))); - real kyyFromfcNEQ = -(c3o1 * om1 / (c1o1-om1))*((f_N+f_NE+f_NW+f_TN+f_BN+f_S+f_SE+f_SW+f_TS+f_BS+ f_TNE+f_TSE+f_BNE+f_TNE+ f_TNW+f_TSW+f_BNW+f_TNW ) / (c1o1 + drho) - ((c1o3*drho + vx2*vx2))); - real kzzFromfcNEQ = -(c3o1 * om1 / (c1o1-om1))*((f_T+f_TE+f_TW+f_TN+f_BS+f_B+f_BE+f_BW+f_BN+f_BS+ f_TNE+f_TSE+f_BNE+f_TNE+ f_TNW+f_TSW+f_BNW+f_TNW ) / (c1o1 + drho) - ((c1o3*drho + vx3*vx3))); - - real magS = sqrtf(kxyFromfcNEQ*kxyFromfcNEQ + kyzFromfcNEQ*kyzFromfcNEQ + kxzFromfcNEQ*kxzFromfcNEQ + kxxFromfcNEQ*kxxFromfcNEQ + kyyFromfcNEQ*kyyFromfcNEQ + kzzFromfcNEQ*kzzFromfcNEQ); - - fac = fac * magS / (c1o3 * (c1o1 / om1 - c1o2)); - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - real *facAst = &QQ[d000 * numberOfBCnodes]; - - fac = fac * alpha + facAst[k] * (c1o1 - alpha); - facAst[k] = fac; - //(&QQ[d000 * numberOfBCnodes])[KQK] = fac; - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - ////real uk = sqrtf(vx1*vx1 + vx2*vx2 + vx3*vx3); - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //real phi = expf(magS/0.01f) - one; - //phi = (phi > one) ? one:phi; - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //real C = five; - //real kappa = 0.41f; - //real phi = (C * kappa * c1o2 * logf(magS / (c1o3 * (one / om1 - c1o2))) - one) / (C * kappa * c1o2 * logf(magS / (c1o3 * (one / om1 - c1o2)))); - //phi = (phi < zero) ? zero:phi; - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //real sum = zero, count = zero; - // q = q_dirE [k]; if (q>=zero && q<=one) sum += (q * nx_dirE[k] ); count += one; - // q = q_dirW [k]; if (q>=zero && q<=one) sum += (q * (-nx_dirW[k])); count += one; - // q = q_dirN [k]; if (q>=zero && q<=one) sum += (q * nx_dirN[k] ); count += one; - // q = q_dirS [k]; if (q>=zero && q<=one) sum += (q * (-nx_dirS[k])); count += one; - // q = q_dirT [k]; if (q>=zero && q<=one) sum += (q * nx_dirT[k] ); count += one; - // q = q_dirB [k]; if (q>=zero && q<=one) sum += (q * (-nx_dirB[k])); count += one; - // q = q_dirNE [k]; if (q>=zero && q<=one) sum += (q * ( nx_dirNE[k] + ny_dirNE[k])/(sqrtf(two))); count += one; - // q = q_dirSW [k]; if (q>=zero && q<=one) sum += (q * ((-nx_dirSW[k]) - ny_dirSW[k])/(sqrtf(two))); count += one; - // q = q_dirSE [k]; if (q>=zero && q<=one) sum += (q * ( nx_dirSE[k] - ny_dirSE[k])/(sqrtf(two))); count += one; - // q = q_dirNW [k]; if (q>=zero && q<=one) sum += (q * ((-nx_dirNW[k]) + ny_dirNW[k])/(sqrtf(two))); count += one; - // q = q_dirTE [k]; if (q>=zero && q<=one) sum += (q * ( nx_dirTE[k] + nz_dirTE[k])/(sqrtf(two))); count += one; - // q = q_dirBW [k]; if (q>=zero && q<=one) sum += (q * ((-nx_dirBW[k]) - nz_dirBW[k])/(sqrtf(two))); count += one; - // q = q_dirBE [k]; if (q>=zero && q<=one) sum += (q * ( nx_dirBE[k] - nz_dirBE[k])/(sqrtf(two))); count += one; - // q = q_dirTW [k]; if (q>=zero && q<=one) sum += (q * ((-nx_dirTW[k]) + nz_dirTW[k])/(sqrtf(two))); count += one; - // q = q_dirTN [k]; if (q>=zero && q<=one) sum += (q * ( ny_dirTN[k] + nz_dirTN[k])/(sqrtf(two))); count += one; - // q = q_dirBS [k]; if (q>=zero && q<=one) sum += (q * ((-ny_dirBS[k]) - nz_dirBS[k])/(sqrtf(two))); count += one; - // q = q_dirBN [k]; if (q>=zero && q<=one) sum += (q * ( ny_dirBN[k] - nz_dirBN[k])/(sqrtf(two))); count += one; - // q = q_dirTS [k]; if (q>=zero && q<=one) sum += (q * ((-ny_dirTS[k]) + nz_dirTS[k])/(sqrtf(two))); count += one; - // q = q_dirTNE [k]; if (q>=zero && q<=one) sum += (q * ( nx_dirTNE[k] + ny_dirTNE[k] + nz_dirTNE[k])/(sqrtf(three))); count += one; - // q = q_dirTSW [k]; if (q>=zero && q<=one) sum += (q * ((-nx_dirTSW[k])- ny_dirTSW[k] + nz_dirTSW[k])/(sqrtf(three))); count += one; - // q = q_dirTSE [k]; if (q>=zero && q<=one) sum += (q * ( nx_dirTSE[k] - ny_dirTSE[k] + nz_dirTSE[k])/(sqrtf(three))); count += one; - // q = q_dirTNW [k]; if (q>=zero && q<=one) sum += (q * ((-nx_dirTNW[k])+ ny_dirTNW[k] + nz_dirTNW[k])/(sqrtf(three))); count += one; - // q = q_dirBNE [k]; if (q>=zero && q<=one) sum += (q * ( nx_dirBNE[k] + ny_dirBNE[k] - nz_dirBNE[k])/(sqrtf(three))); count += one; - // q = q_dirBSW [k]; if (q>=zero && q<=one) sum += (q * ((-nx_dirBSW[k])- ny_dirBSW[k] - nz_dirBSW[k])/(sqrtf(three))); count += one; - // q = q_dirBSE [k]; if (q>=zero && q<=one) sum += (q * ( nx_dirBSE[k] - ny_dirBSE[k] - nz_dirBSE[k])/(sqrtf(three))); count += one; - // q = q_dirBNW [k]; if (q>=zero && q<=one) sum += (q * ((-nx_dirBNW[k])+ ny_dirBNW[k] - nz_dirBNW[k])/(sqrtf(three))); count += one; - //real qMed = sum/count; - //real phi = fac / (qMed + fac); - //phi = (phi > one) ? one:one; - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - real sliplength = 0.9f;//c1o2; - real qSlip = c0o1; - real un = c0o1; - real ut = c0o1; - real tangential = c0o1; - //real cSmallSingle = c0p0000002; - - q = q_dirE[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = vx1 - (vx1 * nx_dirE[k] + vx2 * ny_dirE[k] + vx3 * nz_dirE[k]) * nx_dirE[k]; - un = fabs((vx1 * nx_dirE[k] + vx2 * ny_dirE[k] + vx3 * nz_dirE[k]) * nx_dirE[k]); - ut = fabs(VeloX); - tangential = ut / (ut + un + cSmallSingle); - qSlip = sliplength * fabs( nx_dirE[k]); //sliplength * e_i * n_i - //qSlip = (qSlip < zero) ? zero:qSlip; - //tangential = (tangential > one) ? one:tangential; - q = (q + qSlip)/(c1o1 + qSlip * (c1o1 - tangential) / (cSmallSingle + q)); - feq=c2o27* (drho/*+three*( vx1 )*/+c9o2*( vx1 )*( vx1 ) * (c1o1 + drho)-cu_sq); - (D.f[dM00])[kw]=(c1o1-q)/(c1o1+q)*(f_E-f_W+(f_E+f_W-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_E+f_W))/(c1o1+q) - c2o27 * drho; - } - - q = q_dirW[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = vx1 - (vx1 * nx_dirW[k] + vx2 * ny_dirW[k] + vx3 * nz_dirW[k]) * nx_dirW[k]; - un = fabs(-(vx1 * nx_dirW[k] + vx2 * ny_dirW[k] + vx3 * nz_dirW[k]) * nx_dirW[k]); - ut = fabs(-VeloX); - tangential = ut / (ut + un + cSmallSingle); - qSlip = sliplength * fabs(-nx_dirW[k]); //sliplength * e_i * n_i - //qSlip = (qSlip < zero) ? zero:qSlip; - //tangential = (tangential > one) ? one:tangential; - q = (q + qSlip)/(c1o1 + qSlip * (c1o1 - tangential) / (cSmallSingle + q)); - feq=c2o27* (drho/*+three*(-vx1 )*/+c9o2*(-vx1 )*(-vx1 ) * (c1o1 + drho)-cu_sq); - (D.f[dP00])[ke]=(c1o1-q)/(c1o1+q)*(f_W-f_E+(f_W+f_E-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_W+f_E))/(c1o1+q) - c2o27 * drho; - } - - q = q_dirN[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloY = vx2 - (vx1 * nx_dirN[k] + vx2 * ny_dirN[k] + vx3 * nz_dirN[k]) * ny_dirN[k]; - un = fabs( (vx1 * nx_dirN[k] + vx2 * ny_dirN[k] + vx3 * nz_dirN[k]) * ny_dirN[k]); - ut = fabs( VeloY); - tangential = ut / (ut + un + cSmallSingle); - qSlip = sliplength * fabs( ny_dirN[k]); //sliplength * e_i * n_i - //qSlip = (qSlip < zero) ? zero:qSlip; - //tangential = (tangential > one) ? one:tangential; - q = (q + qSlip)/(c1o1 + qSlip * (c1o1 - tangential) / (cSmallSingle + q)); - feq=c2o27* (drho/*+three*( vx2 )*/+c9o2*( vx2 )*( vx2 ) * (c1o1 + drho)-cu_sq); - (D.f[d0M0])[ks]=(c1o1-q)/(c1o1+q)*(f_N-f_S+(f_N+f_S-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_N+f_S))/(c1o1+q) - c2o27 * drho; - } - - q = q_dirS[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloY = vx2 - (vx1 * nx_dirS[k] + vx2 * ny_dirS[k] + vx3 * nz_dirS[k]) * ny_dirS[k]; - un = fabs(-(vx1 * nx_dirS[k] + vx2 * ny_dirS[k] + vx3 * nz_dirS[k]) * ny_dirS[k]); - ut = fabs(-VeloY); - tangential = ut / (ut + un + cSmallSingle); - qSlip = sliplength * fabs(-ny_dirS[k]); //sliplength * e_i * n_i - //qSlip = (qSlip < zero) ? zero:qSlip; - //tangential = (tangential > one) ? one:tangential; - q = (q + qSlip)/(c1o1 + qSlip * (c1o1 - tangential) / (cSmallSingle + q)); - feq=c2o27* (drho/*+three*( -vx2 )*/+c9o2*( -vx2 )*( -vx2 ) * (c1o1 + drho)-cu_sq); - (D.f[d0P0])[kn]=(c1o1-q)/(c1o1+q)*(f_S-f_N+(f_S+f_N-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_S+f_N))/(c1o1+q) - c2o27 * drho; - } - - q = q_dirT[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloZ = vx3 - (vx1 * nx_dirT[k] + vx2 * ny_dirT[k] + vx3 * nz_dirT[k]) * nz_dirT[k]; - un = fabs( (vx1 * nx_dirT[k] + vx2 * ny_dirT[k] + vx3 * nz_dirT[k]) * nz_dirT[k]); - ut = fabs( VeloZ); - tangential = ut / (ut + un + cSmallSingle); - qSlip = sliplength * fabs( nz_dirT[k]); //sliplength * e_i * n_i - //qSlip = (qSlip < zero) ? zero:qSlip; - //tangential = (tangential > one) ? one:tangential; - q = (q + qSlip)/(c1o1 + qSlip * (c1o1 - tangential) / (cSmallSingle + q)); - feq=c2o27* (drho/*+three*( vx3)*/+c9o2*( vx3)*( vx3) * (c1o1 + drho)-cu_sq); - (D.f[d00M])[kb]=(c1o1-q)/(c1o1+q)*(f_T-f_B+(f_T+f_B-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_T+f_B))/(c1o1+q) - c2o27 * drho; - } - - q = q_dirB[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloZ = vx3 - (vx1 * nx_dirB[k] + vx2 * ny_dirB[k] + vx3 * nz_dirB[k]) * nz_dirB[k]; - un = fabs(-(vx1 * nx_dirB[k] + vx2 * ny_dirB[k] + vx3 * nz_dirB[k]) * nz_dirB[k]); - ut = fabs(-VeloZ); - tangential = ut / (ut + un + cSmallSingle); - qSlip = sliplength * fabs(-nz_dirB[k]); //sliplength * e_i * n_i - //qSlip = (qSlip < zero) ? zero:qSlip; - //tangential = (tangential > one) ? one:tangential; - q = (q + qSlip)/(c1o1 + qSlip * (c1o1 - tangential) / (cSmallSingle + q)); - feq=c2o27* (drho/*+three*( -vx3)*/+c9o2*( -vx3)*( -vx3) * (c1o1 + drho)-cu_sq); - (D.f[d00P])[kt]=(c1o1-q)/(c1o1+q)*(f_B-f_T+(f_B+f_T-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_B+f_T))/(c1o1+q) - c2o27 * drho; - } - - q = q_dirNE[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = vx1 - (vx1 * nx_dirNE[k] + vx2 * ny_dirNE[k] + vx3 * nz_dirNE[k]) * nx_dirNE[k]; - VeloY = vx2 - (vx1 * nx_dirNE[k] + vx2 * ny_dirNE[k] + vx3 * nz_dirNE[k]) * ny_dirNE[k]; - un = fabs( (vx1 * nx_dirNE[k] + vx2 * ny_dirNE[k] + vx3 * nz_dirNE[k]) * nx_dirNE[k] + (vx1 * nx_dirNE[k] + vx2 * ny_dirNE[k] + vx3 * nz_dirNE[k]) * ny_dirNE[k]); - ut = fabs( VeloX + VeloY); - tangential = ut / (ut + un + cSmallSingle); - qSlip = sliplength * fabs( nx_dirNE[k]+ny_dirNE[k]); //sliplength * e_i * n_i - //qSlip = (qSlip < zero) ? zero:qSlip; - //tangential = (tangential > one) ? one:tangential; - q = (q + qSlip)/(c1o1 + qSlip * (c1o1 - tangential) / (cSmallSingle + q)); - feq=c1o54* (drho/*+three*( vx1+vx2 )*/+c9o2*( vx1+vx2 )*( vx1+vx2 ) * (c1o1 + drho)-cu_sq); - (D.f[dMM0])[ksw]=(c1o1-q)/(c1o1+q)*(f_NE-f_SW+(f_NE+f_SW-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_NE+f_SW))/(c1o1+q) - c1o54 * drho; - } - - q = q_dirSW[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = vx1 - (vx1 * nx_dirSW[k] + vx2 * ny_dirSW[k] + vx3 * nz_dirSW[k]) * nx_dirSW[k]; - VeloY = vx2 - (vx1 * nx_dirSW[k] + vx2 * ny_dirSW[k] + vx3 * nz_dirSW[k]) * ny_dirSW[k]; - un = fabs(-(vx1 * nx_dirSW[k] + vx2 * ny_dirSW[k] + vx3 * nz_dirSW[k]) * nx_dirSW[k] - (vx1 * nx_dirSW[k] + vx2 * ny_dirSW[k] + vx3 * nz_dirSW[k]) * ny_dirSW[k]); - ut = fabs(-VeloX - VeloY); - tangential = ut / (ut + un + cSmallSingle); - qSlip = sliplength * fabs(-nx_dirSW[k]-ny_dirSW[k]); //sliplength * e_i * n_i - //qSlip = (qSlip < zero) ? zero:qSlip; - //tangential = (tangential > one) ? one:tangential; - q = (q + qSlip)/(c1o1 + qSlip * (c1o1 - tangential) / (cSmallSingle + q)); - feq=c1o54* (drho/*+three*(-vx1-vx2 )*/+c9o2*(-vx1-vx2 )*(-vx1-vx2 ) * (c1o1 + drho)-cu_sq); - (D.f[dPP0])[kne]=(c1o1-q)/(c1o1+q)*(f_SW-f_NE+(f_SW+f_NE-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_SW+f_NE))/(c1o1+q) - c1o54 * drho; - } - - q = q_dirSE[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = vx1 - (vx1 * nx_dirSE[k] + vx2 * ny_dirSE[k] + vx3 * nz_dirSE[k]) * nx_dirSE[k]; - VeloY = vx2 - (vx1 * nx_dirSE[k] + vx2 * ny_dirSE[k] + vx3 * nz_dirSE[k]) * ny_dirSE[k]; - un = fabs( (vx1 * nx_dirSE[k] + vx2 * ny_dirSE[k] + vx3 * nz_dirSE[k]) * nx_dirSE[k] - (vx1 * nx_dirSE[k] + vx2 * ny_dirSE[k] + vx3 * nz_dirSE[k]) * ny_dirSE[k]); - ut = fabs( VeloX - VeloY); - tangential = ut / (ut + un + cSmallSingle); - qSlip = sliplength * fabs( nx_dirSE[k]-ny_dirSE[k]); //sliplength * e_i * n_i - //qSlip = (qSlip < zero) ? zero:qSlip; - //tangential = (tangential > one) ? one:tangential; - q = (q + qSlip)/(c1o1 + qSlip * (c1o1 - tangential) / (cSmallSingle + q)); - feq=c1o54* (drho/*+three*( vx1-vx2 )*/+c9o2*( vx1-vx2 )*( vx1-vx2 ) * (c1o1 + drho)-cu_sq); - (D.f[dMP0])[knw]=(c1o1-q)/(c1o1+q)*(f_SE-f_NW+(f_SE+f_NW-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_SE+f_NW))/(c1o1+q) - c1o54 * drho; - } - - q = q_dirNW[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = vx1 - (vx1 * nx_dirNW[k] + vx2 * ny_dirNW[k] + vx3 * nz_dirNW[k]) * nx_dirNW[k]; - VeloY = vx2 - (vx1 * nx_dirNW[k] + vx2 * ny_dirNW[k] + vx3 * nz_dirNW[k]) * ny_dirNW[k]; - un = fabs(-(vx1 * nx_dirNW[k] + vx2 * ny_dirNW[k] + vx3 * nz_dirNW[k]) * nx_dirNW[k] + (vx1 * nx_dirNW[k] + vx2 * ny_dirNW[k] + vx3 * nz_dirNW[k]) * ny_dirNW[k]); - ut = fabs(-VeloX + VeloY); - tangential = ut / (ut + un + cSmallSingle); - qSlip = sliplength * fabs(-nx_dirNW[k]+ny_dirNW[k]); //sliplength * e_i * n_i - //qSlip = (qSlip < zero) ? zero:qSlip; - //tangential = (tangential > one) ? one:tangential; - q = (q + qSlip)/(c1o1 + qSlip * (c1o1 - tangential) / (cSmallSingle + q)); - feq=c1o54* (drho/*+three*(-vx1+vx2 )*/+c9o2*(-vx1+vx2 )*(-vx1+vx2 ) * (c1o1 + drho)-cu_sq); - (D.f[dPM0])[kse]=(c1o1-q)/(c1o1+q)*(f_NW-f_SE+(f_NW+f_SE-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_NW+f_SE))/(c1o1+q) - c1o54 * drho; - } - - q = q_dirTE[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = vx1 - (vx1 * nx_dirTE[k] + vx2 * ny_dirTE[k] + vx3 * nz_dirTE[k]) * nx_dirTE[k]; - VeloZ = vx3 - (vx1 * nx_dirTE[k] + vx2 * ny_dirTE[k] + vx3 * nz_dirTE[k]) * nz_dirTE[k]; - un = fabs( (vx1 * nx_dirTE[k] + vx2 * ny_dirTE[k] + vx3 * nz_dirTE[k]) * nx_dirTE[k] + (vx1 * nx_dirTE[k] + vx2 * ny_dirTE[k] + vx3 * nz_dirTE[k]) * nz_dirTE[k]); - ut = fabs( VeloX + VeloZ); - tangential = ut / (ut + un + cSmallSingle); - qSlip = sliplength * fabs( nx_dirTE[k]+nz_dirTE[k]); //sliplength * e_i * n_i - //qSlip = (qSlip < zero) ? zero:qSlip; - //tangential = (tangential > one) ? one:tangential; - q = (q + qSlip)/(c1o1 + qSlip * (c1o1 - tangential) / (cSmallSingle + q)); - feq=c1o54* (drho/*+three*( vx1 +vx3)*/+c9o2*( vx1 +vx3)*( vx1 +vx3) * (c1o1 + drho)-cu_sq); - (D.f[dM0M])[kbw]=(c1o1-q)/(c1o1+q)*(f_TE-f_BW+(f_TE+f_BW-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_TE+f_BW))/(c1o1+q) - c1o54 * drho; - } - - q = q_dirBW[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = vx1 - (vx1 * nx_dirBW[k] + vx2 * ny_dirBW[k] + vx3 * nz_dirBW[k]) * nx_dirBW[k]; - VeloZ = vx3 - (vx1 * nx_dirBW[k] + vx2 * ny_dirBW[k] + vx3 * nz_dirBW[k]) * nz_dirBW[k]; - un = fabs(-(vx1 * nx_dirBW[k] + vx2 * ny_dirBW[k] + vx3 * nz_dirBW[k]) * nx_dirBW[k] - (vx1 * nx_dirBW[k] + vx2 * ny_dirBW[k] + vx3 * nz_dirBW[k]) * nz_dirBW[k]); - ut = fabs(-VeloX - VeloZ); - tangential = ut / (ut + un + cSmallSingle); - qSlip = sliplength * fabs(-nx_dirBW[k]-nz_dirBW[k]); //sliplength * e_i * n_i - //qSlip = (qSlip < zero) ? zero:qSlip; - //tangential = (tangential > one) ? one:tangential; - q = (q + qSlip)/(c1o1 + qSlip * (c1o1 - tangential) / (cSmallSingle + q)); - feq=c1o54* (drho/*+three*(-vx1 -vx3)*/+c9o2*(-vx1 -vx3)*(-vx1 -vx3) * (c1o1 + drho)-cu_sq); - (D.f[dP0P])[kte]=(c1o1-q)/(c1o1+q)*(f_BW-f_TE+(f_BW+f_TE-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_BW+f_TE))/(c1o1+q) - c1o54 * drho; - } - - q = q_dirBE[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = vx1 - (vx1 * nx_dirBE[k] + vx2 * ny_dirBE[k] + vx3 * nz_dirBE[k]) * nx_dirBE[k]; - VeloZ = vx3 - (vx1 * nx_dirBE[k] + vx2 * ny_dirBE[k] + vx3 * nz_dirBE[k]) * nz_dirBE[k]; - un = fabs( (vx1 * nx_dirBE[k] + vx2 * ny_dirBE[k] + vx3 * nz_dirBE[k]) * nx_dirBE[k] - (vx1 * nx_dirBE[k] + vx2 * ny_dirBE[k] + vx3 * nz_dirBE[k]) * nz_dirBE[k]); - ut = fabs( VeloX - VeloZ); - tangential = ut / (ut + un + cSmallSingle); - qSlip = sliplength * fabs( nx_dirBE[k]-nz_dirBE[k]); //sliplength * e_i * n_i - //qSlip = (qSlip < zero) ? zero:qSlip; - //tangential = (tangential > one) ? one:tangential; - q = (q + qSlip)/(c1o1 + qSlip * (c1o1 - tangential) / (cSmallSingle + q)); - feq=c1o54* (drho/*+three*( vx1 -vx3)*/+c9o2*( vx1 -vx3)*( vx1 -vx3) * (c1o1 + drho)-cu_sq); - (D.f[dM0P])[ktw]=(c1o1-q)/(c1o1+q)*(f_BE-f_TW+(f_BE+f_TW-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_BE+f_TW))/(c1o1+q) - c1o54 * drho; - } - - q = q_dirTW[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = vx1 - (vx1 * nx_dirTW[k] + vx2 * ny_dirTW[k] + vx3 * nz_dirTW[k]) * nx_dirTW[k]; - VeloZ = vx3 - (vx1 * nx_dirTW[k] + vx2 * ny_dirTW[k] + vx3 * nz_dirTW[k]) * nz_dirTW[k]; - un = fabs(-(vx1 * nx_dirTW[k] + vx2 * ny_dirTW[k] + vx3 * nz_dirTW[k]) * nx_dirTW[k] + (vx1 * nx_dirTW[k] + vx2 * ny_dirTW[k] + vx3 * nz_dirTW[k]) * nz_dirTW[k]); - ut = fabs(-VeloX + VeloZ); - tangential = ut / (ut + un + cSmallSingle); - qSlip = sliplength * fabs(-nx_dirTW[k]+nz_dirTW[k]); //sliplength * e_i * n_i - //qSlip = (qSlip < zero) ? zero:qSlip; - //tangential = (tangential > one) ? one:tangential; - q = (q + qSlip)/(c1o1 + qSlip * (c1o1 - tangential) / (cSmallSingle + q)); - feq=c1o54* (drho/*+three*(-vx1 +vx3)*/+c9o2*(-vx1 +vx3)*(-vx1 +vx3) * (c1o1 + drho)-cu_sq); - (D.f[dP0M])[kbe]=(c1o1-q)/(c1o1+q)*(f_TW-f_BE+(f_TW+f_BE-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_TW+f_BE))/(c1o1+q) - c1o54 * drho; - } - - q = q_dirTN[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloY = vx2 - (vx1 * nx_dirTN[k] + vx2 * ny_dirTN[k] + vx3 * nz_dirTN[k]) * ny_dirTN[k]; - VeloZ = vx3 - (vx1 * nx_dirTN[k] + vx2 * ny_dirTN[k] + vx3 * nz_dirTN[k]) * nz_dirTN[k]; - un = fabs( (vx1 * nx_dirTN[k] + vx2 * ny_dirTN[k] + vx3 * nz_dirTN[k]) * ny_dirTN[k] + (vx1 * nx_dirTN[k] + vx2 * ny_dirTN[k] + vx3 * nz_dirTN[k]) * nz_dirTN[k]); - ut = fabs( VeloY + VeloZ); - tangential = ut / (ut + un + cSmallSingle); - qSlip = sliplength * fabs( ny_dirTN[k]+nz_dirTN[k]); //sliplength * e_i * n_i - //qSlip = (qSlip < zero) ? zero:qSlip; - //tangential = (tangential > one) ? one:tangential; - q = (q + qSlip)/(c1o1 + qSlip * (c1o1 - tangential) / (cSmallSingle + q)); - feq=c1o54* (drho/*+three*( vx2+vx3)*/+c9o2*( vx2+vx3)*( vx2+vx3) * (c1o1 + drho)-cu_sq); - (D.f[d0MM])[kbs]=(c1o1-q)/(c1o1+q)*(f_TN-f_BS+(f_TN+f_BS-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_TN+f_BS))/(c1o1+q) - c1o54 * drho; - } - - q = q_dirBS[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloY = vx2 - (vx1 * nx_dirBS[k] + vx2 * ny_dirBS[k] + vx3 * nz_dirBS[k]) * ny_dirBS[k]; - VeloZ = vx3 - (vx1 * nx_dirBS[k] + vx2 * ny_dirBS[k] + vx3 * nz_dirBS[k]) * nz_dirBS[k]; - un = fabs(-(vx1 * nx_dirBS[k] + vx2 * ny_dirBS[k] + vx3 * nz_dirBS[k]) * ny_dirBS[k] - (vx1 * nx_dirBS[k] + vx2 * ny_dirBS[k] + vx3 * nz_dirBS[k]) * nz_dirBS[k]); - ut = fabs(-VeloY - VeloZ); - tangential = ut / (ut + un + cSmallSingle); - qSlip = sliplength * fabs(-ny_dirBS[k]-nz_dirBS[k]); //sliplength * e_i * n_i - //qSlip = (qSlip < zero) ? zero:qSlip; - //tangential = (tangential > one) ? one:tangential; - q = (q + qSlip)/(c1o1 + qSlip * (c1o1 - tangential) / (cSmallSingle + q)); - feq=c1o54* (drho/*+three*( -vx2-vx3)*/+c9o2*( -vx2-vx3)*( -vx2-vx3) * (c1o1 + drho)-cu_sq); - (D.f[d0PP])[ktn]=(c1o1-q)/(c1o1+q)*(f_BS-f_TN+(f_BS+f_TN-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_BS+f_TN))/(c1o1+q) - c1o54 * drho; - } - - q = q_dirBN[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloY = vx2 - (vx1 * nx_dirBN[k] + vx2 * ny_dirBN[k] + vx3 * nz_dirBN[k]) * ny_dirBN[k]; - VeloZ = vx3 - (vx1 * nx_dirBN[k] + vx2 * ny_dirBN[k] + vx3 * nz_dirBN[k]) * nz_dirBN[k]; - un = fabs( (vx1 * nx_dirBN[k] + vx2 * ny_dirBN[k] + vx3 * nz_dirBN[k]) * ny_dirBN[k] - (vx1 * nx_dirBN[k] + vx2 * ny_dirBN[k] + vx3 * nz_dirBN[k]) * nz_dirBN[k]); - ut = fabs( VeloY - VeloZ); - tangential = ut / (ut + un + cSmallSingle); - qSlip = sliplength * fabs( ny_dirBN[k]-nz_dirBN[k]); //sliplength * e_i * n_i - //qSlip = (qSlip < zero) ? zero:qSlip; - //tangential = (tangential > one) ? one:tangential; - q = (q + qSlip)/(c1o1 + qSlip * (c1o1 - tangential) / (cSmallSingle + q)); - feq=c1o54* (drho/*+three*( vx2-vx3)*/+c9o2*( vx2-vx3)*( vx2-vx3) * (c1o1 + drho)-cu_sq); - (D.f[d0MP])[kts]=(c1o1-q)/(c1o1+q)*(f_BN-f_TS+(f_BN+f_TS-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_BN+f_TS))/(c1o1+q) - c1o54 * drho; - } - - q = q_dirTS[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloY = vx2 - (vx1 * nx_dirTS[k] + vx2 * ny_dirTS[k] + vx3 * nz_dirTS[k]) * ny_dirTS[k]; - VeloZ = vx3 - (vx1 * nx_dirTS[k] + vx2 * ny_dirTS[k] + vx3 * nz_dirTS[k]) * nz_dirTS[k]; - un = fabs(-(vx1 * nx_dirTS[k] + vx2 * ny_dirTS[k] + vx3 * nz_dirTS[k]) * ny_dirTS[k] + (vx1 * nx_dirTS[k] + vx2 * ny_dirTS[k] + vx3 * nz_dirTS[k]) * nz_dirTS[k]); - ut = fabs(-VeloY + VeloZ); - tangential = ut / (ut + un + cSmallSingle); - qSlip = sliplength * fabs(-ny_dirTS[k]+nz_dirTS[k]); //sliplength * e_i * n_i - //qSlip = (qSlip < zero) ? zero:qSlip; - //tangential = (tangential > one) ? one:tangential; - q = (q + qSlip)/(c1o1 + qSlip * (c1o1 - tangential) / (cSmallSingle + q)); - feq=c1o54* (drho/*+three*( -vx2+vx3)*/+c9o2*( -vx2+vx3)*( -vx2+vx3) * (c1o1 + drho)-cu_sq); - (D.f[d0PM])[kbn]=(c1o1-q)/(c1o1+q)*(f_TS-f_BN+(f_TS+f_BN-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_TS+f_BN))/(c1o1+q) - c1o54 * drho; - } - - q = q_dirTNE[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = vx1 - (vx1 * nx_dirTNE[k] + vx2 * ny_dirTNE[k] + vx3 * nz_dirTNE[k]) * nx_dirTNE[k]; - VeloY = vx2 - (vx1 * nx_dirTNE[k] + vx2 * ny_dirTNE[k] + vx3 * nz_dirTNE[k]) * ny_dirTNE[k]; - VeloZ = vx3 - (vx1 * nx_dirTNE[k] + vx2 * ny_dirTNE[k] + vx3 * nz_dirTNE[k]) * nz_dirTNE[k]; - un = fabs( (vx1 * nx_dirTNE[k] + vx2 * ny_dirTNE[k] + vx3 * nz_dirTNE[k]) * nx_dirTNE[k] - +(vx1 * nx_dirTNE[k] + vx2 * ny_dirTNE[k] + vx3 * nz_dirTNE[k]) * ny_dirTNE[k] - +(vx1 * nx_dirTNE[k] + vx2 * ny_dirTNE[k] + vx3 * nz_dirTNE[k]) * nz_dirTNE[k]); - ut = fabs( VeloX + VeloY + VeloZ); - tangential = ut / (ut + un + cSmallSingle); - qSlip = sliplength * fabs( nx_dirTNE[k] + ny_dirTNE[k] + nz_dirTNE[k]); //sliplength * e_i * n_i - //qSlip = (qSlip < zero) ? zero:qSlip; - //tangential = (tangential > one) ? one:tangential; - q = (q + qSlip)/(c1o1 + qSlip * (c1o1 - tangential) / (cSmallSingle + q)); - feq=c1o216*(drho/*+three*( vx1+vx2+vx3)*/+c9o2*( vx1+vx2+vx3)*( vx1+vx2+vx3) * (c1o1 + drho)-cu_sq); - (D.f[dMMM])[kbsw]=(c1o1-q)/(c1o1+q)*(f_TNE-f_BSW+(f_TNE+f_BSW-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_TNE+f_BSW))/(c1o1+q) - c1o216 * drho; - } - - q = q_dirBSW[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = vx1 - (vx1 * nx_dirBSW[k] + vx2 * ny_dirBSW[k] + vx3 * nz_dirBSW[k]) * nx_dirBSW[k]; - VeloY = vx2 - (vx1 * nx_dirBSW[k] + vx2 * ny_dirBSW[k] + vx3 * nz_dirBSW[k]) * ny_dirBSW[k]; - VeloZ = vx3 - (vx1 * nx_dirBSW[k] + vx2 * ny_dirBSW[k] + vx3 * nz_dirBSW[k]) * nz_dirBSW[k]; - un = fabs(-(vx1 * nx_dirBSW[k] + vx2 * ny_dirBSW[k] + vx3 * nz_dirBSW[k]) * nx_dirBSW[k] - -(vx1 * nx_dirBSW[k] + vx2 * ny_dirBSW[k] + vx3 * nz_dirBSW[k]) * ny_dirBSW[k] - -(vx1 * nx_dirBSW[k] + vx2 * ny_dirBSW[k] + vx3 * nz_dirBSW[k]) * nz_dirBSW[k]); - ut = fabs(-VeloX - VeloY - VeloZ); - tangential = ut / (ut + un + cSmallSingle); - qSlip = sliplength * fabs(-nx_dirBSW[k] - ny_dirBSW[k] - nz_dirBSW[k]); //sliplength * e_i * n_i - //qSlip = (qSlip < zero) ? zero:qSlip; - //tangential = (tangential > one) ? one:tangential; - q = (q + qSlip)/(c1o1 + qSlip * (c1o1 - tangential) / (cSmallSingle + q)); - feq=c1o216*(drho/*+three*(-vx1-vx2-vx3)*/+c9o2*(-vx1-vx2-vx3)*(-vx1-vx2-vx3) * (c1o1 + drho)-cu_sq); - (D.f[dPPP])[ktne]=(c1o1-q)/(c1o1+q)*(f_BSW-f_TNE+(f_BSW+f_TNE-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_BSW+f_TNE))/(c1o1+q) - c1o216 * drho; - } - - q = q_dirBNE[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = vx1 - (vx1 * nx_dirBNE[k] + vx2 * ny_dirBNE[k] + vx3 * nz_dirBNE[k]) * nx_dirBNE[k]; - VeloY = vx2 - (vx1 * nx_dirBNE[k] + vx2 * ny_dirBNE[k] + vx3 * nz_dirBNE[k]) * ny_dirBNE[k]; - VeloZ = vx3 - (vx1 * nx_dirBNE[k] + vx2 * ny_dirBNE[k] + vx3 * nz_dirBNE[k]) * nz_dirBNE[k]; - un = fabs( (vx1 * nx_dirBNE[k] + vx2 * ny_dirBNE[k] + vx3 * nz_dirBNE[k]) * nx_dirBNE[k] - +(vx1 * nx_dirBNE[k] + vx2 * ny_dirBNE[k] + vx3 * nz_dirBNE[k]) * ny_dirBNE[k] - -(vx1 * nx_dirBNE[k] + vx2 * ny_dirBNE[k] + vx3 * nz_dirBNE[k]) * nz_dirBNE[k]); - ut = fabs( VeloX + VeloY - VeloZ); - tangential = ut / (ut + un + cSmallSingle); - qSlip = sliplength * fabs( nx_dirBNE[k] + ny_dirBNE[k] - nz_dirBNE[k]); //sliplength * e_i * n_i - //qSlip = (qSlip < zero) ? zero:qSlip; - //tangential = (tangential > one) ? one:tangential; - q = (q + qSlip)/(c1o1 + qSlip * (c1o1 - tangential) / (cSmallSingle + q)); - feq=c1o216*(drho/*+three*( vx1+vx2-vx3)*/+c9o2*( vx1+vx2-vx3)*( vx1+vx2-vx3) * (c1o1 + drho)-cu_sq); - (D.f[dMMP])[ktsw]=(c1o1-q)/(c1o1+q)*(f_BNE-f_TSW+(f_BNE+f_TSW-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_BNE+f_TSW))/(c1o1+q) - c1o216 * drho; - } - - q = q_dirTSW[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = vx1 - (vx1 * nx_dirTSW[k] + vx2 * ny_dirTSW[k] + vx3 * nz_dirTSW[k]) * nx_dirTSW[k]; - VeloY = vx2 - (vx1 * nx_dirTSW[k] + vx2 * ny_dirTSW[k] + vx3 * nz_dirTSW[k]) * ny_dirTSW[k]; - VeloZ = vx3 - (vx1 * nx_dirTSW[k] + vx2 * ny_dirTSW[k] + vx3 * nz_dirTSW[k]) * nz_dirTSW[k]; - un = fabs(-(vx1 * nx_dirTSW[k] + vx2 * ny_dirTSW[k] + vx3 * nz_dirTSW[k]) * nx_dirTSW[k] - -(vx1 * nx_dirTSW[k] + vx2 * ny_dirTSW[k] + vx3 * nz_dirTSW[k]) * ny_dirTSW[k] - +(vx1 * nx_dirTSW[k] + vx2 * ny_dirTSW[k] + vx3 * nz_dirTSW[k]) * nz_dirTSW[k]); - ut = fabs(-VeloX - VeloY + VeloZ); - tangential = ut / (ut + un + cSmallSingle); - qSlip = sliplength * fabs(-nx_dirTSW[k] - ny_dirTSW[k] + nz_dirTSW[k]); //sliplength * e_i * n_i - //qSlip = (qSlip < zero) ? zero:qSlip; - //tangential = (tangential > one) ? one:tangential; - q = (q + qSlip)/(c1o1 + qSlip * (c1o1 - tangential) / (cSmallSingle + q)); - feq=c1o216*(drho/*+three*(-vx1-vx2+vx3)*/+c9o2*(-vx1-vx2+vx3)*(-vx1-vx2+vx3) * (c1o1 + drho)-cu_sq); - (D.f[dPPM])[kbne]=(c1o1-q)/(c1o1+q)*(f_TSW-f_BNE+(f_TSW+f_BNE-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_TSW+f_BNE))/(c1o1+q) - c1o216 * drho; - } - - q = q_dirTSE[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = vx1 - (vx1 * nx_dirTSE[k] + vx2 * ny_dirTSE[k] + vx3 * nz_dirTSE[k]) * nx_dirTSE[k]; - VeloY = vx2 - (vx1 * nx_dirTSE[k] + vx2 * ny_dirTSE[k] + vx3 * nz_dirTSE[k]) * ny_dirTSE[k]; - VeloZ = vx3 - (vx1 * nx_dirTSE[k] + vx2 * ny_dirTSE[k] + vx3 * nz_dirTSE[k]) * nz_dirTSE[k]; - un = fabs(+(vx1 * nx_dirTSE[k] + vx2 * ny_dirTSE[k] + vx3 * nz_dirTSE[k]) * nx_dirTSE[k] - -(vx1 * nx_dirTSE[k] + vx2 * ny_dirTSE[k] + vx3 * nz_dirTSE[k]) * ny_dirTSE[k] - +(vx1 * nx_dirTSE[k] + vx2 * ny_dirTSE[k] + vx3 * nz_dirTSE[k]) * nz_dirTSE[k]); - ut = fabs(+VeloX - VeloY + VeloZ); - tangential = ut / (ut + un + cSmallSingle); - qSlip = sliplength * fabs( nx_dirTSE[k] - ny_dirTSE[k] + nz_dirTSE[k]); //sliplength * e_i * n_i - //qSlip = (qSlip < zero) ? zero:qSlip; - //tangential = (tangential > one) ? one:tangential; - q = (q + qSlip)/(c1o1 + qSlip * (c1o1 - tangential) / (cSmallSingle + q)); - feq=c1o216*(drho/*+three*( vx1-vx2+vx3)*/+c9o2*( vx1-vx2+vx3)*( vx1-vx2+vx3) * (c1o1 + drho)-cu_sq); - (D.f[dMPM])[kbnw]=(c1o1-q)/(c1o1+q)*(f_TSE-f_BNW+(f_TSE+f_BNW-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_TSE+f_BNW))/(c1o1+q) - c1o216 * drho; - } - - q = q_dirBNW[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = vx1 - (vx1 * nx_dirBNW[k] + vx2 * ny_dirBNW[k] + vx3 * nz_dirBNW[k]) * nx_dirBNW[k]; - VeloY = vx2 - (vx1 * nx_dirBNW[k] + vx2 * ny_dirBNW[k] + vx3 * nz_dirBNW[k]) * ny_dirBNW[k]; - VeloZ = vx3 - (vx1 * nx_dirBNW[k] + vx2 * ny_dirBNW[k] + vx3 * nz_dirBNW[k]) * nz_dirBNW[k]; - un = fabs(-(vx1 * nx_dirBNW[k] + vx2 * ny_dirBNW[k] + vx3 * nz_dirBNW[k]) * nx_dirBNW[k] - +(vx1 * nx_dirBNW[k] + vx2 * ny_dirBNW[k] + vx3 * nz_dirBNW[k]) * ny_dirBNW[k] - -(vx1 * nx_dirBNW[k] + vx2 * ny_dirBNW[k] + vx3 * nz_dirBNW[k]) * nz_dirBNW[k]); - ut = fabs(-VeloX + VeloY - VeloZ); - tangential = ut / (ut + un + cSmallSingle); - qSlip = sliplength * fabs(-nx_dirBNW[k] + ny_dirBNW[k] - nz_dirBNW[k]); //sliplength * e_i * n_i - //qSlip = (qSlip < zero) ? zero:qSlip; - //tangential = (tangential > one) ? one:tangential; - q = (q + qSlip)/(c1o1 + qSlip * (c1o1 - tangential) / (cSmallSingle + q)); - feq=c1o216*(drho/*+three*(-vx1+vx2-vx3)*/+c9o2*(-vx1+vx2-vx3)*(-vx1+vx2-vx3) * (c1o1 + drho)-cu_sq); - (D.f[dPMP])[ktse]=(c1o1-q)/(c1o1+q)*(f_BNW-f_TSE+(f_BNW+f_TSE-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_BNW+f_TSE))/(c1o1+q) - c1o216 * drho; - } - - q = q_dirBSE[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = vx1 - (vx1 * nx_dirBSE[k] + vx2 * ny_dirBSE[k] + vx3 * nz_dirBSE[k]) * nx_dirBSE[k]; - VeloY = vx2 - (vx1 * nx_dirBSE[k] + vx2 * ny_dirBSE[k] + vx3 * nz_dirBSE[k]) * ny_dirBSE[k]; - VeloZ = vx3 - (vx1 * nx_dirBSE[k] + vx2 * ny_dirBSE[k] + vx3 * nz_dirBSE[k]) * nz_dirBSE[k]; - un = fabs( (vx1 * nx_dirBSE[k] + vx2 * ny_dirBSE[k] + vx3 * nz_dirBSE[k]) * nx_dirBSE[k] - -(vx1 * nx_dirBSE[k] + vx2 * ny_dirBSE[k] + vx3 * nz_dirBSE[k]) * ny_dirBSE[k] - -(vx1 * nx_dirBSE[k] + vx2 * ny_dirBSE[k] + vx3 * nz_dirBSE[k]) * nz_dirBSE[k]); - ut = fabs( VeloX - VeloY - VeloZ); - tangential = ut / (ut + un + cSmallSingle); - qSlip = sliplength * fabs( nx_dirBSE[k] - ny_dirBSE[k] - nz_dirBSE[k]); //sliplength * e_i * n_i - //qSlip = (qSlip < zero) ? zero:qSlip; - //tangential = (tangential > one) ? one:tangential; - q = (q + qSlip)/(c1o1 + qSlip * (c1o1 - tangential) / (cSmallSingle + q)); - feq=c1o216*(drho/*+three*( vx1-vx2-vx3)*/+c9o2*( vx1-vx2-vx3)*( vx1-vx2-vx3) * (c1o1 + drho)-cu_sq); - (D.f[dMPP])[ktnw]=(c1o1-q)/(c1o1+q)*(f_BSE-f_TNW+(f_BSE+f_TNW-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_BSE+f_TNW))/(c1o1+q) - c1o216 * drho; - } - - q = q_dirTNW[k]; - if (q>=c0o1 && q<=c1o1) - { - VeloX = vx1 - (vx1 * nx_dirTNW[k] + vx2 * ny_dirTNW[k] + vx3 * nz_dirTNW[k]) * nx_dirTNW[k]; - VeloY = vx2 - (vx1 * nx_dirTNW[k] + vx2 * ny_dirTNW[k] + vx3 * nz_dirTNW[k]) * ny_dirTNW[k]; - VeloZ = vx3 - (vx1 * nx_dirTNW[k] + vx2 * ny_dirTNW[k] + vx3 * nz_dirTNW[k]) * nz_dirTNW[k]; - un = fabs(-(vx1 * nx_dirTNW[k] + vx2 * ny_dirTNW[k] + vx3 * nz_dirTNW[k]) * nx_dirTNW[k] - +(vx1 * nx_dirTNW[k] + vx2 * ny_dirTNW[k] + vx3 * nz_dirTNW[k]) * ny_dirTNW[k] - +(vx1 * nx_dirTNW[k] + vx2 * ny_dirTNW[k] + vx3 * nz_dirTNW[k]) * nz_dirTNW[k]); - ut = fabs(-VeloX + VeloY + VeloZ); - tangential = ut / (ut + un + cSmallSingle); - qSlip = sliplength * fabs(-nx_dirTNW[k] + ny_dirTNW[k] + nz_dirTNW[k]); //sliplength * e_i * n_i - //qSlip = (qSlip < zero) ? zero:qSlip; - //tangential = (tangential > one) ? one:tangential; - q = (q + qSlip)/(c1o1 + qSlip * (c1o1 - tangential) / (cSmallSingle + q)); - feq=c1o216*(drho/*+three*(-vx1+vx2+vx3)*/+c9o2*(-vx1+vx2+vx3)*(-vx1+vx2+vx3) * (c1o1 + drho)-cu_sq); - (D.f[dPMM])[kbse]=(c1o1-q)/(c1o1+q)*(f_TNW-f_BSE+(f_TNW+f_BSE-c2o1*feq*om1)/(c1o1-om1))*c1o2+(q*(f_TNW+f_BSE))/(c1o1+q) - c1o216 * drho; - } - } -} -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////