fvMeshStitcher: Stabilise calculation of error face areas

This commit is contained in:
Will Bainbridge
2023-05-12 11:45:51 +01:00
parent 3479c6a37f
commit c9bf66a632

View File

@ -987,11 +987,14 @@ void Foam::fvMeshStitchers::moving::unconformErrorFaceCorrectMeshPhi
const label errorPatchFacei0 = 2*origPatchFacei;
const label errorPatchFacei1 = 2*origPatchFacei + 1;
const vector errorSf =
origPp.faceNormals()[origPatchFacei]
*phi.boundaryField()[errorPatchi][errorPatchFacei0]
const scalar a =
phi.boundaryField()[errorPatchi][errorPatchFacei0]
/max(meshMagUfb[origPatchi][origPatchFacei], vSmall);
const vector errorSf =
sign(a)*min(mag(a), origPp.magFaceAreas()[origPatchFacei])
*origPp.faceNormals()[origPatchFacei];
fvsPatchField<vector>& Sfp =
SfSf.boundaryFieldRef()[errorPatchi];
Sfp[errorPatchFacei0] += errorSf;