Updated immersed boundary masks tool
This commit is contained in:
parent
49e554ee72
commit
0ae9da4ae6
1 changed files with 38 additions and 4 deletions
|
@ -50,9 +50,42 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
|
|||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("one", dimless, 0)
|
||||
dimensionedScalar("one", dimless, 1)
|
||||
);
|
||||
gamma.internalField() = mesh.V()/mesh.cellVolumes();
|
||||
gamma.write();
|
||||
|
||||
// Report minimal live cell volume
|
||||
scalar minLiveGamma = GREAT;
|
||||
label minLiveCell = -1;
|
||||
const scalarField& gammaIn = gamma.internalField();
|
||||
|
||||
forAll (mesh.boundary(), patchI)
|
||||
{
|
||||
if (isA<immersedBoundaryFvPatch>(mesh.boundary()[patchI]))
|
||||
{
|
||||
const immersedBoundaryFvPatch& ibPatch =
|
||||
refCast<const immersedBoundaryFvPatch>
|
||||
(
|
||||
mesh.boundary()[patchI]
|
||||
);
|
||||
|
||||
const labelList& ibCells = ibPatch.ibPolyPatch().ibCells();
|
||||
|
||||
forAll (ibCells, dcI)
|
||||
{
|
||||
if (gammaIn[ibCells[dcI]] < minLiveGamma)
|
||||
{
|
||||
minLiveGamma = gammaIn[ibCells[dcI]];
|
||||
minLiveCell = ibCells[dcI];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Info<< "Min live cell " << minLiveCell
|
||||
<< " gamma = " << minLiveGamma
|
||||
<< endl;
|
||||
|
||||
Info<< nl << "Calculating sGamma" << endl;
|
||||
surfaceScalarField sGamma
|
||||
|
@ -89,7 +122,6 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
|
|||
}
|
||||
}
|
||||
|
||||
gamma.write();
|
||||
sGamma.write();
|
||||
|
||||
// Check consistency of face area vectors
|
||||
|
@ -117,6 +149,8 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
|
|||
<< max(magDivSf)
|
||||
<< endl;
|
||||
}
|
||||
|
||||
Info<< endl;
|
||||
}
|
||||
|
||||
|
||||
|
|
Reference in a new issue