Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fvMeshDistributors: New framework within fvMesh to handle run-time me…
…sh redistribution for e.g. load-balancing. The fvMeshDistributor is selected via the new optional distributor entry in dynamicMeshDict, e.g. distributor { type decomposer; libs ("libfvMeshDistributors.so"); } Note that currently only the framework is included in this commit, the fvMeshDistributors library is not yet fully functional and hence not released yet.
- Loading branch information
Henry Weller
committed
Nov 18, 2021
1 parent
daf9d6e
commit 6879967
Showing
31 changed files
with
692 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 95 additions & 0 deletions
95
src/finiteVolume/fvMesh/fvMeshDistributors/fvMeshDistributor/fvMeshDistributor.C
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
/*---------------------------------------------------------------------------*\ | ||
========= | | ||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox | ||
\\ / O peration | Website: https://openfoam.org | ||
\\ / A nd | Copyright (C) 2021 OpenFOAM Foundation | ||
\\/ M anipulation | | ||
------------------------------------------------------------------------------- | ||
License | ||
This file is part of OpenFOAM. | ||
OpenFOAM is free software: you can redistribute it and/or modify it | ||
under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT | ||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. | ||
\*---------------------------------------------------------------------------*/ | ||
|
||
#include "fvMeshDistributor.H" | ||
#include "volFields.H" | ||
|
||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // | ||
|
||
namespace Foam | ||
{ | ||
defineTypeNameAndDebug(fvMeshDistributor, 0); | ||
defineRunTimeSelectionTable(fvMeshDistributor, fvMesh); | ||
} | ||
|
||
|
||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // | ||
|
||
Foam::fvMeshDistributor::fvMeshDistributor(fvMesh& mesh) | ||
: | ||
mesh_(mesh), | ||
dynamicMeshDict_ | ||
( | ||
IOdictionary | ||
( | ||
IOobject | ||
( | ||
"dynamicMeshDict", | ||
mesh.time().constant(), | ||
mesh.dbDir(), | ||
mesh, | ||
IOobject::READ_IF_PRESENT, | ||
IOobject::NO_WRITE, | ||
false | ||
) | ||
) | ||
) | ||
{} | ||
|
||
|
||
Foam::fvMeshDistributor::velocityMotionCorrection::velocityMotionCorrection | ||
( | ||
const fvMesh& mesh, | ||
const dictionary& dict | ||
) | ||
: | ||
mesh_(mesh), | ||
velocityFields_(dict.lookupOrDefault("velocityFields", wordList())) | ||
{} | ||
|
||
|
||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // | ||
|
||
Foam::fvMeshDistributor::~fvMeshDistributor() | ||
{} | ||
|
||
|
||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // | ||
|
||
void Foam::fvMeshDistributor::velocityMotionCorrection::update() const | ||
{ | ||
forAll(velocityFields_, i) | ||
{ | ||
if (mesh_.foundObject<volVectorField>(velocityFields_[i])) | ||
{ | ||
mesh_.lookupObjectRef<volVectorField> | ||
( | ||
velocityFields_[i] | ||
).correctBoundaryConditions(); | ||
} | ||
} | ||
} | ||
|
||
// ************************************************************************* // |
Oops, something went wrong.