turbulentTemperatureCoupledBaffleMixed: Added error message

This commit is contained in:
Will Bainbridge
2018-02-28 14:12:17 +00:00
parent 4677d8f12f
commit b4c0d086e0
2 changed files with 34 additions and 19 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -177,17 +177,22 @@ void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs()
// Calculate the temperature by harmonic averaging
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const turbulentTemperatureCoupledBaffleMixedFvPatchScalarField& nbrField =
refCast
<
const turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
>
(
nbrPatch.lookupPatchField<volScalarField, scalar>
(
TnbrName_
)
);
typedef turbulentTemperatureCoupledBaffleMixedFvPatchScalarField thisType;
const fvPatchScalarField& nbrTp =
nbrPatch.lookupPatchField<volScalarField, scalar>(TnbrName_);
if (!isA<thisType>(nbrTp))
{
FatalErrorInFunction
<< "Patch field for " << internalField().name() << " on "
<< patch().name() << " is of type " << thisType::typeName
<< endl << "The neighbouring patch field " << TnbrName_ << " on "
<< nbrPatch.name() << " is of type " << nbrTp.type() << endl
<< "They need to be the same type" << exit(FatalError);
}
const thisType& nbrField = refCast<const thisType>(nbrTp);
// Swap to obtain full local values of neighbour internal field
tmp<scalarField> nbrIntFld(new scalarField(nbrField.size(), 0.0));

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -186,12 +186,22 @@ void turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs()
scalarField Tc(patchInternalField());
scalarField& Tp = *this;
const turbulentTemperatureRadCoupledMixedFvPatchScalarField&
nbrField = refCast
<const turbulentTemperatureRadCoupledMixedFvPatchScalarField>
(
nbrPatch.lookupPatchField<volScalarField, scalar>(TnbrName_)
);
typedef turbulentTemperatureRadCoupledMixedFvPatchScalarField thisType;
const fvPatchScalarField& nbrTp =
nbrPatch.lookupPatchField<volScalarField, scalar>(TnbrName_);
if (!isA<thisType>(nbrTp))
{
FatalErrorInFunction
<< "Patch field for " << internalField().name() << " on "
<< patch().name() << " is of type " << thisType::typeName
<< endl << "The neighbouring patch field " << TnbrName_ << " on "
<< nbrPatch.name() << " is of type " << nbrTp.type() << endl
<< "They need to be the same type" << exit(FatalError);
}
const thisType& nbrField = refCast<const thisType>(nbrTp);
// Swap to obtain full local values of neighbour internal field
scalarField TcNbr(nbrField.patchInternalField());