fvConstraints: Added support for mesh redistribution and load-balancing

This commit is contained in:
Henry Weller
2021-12-24 11:32:06 +00:00
parent a4e02fb247
commit 4267bb6c37
16 changed files with 99 additions and 27 deletions

View File

@ -148,18 +148,4 @@ bool Foam::fvConstraint::read(const dictionary& dict)
}
void Foam::fvConstraint::updateMesh(const mapPolyMesh&)
{}
void Foam::fvConstraint::distribute(const mapDistributePolyMesh&)
{}
bool Foam::fvConstraint::movePoints()
{
return true;
}
// ************************************************************************* //

View File

@ -213,13 +213,13 @@ public:
// Mesh changes
//- Update for mesh changes
virtual void updateMesh(const mapPolyMesh&);
virtual void updateMesh(const mapPolyMesh&) = 0;
//- Update mesh corresponding to the given distribution map
virtual void distribute(const mapDistributePolyMesh&);
virtual void distribute(const mapDistributePolyMesh&) = 0;
//- Update for mesh motion
virtual bool movePoints();
virtual bool movePoints() = 0;
// IO

View File

@ -174,6 +174,13 @@ void Foam::fvCellSet::updateMesh(const mapPolyMesh&)
}
void Foam::fvCellSet::distribute(const mapDistributePolyMesh&)
{
setCells();
setV();
}
void Foam::fvCellSet::movePoints()
{
if (selectionMode_ == selectionModeType::points)

View File

@ -70,6 +70,7 @@ namespace Foam
{
class fvMesh;
class mapDistributePolyMesh;
/*---------------------------------------------------------------------------*\
Class fvCellSet Declaration
@ -168,6 +169,9 @@ public:
//- Update for mesh changes
void updateMesh(const mapPolyMesh&);
//- Update mesh corresponding to the given distribution map
void distribute(const mapDistributePolyMesh&);
//- Update for mesh motion
void movePoints();

View File

@ -156,9 +156,18 @@ bool Foam::fv::fixedTemperatureConstraint::constrain
}
void Foam::fv::fixedTemperatureConstraint::updateMesh(const mapPolyMesh& mpm)
void Foam::fv::fixedTemperatureConstraint::updateMesh(const mapPolyMesh& map)
{
set_.updateMesh(mpm);
set_.updateMesh(map);
}
void Foam::fv::fixedTemperatureConstraint::distribute
(
const mapDistributePolyMesh& map
)
{
set_.distribute(map);
}

View File

@ -158,6 +158,9 @@ public:
//- Update for mesh changes
virtual void updateMesh(const mapPolyMesh&);
//- Update mesh corresponding to the given distribution map
virtual void distribute(const mapDistributePolyMesh&);
//- Update for mesh motion
virtual bool movePoints();

View File

@ -117,9 +117,18 @@ FOR_ALL_FIELD_TYPES
);
void Foam::fv::fixedValueConstraint::updateMesh(const mapPolyMesh& mpm)
void Foam::fv::fixedValueConstraint::updateMesh(const mapPolyMesh& map)
{
set_.updateMesh(mpm);
set_.updateMesh(map);
}
void Foam::fv::fixedValueConstraint::distribute
(
const mapDistributePolyMesh& map
)
{
set_.distribute(map);
}

View File

@ -121,6 +121,9 @@ public:
//- Update for mesh changes
virtual void updateMesh(const mapPolyMesh&);
//- Update mesh corresponding to the given distribution map
virtual void distribute(const mapDistributePolyMesh&);
//- Update for mesh motion
virtual bool movePoints();

View File

@ -219,6 +219,21 @@ bool Foam::fv::limitPressure::constrain(volScalarField& p) const
}
void Foam::fv::limitPressure::updateMesh(const mapPolyMesh&)
{}
void Foam::fv::limitPressure::distribute(const mapDistributePolyMesh&)
{}
bool Foam::fv::limitPressure::movePoints()
{
return true;
}
bool Foam::fv::limitPressure::read(const dictionary& dict)
{
if (fvConstraint::read(dict))

View File

@ -126,6 +126,15 @@ public:
//- Constrain the energy field
virtual bool constrain(volScalarField& he) const;
//- Update for mesh changes
virtual void updateMesh(const mapPolyMesh&);
//- Update mesh corresponding to the given distribution map
virtual void distribute(const mapDistributePolyMesh&);
//- Update for mesh motion
virtual bool movePoints();
//- Read dictionary
virtual bool read(const dictionary& dict);

View File

@ -183,9 +183,15 @@ bool Foam::fv::limitTemperature::constrain(volScalarField& he) const
}
void Foam::fv::limitTemperature::updateMesh(const mapPolyMesh& mpm)
void Foam::fv::limitTemperature::updateMesh(const mapPolyMesh& map)
{
set_.updateMesh(mpm);
set_.updateMesh(map);
}
void Foam::fv::limitTemperature::distribute(const mapDistributePolyMesh& map)
{
set_.distribute(map);
}

View File

@ -133,6 +133,9 @@ public:
//- Update for mesh changes
virtual void updateMesh(const mapPolyMesh&);
//- Update mesh corresponding to the given distribution map
virtual void distribute(const mapDistributePolyMesh&);
//- Update for mesh motion
virtual bool movePoints();

View File

@ -128,9 +128,15 @@ bool Foam::fv::limitVelocity::constrain(volVectorField& U) const
}
void Foam::fv::limitVelocity::updateMesh(const mapPolyMesh& mpm)
void Foam::fv::limitVelocity::updateMesh(const mapPolyMesh& map)
{
set_.updateMesh(mpm);
set_.updateMesh(map);
}
void Foam::fv::limitVelocity::distribute(const mapDistributePolyMesh& map)
{
set_.distribute(map);
}

View File

@ -121,6 +121,9 @@ public:
//- Update for mesh changes
virtual void updateMesh(const mapPolyMesh&);
//- Update mesh corresponding to the given distribution map
virtual void distribute(const mapDistributePolyMesh&);
//- Update for mesh motion
virtual bool movePoints();

View File

@ -248,9 +248,15 @@ bool Foam::fv::meanVelocityForce::constrain(volVectorField& U) const
}
void Foam::fv::meanVelocityForce::updateMesh(const mapPolyMesh& mpm)
void Foam::fv::meanVelocityForce::updateMesh(const mapPolyMesh& map)
{
set_.updateMesh(mpm);
set_.updateMesh(map);
}
void Foam::fv::meanVelocityForce::distribute(const mapDistributePolyMesh& map)
{
set_.distribute(map);
}

View File

@ -158,6 +158,9 @@ public:
//- Update for mesh changes
virtual void updateMesh(const mapPolyMesh&);
//- Update mesh corresponding to the given distribution map
virtual void distribute(const mapDistributePolyMesh&);
//- Update for mesh motion
virtual bool movePoints();