Warn if no IB patches found

This commit is contained in:
Hrvoje Jasak 2021-07-05 15:46:26 +01:00
parent 3bf258ab2b
commit 6d84054b11

View file

@ -39,6 +39,24 @@ Description
void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh) void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
{ {
bool foundImmersedBoundaryPatch = false;
forAll (mesh.boundary(), patchI)
{
if (isA<immersedBoundaryFvPatch>(mesh.boundary()[patchI]))
{
foundImmersedBoundaryPatch = true;
}
}
if (!foundImmersedBoundaryPatch)
{
InfoInFunction
<< "Cannot find immersed boundary patch. Exiting" << endl;
return;
}
Info<< nl << "Calculating gamma" << endl; Info<< nl << "Calculating gamma" << endl;
volScalarField gamma volScalarField gamma
( (
@ -133,6 +151,7 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
// Create dead cells set // Create dead cells set
if (!deadCellsHash.empty())
{ {
cellSet cellSet
( (
@ -141,6 +160,11 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
deadCellsHash deadCellsHash
).write(); ).write();
} }
else
{
InfoInFunction
<< "Dead cells not found" << endl;
}
// Check consistency of face area vectors // Check consistency of face area vectors