diff --git a/src/finiteVolume/fields/fvPatchFields/derived/directMappedField/directMappedFieldFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/directMappedField/directMappedFieldFvPatchField.C index 36f755c73f..1f4e77192c 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/directMappedField/directMappedFieldFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/directMappedField/directMappedFieldFvPatchField.C @@ -190,6 +190,11 @@ void directMappedFieldFvPatchField::updateCoeffs() typedef GeometricField fieldType; + // Since we're inside initEvaluate/evaluate there might be processor + // comms underway. Change the tag we use. + int oldTag = UPstream::msgType(); + UPstream::msgType() = oldTag+1; + const fvMesh& nbrMesh = refCast(sampleMesh()); const mapDistribute& distMap = directMappedPatchBase::map(); @@ -290,6 +295,9 @@ void directMappedFieldFvPatchField::updateCoeffs() << endl; } + // Restore tag + UPstream::msgType() = oldTag; + fixedValueFvPatchField::updateCoeffs(); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchField.C index 95dd14b934..177fbbe428 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchField.C @@ -102,6 +102,11 @@ void Foam::directMappedFixedInternalValueFvPatchField::updateCoeffs() return; } + // Since we're inside initEvaluate/evaluate there might be processor + // comms underway. Change the tag we use. + int oldTag = UPstream::msgType(); + UPstream::msgType() = oldTag+1; + // Retrieve the neighbour values and assign to this patch boundary field directMappedFixedValueFvPatchField::updateCoeffs(); @@ -134,6 +139,9 @@ void Foam::directMappedFixedInternalValueFvPatchField::updateCoeffs() nbrIntFld ); + // Restore tag + UPstream::msgType() = oldTag; + // Assign (this) patch internal field to its neighbour values Field& intFld = const_cast&>(this->internalField()); UIndirectList(intFld, this->patch().faceCells()) = nbrIntFld; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedValue/directMappedFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedValue/directMappedFixedValueFvPatchField.C index d5056caa34..1b54303db6 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedValue/directMappedFixedValueFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedValue/directMappedFixedValueFvPatchField.C @@ -224,6 +224,12 @@ void directMappedFixedValueFvPatchField::updateCoeffs() typedef GeometricField fieldType; + // Since we're inside initEvaluate/evaluate there might be processor + // comms underway. Change the tag we use. + int oldTag = UPstream::msgType(); + UPstream::msgType() = oldTag+1; + + // Get the scheduling information from the directMappedPatchBase const directMappedPatchBase& mpp = refCast ( @@ -363,6 +369,9 @@ void directMappedFixedValueFvPatchField::updateCoeffs() << endl; } + // Restore tag + UPstream::msgType() = oldTag; + fixedValueFvPatchField::updateCoeffs(); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFlowRate/directMappedFlowRateFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/directMappedFlowRate/directMappedFlowRateFvPatchVectorField.C index d6498a9819..9c18c19e8c 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFlowRate/directMappedFlowRateFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/directMappedFlowRate/directMappedFlowRateFvPatchVectorField.C @@ -114,6 +114,11 @@ void Foam::directMappedFlowRateFvPatchVectorField::updateCoeffs() return; } + // Since we're inside initEvaluate/evaluate there might be processor + // comms underway. Change the tag we use. + int oldTag = UPstream::msgType(); + UPstream::msgType() = oldTag+1; + // Get the coupling information from the directMappedPatchBase const directMappedPatchBase& mpp = refCast ( @@ -176,6 +181,9 @@ void Foam::directMappedFlowRateFvPatchVectorField::updateCoeffs() << nl << exit(FatalError); } + // Restore tag + UPstream::msgType() = oldTag; + fixedValueFvPatchField::updateCoeffs(); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C index 04a2650c79..caf00eff10 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C @@ -166,6 +166,11 @@ void Foam::directMappedVelocityFluxFixedValueFvPatchField::updateCoeffs() return; } + // Since we're inside initEvaluate/evaluate there might be processor + // comms underway. Change the tag we use. + int oldTag = UPstream::msgType(); + UPstream::msgType() = oldTag+1; + // Get the directMappedPatchBase const directMappedPatchBase& mpp = refCast ( @@ -245,6 +250,9 @@ void Foam::directMappedVelocityFluxFixedValueFvPatchField::updateCoeffs() operator==(newUValues); phiField.boundaryField()[patch().index()] == newPhiValues; + // Restore tag + UPstream::msgType() = oldTag; + fixedValueFvPatchVectorField::updateCoeffs(); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/selfContainedDirectMapped/selfContainedDirectMappedFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/selfContainedDirectMapped/selfContainedDirectMappedFixedValueFvPatchField.C index 4d93eff70c..05a2b55c5a 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/selfContainedDirectMapped/selfContainedDirectMappedFixedValueFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/selfContainedDirectMapped/selfContainedDirectMappedFixedValueFvPatchField.C @@ -222,6 +222,11 @@ void selfContainedDirectMappedFixedValueFvPatchField::updateCoeffs() typedef GeometricField fieldType; + // Since we're inside initEvaluate/evaluate there might be processor + // comms underway. Change the tag we use. + int oldTag = UPstream::msgType(); + UPstream::msgType() = oldTag+1; + const fvMesh& thisMesh = this->patch().boundaryMesh().mesh(); const fvMesh& nbrMesh = refCast(sampleMesh()); const mapDistribute& distMap = directMappedPatchBase::map(); @@ -360,6 +365,9 @@ void selfContainedDirectMappedFixedValueFvPatchField::updateCoeffs() << endl; } + // Restore tag + UPstream::msgType() = oldTag; + fixedValueFvPatchField::updateCoeffs(); } diff --git a/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisTemperatureCoupled/filmPyrolysisTemperatureCoupledFvPatchScalarField.C b/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisTemperatureCoupled/filmPyrolysisTemperatureCoupledFvPatchScalarField.C index 0908509b4d..e28b862bbf 100644 --- a/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisTemperatureCoupled/filmPyrolysisTemperatureCoupledFvPatchScalarField.C +++ b/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisTemperatureCoupled/filmPyrolysisTemperatureCoupledFvPatchScalarField.C @@ -117,6 +117,11 @@ void Foam::filmPyrolysisTemperatureCoupledFvPatchScalarField::updateCoeffs() typedef regionModels::surfaceFilmModels::surfaceFilmModel filmModelType; typedef regionModels::pyrolysisModels::pyrolysisModel pyrModelType; + // Since we're inside initEvaluate/evaluate there might be processor + // comms underway. Change the tag we use. + int oldTag = UPstream::msgType(); + UPstream::msgType() = oldTag+1; + bool filmOk = db().objectRegistry::foundObject ( @@ -181,6 +186,9 @@ void Foam::filmPyrolysisTemperatureCoupledFvPatchScalarField::updateCoeffs() } } + // Restore tag + UPstream::msgType() = oldTag; + fixedValueFvPatchScalarField::updateCoeffs(); } diff --git a/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisVelocityCoupled/filmPyrolysisVelocityCoupledFvPatchVectorField.C b/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisVelocityCoupled/filmPyrolysisVelocityCoupledFvPatchVectorField.C index 23154894bd..2864426c1d 100644 --- a/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisVelocityCoupled/filmPyrolysisVelocityCoupledFvPatchVectorField.C +++ b/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisVelocityCoupled/filmPyrolysisVelocityCoupledFvPatchVectorField.C @@ -117,6 +117,11 @@ void Foam::filmPyrolysisVelocityCoupledFvPatchVectorField::updateCoeffs() typedef regionModels::surfaceFilmModels::surfaceFilmModel filmModelType; typedef regionModels::pyrolysisModels::pyrolysisModel pyrModelType; + // Since we're inside initEvaluate/evaluate there might be processor + // comms underway. Change the tag we use. + int oldTag = UPstream::msgType(); + UPstream::msgType() = oldTag+1; + bool filmOk = db().objectRegistry::foundObject ( @@ -216,6 +221,9 @@ void Foam::filmPyrolysisVelocityCoupledFvPatchVectorField::updateCoeffs() } } + // Restore tag + UPstream::msgType() = oldTag; + fixedValueFvPatchVectorField::updateCoeffs(); } diff --git a/src/regionModels/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.C b/src/regionModels/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.C index 8960467fbd..154dcf7499 100644 --- a/src/regionModels/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.C +++ b/src/regionModels/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.C @@ -136,6 +136,11 @@ void alphatFilmWallFunctionFvPatchScalarField::updateCoeffs() typedef regionModels::surfaceFilmModels::surfaceFilmModel modelType; + // Since we're inside initEvaluate/evaluate there might be processor + // comms underway. Change the tag we use. + int oldTag = UPstream::msgType(); + UPstream::msgType() = oldTag+1; + bool ok = db().objectRegistry::foundObject("surfaceFilmProperties"); @@ -205,6 +210,11 @@ void alphatFilmWallFunctionFvPatchScalarField::updateCoeffs() alphat[faceI] = max(alphaEff - alphaw[faceI], 0.0); } + + // Restore tag + UPstream::msgType() = oldTag; + + fixedValueFvPatchScalarField::updateCoeffs(); } diff --git a/src/thermophysicalModels/radiationModels/derivedFvPatchFields/MarshakRadiation/MarshakRadiationMixedFvPatchScalarField.C b/src/thermophysicalModels/radiationModels/derivedFvPatchFields/MarshakRadiation/MarshakRadiationMixedFvPatchScalarField.C index bacb8fa8be..bb6e27c34b 100644 --- a/src/thermophysicalModels/radiationModels/derivedFvPatchFields/MarshakRadiation/MarshakRadiationMixedFvPatchScalarField.C +++ b/src/thermophysicalModels/radiationModels/derivedFvPatchFields/MarshakRadiation/MarshakRadiationMixedFvPatchScalarField.C @@ -159,6 +159,11 @@ void Foam::MarshakRadiationFvPatchScalarField::updateCoeffs() return; } + // Since we're inside initEvaluate/evaluate there might be processor + // comms underway. Change the tag we use. + int oldTag = UPstream::msgType(); + UPstream::msgType() = oldTag+1; + // Temperature field const scalarField& Tp = patch().lookupPatchField(TName_); @@ -175,6 +180,9 @@ void Foam::MarshakRadiationFvPatchScalarField::updateCoeffs() // Set value fraction valueFraction() = 1.0/(1.0 + gamma*patch().deltaCoeffs()/Ep); + // Restore tag + UPstream::msgType() = oldTag; + mixedFvPatchScalarField::updateCoeffs(); } diff --git a/src/thermophysicalModels/radiationModels/derivedFvPatchFields/MarshakRadiationFixedT/MarshakRadiationFixedTMixedFvPatchScalarField.C b/src/thermophysicalModels/radiationModels/derivedFvPatchFields/MarshakRadiationFixedT/MarshakRadiationFixedTMixedFvPatchScalarField.C index 1dd3a8b69f..f13bdf2e15 100644 --- a/src/thermophysicalModels/radiationModels/derivedFvPatchFields/MarshakRadiationFixedT/MarshakRadiationFixedTMixedFvPatchScalarField.C +++ b/src/thermophysicalModels/radiationModels/derivedFvPatchFields/MarshakRadiationFixedT/MarshakRadiationFixedTMixedFvPatchScalarField.C @@ -164,6 +164,11 @@ void Foam::MarshakRadiationFixedTMixedFvPatchScalarField::updateCoeffs() return; } + // Since we're inside initEvaluate/evaluate there might be processor + // comms underway. Change the tag we use. + int oldTag = UPstream::msgType(); + UPstream::msgType() = oldTag+1; + // Re-calc reference value refValue() = 4.0*constant::physicoChemical::sigma.value()*pow4(Trad_); @@ -176,6 +181,9 @@ void Foam::MarshakRadiationFixedTMixedFvPatchScalarField::updateCoeffs() // Set value fraction valueFraction() = 1.0/(1.0 + gamma*patch().deltaCoeffs()/Ep); + // Restore tag + UPstream::msgType() = oldTag; + mixedFvPatchScalarField::updateCoeffs(); } diff --git a/src/thermophysicalModels/radiationModels/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C b/src/thermophysicalModels/radiationModels/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C index b9a7b3acf8..4416ce0157 100644 --- a/src/thermophysicalModels/radiationModels/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C +++ b/src/thermophysicalModels/radiationModels/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C @@ -157,6 +157,11 @@ updateCoeffs() return; } + // Since we're inside initEvaluate/evaluate there might be processor + // comms underway. Change the tag we use. + int oldTag = UPstream::msgType(); + UPstream::msgType() = oldTag+1; + const scalarField& Tp = patch().lookupPatchField(TName_); @@ -240,6 +245,10 @@ updateCoeffs() Iw[faceI]*(n[faceI] & ray.dAve()); } } + + // Restore tag + UPstream::msgType() = oldTag; + mixedFvPatchScalarField::updateCoeffs(); } diff --git a/src/thermophysicalModels/radiationModels/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C b/src/thermophysicalModels/radiationModels/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C index f7b6e99187..f74930b729 100644 --- a/src/thermophysicalModels/radiationModels/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C +++ b/src/thermophysicalModels/radiationModels/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C @@ -155,6 +155,11 @@ updateCoeffs() return; } + // Since we're inside initEvaluate/evaluate there might be processor + // comms underway. Change the tag we use. + int oldTag = UPstream::msgType(); + UPstream::msgType() = oldTag+1; + const radiationModel& radiation = db().lookupObject("radiationProperties"); @@ -230,6 +235,9 @@ updateCoeffs() } } + // Restore tag + UPstream::msgType() = oldTag; + mixedFvPatchScalarField::updateCoeffs(); } diff --git a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/temperatureThermoBaffle1D/temperatureThermoBaffle1DFvPatchScalarField.C b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/temperatureThermoBaffle1D/temperatureThermoBaffle1DFvPatchScalarField.C index 0f00e5cdf8..75a8d96d3c 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/temperatureThermoBaffle1D/temperatureThermoBaffle1DFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/temperatureThermoBaffle1D/temperatureThermoBaffle1DFvPatchScalarField.C @@ -192,6 +192,10 @@ void temperatureThermoBaffle1DFvPatchScalarField::updateCoeffs() return; } + // Since we're inside initEvaluate/evaluate there might be processor + // comms underway. Change the tag we use. + int oldTag = UPstream::msgType(); + UPstream::msgType() = oldTag+1; const directMappedPatchBase& mpp = refCast ( @@ -356,6 +360,9 @@ void temperatureThermoBaffle1DFvPatchScalarField::updateCoeffs() } } + // Restore tag + UPstream::msgType() = oldTag; + mixedFvPatchScalarField::updateCoeffs(); } diff --git a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureCoupledBaffle/turbulentTemperatureCoupledBaffleFvPatchScalarField.C b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureCoupledBaffle/turbulentTemperatureCoupledBaffleFvPatchScalarField.C index 43d52c98ab..012d013012 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureCoupledBaffle/turbulentTemperatureCoupledBaffleFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureCoupledBaffle/turbulentTemperatureCoupledBaffleFvPatchScalarField.C @@ -184,6 +184,11 @@ void Foam::turbulentTemperatureCoupledBaffleFvPatchScalarField::updateCoeffs() return; } + // Since we're inside initEvaluate/evaluate there might be processor + // comms underway. Change the tag we use. + int oldTag = UPstream::msgType(); + UPstream::msgType() = oldTag+1; + // Get the coupling information from the directMappedPatchBase const directMappedPatchBase& mpp = refCast ( @@ -268,6 +273,9 @@ void Foam::turbulentTemperatureCoupledBaffleFvPatchScalarField::updateCoeffs() << endl; } + // Restore tag + UPstream::msgType() = oldTag; + fixedValueFvPatchScalarField::updateCoeffs(); } diff --git a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C index 7fa6579a4e..28ca25cda7 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C @@ -145,6 +145,11 @@ void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs() return; } + // Since we're inside initEvaluate/evaluate there might be processor + // comms underway. Change the tag we use. + int oldTag = UPstream::msgType(); + UPstream::msgType() = oldTag+1; + // Get the coupling information from the directMappedPatchBase const directMappedPatchBase& mpp = refCast ( @@ -212,7 +217,6 @@ void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs() mixedFvPatchScalarField::updateCoeffs(); - if (debug) { scalar Q = gSum(K(*this)*patch().magSf()*snGrad()); @@ -230,6 +234,9 @@ void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs() << " avg:" << gAverage(*this) << endl; } + + // Restore tag + UPstream::msgType() = oldTag; } diff --git a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C index 85d4a38c35..df2a4718a0 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C @@ -150,6 +150,11 @@ void turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs() return; } + // Since we're inside initEvaluate/evaluate there might be processor + // comms underway. Change the tag we use. + int oldTag = UPstream::msgType(); + UPstream::msgType() = oldTag+1; + // Get the coupling information from the directMappedPatchBase const directMappedPatchBase& mpp = refCast(patch().patch()); @@ -202,6 +207,9 @@ void turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs() refValue() = (KDeltaNbr*TcNbr)/alpha; + // Restore tag + UPstream::msgType() = oldTag; + mixedFvPatchScalarField::updateCoeffs(); }