diff --git a/src/immersedBoundary/immersedBoundaryDynamicMesh/immersedBoundaryDynamicRefineSolidBodyMotionFvMesh/immersedBoundaryDynamicRefineSolidBodyMotionFvMesh.C b/src/immersedBoundary/immersedBoundaryDynamicMesh/immersedBoundaryDynamicRefineSolidBodyMotionFvMesh/immersedBoundaryDynamicRefineSolidBodyMotionFvMesh.C index 1bcb5c10e..113d83022 100644 --- a/src/immersedBoundary/immersedBoundaryDynamicMesh/immersedBoundaryDynamicRefineSolidBodyMotionFvMesh/immersedBoundaryDynamicRefineSolidBodyMotionFvMesh.C +++ b/src/immersedBoundary/immersedBoundaryDynamicMesh/immersedBoundaryDynamicRefineSolidBodyMotionFvMesh/immersedBoundaryDynamicRefineSolidBodyMotionFvMesh.C @@ -130,8 +130,10 @@ bool immersedBoundaryDynamicRefineSolidBodyMotionFvMesh::update() bool hasChanged = dynamicPolyRefinementFvMesh::update(); - changing(hasChanged); - + // If the background mesh has not changed, execute dummy mesh sync + // and mesh motion to re-calculate immersed boundary parameters, + // since the immersed boundary has been moved + // HJ, 17/May/2018 if (!hasChanged) { fvMesh::syncUpdateMesh(); diff --git a/src/immersedBoundary/immersedBoundaryDynamicMesh/immersedBoundaryRefinement/immersedBoundaryRefinement.C b/src/immersedBoundary/immersedBoundaryDynamicMesh/immersedBoundaryRefinement/immersedBoundaryRefinement.C index 6bd81d862..04c5a55ab 100644 --- a/src/immersedBoundary/immersedBoundaryDynamicMesh/immersedBoundaryRefinement/immersedBoundaryRefinement.C +++ b/src/immersedBoundary/immersedBoundaryDynamicMesh/immersedBoundaryRefinement/immersedBoundaryRefinement.C @@ -57,8 +57,14 @@ Foam::immersedBoundaryRefinement::immersedBoundaryRefinement ) : refinementSelection(mesh, dict), - refinementDistance_(readScalar(coeffDict().lookup("refinementDistance"))), - coarseningDistance_(readScalar(coeffDict().lookup("coarseningDistance"))) + refinementDistance_ + ( + readScalar(coeffDict().lookup("refinementDistance")) + ), + unrefinementDistance_ + ( + readScalar(coeffDict().lookup("unrefinementDistance")) + ) {} @@ -110,7 +116,7 @@ Foam::immersedBoundaryRefinement::refinementCellCandidates() const } Info<< "Cell distance (min, max): (" << min(cellDistance) - << " " << max(cellDistance) << ")" << endl; + << ", " << max(cellDistance) << ")" << endl; // Create storage for collection of cells. Assume that almost all of the // cells will be marked to prevent excessive resizing. @@ -122,7 +128,7 @@ Foam::immersedBoundaryRefinement::refinementCellCandidates() const if ( cellDistance[cellI] > -refinementDistance_ - && cellDistance[cellI] < 0 + && cellDistance[cellI] < 0 ) { // Found a refinement cell @@ -144,11 +150,8 @@ Foam::immersedBoundaryRefinement::refinementCellCandidates() const Foam::Xfer Foam::immersedBoundaryRefinement::unrefinementPointCandidates() const { - // Mark all points as unrefinement candidates since only split points may be - // considered for actual unrefinement and since this refinement criterion - // will be usually used in combination with others. VV, 15/Mar/2018. - - // All points are unrefinement candidates + // All points are unrefinement candidates (not just split points, these are + // filtered out in polyhedralRefinement engine) dynamicLabelList unrefinementCandidates(mesh().nPoints()); // Calculate distance to immersed boundary @@ -185,15 +188,16 @@ Foam::immersedBoundaryRefinement::unrefinementPointCandidates() const } Info<< "Split point distance(min, max): (" << min(pointDistance) - << " " << max(pointDistance) << ")" << endl; + << ", " << max(pointDistance) << ")" << endl; forAll (pointDistance, pointI) { - // Coarse live cells next to immersed boundary or dead cells + // Unrefine both live cells and dead cells far from the immersed + // boundary or dead cells if ( - pointDistance[pointI] < -coarseningDistance_ - || pointDistance[pointI] > SMALL + pointDistance[pointI] < -unrefinementDistance_ + || pointDistance[pointI] > unrefinementDistance_ ) { unrefinementCandidates.append(pointI); diff --git a/src/immersedBoundary/immersedBoundaryDynamicMesh/immersedBoundaryRefinement/immersedBoundaryRefinement.H b/src/immersedBoundary/immersedBoundaryDynamicMesh/immersedBoundaryRefinement/immersedBoundaryRefinement.H index 56332af8f..e3f6b68bf 100644 --- a/src/immersedBoundary/immersedBoundaryDynamicMesh/immersedBoundaryRefinement/immersedBoundaryRefinement.H +++ b/src/immersedBoundary/immersedBoundaryDynamicMesh/immersedBoundaryRefinement/immersedBoundaryRefinement.H @@ -58,8 +58,8 @@ class immersedBoundaryRefinement //- Refinement distance to immersed boundary scalar refinementDistance_; - //- Coarsening distance to immersed boundary - scalar coarseningDistance_; + //- Unrefinement distance to immersed boundary + scalar unrefinementDistance_; // Private Member Functions