Updates for dynamic refinement and immersed boundary
This commit is contained in:
parent
31bfbdada7
commit
55aa8c272a
5 changed files with 26 additions and 63 deletions
|
@ -82,7 +82,8 @@ void Foam::dynamicPolyRefinementFvMesh::readDict()
|
||||||
|
|
||||||
Foam::dynamicPolyRefinementFvMesh::dynamicPolyRefinementFvMesh
|
Foam::dynamicPolyRefinementFvMesh::dynamicPolyRefinementFvMesh
|
||||||
(
|
(
|
||||||
const IOobject& io
|
const IOobject& io,
|
||||||
|
const word subDictName
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
topoChangerFvMesh(io),
|
topoChangerFvMesh(io),
|
||||||
|
@ -99,7 +100,7 @@ Foam::dynamicPolyRefinementFvMesh::dynamicPolyRefinementFvMesh
|
||||||
IOobject::NO_WRITE,
|
IOobject::NO_WRITE,
|
||||||
false
|
false
|
||||||
)
|
)
|
||||||
).subDict(typeName + "Coeffs")
|
).subDict(subDictName + "Coeffs")
|
||||||
),
|
),
|
||||||
refineInterval_(readLabel(refinementDict_.lookup("refineInterval"))),
|
refineInterval_(readLabel(refinementDict_.lookup("refineInterval"))),
|
||||||
unrefineInterval_(readLabel(refinementDict_.lookup("unrefineInterval"))),
|
unrefineInterval_(readLabel(refinementDict_.lookup("unrefineInterval"))),
|
||||||
|
|
|
@ -106,8 +106,15 @@ public:
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from IOobject
|
//- Construct from IOobject and optional name for the subdictionary
|
||||||
explicit dynamicPolyRefinementFvMesh(const IOobject& io);
|
// 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
|
//- Destructor
|
||||||
|
|
|
@ -60,25 +60,14 @@ addToRunTimeSelectionTable
|
||||||
Foam::immersedBoundaryDynamicRefineSolidBodyMotionFvMesh::
|
Foam::immersedBoundaryDynamicRefineSolidBodyMotionFvMesh::
|
||||||
immersedBoundaryDynamicRefineSolidBodyMotionFvMesh(const IOobject& io)
|
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_()
|
ibMotions_()
|
||||||
{
|
{
|
||||||
// Read motion function for all regions
|
// Read Immersed Boundary motion functions from base class dictionary
|
||||||
dictionary dynamicMeshCoeffs
|
|
||||||
(
|
|
||||||
IOdictionary
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"dynamicMeshDict",
|
|
||||||
time().constant(),
|
|
||||||
*this,
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
)
|
|
||||||
).subDict(typeName + "Coeffs")
|
|
||||||
);
|
|
||||||
|
|
||||||
PtrList<entry> motionDicts(refinementDict().lookup("motionFunctions"));
|
PtrList<entry> motionDicts(refinementDict().lookup("motionFunctions"));
|
||||||
|
|
||||||
ibMotions_.setSize(motionDicts.size());
|
ibMotions_.setSize(motionDicts.size());
|
||||||
|
|
|
@ -197,7 +197,7 @@ Foam::immersedBoundaryRefinement::unrefinementPointCandidates() const
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
pointDistance[pointI] < -unrefinementDistance_
|
pointDistance[pointI] < -unrefinementDistance_
|
||||||
|| pointDistance[pointI] > unrefinementDistance_
|
|| pointDistance[pointI] > SMALL
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
unrefinementCandidates.append(pointI);
|
unrefinementCandidates.append(pointI);
|
||||||
|
|
|
@ -18,25 +18,10 @@ FoamFile
|
||||||
// dynamicFvMesh immersedBoundarySolidBodyMotionFvMesh;
|
// dynamicFvMesh immersedBoundarySolidBodyMotionFvMesh;
|
||||||
dynamicFvMesh immersedBoundaryDynamicRefineSolidBodyMotionFvMesh;
|
dynamicFvMesh immersedBoundaryDynamicRefineSolidBodyMotionFvMesh;
|
||||||
|
|
||||||
immersedBoundarySolidBodyMotionFvMeshCoeffs
|
|
||||||
{
|
|
||||||
motionFunctions
|
|
||||||
(
|
|
||||||
ibCylinder
|
|
||||||
{
|
|
||||||
solidBodyMotionFunction linearOscillation;
|
|
||||||
linearOscillationCoeffs
|
|
||||||
{
|
|
||||||
amplitude (0.5 0 0);
|
|
||||||
period 2.5;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
immersedBoundaryDynamicRefineSolidBodyMotionFvMeshCoeffs
|
immersedBoundaryDynamicRefineSolidBodyMotionFvMeshCoeffs
|
||||||
{
|
{
|
||||||
|
// Immersed boundary controls
|
||||||
motionFunctions
|
motionFunctions
|
||||||
(
|
(
|
||||||
ibCylinder
|
ibCylinder
|
||||||
|
@ -49,18 +34,14 @@ immersedBoundaryDynamicRefineSolidBodyMotionFvMeshCoeffs
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
dynamicPolyRefinementFvMeshCoeffs
|
|
||||||
{
|
|
||||||
// Dynamic mesh procedure controls
|
// Dynamic mesh procedure controls
|
||||||
|
|
||||||
// Refine every refineInterval step
|
// Refine every refineInterval step
|
||||||
refineInterval 1;
|
refineInterval 2;
|
||||||
|
|
||||||
// Unrefine every unrefineInterval step
|
// Unrefine every unrefineInterval step
|
||||||
unrefineInterval 1;
|
unrefineInterval 2;
|
||||||
|
|
||||||
// Separate refinement/unrefinement steps. In case this is switched on,
|
// Separate refinement/unrefinement steps. In case this is switched on,
|
||||||
// if both refinement and unrefinement should have been performed in a
|
// if both refinement and unrefinement should have been performed in a
|
||||||
|
@ -72,8 +53,8 @@ dynamicPolyRefinementFvMeshCoeffs
|
||||||
refinementSelection
|
refinementSelection
|
||||||
{
|
{
|
||||||
type immersedBoundaryRefinement;
|
type immersedBoundaryRefinement;
|
||||||
refinementDistance 0.1;
|
refinementDistance 0.08;
|
||||||
coarseningDistance 0.1;
|
unrefinementDistance 0.08;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Polyhedral refinement engine controls
|
// Polyhedral refinement engine controls
|
||||||
|
@ -86,31 +67,16 @@ dynamicPolyRefinementFvMeshCoeffs
|
||||||
maxRefinementLevel 2;
|
maxRefinementLevel 2;
|
||||||
|
|
||||||
// Number of buffer layers between refinement levels
|
// Number of buffer layers between refinement levels
|
||||||
nRefinementBufferLayers 0;
|
nRefinementBufferLayers 1;
|
||||||
|
|
||||||
// Number of buffer layers for unrefinement in order to run away from the
|
// 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
|
// region that is getting refined at the same time in order to avoid point
|
||||||
// level inconsistencies
|
// level inconsistencies
|
||||||
nUnrefinementBufferLayers 2;
|
nUnrefinementBufferLayers 3;
|
||||||
|
|
||||||
// Whether to use edge based consistency check. Needed when one allows more
|
// Whether to use edge based consistency check. Needed when one allows more
|
||||||
// than 2 refinement levels (automatically switched on)
|
// than 2 refinement levels (automatically switched on)
|
||||||
edgeBasedConsistency true;
|
edgeBasedConsistency true;
|
||||||
|
|
||||||
// Motion functions for IBM
|
|
||||||
motionFunctions
|
|
||||||
(
|
|
||||||
ibCylinder
|
|
||||||
{
|
|
||||||
solidBodyMotionFunction linearOscillation;
|
|
||||||
linearOscillationCoeffs
|
|
||||||
{
|
|
||||||
amplitude (0.5 0 0);
|
|
||||||
period 2.5;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|
Reference in a new issue