Commit 415cdf41 authored by mattijs's avatar mattijs

ENH: directMappedFixedValue: use different tag

use different tag inside updateCoeffs for overlapping comms.
parent 2d192faa
......@@ -190,6 +190,11 @@ void directMappedFieldFvPatchField<Type>::updateCoeffs()
typedef GeometricField<Type, fvPatchField, volMesh> 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<const fvMesh>(sampleMesh());
const mapDistribute& distMap = directMappedPatchBase::map();
......@@ -290,6 +295,9 @@ void directMappedFieldFvPatchField<Type>::updateCoeffs()
<< endl;
}
// Restore tag
UPstream::msgType() = oldTag;
fixedValueFvPatchField<Type>::updateCoeffs();
}
......
......@@ -102,6 +102,11 @@ void Foam::directMappedFixedInternalValueFvPatchField<Type>::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<Type>::updateCoeffs();
......@@ -134,6 +139,9 @@ void Foam::directMappedFixedInternalValueFvPatchField<Type>::updateCoeffs()
nbrIntFld
);
// Restore tag
UPstream::msgType() = oldTag;
// Assign (this) patch internal field to its neighbour values
Field<Type>& intFld = const_cast<Field<Type>&>(this->internalField());
UIndirectList<Type>(intFld, this->patch().faceCells()) = nbrIntFld;
......
......@@ -224,6 +224,12 @@ void directMappedFixedValueFvPatchField<Type>::updateCoeffs()
typedef GeometricField<Type, fvPatchField, volMesh> 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<const directMappedPatchBase>
(
......@@ -363,6 +369,9 @@ void directMappedFixedValueFvPatchField<Type>::updateCoeffs()
<< endl;
}
// Restore tag
UPstream::msgType() = oldTag;
fixedValueFvPatchField<Type>::updateCoeffs();
}
......
......@@ -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<const directMappedPatchBase>
(
......@@ -176,6 +181,9 @@ void Foam::directMappedFlowRateFvPatchVectorField::updateCoeffs()
<< nl << exit(FatalError);
}
// Restore tag
UPstream::msgType() = oldTag;
fixedValueFvPatchField<vector>::updateCoeffs();
}
......
......@@ -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<const directMappedPatchBase>
(
......@@ -245,6 +250,9 @@ void Foam::directMappedVelocityFluxFixedValueFvPatchField::updateCoeffs()
operator==(newUValues);
phiField.boundaryField()[patch().index()] == newPhiValues;
// Restore tag
UPstream::msgType() = oldTag;
fixedValueFvPatchVectorField::updateCoeffs();
}
......
......@@ -222,6 +222,11 @@ void selfContainedDirectMappedFixedValueFvPatchField<Type>::updateCoeffs()
typedef GeometricField<Type, fvPatchField, volMesh> 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<const fvMesh>(sampleMesh());
const mapDistribute& distMap = directMappedPatchBase::map();
......@@ -360,6 +365,9 @@ void selfContainedDirectMappedFixedValueFvPatchField<Type>::updateCoeffs()
<< endl;
}
// Restore tag
UPstream::msgType() = oldTag;
fixedValueFvPatchField<Type>::updateCoeffs();
}
......
......@@ -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<filmModelType>
(
......@@ -181,6 +186,9 @@ void Foam::filmPyrolysisTemperatureCoupledFvPatchScalarField::updateCoeffs()
}
}
// Restore tag
UPstream::msgType() = oldTag;
fixedValueFvPatchScalarField::updateCoeffs();
}
......
......@@ -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<filmModelType>
(
......@@ -216,6 +221,9 @@ void Foam::filmPyrolysisVelocityCoupledFvPatchVectorField::updateCoeffs()
}
}
// Restore tag
UPstream::msgType() = oldTag;
fixedValueFvPatchVectorField::updateCoeffs();
}
......
......@@ -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<modelType>("surfaceFilmProperties");
......@@ -205,6 +210,11 @@ void alphatFilmWallFunctionFvPatchScalarField::updateCoeffs()
alphat[faceI] = max(alphaEff - alphaw[faceI], 0.0);
}
// Restore tag
UPstream::msgType() = oldTag;
fixedValueFvPatchScalarField::updateCoeffs();
}
......
......@@ -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<volScalarField, scalar>(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();
}
......
......@@ -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();
}
......
......@@ -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<volScalarField, scalar>(TName_);
......@@ -240,6 +245,10 @@ updateCoeffs()
Iw[faceI]*(n[faceI] & ray.dAve());
}
}
// Restore tag
UPstream::msgType() = oldTag;
mixedFvPatchScalarField::updateCoeffs();
}
......
......@@ -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<radiationModel>("radiationProperties");
......@@ -230,6 +235,9 @@ updateCoeffs()
}
}
// Restore tag
UPstream::msgType() = oldTag;
mixedFvPatchScalarField::updateCoeffs();
}
......
......@@ -192,6 +192,10 @@ void temperatureThermoBaffle1DFvPatchScalarField<solidType>::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<const directMappedPatchBase>
(
......@@ -356,6 +360,9 @@ void temperatureThermoBaffle1DFvPatchScalarField<solidType>::updateCoeffs()
}
}
// Restore tag
UPstream::msgType() = oldTag;
mixedFvPatchScalarField::updateCoeffs();
}
......
......@@ -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<const directMappedPatchBase>
(
......@@ -268,6 +273,9 @@ void Foam::turbulentTemperatureCoupledBaffleFvPatchScalarField::updateCoeffs()
<< endl;
}
// Restore tag
UPstream::msgType() = oldTag;
fixedValueFvPatchScalarField::updateCoeffs();
}
......
......@@ -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<const directMappedPatchBase>
(
......@@ -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;
}
......
......@@ -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<const directMappedPatchBase>(patch().patch());
......@@ -202,6 +207,9 @@ void turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs()
refValue() = (KDeltaNbr*TcNbr)/alpha;
// Restore tag
UPstream::msgType() = oldTag;
mixedFvPatchScalarField::updateCoeffs();
}
......
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