Updates for dynamic refinement and immersed boundary

This commit is contained in:
Hrvoje Jasak 2018-05-17 14:52:46 +01:00
parent 31bfbdada7
commit 55aa8c272a
5 changed files with 26 additions and 63 deletions

View file

@ -82,7 +82,8 @@ void Foam::dynamicPolyRefinementFvMesh::readDict()
Foam::dynamicPolyRefinementFvMesh::dynamicPolyRefinementFvMesh
(
const IOobject& io
const IOobject& io,
const word subDictName
)
:
topoChangerFvMesh(io),
@ -99,7 +100,7 @@ Foam::dynamicPolyRefinementFvMesh::dynamicPolyRefinementFvMesh
IOobject::NO_WRITE,
false
)
).subDict(typeName + "Coeffs")
).subDict(subDictName + "Coeffs")
),
refineInterval_(readLabel(refinementDict_.lookup("refineInterval"))),
unrefineInterval_(readLabel(refinementDict_.lookup("unrefineInterval"))),

View file

@ -106,8 +106,15 @@ public:
// Constructors
//- Construct from IOobject
explicit dynamicPolyRefinementFvMesh(const IOobject& io);
//- Construct from IOobject and optional name for the subdictionary
// containing the refinement (and possibly other controls). The second
// parameter is useful if we derive another dynamic mesh class from
// this one instead of topoChangerFvMesh base class. VV, 17/May/2018.
dynamicPolyRefinementFvMesh
(
const IOobject& io,
const word subDictName = typeName
);
//- Destructor

View file

@ -60,25 +60,14 @@ addToRunTimeSelectionTable
Foam::immersedBoundaryDynamicRefineSolidBodyMotionFvMesh::
immersedBoundaryDynamicRefineSolidBodyMotionFvMesh(const IOobject& io)
:
dynamicPolyRefinementFvMesh(io),
// Create base class with the name of this class to be able to define all
// the controls in immersedBoundaryDynamicRefineSolidBodyMotionFvMeshCoeffs
// subdictionary in dynamicMeshDict (see dynamicPolyRefinementFvMesh
// constructor). VV, 17/May/2018.
dynamicPolyRefinementFvMesh(io, typeName),
ibMotions_()
{
// Read motion function for all regions
dictionary dynamicMeshCoeffs
(
IOdictionary
(
IOobject
(
"dynamicMeshDict",
time().constant(),
*this,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
).subDict(typeName + "Coeffs")
);
// Read Immersed Boundary motion functions from base class dictionary
PtrList<entry> motionDicts(refinementDict().lookup("motionFunctions"));
ibMotions_.setSize(motionDicts.size());

View file

@ -197,7 +197,7 @@ Foam::immersedBoundaryRefinement::unrefinementPointCandidates() const
if
(
pointDistance[pointI] < -unrefinementDistance_
|| pointDistance[pointI] > unrefinementDistance_
|| pointDistance[pointI] > SMALL
)
{
unrefinementCandidates.append(pointI);

View file

@ -18,25 +18,10 @@ FoamFile
// dynamicFvMesh immersedBoundarySolidBodyMotionFvMesh;
dynamicFvMesh immersedBoundaryDynamicRefineSolidBodyMotionFvMesh;
immersedBoundarySolidBodyMotionFvMeshCoeffs
{
motionFunctions
(
ibCylinder
{
solidBodyMotionFunction linearOscillation;
linearOscillationCoeffs
{
amplitude (0.5 0 0);
period 2.5;
}
}
);
}
immersedBoundaryDynamicRefineSolidBodyMotionFvMeshCoeffs
{
// Immersed boundary controls
motionFunctions
(
ibCylinder
@ -49,18 +34,14 @@ immersedBoundaryDynamicRefineSolidBodyMotionFvMeshCoeffs
}
}
);
}
dynamicPolyRefinementFvMeshCoeffs
{
// Dynamic mesh procedure controls
// Refine every refineInterval step
refineInterval 1;
refineInterval 2;
// Unrefine every unrefineInterval step
unrefineInterval 1;
unrefineInterval 2;
// Separate refinement/unrefinement steps. In case this is switched on,
// if both refinement and unrefinement should have been performed in a
@ -72,8 +53,8 @@ dynamicPolyRefinementFvMeshCoeffs
refinementSelection
{
type immersedBoundaryRefinement;
refinementDistance 0.1;
coarseningDistance 0.1;
refinementDistance 0.08;
unrefinementDistance 0.08;
}
// Polyhedral refinement engine controls
@ -86,31 +67,16 @@ dynamicPolyRefinementFvMeshCoeffs
maxRefinementLevel 2;
// Number of buffer layers between refinement levels
nRefinementBufferLayers 0;
nRefinementBufferLayers 1;
// Number of buffer layers for unrefinement in order to run away from the
// region that is getting refined at the same time in order to avoid point
// level inconsistencies
nUnrefinementBufferLayers 2;
nUnrefinementBufferLayers 3;
// Whether to use edge based consistency check. Needed when one allows more
// than 2 refinement levels (automatically switched on)
edgeBasedConsistency true;
// Motion functions for IBM
motionFunctions
(
ibCylinder
{
solidBodyMotionFunction linearOscillation;
linearOscillationCoeffs
{
amplitude (0.5 0 0);
period 2.5;
}
}
);
}
// ************************************************************************* //