From 011589a375ad3796a7d9a72cbbc16cff636e5647 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Fri, 28 Jun 2019 18:51:35 +0100 Subject: [PATCH] Upddate IB masks: zero or one only --- .../immersedBoundary/include/updateIbMasks.H | 47 ++----------------- 1 file changed, 5 insertions(+), 42 deletions(-) diff --git a/src/immersedBoundary/immersedBoundary/include/updateIbMasks.H b/src/immersedBoundary/immersedBoundary/include/updateIbMasks.H index 974c066a3..9363b5cf8 100644 --- a/src/immersedBoundary/immersedBoundary/include/updateIbMasks.H +++ b/src/immersedBoundary/immersedBoundary/include/updateIbMasks.H @@ -8,51 +8,14 @@ gamma.correctBoundaryConditions(); sGamma.correctBoundaryConditions(); + + // Reset gamma and sGamma + gamma == dimensionedScalar("one", dimless, 1); + sGamma == dimensionedScalar("one", dimless, 1); + scalarField& gammaIn = gamma.internalField(); - - gammaIn = mesh.V()/mesh.cellVolumes(); - scalarField& sGammaIn = sGamma.internalField(); - const surfaceScalarField& magSf = mesh.magSf(); - const scalarField magFaceAreas = mag(mesh.faceAreas()); - - sGammaIn = magSf.internalField()/ - scalarField::subField(magFaceAreas, mesh.nInternalFaces()); - - const scalar maxGamma = max(gammaIn); - const scalar maxSGamma = min(sGammaIn); - if (maxGamma > 1 || maxSGamma > 1) - { - WarningIn - ( - "updateIbMasks.H" - ) - << "Unbounded gamma: max(gamma) = " - << maxGamma << ", max(sGamma) = " << maxSGamma << endl; - } - - forAll (mesh.boundary(), patchI) - { - if (!isA(mesh.boundary()[patchI])) - { - sGamma.boundaryField()[patchI] = - magSf.boundaryField()[patchI]/ - mesh.boundary()[patchI].patchSlice(magFaceAreas); - - gamma.boundaryField()[patchI] = - sGamma.boundaryField()[patchI]; - } - else - { - sGamma.boundaryField()[patchI] = - scalarField(mesh.boundary()[patchI].size(), 1); - - gamma.boundaryField()[patchI] = - scalarField(mesh.boundary()[patchI].size(), 1); - } - } - // Adjust the mask in dead faces and dead cells forAll (mesh.boundary(), patchI) {