From 9d2a0b25db962d2e9acecdd498aae9a1b0114e43 Mon Sep 17 00:00:00 2001 From: laurence Date: Fri, 31 May 2013 10:36:32 +0100 Subject: [PATCH] ENH: Update foamyHexMesh tutorials --- .../foamyHexMesh/blob/system/foamyHexMeshDict | 19 ++- tutorials/mesh/foamyHexMesh/flange/Allrun | 11 +- .../mesh/foamyHexMesh/flange/Allrun-parallel | 5 +- tutorials/mesh/foamyHexMesh/flange/Alltest | 4 +- .../flange/system/foamyHexMeshDict | 124 ++++++++++++++---- .../mesh/foamyHexMesh/simpleShapes/Allrun | 15 --- .../constant/triSurface/domain.stl | 86 ------------ .../simpleShapes/system/collapseDict | 9 +- .../simpleShapes/system/controlDict | 11 +- .../simpleShapes/system/foamyHexMeshDict | 94 ++++--------- .../system/surfaceFeatureExtractDict | 57 -------- 11 files changed, 153 insertions(+), 282 deletions(-) delete mode 100644 tutorials/mesh/foamyHexMesh/simpleShapes/constant/triSurface/domain.stl delete mode 100644 tutorials/mesh/foamyHexMesh/simpleShapes/system/surfaceFeatureExtractDict diff --git a/tutorials/mesh/foamyHexMesh/blob/system/foamyHexMeshDict b/tutorials/mesh/foamyHexMesh/blob/system/foamyHexMeshDict index 62649be994..9a1ae05312 100644 --- a/tutorials/mesh/foamyHexMesh/blob/system/foamyHexMeshDict +++ b/tutorials/mesh/foamyHexMesh/blob/system/foamyHexMeshDict @@ -36,10 +36,10 @@ geometry backgroundMeshDecomposition { - minLevels 0; - sampleResolution 4; - spanScale 20; - maxCellWeightCoeff 20; + minLevels 0; + sampleResolution 4; + spanScale 20; + maxCellWeightCoeff 20; } @@ -65,7 +65,16 @@ initialPoints surfaceConformation { - locationInMesh (0.1 0.1 0.2); + locationInMesh (0.1 0.1 0.2); + + featurePointControls + { + specialiseFeaturePoints off; + edgeAiming off; + guardFeaturePoints off; + snapFeaturePoints off; + circulateEdges off; + } geometryToConformTo { diff --git a/tutorials/mesh/foamyHexMesh/flange/Allrun b/tutorials/mesh/foamyHexMesh/flange/Allrun index f3f8912437..6936782122 100755 --- a/tutorials/mesh/foamyHexMesh/flange/Allrun +++ b/tutorials/mesh/foamyHexMesh/flange/Allrun @@ -4,16 +4,9 @@ cd ${0%/*} || exit 1 # run from this directory # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions -runApplication surfaceFeatureExtract - -# Create tight-fitting background mesh -runApplication blockMesh -runApplication topoSet -dict system/topoSetDict-background -mv log.topoSet log.topoSet.background -runApplication subsetMesh background -patch walls -overwrite - -runApplication cvMesh +runApplication foamyHexMesh runApplication collapseEdges -latestTime -collapseFaces runApplication checkMesh -latestTime -allGeometry -allTopology + # ----------------------------------------------------------------- end-of-file diff --git a/tutorials/mesh/foamyHexMesh/flange/Allrun-parallel b/tutorials/mesh/foamyHexMesh/flange/Allrun-parallel index f5bedb8935..4b56361f2d 100755 --- a/tutorials/mesh/foamyHexMesh/flange/Allrun-parallel +++ b/tutorials/mesh/foamyHexMesh/flange/Allrun-parallel @@ -7,8 +7,6 @@ cd ${0%/*} || exit 1 # run from this directory # Get the number of processors to run on from system/decomposeParDict nProc=$(getNumberOfProcessors) -runApplication surfaceFeatureExtract - # Create tight-fitting background mesh runApplication blockMesh runApplication topoSet -dict system/topoSetDict-background @@ -17,10 +15,11 @@ runApplication subsetMesh background -patch walls -overwrite runApplication decomposePar -runParallel cvMesh $nProc +runParallel foamyHexMesh $nProc runParallel collapseEdges $nProc -latestTime -collapseFaces runParallel checkMesh $nProc -latestTime -allTopology -allGeometry runApplication reconstructParMesh -latestTime + # ----------------------------------------------------------------- end-of-file diff --git a/tutorials/mesh/foamyHexMesh/flange/Alltest b/tutorials/mesh/foamyHexMesh/flange/Alltest index 75b5887193..87587982d8 100755 --- a/tutorials/mesh/foamyHexMesh/flange/Alltest +++ b/tutorials/mesh/foamyHexMesh/flange/Alltest @@ -4,11 +4,9 @@ cd ${0%/*} || exit 1 # run from this directory # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions -runApplication surfaceFeatureExtract - # Create tight-fitting background mesh runApplication blockMesh -runApplication cvMesh +runApplication foamyHexMesh # Change collapseEdges to only do one iteration cp system/collapseDict system/collapseDict.org diff --git a/tutorials/mesh/foamyHexMesh/flange/system/foamyHexMeshDict b/tutorials/mesh/foamyHexMesh/flange/system/foamyHexMeshDict index 6b15b6063c..4ba0ceafe6 100644 --- a/tutorials/mesh/foamyHexMesh/flange/system/foamyHexMeshDict +++ b/tutorials/mesh/foamyHexMesh/flange/system/foamyHexMeshDict @@ -26,29 +26,28 @@ geometry { name flange; type triSurfaceMesh; - } -} - -backgroundMeshDecomposition -{ - minLevels 1; - sampleResolution 4; - spanScale 5; - maxCellWeightCoeff 10; -} - - -surfaceConformation -{ - locationInMesh (0 0 0); - - geometryToConformTo - { - flange + regions { - featureMethod extractFeatures; - includedAngle 140; + patch1 + { + name wall; + } + + patch2 + { + name plate; + } + + patch3 + { + name rings; + } + + patch4 + { + name outlet; + } } } } @@ -68,13 +67,63 @@ initialPoints } +surfaceConformation +{ + locationInMesh (0 0 0); + + geometryToConformTo + { + flange + { + featureMethod extractFeatures; + includedAngle 140; + + regions + { + wall + { + patchInfo + { + inGroups (groupFlange groupWalls); + } + } + + plate + { + patchInfo + { + inGroups (groupFlange groupWalls); + } + } + + rings + { + patchInfo + { + inGroups (groupFlange); + } + } + + outlet + { + patchInfo + { + type patch; + inGroups (groupFlange); + } + } + } + } + } +} + + motionControl { defaultCellSize 0.0008; minimumCellSizeCoeff 0; - // For background cell size and alignment grid maxSmoothingIterations 100; maxRefinementIterations 0; @@ -98,6 +147,28 @@ motionControl surfaceOffsetCoeff 2.5; linearDistanceCoeff 2.5; } + + regions + { + rings + { + type searchableSurfaceControl; + priority 2; + mode inside; + surfaceCellSizeFunction uniformValue; + uniformValueCoeffs + { + surfaceCellSizeCoeff 0.5; + } + cellSizeFunction surfaceOffsetLinearDistance; + surfaceOffsetLinearDistanceCoeffs + { + distanceCellSizeCoeff 1; + surfaceOffsetCoeff 2; + linearDistanceCoeff 2; + } + } + } } } @@ -113,6 +184,15 @@ motionControl } +backgroundMeshDecomposition +{ + minLevels 1; + sampleResolution 4; + spanScale 5; + maxCellWeightCoeff 10; +} + + meshQualityControls { #include "meshQualityDict" diff --git a/tutorials/mesh/foamyHexMesh/simpleShapes/Allrun b/tutorials/mesh/foamyHexMesh/simpleShapes/Allrun index ccecbaaa76..1d2a2a11aa 100755 --- a/tutorials/mesh/foamyHexMesh/simpleShapes/Allrun +++ b/tutorials/mesh/foamyHexMesh/simpleShapes/Allrun @@ -18,26 +18,11 @@ runApplication surfaceOrient \ constant/triSurface/coneAndSphere_clean_orient.obj mv log.surfaceOrient log.surfaceOrient.coneAndSphere -# Same for outside -runApplication surfaceClean \ - constant/triSurface/domain.stl \ - 1e-4 1e-6 \ - constant/triSurface/domain_clean.stl -mv log.surfaceClean log.surfaceClean.domain -runApplication surfaceOrient \ - constant/triSurface/domain_clean.stl \ - -inside '(0 -0.5 0)' \ - constant/triSurface/domain_clean_orient.stl -mv log.surfaceOrient log.surfaceOrient.domain - unset FOAM_SIGFPE -runApplication surfaceFeatureExtract # Generate aligned points (in constant/internalDelaunayVertices) and a # mesh from that. runApplication foamyHexMesh -# Generate some sets for a bit of mesh inspection -runApplication topoSet -time 0:100 # ----------------------------------------------------------------- end-of-file diff --git a/tutorials/mesh/foamyHexMesh/simpleShapes/constant/triSurface/domain.stl b/tutorials/mesh/foamyHexMesh/simpleShapes/constant/triSurface/domain.stl deleted file mode 100644 index 5650ed2001..0000000000 --- a/tutorials/mesh/foamyHexMesh/simpleShapes/constant/triSurface/domain.stl +++ /dev/null @@ -1,86 +0,0 @@ -solid ascii - facet normal -1 0 0 - outer loop - vertex -0.7 -0.9 -1 - vertex -0.7 -0.9 1 - vertex -0.7 1.1 -1 - endloop - endfacet - facet normal -1 0 0 - outer loop - vertex -0.7 1.1 1 - vertex -0.7 1.1 -1 - vertex -0.7 -0.9 1 - endloop - endfacet - facet normal 1 0 0 - outer loop - vertex 1.3 -0.9 -1 - vertex 1.3 1.1 -1 - vertex 1.3 -0.9 1 - endloop - endfacet - facet normal 1 -0 0 - outer loop - vertex 1.3 1.1 1 - vertex 1.3 -0.9 1 - vertex 1.3 1.1 -1 - endloop - endfacet - facet normal 0 -1 0 - outer loop - vertex -0.7 -0.9 -1 - vertex 1.3 -0.9 -1 - vertex -0.7 -0.9 1 - endloop - endfacet - facet normal 0 -1 0 - outer loop - vertex 1.3 -0.9 1 - vertex -0.7 -0.9 1 - vertex 1.3 -0.9 -1 - endloop - endfacet - facet normal 0 1 0 - outer loop - vertex -0.7 1.1 -1 - vertex -0.7 1.1 1 - vertex 1.3 1.1 -1 - endloop - endfacet - facet normal 0 1 -0 - outer loop - vertex 1.3 1.1 1 - vertex 1.3 1.1 -1 - vertex -0.7 1.1 1 - endloop - endfacet - facet normal 0 0 -1 - outer loop - vertex -0.7 -0.9 -1 - vertex -0.7 1.1 -1 - vertex 1.3 -0.9 -1 - endloop - endfacet - facet normal 0 0 -1 - outer loop - vertex 1.3 1.1 -1 - vertex 1.3 -0.9 -1 - vertex -0.7 1.1 -1 - endloop - endfacet - facet normal 0 0 1 - outer loop - vertex -0.7 -0.9 1 - vertex 1.3 -0.9 1 - vertex -0.7 1.1 1 - endloop - endfacet - facet normal -0 0 1 - outer loop - vertex 1.3 1.1 1 - vertex -0.7 1.1 1 - vertex 1.3 -0.9 1 - endloop - endfacet -endsolid diff --git a/tutorials/mesh/foamyHexMesh/simpleShapes/system/collapseDict b/tutorials/mesh/foamyHexMesh/simpleShapes/system/collapseDict index 4ab55ec7bf..be7a782fe3 100644 --- a/tutorials/mesh/foamyHexMesh/simpleShapes/system/collapseDict +++ b/tutorials/mesh/foamyHexMesh/simpleShapes/system/collapseDict @@ -7,10 +7,11 @@ \*---------------------------------------------------------------------------*/ FoamFile { - version 2.0; - format ascii; - class dictionary; - object collapseDict; + version 2.0; + format ascii; + class dictionary; + location "system"; + object collapseDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/mesh/foamyHexMesh/simpleShapes/system/controlDict b/tutorials/mesh/foamyHexMesh/simpleShapes/system/controlDict index 8bbced6c67..c392e61b82 100644 --- a/tutorials/mesh/foamyHexMesh/simpleShapes/system/controlDict +++ b/tutorials/mesh/foamyHexMesh/simpleShapes/system/controlDict @@ -5,24 +5,17 @@ | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ - FoamFile { version 2.0; format ascii; - - root ""; - case ""; - instance ""; - local ""; - + location "system"; class dictionary; object controlDict; } - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -startFrom latestTime; +startFrom startTime; startTime 0; diff --git a/tutorials/mesh/foamyHexMesh/simpleShapes/system/foamyHexMeshDict b/tutorials/mesh/foamyHexMesh/simpleShapes/system/foamyHexMeshDict index 5f14ff9d46..a449695221 100644 --- a/tutorials/mesh/foamyHexMesh/simpleShapes/system/foamyHexMeshDict +++ b/tutorials/mesh/foamyHexMesh/simpleShapes/system/foamyHexMeshDict @@ -27,25 +27,29 @@ geometry } // Outside of domain - domain_clean_orient.stl + domain { - name domain; - type triSurfaceMesh; - regions - { - ascii{ name domain_patch0; } - } + type searchableBox; + min (-0.7 -0.9 -1); + max (1.3 1.1 1); } } -// Controls for conforming to the surfaces. surfaceConformation { - // A point inside surfaces that is inside mesh. locationInMesh (0 -0.5 0); + featurePointControls + { + specialiseFeaturePoints on; + edgeAiming on; + guardFeaturePoints off; + snapFeaturePoints on; + circulateEdges off; + } + // Geometry to mesh to geometryToConformTo { @@ -53,94 +57,43 @@ surfaceConformation { featureMethod extractFeatures; includedAngle 140; - featureMethod extendedFeatureEdgeMesh; - extendedFeatureEdgeMesh "coneAndSphere_clean_orient.extendedFeatureEdgeMesh"; } domain { featureMethod extractFeatures; - includedAngle 125; - featureMethod extendedFeatureEdgeMesh; - extendedFeatureEdgeMesh "domain_clean_orient.extendedFeatureEdgeMesh"; + includedAngle 100; + mode outside; } } - - additionalFeatures - {} } -// Controls for seeding initial points and general control of the target -// cell size (used everywhere) initialPoints { initialPointsMethod autoDensity; - // initialPointsMethod uniformGrid; - // initialPointsMethod bodyCentredCubic; - // initialPointsMethod pointFile; - // Take boundbox of all geometry. Samples with this box. If too much - // samples (due to target cell size) in box split box. autoDensityCoeffs { - minCellSizeLimit 0.1; - // Initial number of refinement levels. Needs to be enough to pick - // up features due to size ratio. If not enough it will take longer - // to determine point seeding. - minLevels 4; - // Split box if ratio of min to max cell size larger than maxSizeRatio - maxSizeRatio 5.0; - // Per box sample 3x3x3 internally - sampleResolution 3; - // Additionally per face of the box sample 3 + minCellSizeLimit 0.1; + minLevels 4; + maxSizeRatio 5.0; + sampleResolution 3; surfaceSampleResolution 3; } - - uniformGridCoeffs - { - // Absolute cell size. - initialCellSize 0.0015; - randomiseInitialGrid yes; - randomPerturbationCoeff 0.02; - } - - bodyCentredCubicCoeffs - { - initialCellSize 0.0015; - randomiseInitialGrid no; - randomPerturbationCoeff 0.1; - } - - pointFileCoeffs - { - // Reads points from file. Still rejects points that are too - // close to the surface (minimumSurfaceDistanceCoeff) or on the - // wrong side of the surfaces. - pointFile "constant/internalDelaunayVertices"; - } } -// Control size of voronoi cells i.e. distance between points. This -// determines the target cell size which is used everywhere. -// It determines the cell size given a location. It then uses all -// the rules -// - defaultCellSize -// - cellSizeControlGeometry -// to determine target cell size. Rule with highest priority wins. If same -// priority smallest cell size wins. motionControl { - // Absolute cell size of back ground mesh. This is the maximum cell size. defaultCellSize 0.1; minimumCellSizeCoeff 0; // For background cell size and alignment grid - maxSmoothingIterations 100; + maxSmoothingIterations 100; - maxRefinementIterations 0; + maxRefinementIterations 0; shapeControlFunctions { @@ -197,7 +150,10 @@ polyMeshFiltering } -#include "meshQualityDict"; +meshQualityControls +{ + #include "meshQualityDict" +} // ************************************************************************* // diff --git a/tutorials/mesh/foamyHexMesh/simpleShapes/system/surfaceFeatureExtractDict b/tutorials/mesh/foamyHexMesh/simpleShapes/system/surfaceFeatureExtractDict deleted file mode 100644 index 850a4ea41f..0000000000 --- a/tutorials/mesh/foamyHexMesh/simpleShapes/system/surfaceFeatureExtractDict +++ /dev/null @@ -1,57 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - object surfaceFeatureExtractDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -coneAndSphere_clean_orient.obj -{ - extractionMethod extractFromSurface; - - extractFromSurfaceCoeffs - { - // Mark edges whose adjacent surface normals are at an angle less - // than includedAngle as features - // - 0 : selects no edges - // - 180: selects all edges - includedAngle 125; - } - - // Write options - - // Write features to obj format for postprocessing - writeObj no; -} - - -domain_clean_orient.stl -{ - extractionMethod extractFromSurface; - - extractFromSurfaceCoeffs - { - // Mark edges whose adjacent surface normals are at an angle less - // than includedAngle as features - // - 0 : selects no edges - // - 180: selects all edges - includedAngle 125; - } - - // Write options - - // Write features to obj format for postprocessing - writeObj no; -} - - -// ************************************************************************* //