From 986532b18a86b4838226b21993b13507e7898330 Mon Sep 17 00:00:00 2001 From: laurence Date: Tue, 5 Feb 2013 16:51:37 +0000 Subject: [PATCH] ENH: cvMesh: Update tutorials --- .../mesh/cvMesh/blob/system/collapseDict | 70 +++++++++++----- tutorials/mesh/cvMesh/blob/system/cvMeshDict | 84 ++++++++++--------- .../mesh/cvMesh/blob/system/meshQualityDict | 8 -- .../mesh/cvMesh/flange/system/collapseDict | 64 ++++++++++---- .../mesh/cvMesh/flange/system/cvMeshDict | 77 +++++++++-------- .../mesh/cvMesh/flange/system/meshQualityDict | 8 -- .../cvMesh/simpleShapes/system/collapseDict | 66 +++++++++++---- .../cvMesh/simpleShapes/system/cvMeshDict | 24 ++++-- .../simpleShapes/system/meshQualityDict | 8 -- 9 files changed, 252 insertions(+), 157 deletions(-) diff --git a/tutorials/mesh/cvMesh/blob/system/collapseDict b/tutorials/mesh/cvMesh/blob/system/collapseDict index 4948b7a61d..4ab55ec7bf 100644 --- a/tutorials/mesh/cvMesh/blob/system/collapseDict +++ b/tutorials/mesh/cvMesh/blob/system/collapseDict @@ -5,49 +5,79 @@ | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ - FoamFile { version 2.0; format ascii; - - root ""; - case ""; - instance ""; - local ""; - class dictionary; object collapseDict; } - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +controlMeshQuality on; + collapseEdgesCoeffs { - minimumEdgeLength 1e-4; - maximumMergeAngle 180; - reductionFactor 0.5; -} + // Edges shorter than this absolute value will be merged + minimumEdgeLength 1e-6; + // The maximum angle between two edges that share a point attached to + // no other edges + maximumMergeAngle 180; +} collapseFacesCoeffs { + // The initial face length factor initialFaceLengthFactor 0.5; - reductionFactor 0.5; - allowEarlyCollapseToPoint on; - allowEarlyCollapseCoeff 0.2; - guardFraction 0.1; + // If the face can't be collapsed to an edge, and it has a span less than + // the target face length multiplied by this coefficient, collapse it + // to a point. maxCollapseFaceToPointSideLengthCoeff 0.3; + + // Allow early collapse of edges to a point + allowEarlyCollapseToPoint on; + + // Fraction to premultiply maxCollapseFaceToPointSideLengthCoeff by if + // allowEarlyCollapseToPoint is enabled + allowEarlyCollapseCoeff 0.2; + + // Defining how close to the midpoint (M) of the projected + // vertices line a projected vertex (X) can be before making this + // an invalid edge collapse + // + // X---X-g----------------M----X-----------g----X--X + // + // Only allow a collapse if all projected vertices are outwith + // guardFraction (g) of the distance form the face centre to the + // furthest vertex in the considered direction + guardFraction 0.1; } - -meshQualityCoeffs +controlMeshQualityCoeffs { + // Name of the dictionary that has the mesh quality coefficients used + // by motionSmoother::checkMesh #include "meshQualityDict"; + + // The amount that minimumEdgeLength will be reduced by for each + // edge if that edge's collapse generates a poor quality face + edgeReductionFactor 0.5; + + // The amount that initialFaceLengthFactor will be reduced by for each + // face if its collapse generates a poor quality face + faceReductionFactor 0.5; + + // Maximum number of smoothing iterations for the reductionFactors + maximumSmoothingIterations 2; + + // Maximum number of outer iterations is mesh quality checking is enabled maximumIterations 10; - maximumSmoothingIterations 1; - maxPointErrorCount 5; + + // Maximum number of iterations deletion of a point can cause a bad face + // to be constructed before it is forced to not be deleted + maxPointErrorCount 3; } diff --git a/tutorials/mesh/cvMesh/blob/system/cvMeshDict b/tutorials/mesh/cvMesh/blob/system/cvMeshDict index eda52324f5..17478d3aee 100644 --- a/tutorials/mesh/cvMesh/blob/system/cvMeshDict +++ b/tutorials/mesh/cvMesh/blob/system/cvMeshDict @@ -5,21 +5,13 @@ | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ - FoamFile { version 2.0; format ascii; - - root ""; - case ""; - instance ""; - local ""; - class dictionary; object cvMeshDict; } - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // Any scalar with a name Coeff specifies a value that will be implemented @@ -29,6 +21,7 @@ geometry { blob.stl { + name blob; type triSurfaceMesh; } @@ -54,29 +47,29 @@ initialPoints { minimumSurfaceDistanceCoeff 0.55; - initialPointsMethod autoDensity; + initialPointsMethod autoDensity; // initialPointsMethod pointFile; autoDensityCoeffs { - minLevels 0; - maxSizeRatio 5.0; - sampleResolution 5; + minLevels 0; + maxSizeRatio 5.0; + sampleResolution 5; surfaceSampleResolution 5; } pointFileCoeffs { - pointFile "constant/internalDelaunayVertices"; + pointFile "constant/internalDelaunayVertices"; } } surfaceConformation { - locationInMesh (0.1 0.1 0.2); + locationInMesh (0.1 0.1 0.2); - pointPairDistanceCoeff 0.1; + pointPairDistanceCoeff 0.1; mixedFeaturePointPPDistanceCoeff 5.0; @@ -84,17 +77,17 @@ surfaceConformation featureEdgeExclusionDistanceCoeff 0.2; - surfaceSearchDistanceCoeff 5; + surfaceSearchDistanceCoeff 5; - nearBoundaryDistanceCoeff 5; + nearBoundaryDistanceCoeff 5; - maxSurfaceProtrusionCoeff 0.001; + maxSurfaceProtrusionCoeff 0.001; - maxQuadAngle 125; + maxQuadAngle 125; surfaceConformationRebuildFrequency 10; - specialiseFeaturePoints off; + specialiseFeaturePoints off; conformationControls { @@ -102,51 +95,62 @@ surfaceConformation surfacePtReplaceDistCoeff 0.5; surfacePtExclusionDistanceCoeff 0.5; - maxIterations 15; + maxIterations 15; iterationToInitialHitRatioLimit 0.0001; } geometryToConformTo { - blob.stl + blob { featureMethod none; } } additionalFeatures - { - } + {} } motionControl { - defaultCellSize 0.1; + defaultCellSize 0.1; + + minimumCellSizeCoeff 0; + + maxSmoothingIterations 0; + maxRefinementIterations 0; shapeControlFunctions { - blob.stl +/* blob*/ +/* {*/ +/* type searchableSurfaceControl;*/ +/* priority 1;*/ +/* mode bothSides;*/ + +/* surfaceCellSizeFunction uniformValue;*/ +/* uniformValueCoeffs*/ +/* {*/ +/* surfaceCellSizeCoeff 1;*/ +/* }*/ + +/* cellSizeFunction uniform;*/ +/* uniformCoeffs*/ +/* {}*/ +/* }*/ + + fileControl { - type searchableSurfaceControl; + type fileControl; priority 1; - mode bothSides; - - surfaceCellSizeFunction uniformValue; - uniformValueCoeffs - { - surfaceCellSize $defaultCellSize; - } - - cellSizeFunction uniform; - uniformCoeffs - {} + pointsFile "points"; + sizesFile "sizes"; + alignmentsFile "alignments"; } } - maxRefinementIterations 1; - cellAspectRatioControl { aspectRatio 1.0; diff --git a/tutorials/mesh/cvMesh/blob/system/meshQualityDict b/tutorials/mesh/cvMesh/blob/system/meshQualityDict index fa5319e087..cff7330789 100644 --- a/tutorials/mesh/cvMesh/blob/system/meshQualityDict +++ b/tutorials/mesh/cvMesh/blob/system/meshQualityDict @@ -5,21 +5,13 @@ | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ - FoamFile { version 2.0; format ascii; - - root ""; - case ""; - instance ""; - local ""; - class dictionary; object meshQualityDict; } - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // //- Maximum non-orthogonality allowed. Set to 180 to disable. diff --git a/tutorials/mesh/cvMesh/flange/system/collapseDict b/tutorials/mesh/cvMesh/flange/system/collapseDict index 729710d9fd..4ab55ec7bf 100644 --- a/tutorials/mesh/cvMesh/flange/system/collapseDict +++ b/tutorials/mesh/cvMesh/flange/system/collapseDict @@ -5,47 +5,79 @@ | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ - FoamFile { version 2.0; format ascii; - - root ""; - case ""; - instance ""; - local ""; - class dictionary; object collapseDict; } - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +controlMeshQuality on; + collapseEdgesCoeffs { + // Edges shorter than this absolute value will be merged minimumEdgeLength 1e-6; + + // The maximum angle between two edges that share a point attached to + // no other edges maximumMergeAngle 180; - reductionFactor 0.5; } collapseFacesCoeffs { + // The initial face length factor initialFaceLengthFactor 0.5; - reductionFactor 0.5; - allowEarlyCollapseToPoint on; - allowEarlyCollapseCoeff 0.2; - guardFraction 0.1; + // If the face can't be collapsed to an edge, and it has a span less than + // the target face length multiplied by this coefficient, collapse it + // to a point. maxCollapseFaceToPointSideLengthCoeff 0.3; + + // Allow early collapse of edges to a point + allowEarlyCollapseToPoint on; + + // Fraction to premultiply maxCollapseFaceToPointSideLengthCoeff by if + // allowEarlyCollapseToPoint is enabled + allowEarlyCollapseCoeff 0.2; + + // Defining how close to the midpoint (M) of the projected + // vertices line a projected vertex (X) can be before making this + // an invalid edge collapse + // + // X---X-g----------------M----X-----------g----X--X + // + // Only allow a collapse if all projected vertices are outwith + // guardFraction (g) of the distance form the face centre to the + // furthest vertex in the considered direction + guardFraction 0.1; } -meshQualityCoeffs +controlMeshQualityCoeffs { + // Name of the dictionary that has the mesh quality coefficients used + // by motionSmoother::checkMesh #include "meshQualityDict"; + + // The amount that minimumEdgeLength will be reduced by for each + // edge if that edge's collapse generates a poor quality face + edgeReductionFactor 0.5; + + // The amount that initialFaceLengthFactor will be reduced by for each + // face if its collapse generates a poor quality face + faceReductionFactor 0.5; + + // Maximum number of smoothing iterations for the reductionFactors + maximumSmoothingIterations 2; + + // Maximum number of outer iterations is mesh quality checking is enabled maximumIterations 10; - maximumSmoothingIterations 1; - maxPointErrorCount 5; + + // Maximum number of iterations deletion of a point can cause a bad face + // to be constructed before it is forced to not be deleted + maxPointErrorCount 3; } diff --git a/tutorials/mesh/cvMesh/flange/system/cvMeshDict b/tutorials/mesh/cvMesh/flange/system/cvMeshDict index fe581a5493..48e61e8e27 100644 --- a/tutorials/mesh/cvMesh/flange/system/cvMeshDict +++ b/tutorials/mesh/cvMesh/flange/system/cvMeshDict @@ -5,30 +5,23 @@ | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ - FoamFile { version 2.0; format ascii; - - root ""; - case ""; - instance ""; - local ""; - class dictionary; object cvMeshDict; } - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // Any scalar with a name Coeff specifies a value that will be implemented -// as a faction of the local target cell size +// as a faction of the target cell size geometry { flange.obj { + name flange; type triSurfaceMesh; } } @@ -78,7 +71,7 @@ surfaceConformation geometryToConformTo { - flange.obj + flange { featureMethod extendedFeatureEdgeMesh; extendedFeatureEdgeMesh "flange.extendedFeatureEdgeMesh"; @@ -86,8 +79,7 @@ surfaceConformation } additionalFeatures - { - } + {} } @@ -96,13 +88,12 @@ initialPoints minimumSurfaceDistanceCoeff 0.55; initialPointsMethod autoDensity; - //initialPointsMethod pointFile; autoDensityCoeffs { - minLevels 1; - maxSizeRatio 3.0; - sampleResolution 4; + minLevels 2; + maxSizeRatio 3.0; + sampleResolution 4; surfaceSampleResolution 5; } @@ -115,38 +106,58 @@ initialPoints motionControl { - defaultCellSize 0.001; + defaultCellSize 0.0008; + + minimumCellSizeCoeff 0; + + // For background cell size and alignment grid + maxSmoothingIterations 100; + + maxRefinementIterations 5; shapeControlFunctions { - flange.obj + flange { - type searchableSurfaceControl; - priority 1; - mode inside; - surfaceCellSizeFunction uniformValue; + type searchableSurfaceControl; + priority 1; + mode inside; + surfaceCellSizeFunction uniformValue; uniformValueCoeffs { - surfaceCellSize $defaultCellSize; + surfaceCellSizeCoeff 1; + } + cellSizeFunction surfaceOffsetLinearDistance; + surfaceOffsetLinearDistanceCoeffs + { + distanceCellSizeCoeff 1; + surfaceOffsetCoeff 2.5; + linearDistanceCoeff 2.5; } - - cellSizeFunction uniform; - uniformCoeffs{} } + +/* fileControl*/ +/* {*/ +/* type fileControl;*/ +/* priority 1;*/ +/* pointsFile "points";*/ +/* sizesFile "sizes";*/ +/* alignmentsFile "alignments";*/ +/* }*/ } cellAspectRatioControl { - aspectRatio 1.0; - aspectRatioDirection (0 0 0); + aspectRatio 1.0; + aspectRatioDirection (0 0 0); } - relaxationModel adaptiveLinear; + relaxationModel adaptiveLinear; adaptiveLinearCoeffs { - relaxationStart 1.0; - relaxationEnd 0.0; + relaxationStart 0.5; + relaxationEnd 0.0; } objOutput no; @@ -170,10 +181,10 @@ motionControl pointRemovalCriteria { - cellCentreDistCoeff 0.65; + cellCentreDistCoeff 0.65; } - faceAreaWeightModel piecewiseLinearRamp; + faceAreaWeightModel piecewiseLinearRamp; piecewiseLinearRampCoeffs { diff --git a/tutorials/mesh/cvMesh/flange/system/meshQualityDict b/tutorials/mesh/cvMesh/flange/system/meshQualityDict index 4a182cc0b5..7be0913bbf 100644 --- a/tutorials/mesh/cvMesh/flange/system/meshQualityDict +++ b/tutorials/mesh/cvMesh/flange/system/meshQualityDict @@ -5,21 +5,13 @@ | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ - FoamFile { version 2.0; format ascii; - - root ""; - case ""; - instance ""; - local ""; - class dictionary; object meshQualityDict; } - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // //- Maximum non-orthogonality allowed. Set to 180 to disable. diff --git a/tutorials/mesh/cvMesh/simpleShapes/system/collapseDict b/tutorials/mesh/cvMesh/simpleShapes/system/collapseDict index 9034677ca9..4ab55ec7bf 100644 --- a/tutorials/mesh/cvMesh/simpleShapes/system/collapseDict +++ b/tutorials/mesh/cvMesh/simpleShapes/system/collapseDict @@ -5,47 +5,79 @@ | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ - FoamFile { version 2.0; format ascii; - - root ""; - case ""; - instance ""; - local ""; - class dictionary; object collapseDict; } - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +controlMeshQuality on; + collapseEdgesCoeffs { + // Edges shorter than this absolute value will be merged minimumEdgeLength 1e-6; + + // The maximum angle between two edges that share a point attached to + // no other edges maximumMergeAngle 180; - reductionFactor 0.5; } collapseFacesCoeffs { + // The initial face length factor initialFaceLengthFactor 0.5; - reductionFactor 0.5; - allowEarlyCollapseToPoint on; - allowEarlyCollapseCoeff 0.2; - guardFraction 0.1; + // If the face can't be collapsed to an edge, and it has a span less than + // the target face length multiplied by this coefficient, collapse it + // to a point. maxCollapseFaceToPointSideLengthCoeff 0.3; + + // Allow early collapse of edges to a point + allowEarlyCollapseToPoint on; + + // Fraction to premultiply maxCollapseFaceToPointSideLengthCoeff by if + // allowEarlyCollapseToPoint is enabled + allowEarlyCollapseCoeff 0.2; + + // Defining how close to the midpoint (M) of the projected + // vertices line a projected vertex (X) can be before making this + // an invalid edge collapse + // + // X---X-g----------------M----X-----------g----X--X + // + // Only allow a collapse if all projected vertices are outwith + // guardFraction (g) of the distance form the face centre to the + // furthest vertex in the considered direction + guardFraction 0.1; } -meshQualityCoeffs +controlMeshQualityCoeffs { + // Name of the dictionary that has the mesh quality coefficients used + // by motionSmoother::checkMesh #include "meshQualityDict"; - maximumIterations 30; - maximumSmoothingIterations 1; - maxPointErrorCount 5; + + // The amount that minimumEdgeLength will be reduced by for each + // edge if that edge's collapse generates a poor quality face + edgeReductionFactor 0.5; + + // The amount that initialFaceLengthFactor will be reduced by for each + // face if its collapse generates a poor quality face + faceReductionFactor 0.5; + + // Maximum number of smoothing iterations for the reductionFactors + maximumSmoothingIterations 2; + + // Maximum number of outer iterations is mesh quality checking is enabled + maximumIterations 10; + + // Maximum number of iterations deletion of a point can cause a bad face + // to be constructed before it is forced to not be deleted + maxPointErrorCount 3; } diff --git a/tutorials/mesh/cvMesh/simpleShapes/system/cvMeshDict b/tutorials/mesh/cvMesh/simpleShapes/system/cvMeshDict index 99379e62c9..ac3cd4aaad 100644 --- a/tutorials/mesh/cvMesh/simpleShapes/system/cvMeshDict +++ b/tutorials/mesh/cvMesh/simpleShapes/system/cvMeshDict @@ -5,7 +5,6 @@ | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ - FoamFile { version 2.0; @@ -13,7 +12,6 @@ FoamFile class dictionary; object cvMeshDict; } - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -45,7 +43,7 @@ See also cvControls.H in the conformalVoronoiMesh library // Important: // ---------- // Any scalar with a name Coeff specifies a value that will be implemented -// as a faction of the local target cell size +// as a faction of the target cell size // Any scalar with a name Size specifies an absolute size. @@ -69,6 +67,10 @@ geometry { name domain; type triSurfaceMesh; + regions + { + ascii{ name domain_patch0; } + } } } @@ -167,7 +169,8 @@ surfaceConformation } } - additionalFeatures {} + additionalFeatures + {} } @@ -237,7 +240,14 @@ initialPoints motionControl { // Absolute cell size of back ground mesh. This is the maximum cell size. - defaultCellSize 0.1; + defaultCellSize 0.1; + + minimumCellSizeCoeff 0; + + // For background cell size and alignment grid + maxSmoothingIterations 100; + + maxRefinementIterations 0; shapeControlFunctions { @@ -250,7 +260,7 @@ motionControl surfaceCellSizeFunction uniformValue; uniformValueCoeffs { - surfaceCellSize 0.075; + surfaceCellSizeCoeff 0.75; } cellSizeFunction uniform; @@ -267,7 +277,7 @@ motionControl surfaceCellSizeFunction uniformValue; uniformValueCoeffs { - surfaceCellSize $defaultCellSize; + surfaceCellSizeCoeff 1; } cellSizeFunction uniform; diff --git a/tutorials/mesh/cvMesh/simpleShapes/system/meshQualityDict b/tutorials/mesh/cvMesh/simpleShapes/system/meshQualityDict index 1b83e2bd87..660292d12c 100644 --- a/tutorials/mesh/cvMesh/simpleShapes/system/meshQualityDict +++ b/tutorials/mesh/cvMesh/simpleShapes/system/meshQualityDict @@ -5,21 +5,13 @@ | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ - FoamFile { version 2.0; format ascii; - - root ""; - case ""; - instance ""; - local ""; - class dictionary; object meshQualityDict; } - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // //- Maximum non-orthogonality allowed. Set to 180 to disable.