From 333d37ea7d3b458a2b6cdce3c7fcc524cf27a31f Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 13 Dec 2012 13:12:21 +0000 Subject: [PATCH] BUG: mapped bc: use distribute on the mappedPatchBase to account for AMI --- .../mappedFixedValue/mappedFixedValueFvPatchField.C | 6 ++---- .../radiationCoupledBase/radiationCoupledBase.C | 5 +---- ...ntTemperatureCoupledBaffleMixedFvPatchScalarField.C | 6 ++---- ...ulentTemperatureRadCoupledMixedFvPatchScalarField.C | 10 ++++------ 4 files changed, 9 insertions(+), 18 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedValue/mappedFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedValue/mappedFixedValueFvPatchField.C index 930a931206..77cc8d61a9 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedValue/mappedFixedValueFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedValue/mappedFixedValueFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -308,8 +308,6 @@ void mappedFixedValueFvPatchField::updateCoeffs() } case mappedPatchBase::NEARESTFACE: { - const mapDistribute& distMap = mpp.map(); - Field allValues(nbrMesh.nFaces(), pTraits::zero); const fieldType& nbrField = sampleField(); @@ -326,7 +324,7 @@ void mappedFixedValueFvPatchField::updateCoeffs() } } - distMap.distribute(allValues); + mpp.distribute(allValues); newValues.transfer(allValues); break; diff --git a/src/thermophysicalModels/radiationModels/derivedFvPatchFields/radiationCoupledBase/radiationCoupledBase.C b/src/thermophysicalModels/radiationModels/derivedFvPatchFields/radiationCoupledBase/radiationCoupledBase.C index 5387a38a53..ced47a9504 100644 --- a/src/thermophysicalModels/radiationModels/derivedFvPatchFields/radiationCoupledBase/radiationCoupledBase.C +++ b/src/thermophysicalModels/radiationModels/derivedFvPatchFields/radiationCoupledBase/radiationCoupledBase.C @@ -146,9 +146,6 @@ Foam::scalarField Foam::radiationCoupledBase::emissivity() const ); - // Force recalculation of mapping and schedule - const mapDistribute& distMap = mpp.map(); - const fvMesh& nbrFvMesh = refCast(nbrMesh); const fvPatch& nbrPatch = @@ -162,7 +159,7 @@ Foam::scalarField Foam::radiationCoupledBase::emissivity() const nbrPatch.index() ] ); - distMap.distribute(emissivity); + mpp.distribute(emissivity); return emissivity; diff --git a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C index f04f11ef18..5271b5da69 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C @@ -158,8 +158,6 @@ void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs() nbrMesh ).boundary()[mpp.samplePolyPatch().index()]; - // Force recalculation of mapping and schedule - const mapDistribute& distMap = mpp.map(); tmp intFld = patchInternalField(); @@ -181,11 +179,11 @@ void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs() // Swap to obtain full local values of neighbour internal field scalarField nbrIntFld(nbrField.patchInternalField()); - distMap.distribute(nbrIntFld); + mpp.distribute(nbrIntFld); // Swap to obtain full local values of neighbour kappa*delta scalarField nbrKDelta(nbrField.kappa(nbrField)*nbrPatch.deltaCoeffs()); - distMap.distribute(nbrKDelta); + mpp.distribute(nbrKDelta); tmp myKDelta = kappa(*this)*patch().deltaCoeffs(); diff --git a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C index beec3b069c..137db852d4 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -163,8 +163,6 @@ void turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs() const fvPatch& nbrPatch = refCast(nbrMesh).boundary()[samplePatchI]; - // Force recalculation of mapping and schedule - const mapDistribute& distMap = mpp.map(); scalarField Tc(patchInternalField()); scalarField& Tp = *this; @@ -178,12 +176,12 @@ void turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs() // Swap to obtain full local values of neighbour internal field scalarField TcNbr(nbrField.patchInternalField()); - distMap.distribute(TcNbr); + mpp.distribute(TcNbr); // Swap to obtain full local values of neighbour K*delta scalarField KDeltaNbr(nbrField.kappa(nbrField)*nbrPatch.deltaCoeffs()); - distMap.distribute(KDeltaNbr); + mpp.distribute(KDeltaNbr); scalarField KDelta(kappa(*this)*patch().deltaCoeffs()); @@ -198,7 +196,7 @@ void turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs() if (QrNbrName_ != "none") { QrNbr = nbrPatch.lookupPatchField(QrNbrName_); - distMap.distribute(QrNbr); + mpp.distribute(QrNbr); } scalarField alpha(KDeltaNbr - (Qr + QrNbr)/Tp);