mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Adding lower and upper bounds to nonUniformTable index
This commit is contained in:
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2020 OpenFOAM Foundation
|
Copyright (C) 2020 OpenFOAM Foundation
|
||||||
Copyright (C) 2020 OpenCFD Ltd.
|
Copyright (C) 2020-2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -36,15 +36,16 @@ inline Foam::label Foam::nonUniformTable::index
|
|||||||
scalar T
|
scalar T
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
if (T < Trange_.min() || T > Trange_.max())
|
scalar nd = 0;
|
||||||
|
if (T > Trange_.min() || T < Trange_.max())
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
nd = (T - Trange_.min())/deltaT_;
|
||||||
<< "Temperature " << T << " out of range " << Trange_ << nl
|
}
|
||||||
<< " for nonUniformTable " << name_
|
else if (T > Trange_.max())
|
||||||
<< exit(FatalError);
|
{
|
||||||
|
nd = (Trange_.max() - Trange_.min())/deltaT_;
|
||||||
}
|
}
|
||||||
|
|
||||||
const scalar nd = (T - Trange_.min())/deltaT_;
|
|
||||||
const label j = nd;
|
const label j = nd;
|
||||||
|
|
||||||
label i = jumpTable_[j];
|
label i = jumpTable_[j];
|
||||||
|
|||||||
Reference in New Issue
Block a user