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 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -177,17 +177,22 @@ void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs()
// Calculate the temperature by harmonic averaging // Calculate the temperature by harmonic averaging
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const turbulentTemperatureCoupledBaffleMixedFvPatchScalarField& nbrField = typedef turbulentTemperatureCoupledBaffleMixedFvPatchScalarField thisType;
refCast
< const fvPatchScalarField& nbrTp =
const turbulentTemperatureCoupledBaffleMixedFvPatchScalarField nbrPatch.lookupPatchField<volScalarField, scalar>(TnbrName_);
>
( if (!isA<thisType>(nbrTp))
nbrPatch.lookupPatchField<volScalarField, scalar> {
( FatalErrorInFunction
TnbrName_ << "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 // Swap to obtain full local values of neighbour internal field
tmp<scalarField> nbrIntFld(new scalarField(nbrField.size(), 0.0)); tmp<scalarField> nbrIntFld(new scalarField(nbrField.size(), 0.0));

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -186,12 +186,22 @@ void turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs()
scalarField Tc(patchInternalField()); scalarField Tc(patchInternalField());
scalarField& Tp = *this; scalarField& Tp = *this;
const turbulentTemperatureRadCoupledMixedFvPatchScalarField& typedef turbulentTemperatureRadCoupledMixedFvPatchScalarField thisType;
nbrField = refCast
<const turbulentTemperatureRadCoupledMixedFvPatchScalarField> const fvPatchScalarField& nbrTp =
( nbrPatch.lookupPatchField<volScalarField, scalar>(TnbrName_);
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 // Swap to obtain full local values of neighbour internal field
scalarField TcNbr(nbrField.patchInternalField()); scalarField TcNbr(nbrField.patchInternalField());