Added creation of dead cell set

This commit is contained in:
Hrvoje Jasak 2019-06-18 16:39:41 +01:00
parent 6c80a5b3e4
commit 9ca9cabbac

View file

@ -33,6 +33,7 @@ Description
#include "fvc.H" #include "fvc.H"
#include "fvMatrices.H" #include "fvMatrices.H"
#include "immersedBoundaryFvPatch.H" #include "immersedBoundaryFvPatch.H"
#include "cellSet.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -59,6 +60,9 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
label minLiveCell = -1; label minLiveCell = -1;
const scalarField& gammaIn = gamma.internalField(); const scalarField& gammaIn = gamma.internalField();
// Collect dead cells
labelHashSet deadCellsHash;
forAll (mesh.boundary(), patchI) forAll (mesh.boundary(), patchI)
{ {
if (isA<immersedBoundaryFvPatch>(mesh.boundary()[patchI])) if (isA<immersedBoundaryFvPatch>(mesh.boundary()[patchI]))
@ -79,6 +83,9 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
minLiveCell = ibCells[dcI]; minLiveCell = ibCells[dcI];
} }
} }
// Collect dead cells
deadCellsHash.insert(ibPatch.ibPolyPatch().deadCells());
} }
} }
@ -124,6 +131,17 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
sGamma.write(); sGamma.write();
gamma.write(); gamma.write();
// Create dead cells set
{
cellSet
(
mesh,
"deadCells",
deadCellsHash
).write();
}
// Check consistency of face area vectors // Check consistency of face area vectors
Info<< nl << "Calculating divSf" << endl; Info<< nl << "Calculating divSf" << endl;
@ -240,8 +258,6 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
<< "Sum normal areas: " << sum(openFaceAreas) << nl << "Sum normal areas: " << sum(openFaceAreas) << nl
<< "Sum iB areas: " << sum(ibVectors) << nl << "Sum iB areas: " << sum(ibVectors) << nl
<< endl; << endl;
} }
Info<< endl; Info<< endl;