BUG: blockMesh mergePatchPairs fails with edge-shared points (fixes #2589)

- remedy by performing the attach() action sequentially (as per
  stitchMesh changes). This ensures that the current point addressing
  is always used and avoids references to the already-merged points
  (which is what causes the failure).

ENH: improve handling of empty patch removal

- only remove empty *merged* patches, but leave any other empty
  patches untouched since they may intentional placeholders for other
  parts of a workflow.

- remove any empty point/face zones created for patch merging
This commit is contained in:
Mark Olesen
2022-09-23 10:01:39 +02:00
parent 9fa37ba068
commit 56e9f7bf4b
6 changed files with 371 additions and 39 deletions

View File

@ -0,0 +1,10 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
#------------------------------------------------------------------------------
cleanCase0
rm -rf constant
#------------------------------------------------------------------------------

View File

@ -0,0 +1,8 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
runApplication blockMesh
#------------------------------------------------------------------------------

View File

@ -0,0 +1,119 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
scale 0.001;
vertices
(
// Block d
( 50 -17 -12.5)
(100 -17 -12.5)
(100 -2 -12.5)
( 50 -2 -12.5)
( 50 -17 12.5)
(100 -17 12.5)
(100 -2 12.5)
( 50 -2 12.5)
// Block e
( 0 -17 -12.5)
( 50 -17 -12.5)
( 50 -2 -12.5)
( 0 -2 -12.5)
( 0 -17 12.5)
( 50 -17 12.5)
( 50 -2 12.5)
( 0 -2 12.5)
// Block f
( 0 -19 -12.5)
( 50 -19 -12.5)
( 50 -17 -12.5)
( 0 -17 -12.5)
( 0 -19 12.5)
( 50 -19 12.5)
( 50 -17 12.5)
( 0 -17 12.5)
);
blocks
(
// Block d
hex (0 1 2 3 4 5 6 7) block-d (4 5 4) grading (1 1 1)
// Block e
hex (8 9 10 11 12 13 14 15) block-e (4 4 4) grading (1 1 1)
// Block f
hex (16 17 18 19 20 21 22 23) block-f (5 4 4) grading (1 1 1)
);
edges
(
);
boundary
(
mid6
{
type patch;
faces
(
(0 0) // Block d
);
}
mid7
{
type patch;
faces
(
(1 1) // Block e
);
}
mid8
{
type patch;
faces
(
(1 2) // Block e
);
}
mid9
{
type patch;
faces
(
(2 3) // Block e
);
}
other
{
type patch;
faces ();
}
);
mergePatchPairs
(
(mid6 mid7)
(mid8 mid9)
);
// ************************************************************************* //

View File

@ -0,0 +1,48 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2206 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application blockMesh;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 0;
deltaT 0;
writeControl timeStep;
writeInterval 1;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable true;
// ************************************************************************* //