mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: foamyHexMesh: Enable only the conformation step to be run if internal points are all fixed
This commit is contained in:
@ -1046,6 +1046,18 @@ Foam::conformalVoronoiMesh::conformalVoronoiMesh
|
||||
)
|
||||
),
|
||||
decomposition_()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::conformalVoronoiMesh::~conformalVoronoiMesh()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::conformalVoronoiMesh::initialiseForMotion()
|
||||
{
|
||||
if (foamyHexMeshControls().objOutput())
|
||||
{
|
||||
@ -1061,7 +1073,10 @@ Foam::conformalVoronoiMesh::conformalVoronoiMesh
|
||||
runTime_,
|
||||
rndGen_,
|
||||
geometryToConformTo_,
|
||||
foamyHexMeshDict.subDict("backgroundMeshDecomposition")
|
||||
foamyHexMeshControls().foamyHexMeshDict().subDict
|
||||
(
|
||||
"backgroundMeshDecomposition"
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -1125,13 +1140,53 @@ Foam::conformalVoronoiMesh::conformalVoronoiMesh
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
void Foam::conformalVoronoiMesh::initialiseForConformation()
|
||||
{
|
||||
if (Pstream::parRun())
|
||||
{
|
||||
decomposition_.reset
|
||||
(
|
||||
new backgroundMeshDecomposition
|
||||
(
|
||||
runTime_,
|
||||
rndGen_,
|
||||
geometryToConformTo_,
|
||||
foamyHexMeshControls().foamyHexMeshDict().subDict
|
||||
(
|
||||
"backgroundMeshDecomposition"
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Foam::conformalVoronoiMesh::~conformalVoronoiMesh()
|
||||
{}
|
||||
insertInitialPoints();
|
||||
|
||||
insertFeaturePoints();
|
||||
|
||||
// Improve the guess that the backgroundMeshDecomposition makes with the
|
||||
// initial positions. Use before building the surface conformation to
|
||||
// better balance the surface conformation load.
|
||||
distributeBackground(*this);
|
||||
|
||||
buildSurfaceConformation();
|
||||
|
||||
// The introduction of the surface conformation may have distorted the
|
||||
// balance of vertices, distribute if necessary.
|
||||
distributeBackground(*this);
|
||||
|
||||
if (Pstream::parRun())
|
||||
{
|
||||
sync(decomposition_().procBounds());
|
||||
}
|
||||
|
||||
cellSizeMeshOverlapsBackground();
|
||||
|
||||
if (foamyHexMeshControls().printVertexInfo())
|
||||
{
|
||||
printVertexInfo(Info);
|
||||
}
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::conformalVoronoiMesh::move()
|
||||
{
|
||||
|
||||
@ -1038,6 +1038,10 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
void initialiseForMotion();
|
||||
|
||||
void initialiseForConformation();
|
||||
|
||||
//- Move the vertices according to the controller, re-conforming to the
|
||||
// surface as required
|
||||
void move();
|
||||
|
||||
@ -58,7 +58,7 @@ List<Vb::Point> pointFile::initialPoints() const
|
||||
IOobject
|
||||
(
|
||||
pointFileName_.name(),
|
||||
foamyHexMesh_.time().constant(),
|
||||
foamyHexMesh_.time().timeName(),
|
||||
foamyHexMesh_.time(),
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
|
||||
@ -45,12 +45,22 @@ int main(int argc, char *argv[])
|
||||
"check all surface geometry for quality"
|
||||
);
|
||||
|
||||
Foam::argList::addBoolOption
|
||||
(
|
||||
"conformationOnly",
|
||||
"conform to the initial points without any point motion"
|
||||
);
|
||||
|
||||
#include "addOverwriteOption.H"
|
||||
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
|
||||
runTime.functionObjects().off();
|
||||
|
||||
const bool checkGeometry = args.optionFound("checkGeometry");
|
||||
const bool conformationOnly = args.optionFound("conformationOnly");
|
||||
const bool overwrite = args.optionFound("overwrite");
|
||||
|
||||
IOdictionary foamyHexMeshDict
|
||||
(
|
||||
@ -104,16 +114,33 @@ int main(int argc, char *argv[])
|
||||
conformalVoronoiMesh mesh(runTime, foamyHexMeshDict);
|
||||
|
||||
|
||||
while (runTime.loop())
|
||||
if (conformationOnly)
|
||||
{
|
||||
Info<< nl << "Time = " << runTime.timeName() << endl;
|
||||
mesh.initialiseForConformation();
|
||||
|
||||
mesh.move();
|
||||
if (!overwrite)
|
||||
{
|
||||
runTime++;
|
||||
}
|
||||
|
||||
Info<< nl << "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< endl;
|
||||
mesh.writeMesh(runTime.timeName());
|
||||
}
|
||||
else
|
||||
{
|
||||
mesh.initialiseForMotion();
|
||||
|
||||
while (runTime.loop())
|
||||
{
|
||||
Info<< nl << "Time = " << runTime.timeName() << endl;
|
||||
|
||||
mesh.move();
|
||||
|
||||
Info<< nl << "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Info<< nl << "End" << nl << endl;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user