ENH: snappyHexMesh: add buffer layers before snapping

This commit is contained in:
Mattijs Janssens
2024-12-12 16:13:32 +00:00
parent e7cf8a1d59
commit de5d34787c
231 changed files with 46574 additions and 963 deletions

View File

@ -0,0 +1,62 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2309 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
arch "LSB;label=32;scalar=64";
class pointVectorField;
location "0";
object pointDisplacement;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 0 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
minX
{
type slip;
}
maxX
{
$minX
}
minY
{
$minX
}
maxY
{
$minX
}
minZ
{
$minX
}
maxZ
{
$minX
}
boundaryEdges
{
type uniformFixedValue;
uniformValue table
(
( 0.0 (0 0 0))
( 1.0 (1.0 -1.0 0))
//(10.0 (0 0 0))
);
}
}
// ************************************************************************* //

View File

@ -0,0 +1,17 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
#------------------------------------------------------------------------------
cleanCase
rm -rf constant/extendedFeatureEdgeMesh
#- From pointMesh generation
rm -rf constant/pointMesh
rm -f constant/triSurface/blockMesh.obj
#- From surfaceFeatureExtract
rm -f constant/triSurface/box222.eMesh
#------------------------------------------------------------------------------

View File

@ -0,0 +1,23 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
#- Generate mesh
runApplication blockMesh
runApplication surfaceMeshExtract \
-featureAngle 45 \
-patches '(minX maxY)' \
constant/triSurface/blockMesh.obj
#- For postprocessing: extract new pointPatches as vtk files
setSet <<EOF
pointSet p0 new patchToPoint boundaryEdges
EOF
#- Morph mesh to the surface (.obj file) and feature-edges (.eMesh file)
#- Note: needs point-based motion solver
runApplication moveDynamicMesh
#------------------------------------------------------------------------------

View File

@ -0,0 +1 @@
Testing relaxation of mesh motion

View File

@ -0,0 +1,39 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2312 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object dynamicMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh dynamicMotionSolverFvMesh;
// For point-bcs
motionSolverLibs (fvMotionSolvers);
motionSolver displacementPointSmoothing;
displacementPointSmoothingCoeffs
{
// Use geometricElementTransform to maintain relative sizes
//pointSmoother geometricElementTransform;
//transformationParameter 0.667;
//nPointSmootherIter 10;
pointSmoother laplacian;
nPointSmootherIter 10;
relaxationFactors (1.0 0.8 0.6 0.4 0.2 0.0);
meshQuality
{
#includeEtc "caseDicts/meshQualityDict"
}
}
// ************************************************************************* //

View File

@ -0,0 +1,95 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2312 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
scale 1;
vertices
(
// Inner block
(-2 -2 -2)
( 2 -2 -2)
( 2 2 -2)
(-2 2 -2)
(-2 -2 2)
( 2 -2 2)
( 2 2 2)
(-2 2 2)
);
blocks
(
hex (0 1 2 3 4 5 6 7) (5 5 4) grading (1 1 1) // Inner block
);
boundary
(
minX
{
type patch;
faces
(
(0 0) // block 0: x-min
);
}
maxX
{
type patch;
faces
(
(0 1) // block 0: x-max
);
}
minY
{
type patch;
faces
(
(0 2) // block 0: y-min
);
}
maxY
{
type patch;
faces
(
(0 3) // block 0: y-max
);
}
minZ
{
type patch;
faces
(
(0 4) // block 0: z-min
);
}
maxZ
{
type patch;
faces
(
(0 5) // block 0: z-max
);
}
);
// ************************************************************************* //

View File

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

View File

@ -0,0 +1,44 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2312 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{}
gradSchemes
{
default Gauss linear;
}
divSchemes
{}
laplacianSchemes
{
default Gauss linear corrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default corrected;
}
// ************************************************************************* //

View File

@ -0,0 +1,33 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2312 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
"cellDisplacement.*"
{
solver GAMG;
tolerance 1e-08;
relTol 0;
smoother GaussSeidel;
}
}
PIMPLE
{}
// ************************************************************************* //