From 4a1650335905e2f821aa8b50fa15829a06dab3e3 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Wed, 16 May 2018 15:10:47 +0100 Subject: [PATCH] Enabled dynamic refinement in immersed boundary dynamic mesh --- .../immersedBoundaryDynamicMesh/Make/files | 3 + .../immersedBoundaryDynamicMesh/Make/options | 2 + ...undaryDynamicRefineSolidBodyMotionFvMesh.C | 631 +----------------- ...undaryDynamicRefineSolidBodyMotionFvMesh.H | 54 +- .../immersedBoundaryRefinement.C | 214 ++++++ .../immersedBoundaryRefinement.H | 114 ++++ 6 files changed, 341 insertions(+), 677 deletions(-) create mode 100644 src/immersedBoundary/immersedBoundaryDynamicMesh/immersedBoundaryRefinement/immersedBoundaryRefinement.C create mode 100644 src/immersedBoundary/immersedBoundaryDynamicMesh/immersedBoundaryRefinement/immersedBoundaryRefinement.H diff --git a/src/immersedBoundary/immersedBoundaryDynamicMesh/Make/files b/src/immersedBoundary/immersedBoundaryDynamicMesh/Make/files index a090e5ac8..963e02966 100644 --- a/src/immersedBoundary/immersedBoundaryDynamicMesh/Make/files +++ b/src/immersedBoundary/immersedBoundaryDynamicMesh/Make/files @@ -2,6 +2,9 @@ movingImmersedBoundary/movingImmersedBoundary.C refineImmersedBoundaryMesh/refineImmersedBoundaryMesh.C immersedBoundarySolidBodyMotionFvMesh/immersedBoundarySolidBodyMotionFvMesh.C + +immersedBoundaryRefinement/immersedBoundaryRefinement.C + immersedBoundaryDynamicRefineSolidBodyMotionFvMesh/immersedBoundaryDynamicRefineSolidBodyMotionFvMesh.C LIB = $(FOAM_LIBBIN)/libimmersedBoundaryDynamicMesh diff --git a/src/immersedBoundary/immersedBoundaryDynamicMesh/Make/options b/src/immersedBoundary/immersedBoundaryDynamicMesh/Make/options index 3fd50b686..10959e1e8 100644 --- a/src/immersedBoundary/immersedBoundaryDynamicMesh/Make/options +++ b/src/immersedBoundary/immersedBoundaryDynamicMesh/Make/options @@ -6,6 +6,7 @@ EXE_INC = \ -I$(LIB_SRC)/sampling/lnInclude \ -I$(LIB_SRC)/dynamicMesh/dynamicMesh/lnInclude \ -I$(LIB_SRC)/dynamicMesh/dynamicFvMesh/lnInclude \ + -I$(LIB_SRC)/dynamicMesh/topoChangerFvMesh/lnInclude \ -I$(LIB_SRC)/dynamicMesh/meshMotion/solidBodyMotion/lnInclude LIB_LIBS = \ @@ -16,4 +17,5 @@ LIB_LIBS = \ -lsampling \ -ldynamicMesh \ -ldynamicFvMesh \ + -ltopoChangerFvMesh \ -lsolidBodyMotion diff --git a/src/immersedBoundary/immersedBoundaryDynamicMesh/immersedBoundaryDynamicRefineSolidBodyMotionFvMesh/immersedBoundaryDynamicRefineSolidBodyMotionFvMesh.C b/src/immersedBoundary/immersedBoundaryDynamicMesh/immersedBoundaryDynamicRefineSolidBodyMotionFvMesh/immersedBoundaryDynamicRefineSolidBodyMotionFvMesh.C index b0833651e..1bcb5c10e 100644 --- a/src/immersedBoundary/immersedBoundaryDynamicMesh/immersedBoundaryDynamicRefineSolidBodyMotionFvMesh/immersedBoundaryDynamicRefineSolidBodyMotionFvMesh.C +++ b/src/immersedBoundary/immersedBoundaryDynamicMesh/immersedBoundaryDynamicRefineSolidBodyMotionFvMesh/immersedBoundaryDynamicRefineSolidBodyMotionFvMesh.C @@ -55,444 +55,13 @@ addToRunTimeSelectionTable } // End namespace Foam -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - -Foam::label Foam::immersedBoundaryDynamicRefineSolidBodyMotionFvMesh::count -( - const PackedBoolList& l, - const unsigned int val -) -{ - label n = 0; - forAll (l, i) - { - if (l.get(i) == val) - { - n++; - } - - // debug also serves to get-around Clang compiler trying to optimise - // out this forAll loop under O3 optimisation - - if (debug) - { - Info<< "n=" << n << endl; - } - } - - return n; -} - - -Foam::autoPtr -Foam::immersedBoundaryDynamicRefineSolidBodyMotionFvMesh::refine -( - const labelList& cellsToRefine -) -{ - // Mesh changing engine. - directTopoChange meshMod(*this); - - // Play refinement commands into mesh changer. - meshCutter_.setRefinement(cellsToRefine, meshMod); - - // Create mesh (with inflation), return map from old to new mesh. - //autoPtr map = meshMod.changeMesh(*this, true); - autoPtr map = meshMod.changeMesh(*this, false); - - Info<< "Refined from " - << returnReduce(map().nOldCells(), sumOp