Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
16b7707c
Commit
16b7707c
authored
Oct 04, 2018
by
mattijs
Browse files
ENH: snappyHexMesh: directional smoothing. See #1031
parent
d9425875
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
src/mesh/snappyHexMesh/shellSurfaces/shellSurfaces.C
View file @
16b7707c
...
...
@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015-201
7
OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-201
8
OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -587,6 +587,7 @@ Foam::shellSurfaces::shellSurfaces
dirLevels_
.
setSize
(
shellI
);
smoothDirection_
.
setSize
(
shellI
);
nSmoothExpansion_
.
setSize
(
shellI
);
nSmoothPosition_
.
setSize
(
shellI
);
extendedGapLevel_
.
setSize
(
shellI
);
extendedGapMode_
.
setSize
(
shellI
);
...
...
@@ -666,10 +667,16 @@ Foam::shellSurfaces::shellSurfaces
// Directional smoothing
// ~~~~~~~~~~~~~~~~~~~~~
nSmoothExpansion_
[
shellI
]
=
0
;
nSmoothPosition_
[
shellI
]
=
0
;
smoothDirection_
[
shellI
]
=
dict
.
lookupOrDefault
(
"smoothDirection"
,
vector
::
zero
);
nSmoothExpansion_
[
shellI
]
=
dict
.
lookupOrDefault
(
"nSmoothExpansion"
,
0
);
if
(
smoothDirection_
[
shellI
]
!=
vector
::
zero
)
{
dict
.
lookup
(
"nSmoothExpansion"
)
>>
nSmoothExpansion_
[
shellI
];
dict
.
lookup
(
"nSmoothPosition"
)
>>
nSmoothPosition_
[
shellI
];
}
// Gap specification
...
...
@@ -824,6 +831,12 @@ const Foam::vectorField& Foam::shellSurfaces::smoothDirection() const
}
const
Foam
::
labelList
&
Foam
::
shellSurfaces
::
nSmoothPosition
()
const
{
return
nSmoothPosition_
;
}
void
Foam
::
shellSurfaces
::
findHigherLevel
(
const
pointField
&
pt
,
...
...
src/mesh/snappyHexMesh/shellSurfaces/shellSurfaces.H
View file @
16b7707c
...
...
@@ -98,6 +98,9 @@ private:
//- Per shell the directional smoothing iterations
labelList
nSmoothExpansion_
;
//- Per shell the positional smoothing iterations
labelList
nSmoothPosition_
;
// Gap level refinement
...
...
@@ -246,6 +249,9 @@ public:
//- Per shell the directional smoothing iterations
const
labelList
&
nSmoothExpansion
()
const
;
//- Per shell the positional smoothing iterations
const
labelList
&
nSmoothPosition
()
const
;
};
...
...
src/mesh/snappyHexMesh/snappyHexMeshDriver/snappyRefineDriver.C
View file @
16b7707c
This diff is collapsed.
Click to expand it.
src/mesh/snappyHexMesh/snappyHexMeshDriver/snappyRefineDriver.H
View file @
16b7707c
...
...
@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015
-2018
OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -36,10 +36,8 @@ SourceFiles
#include
"wordPairHashTable.H"
#include
"labelList.H"
#include
"PackedBoolList.H"
#include
"labelVector.H"
#include
"vector.H"
#include
"scalarField.H"
#include
"Tuple2.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
...
@@ -53,6 +51,7 @@ class snapParameters;
class
meshRefinement
;
class
decompositionMethod
;
class
fvMeshDistribute
;
class
fvMesh
;
/*---------------------------------------------------------------------------*\
Class snappyRefineDriver Declaration
...
...
@@ -156,19 +155,16 @@ class snappyRefineDriver
);
//- Calculate local edge length from cell volumes
void
getVirtualEdgeLength
void
mergeAndSmoothRatio
(
const
vector
&
userDirection
,
const
labelList
&
pointLabels
,
const
PackedBoolList
&
isXFace
,
scalarField
&
maxUserSize
)
const
;
const
scalarList
&
allSeedPointDist
,
const
label
nSmoothExpansion
,
List
<
Tuple2
<
scalar
,
scalar
>>&
keyAndValue
);
//- Smooth the directional expansion ratio
label
directionalSmooth
(
const
refinementParameters
&
refineParams
);
label
directionalSmooth
(
const
refinementParameters
&
refineParams
);
//- Add baffles and remove unreachable cells
void
baffleAndSplitMesh
...
...
@@ -248,7 +244,6 @@ public:
const
refinementParameters
&
refineParams
,
const
HashTable
<
Pair
<
word
>>&
faceZoneToPatches
);
};
...
...
tutorials/mesh/snappyHexMesh/iglooWithFridgesDirectionalRefinement/Allrun
View file @
16b7707c
...
...
@@ -4,22 +4,14 @@ cd ${0%/*} || exit 1 # Run from this directory
runApplication blockMesh
# Serial
runApplication snappyHexMesh
-overwrite
runApplication
$(
getApplication
)
#
# Serial
#
runApplication snappyHexMesh -overwrite
#
runApplication $(getApplication)
## Parallel
#runApplication decomposePar -fileHandler collated
#runParallel snappyHexMesh -overwrite -fileHandler collated
## Remove any include files from the field dictionaries
#( mkdir -p processors/0 && \
# cd 0 && \
# for f in *; do [ -f "$f" ] && \
# foamDictionary "$f" > "../processors/0/$f"; done \
#)
#
#runParallel $(getApplication) -fileHandler collated
#runApplication reconstructParMesh -constant -mergeTol 1e-6
#runApplication reconstructPar
runApplication decomposePar
-fileHandler
collated
runParallel snappyHexMesh
-overwrite
-fileHandler
collated
runParallel redistributePar
-reconstruct
-fileHandler
collated
#runApplication reconstructParMesh -constant -fileHandler collated -mergeTol 1e-6
#------------------------------------------------------------------------------
tutorials/mesh/snappyHexMesh/iglooWithFridgesDirectionalRefinement/system/decomposeParDict
View file @
16b7707c
...
...
@@ -18,13 +18,4 @@ numberOfSubdomains 2;
method scotch;
//coeffs
//{
// n (3 2 1);
// delta 0.001;
// order xyz;
// dataFile "cellDecomposition";
//}
// ************************************************************************* //
tutorials/mesh/snappyHexMesh/iglooWithFridgesDirectionalRefinement/system/snappyHexMeshDict
View file @
16b7707c
...
...
@@ -124,10 +124,10 @@ castellatedMeshControls
// actually be a lot less.
maxGlobalCells 2000000;
// The surface refinement loop might spend lots of iterations refining
just a
// few cells. This setting will cause refinement to stop if <=
minimumRefine
// are selected for refinement. Note: it will at least do one
iteration
// (unless the number of cells to refine is 0)
// The surface refinement loop might spend lots of iterations refining
//
just a
few cells. This setting will cause refinement to stop if <=
//
minimumRefine
are selected for refinement. Note: it will at least do one
//
iteration
(unless the number of cells to refine is 0)
minRefinementCells 100;
// Number of buffer layers between different levels.
...
...
@@ -229,10 +229,10 @@ castellatedMeshControls
// (after all other refinement). Directional refinement
// for all cells according to 'mode' ('inside' or 'outside';
// 'distance' not supported) and within certain range. E.g.
// - for all cells with level 0-1
00
// - do
two
split
s
in z direction. The resulting mesh is
// - for all cells with level 0-1
// - do
one
split in z direction. The resulting mesh is
// no longer compatible with e.g. dynamic refinement/unrefinement.
levelIncrement (0
0
(0 0 1));
levelIncrement (0
1
(0 0 1));
}
dirRefineBox2
{
...
...
@@ -245,7 +245,7 @@ castellatedMeshControls
// (after all other refinement). Directional refinement
// for all cells according to 'mode' ('inside' or 'outside';
// 'distance' not supported) and within certain range. E.g.
// - for all cells with level 0-1
00
// - for all cells with level 0-1
// - do two splits in z direction. The resulting mesh is
// no longer compatible with e.g. dynamic refinement/unrefinement.
levelIncrement (0 1 (0 0 2));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment