Commit 8dadd181 authored by Andrew Heather's avatar Andrew Heather
Browse files

ENH: surfaceInterpolation - improved robustness when dealing with empty patches

parent 27888bf7
......@@ -310,10 +310,23 @@ void Foam::surfaceInterpolation::makeNonOrthDeltaCoeffs() const
forAll(nonOrthDeltaCoeffsBf, patchi)
{
vectorField delta(mesh_.boundary()[patchi].delta());
fvsPatchScalarField& patchDeltaCoeffs = nonOrthDeltaCoeffsBf[patchi];
nonOrthDeltaCoeffsBf[patchi] =
1.0/max(mesh_.boundary()[patchi].nf() & delta, 0.05*mag(delta));
const fvPatch& p = patchDeltaCoeffs.patch();
const vectorField patchDeltas(mesh_.boundary()[patchi].delta());
forAll(p, patchFacei)
{
vector unitArea =
Sf.boundaryField()[patchi][patchFacei]
/magSf.boundaryField()[patchi][patchFacei];
const vector& delta = patchDeltas[patchFacei];
patchDeltaCoeffs[patchFacei] =
1.0/max(unitArea & delta, 0.05*mag(delta));
}
}
}
......@@ -364,8 +377,7 @@ void Foam::surfaceInterpolation::makeNonOrthCorrectionVectors() const
// and calculated consistently with internal corrections for
// coupled patches
surfaceVectorField::Boundary& corrVecsBf =
corrVecs.boundaryFieldRef();
surfaceVectorField::Boundary& corrVecsBf = corrVecs.boundaryFieldRef();
forAll(corrVecsBf, patchi)
{
......@@ -377,8 +389,8 @@ void Foam::surfaceInterpolation::makeNonOrthCorrectionVectors() const
}
else
{
const fvsPatchScalarField& patchNonOrthDeltaCoeffs
= NonOrthDeltaCoeffs.boundaryField()[patchi];
const fvsPatchScalarField& patchNonOrthDeltaCoeffs =
NonOrthDeltaCoeffs.boundaryField()[patchi];
const fvPatch& p = patchCorrVecs.patch();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment