diff --git a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C index 6cd54bb461..1f72f1d221 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C +++ b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C @@ -238,6 +238,25 @@ int main(int argc, char *argv[]) dict.lookup("constructFrom") ); + // Any merging of small edges + const scalar mergeTol(dict.lookupOrDefault("mergeTol", 1e-4)); + + Info<< "Extruding from " << ExtrudeModeNames[mode] + << " using model " << model().type() << endl; + if (flipNormals) + { + Info<< "Flipping normals before extruding" << endl; + } + if (mergeTol > 0) + { + Info<< "Collapsing edges < " << mergeTol << " of bounding box" << endl; + } + else + { + Info<< "Not collapsing any edges after extrusion" << endl; + } + Info<< endl; + // Generated mesh (one of either) autoPtr meshFromMesh; @@ -715,7 +734,7 @@ int main(int argc, char *argv[]) const boundBox& bb = mesh.bounds(); const vector span = bb.span(); - const scalar mergeDim = 1e-4 * bb.minDim(); + const scalar mergeDim = mergeTol * bb.minDim(); Info<< "Mesh bounding box : " << bb << nl << " with span : " << span << nl @@ -726,6 +745,7 @@ int main(int argc, char *argv[]) // Collapse edges // ~~~~~~~~~~~~~~ + if (mergeDim > 0) { Info<< "Collapsing edges < " << mergeDim << " ..." << nl << endl; diff --git a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMeshDict b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMeshDict index e075acbc4e..ecbc647797 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMeshDict +++ b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMeshDict @@ -88,4 +88,8 @@ sigmaRadialCoeffs // degree wedges. mergeFaces false; //true; +// Merge small edges. Fraction of bounding box. +mergeTol 0; + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_simpleFoam/system/extrudeMeshDict b/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_simpleFoam/system/extrudeMeshDict index b695ab7e5d..0bcac7b5ce 100644 --- a/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_simpleFoam/system/extrudeMeshDict +++ b/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_simpleFoam/system/extrudeMeshDict @@ -10,12 +10,14 @@ FoamFile version 2.0; format ascii; class dictionary; - object extrudeProperties; + object extrudeMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // What to extrude: // patch : from patch of another case ('sourceCase') +// mesh : as above but with original case included +// surface : from externally read surface constructFrom patch; sourceCase "../wingMotion_snappyHexMesh"; @@ -24,7 +26,8 @@ sourcePatches (front); // If construct from patch: patch to use for back (can be same as sourcePatch) exposedPatchName back; -// Flip surface normals before usage. +// Flip surface normals before usage. Valid only for extrude from surface or +// patch. flipNormals false; //- Linear extrusion in point-normal direction @@ -41,7 +44,10 @@ linearNormalCoeffs // Do front and back need to be merged? Usually only makes sense for 360 // degree wedges. -mergeFaces false; +mergeFaces false; //true; + +// Merge small edges. Fraction of bounding box. +mergeTol 0; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //