BUG: ACMI - updated interpolation weights and construction order - mantis #1279

This commit is contained in:
andy
2014-05-06 13:18:41 +01:00
committed by Andrew Heather
parent f609ccd76f
commit 18c8c3c585
2 changed files with 14 additions and 4 deletions

View File

@ -127,6 +127,10 @@ void Foam::cyclicACMIPolyPatch::setNeighbourFaceAreas() const
void Foam::cyclicACMIPolyPatch::initGeometry(PstreamBuffers& pBufs) void Foam::cyclicACMIPolyPatch::initGeometry(PstreamBuffers& pBufs)
{ {
// initialise the AMI so that base geometry (e.g. cell volumes) are
// correctly evaluated
resetAMI();
cyclicAMIPolyPatch::initGeometry(pBufs); cyclicAMIPolyPatch::initGeometry(pBufs);
} }

View File

@ -32,13 +32,16 @@ Foam::tmp<Foam::Field<Type> > Foam::cyclicACMIPolyPatch::interpolate
const Field<Type>& fldNonOverlap const Field<Type>& fldNonOverlap
) const ) const
{ {
// note: do not scale AMI field as face areas have already been taken
// into account
if (owner()) if (owner())
{ {
const scalarField& w = srcMask_; const scalarField& w = srcMask_;
tmp<Field<Type> > interpField(AMI().interpolateToSource(fldCouple)); tmp<Field<Type> > interpField(AMI().interpolateToSource(fldCouple));
return w*interpField + (1.0 - w)*fldNonOverlap; return interpField + (1.0 - w)*fldNonOverlap;
} }
else else
{ {
@ -49,7 +52,7 @@ Foam::tmp<Foam::Field<Type> > Foam::cyclicACMIPolyPatch::interpolate
neighbPatch().AMI().interpolateToTarget(fldCouple) neighbPatch().AMI().interpolateToTarget(fldCouple)
); );
return w*interpField + (1.0 - w)*fldNonOverlap; return interpField + (1.0 - w)*fldNonOverlap;
} }
} }
@ -74,19 +77,22 @@ void Foam::cyclicACMIPolyPatch::interpolate
List<Type>& result List<Type>& result
) const ) const
{ {
// note: do not scale AMI field as face areas have already been taken
// into account
if (owner()) if (owner())
{ {
const scalarField& w = srcMask_; const scalarField& w = srcMask_;
AMI().interpolateToSource(fldCouple, cop, result); AMI().interpolateToSource(fldCouple, cop, result);
result = w*result + (1.0 - w)*fldNonOverlap; result = result + (1.0 - w)*fldNonOverlap;
} }
else else
{ {
const scalarField& w = neighbPatch().tgtMask(); const scalarField& w = neighbPatch().tgtMask();
neighbPatch().AMI().interpolateToTarget(fldCouple, cop, result); neighbPatch().AMI().interpolateToTarget(fldCouple, cop, result);
result = w*result + (1.0 - w)*fldNonOverlap; result = result + (1.0 - w)*fldNonOverlap;
} }
} }