From 12351d3a195e16a3b33d816c8aed49b3f8edb546 Mon Sep 17 00:00:00 2001
From: Markus Holzer <markus.holzer@fau.de>
Date: Mon, 26 Feb 2024 08:28:15 +0100
Subject: [PATCH] Started Debugging

---
 apps/showcases/FlowAroundCylinder/Evaluation.cpp    |  4 ++--
 .../FlowAroundCylinder/FlowAroundCylinder.cpp       |  5 +++++
 .../FlowAroundCylinder/SchaeferTurek3D-1Z.prm       | 13 +++++++------
 3 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/apps/showcases/FlowAroundCylinder/Evaluation.cpp b/apps/showcases/FlowAroundCylinder/Evaluation.cpp
index fd267b70d..a4b107bdf 100644
--- a/apps/showcases/FlowAroundCylinder/Evaluation.cpp
+++ b/apps/showcases/FlowAroundCylinder/Evaluation.cpp
@@ -58,8 +58,8 @@ void Evaluation::operator()()
    for (auto& block : *blocks)
    {
       FlagField_T* flagField              = block.getData<FlagField_T>(ids_.flagField);
-      VelocityField_T* velocityField      = block.getData<VelocityField_T>(ids_.avgVelField);
-      ScalarField_T* densityField         = block.getData<ScalarField_T>(ids_.avgPressureField);
+      VelocityField_T* velocityField      = block.getData<VelocityField_T>(ids_.velocityField);
+      ScalarField_T* densityField         = block.getData<ScalarField_T>(ids_.densityField);
       VelocityField_T* avgVelField        = block.getData<VelocityField_T>(ids_.avgVelField);
       VelocityField_T* avgVelSqrField     = block.getData<VelocityField_T>(ids_.avgVelSqrField);
       ScalarField_T* avgPressureField     = block.getData<ScalarField_T>(ids_.avgPressureField);
diff --git a/apps/showcases/FlowAroundCylinder/FlowAroundCylinder.cpp b/apps/showcases/FlowAroundCylinder/FlowAroundCylinder.cpp
index 771357751..3fae7ca9b 100644
--- a/apps/showcases/FlowAroundCylinder/FlowAroundCylinder.cpp
+++ b/apps/showcases/FlowAroundCylinder/FlowAroundCylinder.cpp
@@ -43,6 +43,7 @@
 #include "field/FlagField.h"
 #include "field/StabilityChecker.h"
 #include "field/adaptors/AdaptorCreators.h"
+#include "field/vtk/FlagFieldCellFilter.h"
 #include "field/vtk/VTKWriter.h"
 
 #include "geometry/InitBoundaryHandling.h"
@@ -734,6 +735,10 @@ int main(int argc, char** argv)
          vtkOutput->addCellInclusionFilter(vtk::AABBCellFilter(sliceAABB));
       }
 
+      field::FlagFieldCellFilter<FlagField_T> fluidFilter( ids.flagField );
+      fluidFilter.addFlag(obstacleFlagUID);
+      vtkOutput->addCellExclusionFilter(fluidFilter);
+
       if (writeVelocity)
       {
          auto velWriter = make_shared< field::VTKWriter< VelocityField_T, float32 > >(ids.velocityField, "velocity");
diff --git a/apps/showcases/FlowAroundCylinder/SchaeferTurek3D-1Z.prm b/apps/showcases/FlowAroundCylinder/SchaeferTurek3D-1Z.prm
index 3a3f09a31..5ae5cd63b 100644
--- a/apps/showcases/FlowAroundCylinder/SchaeferTurek3D-1Z.prm
+++ b/apps/showcases/FlowAroundCylinder/SchaeferTurek3D-1Z.prm
@@ -10,7 +10,7 @@ Parameters
     diameterCylinder 0.1; // On the finest mesh
     cylinderXPosition 0.5;
     cylinderyPosition 0.2;
-    coarseMeshSize 0.01; // 9.765625e-4;
+    coarseMeshSize 0.00640625; // 9.765625e-4;
     circularCrossSection true;
     inflowProfile 1; // 1: Parabolic (SchaeferTurek), 2: uniform (Jacob et al)
 
@@ -34,10 +34,10 @@ Parameters
 
 DomainSetup
 {
-    cellsPerBlock < 250, 41, 41 >;
+    cellsPerBlock < 64, 16, 16 >;
     domainSize    < 2.5, 0.41, 0.41 >;
     periodic      < false, false, false>;
-    refinementLevels 0;
+    refinementLevels 1;
     numberProcesses 1; // This is for load balancing, overwritten if more than one proc is used
 }
 
@@ -60,11 +60,12 @@ StabilityChecker
 
 VTKWriter
 {
-    vtkWriteFrequency 0;
+    vtkWriteFrequency 2000;
     velocity true;
     density false;
+    averageFields true;
     flag false;
-    writeOnlySlice true;
+    writeOnlySlice false;
     amrFileFormat false;
     oneFilePerProcess false;
 }
@@ -79,7 +80,7 @@ Logging
 
 Evaluation
 {
-    evaluationCheckFrequency 2000;
+    evaluationCheckFrequency 1000;
     rampUpTime 10000;
     logToStream true;
     logToFile true;
-- 
GitLab