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_()
|
decomposition_()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::conformalVoronoiMesh::~conformalVoronoiMesh()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::conformalVoronoiMesh::initialiseForMotion()
|
||||||
{
|
{
|
||||||
if (foamyHexMeshControls().objOutput())
|
if (foamyHexMeshControls().objOutput())
|
||||||
{
|
{
|
||||||
@ -1061,7 +1073,10 @@ Foam::conformalVoronoiMesh::conformalVoronoiMesh
|
|||||||
runTime_,
|
runTime_,
|
||||||
rndGen_,
|
rndGen_,
|
||||||
geometryToConformTo_,
|
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()
|
void Foam::conformalVoronoiMesh::move()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1038,6 +1038,10 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
void initialiseForMotion();
|
||||||
|
|
||||||
|
void initialiseForConformation();
|
||||||
|
|
||||||
//- Move the vertices according to the controller, re-conforming to the
|
//- Move the vertices according to the controller, re-conforming to the
|
||||||
// surface as required
|
// surface as required
|
||||||
void move();
|
void move();
|
||||||
|
|||||||
@ -58,7 +58,7 @@ List<Vb::Point> pointFile::initialPoints() const
|
|||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
pointFileName_.name(),
|
pointFileName_.name(),
|
||||||
foamyHexMesh_.time().constant(),
|
foamyHexMesh_.time().timeName(),
|
||||||
foamyHexMesh_.time(),
|
foamyHexMesh_.time(),
|
||||||
IOobject::MUST_READ,
|
IOobject::MUST_READ,
|
||||||
IOobject::NO_WRITE
|
IOobject::NO_WRITE
|
||||||
|
|||||||
@ -45,12 +45,22 @@ int main(int argc, char *argv[])
|
|||||||
"check all surface geometry for quality"
|
"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 "setRootCase.H"
|
||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
|
|
||||||
runTime.functionObjects().off();
|
runTime.functionObjects().off();
|
||||||
|
|
||||||
const bool checkGeometry = args.optionFound("checkGeometry");
|
const bool checkGeometry = args.optionFound("checkGeometry");
|
||||||
|
const bool conformationOnly = args.optionFound("conformationOnly");
|
||||||
|
const bool overwrite = args.optionFound("overwrite");
|
||||||
|
|
||||||
IOdictionary foamyHexMeshDict
|
IOdictionary foamyHexMeshDict
|
||||||
(
|
(
|
||||||
@ -104,6 +114,21 @@ int main(int argc, char *argv[])
|
|||||||
conformalVoronoiMesh mesh(runTime, foamyHexMeshDict);
|
conformalVoronoiMesh mesh(runTime, foamyHexMeshDict);
|
||||||
|
|
||||||
|
|
||||||
|
if (conformationOnly)
|
||||||
|
{
|
||||||
|
mesh.initialiseForConformation();
|
||||||
|
|
||||||
|
if (!overwrite)
|
||||||
|
{
|
||||||
|
runTime++;
|
||||||
|
}
|
||||||
|
|
||||||
|
mesh.writeMesh(runTime.timeName());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mesh.initialiseForMotion();
|
||||||
|
|
||||||
while (runTime.loop())
|
while (runTime.loop())
|
||||||
{
|
{
|
||||||
Info<< nl << "Time = " << runTime.timeName() << endl;
|
Info<< nl << "Time = " << runTime.timeName() << endl;
|
||||||
@ -114,6 +139,8 @@ int main(int argc, char *argv[])
|
|||||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Info<< nl << "End" << nl << endl;
|
Info<< nl << "End" << nl << endl;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user