fvMeshMovers::multiValveEngine: Added support for pointZones frozen with respect specific moving object

for example it is now possible to freeze the cylinder head points with respect
to the piston motion but still move with respect to the valve motion by
specifying the cylinderHead pointZone only in the piston specification, e.g.:

    piston
    {
        patches             (piston);
        axis                (0 0 1);

        motion
        {
            type            crankConnectingRodMotion;

            conRodLength    0.147;
            stroke          0.08423;
        }

        // Move the points in the piston bowl with the piston
        movingZones         (pistonBowl);

        // Freeze the points in the cylinder head
        frozenZones         (cylinderHead);

        // There is no need to update the motion weights
        fractionalTravelInterval       1;
    }
This commit is contained in:
Henry Weller
2024-02-21 12:42:48 +00:00
parent 4d3228d2f6
commit 8b67521d49
6 changed files with 78 additions and 40 deletions

View File

@ -211,6 +211,64 @@ Foam::fvMeshMovers::multiValveEngine::movingObject::movingPointZones() const
} }
Foam::labelHashSet
Foam::fvMeshMovers::multiValveEngine::movingObject::staticPointZones() const
{
labelHashSet staticPointZones;
if (frozenPointZones_.size())
{
forAll(frozenPointZones_, i)
{
const labelList indices
(
meshMover_.mesh().pointZones().findIndices(frozenPointZones_[i])
);
if (indices.size())
{
staticPointZones.insert(indices);
Info<< " pointZone " << frozenPointZones_[i]
<< " is frozen (stationary)" << endl;
}
else
{
Info<< " frozenZone " << frozenPointZones_[i]
<< " not found in pointZones" << endl;
}
}
}
if (meshMover_.frozenPointZones_.size())
{
forAll(meshMover_.frozenPointZones_, i)
{
const labelList indices
(
meshMover_.mesh().pointZones().findIndices
(
meshMover_.frozenPointZones_[i]
)
);
if (indices.size())
{
staticPointZones.insert(indices);
Info<< " pointZone " << meshMover_.frozenPointZones_[i]
<< " is frozen (stationary)" << endl;
}
else
{
Info<< " frozenZone " << meshMover_.frozenPointZones_[i]
<< " not found in pointZones" << endl;
}
}
}
return staticPointZones;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::fvMeshMovers::multiValveEngine::movingObject::movingObject Foam::fvMeshMovers::multiValveEngine::movingObject::movingObject
@ -241,6 +299,10 @@ Foam::fvMeshMovers::multiValveEngine::movingObject::movingObject
( (
dict.lookupOrDefault("movingZones", wordReList::null()) dict.lookupOrDefault("movingZones", wordReList::null())
), ),
frozenPointZones_
(
dict.lookupOrDefault("frozenZones", wordReList::null())
),
scale_ scale_
( (
IOobject IOobject

View File

@ -95,38 +95,6 @@ Foam::labelHashSet Foam::fvMeshMovers::multiValveEngine::findStaticPatchSet()
} }
Foam::labelHashSet
Foam::fvMeshMovers::multiValveEngine::staticPointZones() const
{
labelHashSet staticPointZones;
if (frozenPointZones_.size())
{
forAll(frozenPointZones_, i)
{
const labelList indices
(
mesh().pointZones().findIndices(frozenPointZones_[i])
);
if (indices.size())
{
staticPointZones.insert(indices);
Info<< " pointZone " << frozenPointZones_[i]
<< " is frozen (stationary)" << endl;
}
else
{
Info<< " frozenZone " << frozenPointZones_[i]
<< " not found in pointZones" << endl;
}
}
}
return staticPointZones;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::fvMeshMovers::multiValveEngine::multiValveEngine(fvMesh& mesh) Foam::fvMeshMovers::multiValveEngine::multiValveEngine(fvMesh& mesh)

View File

@ -45,7 +45,7 @@ Description
slide mesh nodes while piston is moving. slide mesh nodes while piston is moving.
- frozenZones: list of pointZones the points of which are frozen, - frozenZones: list of pointZones the points of which are frozen,
i.e. do not move. i.e. do not move with respect to any moving object.
- Run-time clearance estimation based on patch-to-patch distances printed. - Run-time clearance estimation based on patch-to-patch distances printed.
@ -67,6 +67,9 @@ Description
- movingZones: list of pointZones the points of which move with the - movingZones: list of pointZones the points of which move with the
object. object.
- frozenZones: list of pointZones the points of which are frozen,
i.e. do not move with respect to this moving object.
- maxMotionDistance: a distance away from the moving object - maxMotionDistance: a distance away from the moving object
after nodes are not allowed to move. (Default inf.) after nodes are not allowed to move. (Default inf.)
@ -152,6 +155,9 @@ Description
// Move the points in the piston bowl with the piston // Move the points in the piston bowl with the piston
movingZones (pistonBowl); movingZones (pistonBowl);
// Freeze the points in the cylinder head
frozenZones (cylinderHead);
// Optional // Optional
maxMotionDistance 1e30; maxMotionDistance 1e30;
movingFrozenLayerThickness 0; movingFrozenLayerThickness 0;
@ -295,6 +301,8 @@ public:
wordReList movingPointZones_; wordReList movingPointZones_;
wordReList frozenPointZones_;
//- Points to move when cell zone is supplied //- Points to move when cell zone is supplied
labelList pointIDs_; labelList pointIDs_;
@ -344,6 +352,8 @@ public:
labelHashSet movingPointZones() const; labelHashSet movingPointZones() const;
labelHashSet staticPointZones() const;
public: public:
@ -551,8 +561,6 @@ private:
//- Find and return the static patch set //- Find and return the static patch set
labelHashSet findStaticPatchSet(); labelHashSet findStaticPatchSet();
labelHashSet staticPointZones() const;
public: public:

View File

@ -182,7 +182,7 @@ void Foam::fvMeshMovers::multiValveEngine::pistonObject::updatePoints
( (
pMesh, pMesh,
staticPatchSet_, staticPatchSet_,
meshMover_.staticPointZones(), staticPointZones(),
points, points,
maxMotionDistance_ maxMotionDistance_
); );

View File

@ -119,7 +119,7 @@ void Foam::fvMeshMovers::multiValveEngine::valveObject::updatePoints
( (
pMesh, pMesh,
staticPatchSet_, staticPatchSet_,
meshMover_.staticPointZones(), staticPointZones(),
points, points,
maxMotionDistance_ maxMotionDistance_
); );

View File

@ -24,9 +24,6 @@ mover
slidingPatches (liner); slidingPatches (liner);
linerPatches (liner); linerPatches (liner);
// Freeze the points in the cylinder head
frozenZones (cylinderHead);
piston piston
{ {
patches (piston); patches (piston);
@ -43,6 +40,9 @@ mover
// Move the points in the piston bowl with the piston // Move the points in the piston bowl with the piston
movingZones (pistonBowl); movingZones (pistonBowl);
// Freeze the points in the cylinder head
frozenZones (cylinderHead);
// There is no need to update the motion weights // There is no need to update the motion weights
fractionalTravelInterval 1; fractionalTravelInterval 1;
} }