Commit e50b2c04 authored by sergio's avatar sergio
Browse files

ENH: Adding clipping information for limitTemperature FO

parent 69861df9
......@@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2012-2017 OpenFOAM Foundation
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -109,12 +109,47 @@ void Foam::fv::limitTemperature::correct(volScalarField& he)
scalarField& hec = he.primitiveFieldRef();
const scalarField& T = thermo.T();
scalar Tmin0 = min(T);
  • Don't need to change this now, but in generally you might like to know that the following should work:

    dimensioned<scalarMinMax> Tlimits0 = minMax(T);
    ...
    Info<< << "Unlimited T min/max " << Tlimits0 << nl;

    Avoids traversing the volume field and boundary field twice. Includes parallel reduction.

Please register or sign in to reply
scalar Tmax0 = max(T);
label nOverTmax = 0;
label nLowerTmin = 0;
forAll(cells_, i)
{
const label celli = cells_[i];
if (hec[celli] < heMin[i])
{
nLowerTmin++;
}
else if (hec[celli] > heMax[i])
{
nOverTmax++;
}
hec[celli]= max(min(hec[celli], heMax[i]), heMin[i]);
}
reduce(nOverTmax, sumOp<label>());
reduce(nLowerTmin, sumOp<label>());
reduce(Tmin0, minOp<scalar>());
reduce(Tmax0, maxOp<scalar>());
Info<< type() << " " << name_ << " Lower limited "
<< nLowerTmin << " ("
<< 100*scalar(nLowerTmin)/mesh_.globalData().nTotalCells()
<< "%) of cells" << endl;
Info<< type() << " " << name_ << " Upper limited "
<< nOverTmax << " ("
<< 100*scalar(nOverTmax)/mesh_.globalData().nTotalCells()
<< "%) of cells" << endl;
Info<< type() << " " << name_ << " Unlimited Tmax " << Tmax0 << nl
<< "Unlimited Tmin " << Tmin0 << endl;
// handle boundaries in the case of 'all'
if (selectionMode_ == smAll)
{
......
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