fvOptions::limitTemperature: Simplify controls and make documentation consistent with the code

This commit is contained in:
Henry Weller
2016-07-06 10:15:47 +01:00
parent 898b51c8a3
commit 48e160dce8
2 changed files with 35 additions and 31 deletions

View File

@ -56,8 +56,8 @@ Foam::fv::limitTemperature::limitTemperature
)
:
cellSetOption(name, modelType, dict, mesh),
Tmin_(readScalar(coeffs_.lookup("Tmin"))),
Tmax_(readScalar(coeffs_.lookup("Tmax")))
Tmin_(readScalar(coeffs_.lookup("min"))),
Tmax_(readScalar(coeffs_.lookup("max")))
{
// Set the field name to that of the energy field from which the temperature
// is obtained
@ -73,6 +73,22 @@ Foam::fv::limitTemperature::limitTemperature
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::fv::limitTemperature::read(const dictionary& dict)
{
if (cellSetOption::read(dict))
{
coeffs_.lookup("min") >> Tmin_;
coeffs_.lookup("max") >> Tmax_;
return true;
}
else
{
return false;
}
}
void Foam::fv::limitTemperature::correct(volScalarField& he)
{
const basicThermo& thermo =
@ -122,20 +138,4 @@ void Foam::fv::limitTemperature::correct(volScalarField& he)
}
bool Foam::fv::limitTemperature::read(const dictionary& dict)
{
if (cellSetOption::read(dict))
{
coeffs_.readIfPresent("Tmin", Tmin_);
coeffs_.readIfPresent("Tmax", Tmax_);
return true;
}
else
{
return false;
}
}
// ************************************************************************* //

View File

@ -26,15 +26,24 @@ Class
Description
Correction for temperature to apply limits between minimum and maximum
values
values.
Constraint described by:
Usage
Example usage:
\verbatim
limitT
{
type limitTemperature;
active yes;
limitTemperatureCoeffs
{
minimum 200;
maximum 500;
selectionMode all;
min 200;
max 500;
}
}
\endverbatim
SourceFiles
limitTemperature.C
@ -109,16 +118,11 @@ public:
// Member Functions
// Evaluate
//- Read dictionary
virtual bool read(const dictionary& dict);
//- Correct the energy field
virtual void correct(volScalarField& he);
// IO
//- Read dictionary
virtual bool read(const dictionary& dict);
//- Correct the energy field
virtual void correct(volScalarField& he);
};