temperatureCoupledBase: Added more user-friendly error messages for inconsistent input
Resolves bug-report https://bugs.openfoam.org/view.php?id=2748
This commit is contained in:
@ -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-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -79,7 +79,43 @@ Foam::temperatureCoupledBase::temperatureCoupledBase
|
|||||||
method_(KMethodTypeNames_.read(dict.lookup("kappaMethod"))),
|
method_(KMethodTypeNames_.read(dict.lookup("kappaMethod"))),
|
||||||
kappaName_(dict.lookupOrDefault<word>("kappa", "none")),
|
kappaName_(dict.lookupOrDefault<word>("kappa", "none")),
|
||||||
alphaAniName_(dict.lookupOrDefault<word>("alphaAni","Anialpha"))
|
alphaAniName_(dict.lookupOrDefault<word>("alphaAni","Anialpha"))
|
||||||
{}
|
{
|
||||||
|
switch (method_)
|
||||||
|
{
|
||||||
|
case mtDirectionalSolidThermo:
|
||||||
|
{
|
||||||
|
if (!dict.found("alphaAni"))
|
||||||
|
{
|
||||||
|
FatalIOErrorInFunction(dict)
|
||||||
|
<< "Did not find entry 'alphaAni'"
|
||||||
|
" required for 'kappaMethod' "
|
||||||
|
<< KMethodTypeNames_[method_]
|
||||||
|
<< exit(FatalIOError);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case mtLookup:
|
||||||
|
{
|
||||||
|
if (!dict.found("kappa"))
|
||||||
|
{
|
||||||
|
FatalIOErrorInFunction(dict)
|
||||||
|
<< "Did not find entry 'kappa'"
|
||||||
|
" required for 'kappaMethod' "
|
||||||
|
<< KMethodTypeNames_[method_] << nl
|
||||||
|
<< " Please set 'kappa' to the name of a volScalarField"
|
||||||
|
" or volSymmTensorField"
|
||||||
|
<< exit(FatalIOError);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::temperatureCoupledBase::temperatureCoupledBase
|
Foam::temperatureCoupledBase::temperatureCoupledBase
|
||||||
@ -133,7 +169,8 @@ Foam::tmp<Foam::scalarField> Foam::temperatureCoupledBase::kappa
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Kappa defined to employ " << KMethodTypeNames_[method_]
|
<< "kappaMethod defined to employ "
|
||||||
|
<< KMethodTypeNames_[method_]
|
||||||
<< " method, but thermo package not available"
|
<< " method, but thermo package not available"
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
@ -197,10 +234,8 @@ Foam::tmp<Foam::scalarField> Foam::temperatureCoupledBase::kappa
|
|||||||
<< "Did not find field " << kappaName_
|
<< "Did not find field " << kappaName_
|
||||||
<< " on mesh " << mesh.name() << " patch " << patch_.name()
|
<< " on mesh " << mesh.name() << " patch " << patch_.name()
|
||||||
<< nl
|
<< nl
|
||||||
<< "Please set 'kappa' to one of "
|
<< " Please set 'kappa' to the name of a volScalarField"
|
||||||
<< KMethodTypeNames_.toc()
|
" or volSymmTensorField."
|
||||||
<< " and 'kappaName' to the name of the volScalar"
|
|
||||||
<< " or volSymmTensor field (if kappa=lookup)"
|
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -211,8 +246,9 @@ Foam::tmp<Foam::scalarField> Foam::temperatureCoupledBase::kappa
|
|||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Unimplemented method " << KMethodTypeNames_[method_] << nl
|
<< "Unimplemented method " << KMethodTypeNames_[method_] << nl
|
||||||
<< "Please set 'kappa' to one of " << KMethodTypeNames_.toc()
|
<< " Please set 'kappaMethod' to one of "
|
||||||
<< " and 'kappaName' to the name of the volScalar"
|
<< KMethodTypeNames_.toc()
|
||||||
|
<< " and 'kappa' to the name of the volScalar"
|
||||||
<< " or volSymmTensor field (if kappa=lookup)"
|
<< " or volSymmTensor field (if kappa=lookup)"
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user