Skip to content
Snippets Groups Projects
Commit 0fc4b79d authored by mattijs's avatar mattijs
Browse files

ENH: checkMesh: write minPyrVol. Fixes #1543.

parent 28eb349a
No related merge requests found
...@@ -161,6 +161,7 @@ int main(int argc, char *argv[]) ...@@ -161,6 +161,7 @@ int main(int argc, char *argv[])
"cellVolume", "cellVolume",
"cellVolumeRatio", "cellVolumeRatio",
"minTetVolume", "minTetVolume",
"minPyrVolume",
"cellRegion", "cellRegion",
"wallDistance" "wallDistance"
}); });
......
...@@ -472,6 +472,69 @@ void Foam::writeFields ...@@ -472,6 +472,69 @@ void Foam::writeFields
minTetVolume.write(); minTetVolume.write();
} }
// minPyrVolume
if (selectedFields.found("minPyrVolume"))
{
volScalarField minPyrVolume
(
IOobject
(
"minPyrVolume",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE,
false
),
mesh,
dimensionedScalar("minPyrVolume", dimless, GREAT),
zeroGradientFvPatchScalarField::typeName
);
// Get owner and neighbour pyr volumes
scalarField ownPyrVol(mesh.nFaces());
scalarField neiPyrVol(mesh.nInternalFaces());
primitiveMeshTools::facePyramidVolume
(
mesh,
mesh.points(),
mesh.cellCentres(),
ownPyrVol,
neiPyrVol
);
// Get min pyr vol per cell
scalarField& cellFld = minPyrVolume.ref();
cellFld = GREAT;
const labelUList& own = mesh.owner();
const labelUList& nei = mesh.neighbour();
// Internal faces
forAll(own, facei)
{
cellFld[own[facei]] = min(cellFld[own[facei]], ownPyrVol[facei]);
cellFld[nei[facei]] = min(cellFld[nei[facei]], neiPyrVol[facei]);
}
// Patch faces
for (const auto& fvp : minPyrVolume.boundaryField())
{
const labelUList& fc = fvp.patch().faceCells();
forAll(fc, i)
{
const label meshFacei = fvp.patch().start();
cellFld[fc[i]] = min(cellFld[fc[i]], ownPyrVol[meshFacei]);
}
}
minPyrVolume.correctBoundaryConditions();
Info<< " Writing minPyrVolume to " << minPyrVolume.name() << endl;
minPyrVolume.write();
}
if (selectedFields.found("cellRegion")) if (selectedFields.found("cellRegion"))
{ {
volScalarField cellRegion volScalarField cellRegion
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment