mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Sprucing up the tutorials folder and adding -dict to "collapseEdges"
Patch provided by Bruno Santos Resolves patch application request http://www.openfoam.org/mantisbt/view.php?id=2015
This commit is contained in:
@ -6,19 +6,14 @@ cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
intersectSurfaces()
|
||||
{
|
||||
runApplication \
|
||||
surfaceBooleanFeatures \
|
||||
intersection \
|
||||
"$@"
|
||||
|
||||
outputName1=$(basename $1)
|
||||
outputName1=${outputName1%.*}
|
||||
|
||||
outputName2=$(basename $2)
|
||||
outputName2=${outputName2%.*}
|
||||
|
||||
mv log.surfaceBooleanFeatures \
|
||||
log.surfaceBooleanFeatures.$outputName1:$outputName2
|
||||
runApplication -s $outputName1:$outputName2 \
|
||||
surfaceBooleanFeatures intersection "$@"
|
||||
}
|
||||
|
||||
# Set application name
|
||||
@ -77,30 +72,33 @@ done
|
||||
|
||||
# Meshing
|
||||
\cp system/controlDict.mesh system/controlDict
|
||||
\cp system/collapseDict.collapseFaces system/collapseDict
|
||||
|
||||
runApplication blockMesh -region backgroundMeshDecomposition
|
||||
|
||||
runApplication decomposePar -region backgroundMeshDecomposition
|
||||
runApplication -s backgroundMeshDecomposition \
|
||||
decomposePar -region backgroundMeshDecomposition
|
||||
|
||||
runApplication surfaceFeatureExtract
|
||||
|
||||
runParallel foamyHexMesh
|
||||
|
||||
runParallel collapseEdges -collapseFaces -latestTime
|
||||
mv log.collapseEdges log.collapseFaces
|
||||
runParallel -s faces \
|
||||
collapseEdges -collapseFaces -latestTime \
|
||||
-dict system/collapseDict.collapseFaces
|
||||
|
||||
#\cp system/collapseDict.indirectPatchFaces system/collapseDict
|
||||
#runParallel collapseEdges -collapseFaceSet indirectPatchFaces -latestTime
|
||||
#mv log.collapseEdges log.collapseFaceSet
|
||||
#runParallel -s faceSet \
|
||||
# collapseEdges -collapseFaceSet indirectPatchFaces -latestTime \
|
||||
# -dict system/collapseDict.indirectPatchFaces
|
||||
|
||||
runParallel checkMesh -allTopology -allGeometry -latestTime
|
||||
|
||||
runApplication reconstructParMesh -latestTime
|
||||
|
||||
# Copy the mesh into polyMesh and delete the 102 directory
|
||||
\cp -r 101/polyMesh constant
|
||||
\rm -rf 101
|
||||
# Copy the mesh from the latest time folder into polyMesh and delete that
|
||||
# latest time folder
|
||||
latestTime=$(foamListTimes -latestTime)
|
||||
\cp -r $latestTime/polyMesh constant
|
||||
\rm -rf $latestTime
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -24,8 +24,8 @@ runApplication createPatch -overwrite
|
||||
runApplication setFields
|
||||
|
||||
# Decompose
|
||||
\rm log.decomposePar
|
||||
runApplication decomposePar -force
|
||||
runApplication -s main \
|
||||
decomposePar -force
|
||||
|
||||
# Run
|
||||
runParallel $application
|
||||
|
||||
@ -1,85 +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 collapseDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// If on, after collapsing check the quality of the mesh. If bad faces are
|
||||
// generated then redo the collapsing with stricter filtering.
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
collapseFacesCoeffs
|
||||
{
|
||||
// The initial face length factor
|
||||
initialFaceLengthFactor 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;
|
||||
}
|
||||
|
||||
|
||||
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 outer iterations is mesh quality checking is enabled
|
||||
maximumIterations 10;
|
||||
|
||||
maximumSmoothingIterations 1;
|
||||
|
||||
maxPointErrorCount 3;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
1
tutorials/mesh/foamyHexMesh/mixerVessel/system/collapseDict
Symbolic link
1
tutorials/mesh/foamyHexMesh/mixerVessel/system/collapseDict
Symbolic link
@ -0,0 +1 @@
|
||||
collapseDict.collapseFaces
|
||||
Reference in New Issue
Block a user