From 2cc7aad27ad28e82619729b9ecbe5e8e1d69d0f3 Mon Sep 17 00:00:00 2001
From: dy94rovu <ravi.k.ayyala@fau.de>
Date: Fri, 14 Mar 2025 16:35:30 +0100
Subject: [PATCH] boundary conditions properly corrected for
 thermalFLuidizedBed application and SC 2 also generated in thermalPSM

---
 .../CMakeLists.txt                            |  2 +-
 .../thermalPSMCodegen.py                      |  2 +-
 .../ThermalFluidizedBedPSM.cpp                | 25 +++++++++++--------
 3 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/apps/benchmarks/MaterialTransport/thermal_PSM/thermalPsmPerformanceBenchmark/CMakeLists.txt b/apps/benchmarks/MaterialTransport/thermal_PSM/thermalPsmPerformanceBenchmark/CMakeLists.txt
index 5b7d8b0c8..d3c21f04a 100644
--- a/apps/benchmarks/MaterialTransport/thermal_PSM/thermalPsmPerformanceBenchmark/CMakeLists.txt
+++ b/apps/benchmarks/MaterialTransport/thermal_PSM/thermalPsmPerformanceBenchmark/CMakeLists.txt
@@ -2,7 +2,7 @@ waLBerla_link_files_to_builddir("*.prm")
 
 if (WALBERLA_BUILD_WITH_CODEGEN)
     if (NOT WALBERLA_BUILD_WITH_GPU_SUPPORT OR (WALBERLA_BUILD_WITH_GPU_SUPPORT AND (CMAKE_CUDA_ARCHITECTURES GREATER_EQUAL 60 OR WALBERLA_BUILD_WITH_HIP)))
-        foreach(solid_collision 1)
+        foreach(solid_collision 1 2)
 
             set(config sc_${solid_collision})
             message(STATUS "Config value in thermal PSM is: ${config}" )
diff --git a/apps/benchmarks/MaterialTransport/thermal_PSM/thermalPsmPerformanceBenchmark/thermalPSMCodegen.py b/apps/benchmarks/MaterialTransport/thermal_PSM/thermalPsmPerformanceBenchmark/thermalPSMCodegen.py
index 6b783f027..ffb1250fa 100644
--- a/apps/benchmarks/MaterialTransport/thermal_PSM/thermalPsmPerformanceBenchmark/thermalPSMCodegen.py
+++ b/apps/benchmarks/MaterialTransport/thermal_PSM/thermalPsmPerformanceBenchmark/thermalPSMCodegen.py
@@ -260,7 +260,7 @@ with CodeGeneration() as ctx:
         "PSMFluidSweepSplit",
         node_collection,
         field_swaps=[(pdfs_fluid, pdfs_fluid_tmp)],
-       target=target,
+        target=target,
         inner_outer_split=True,
     )
 
diff --git a/apps/showcases/ThermalFluidizedBed/ThermalFluidizedBedPSM.cpp b/apps/showcases/ThermalFluidizedBed/ThermalFluidizedBedPSM.cpp
index b1eca1a10..8ee259122 100644
--- a/apps/showcases/ThermalFluidizedBed/ThermalFluidizedBedPSM.cpp
+++ b/apps/showcases/ThermalFluidizedBed/ThermalFluidizedBedPSM.cpp
@@ -385,8 +385,8 @@ int main(int argc, char** argv)
 
    // convert SI units to simulation (LBM) units and check setup
 
-   Vector3< uint_t > domainSize(uint_c((xSize_SI / dx_SI)), uint_c((ySize_SI / dx_SI)),
-                                uint_c((zSize_SI / dx_SI)));
+   Vector3< uint_t > domainSize(((xSize_SI / dx_SI)), ((ySize_SI / dx_SI)),
+                                ((zSize_SI / dx_SI)));
    WALBERLA_LOG_INFO_ON_ROOT("domain size in x is " << domainSize[0]);
    WALBERLA_CHECK_FLOAT_EQUAL(real_t(domainSize[0]) * dx_SI, xSize_SI, "domain size in x is not divisible by given dx");
    WALBERLA_CHECK_FLOAT_EQUAL(real_t(domainSize[1]) * dx_SI, ySize_SI, "domain size in y is not divisible by given dx");
@@ -652,20 +652,24 @@ int main(int argc, char** argv)
 
    boundariesBlockString += "\n BoundariesConcentration";
 
-   boundariesBlockString += "{"
-                            "Border { direction W;    walldistance -1;  flag Neumann_Concentration; }"
-                            "Border { direction E;    walldistance -1;  flag Neumann_Concentration; }";
+   boundariesBlockString += "{";
+
+   if (!periodicInX)
+   {
+      boundariesBlockString += "Border { direction W;    walldistance -1;  flag Density_Concentration_west; }"
+                               "Border { direction E;    walldistance -1;  flag Density_Concentration_west; }";
+   }
 
    if (!periodicInY)
    {
-      boundariesBlockString += "Border { direction S;    walldistance -1;  flag Neumann_Concentration; }"
-                               "Border { direction N;    walldistance -1;  flag Neumann_Concentration; }";
+      boundariesBlockString += "Border { direction S;    walldistance -1;  flag Density_Concentration_west; }"
+                               "Border { direction N;    walldistance -1;  flag Density_Concentration_west; }";
    }
 
    if (!periodicInZ)
    {
-      boundariesBlockString += "Border { direction T;    walldistance -1;  flag Density_Concentration_west; }"
-                               "Border { direction B;    walldistance -1;  flag Density_Concentration_west; }";
+      boundariesBlockString += "Border { direction T;    walldistance -1;  flag Neumann_Concentration; }"
+                               "Border { direction B;    walldistance -1;  flag Neumann_Concentration; }";
    }
    boundariesBlockString += "}";
    WALBERLA_ROOT_SECTION()
@@ -1006,7 +1010,8 @@ auto communication_concentration = std::function< void() >([&]() { com_concentra
 
    else{
       timeloop.add() << BeforeFunction(communication_fluid, "LBM fluid Communication")
-                     << Sweep(deviceSyncWrapper(density_fluid_bc.getSweep()), "Boundary Handling (Outflow Fluid)");
+                     << Sweep(deviceSyncWrapper(noSlip_fluid_bc.getSweep()),"Boundary Handling (No slip)");
+      timeloop.add() << Sweep(deviceSyncWrapper(density_fluid_bc.getSweep()), "Boundary Handling (Outflow Fluid)");
       timeloop.add() << Sweep(deviceSyncWrapper(ubb_fluid_bc.getSweep()),"Boundary Handling (UBB inflow fluid)");
 
       timeloop.add() << BeforeFunction(communication_concentration, "LBM concentration Communication")
-- 
GitLab