diff --git a/src/finiteArea/fields/faPatchFields/basic/coupled/coupledFaPatchField.C b/src/finiteArea/fields/faPatchFields/basic/coupled/coupledFaPatchField.C index 5a029c1d5c..8ac312d804 100644 --- a/src/finiteArea/fields/faPatchFields/basic/coupled/coupledFaPatchField.C +++ b/src/finiteArea/fields/faPatchFields/basic/coupled/coupledFaPatchField.C @@ -130,8 +130,12 @@ void Foam::coupledFaPatchField::evaluate(const Pstream::commsTypes) { Field::operator= ( - this->patch().weights()*this->patchInternalField() - + (1.0 - this->patch().weights())*patchNeighbourField() + lerp + ( + this->patchNeighbourField(), + this->patchInternalField(), + this->patch().weights() + ) ); } diff --git a/src/finiteArea/interpolation/edgeInterpolation/schemes/Gamma/Gamma.H b/src/finiteArea/interpolation/edgeInterpolation/schemes/Gamma/Gamma.H index c4bd351639..d8de90a17e 100644 --- a/src/finiteArea/interpolation/edgeInterpolation/schemes/Gamma/Gamma.H +++ b/src/finiteArea/interpolation/edgeInterpolation/schemes/Gamma/Gamma.H @@ -112,7 +112,7 @@ public: scalar phict = 1 - 0.5*gradf/gradcf; scalar limiter = min(max(phict/k_, 0), 1); - return limiter*cdWeight + (1 - limiter)*udWeight; + return lerp(udWeight, cdWeight, limiter); } }; diff --git a/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchField.C index c68079214a..389b562632 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchField.C @@ -139,8 +139,12 @@ void Foam::coupledFvPatchField::evaluate(const Pstream::commsTypes) Field::operator= ( - this->patch().weights()*this->patchInternalField() - + (1.0 - this->patch().weights())*this->patchNeighbourField() + lerp + ( + this->patchNeighbourField(), + this->patchInternalField(), + this->patch().weights() + ) ); fvPatchField::evaluate(); diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.C b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.C index 69a88da168..f7f8669492 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2019-2021 OpenCFD Ltd. + Copyright (C) 2019-2023 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -264,6 +264,9 @@ Foam::surfaceInterpolationScheme::dotInterpolate for (label fi=0; fi::dotInterpolate { psf = pSf - & ( - pLambda*vf.boundaryField()[pi].patchInternalField() - + (1.0 - pLambda)*vf.boundaryField()[pi].patchNeighbourField() + & lerp + ( + vf.boundaryField()[pi].patchNeighbourField(), + vf.boundaryField()[pi].patchInternalField(), + pLambda ); } else diff --git a/src/sampling/surface/isoSurface/isoSurfacePointTemplates.C b/src/sampling/surface/isoSurface/isoSurfacePointTemplates.C index 8f077680ac..a4bf332ae3 100644 --- a/src/sampling/surface/isoSurface/isoSurfacePointTemplates.C +++ b/src/sampling/surface/isoSurface/isoSurfacePointTemplates.C @@ -111,11 +111,12 @@ Foam::isoSurfacePoint::adaptPatchFields sliceFldBf[patchi] ); - const scalarField& w = mesh.weights().boundaryField()[patchi]; - - tmp> f = - w*pfld.patchInternalField() - + (1.0-w)*pfld.patchNeighbourField(); + tmp> f = lerp + ( + pfld.patchNeighbourField(), + pfld.patchInternalField(), + mesh.weights().boundaryField()[patchi] + ); bitSet isCollocated (