radiation: Removed the redundant "radiation off" switch from radiationProperties

To switch-off radiation set

    radiationModel  none;

in radiationProperties which instantiates "null" model that does not read any
data or coefficients or evaluate any fields.
This commit is contained in:
Henry Weller
2018-07-25 08:10:30 +01:00
parent 9cf8078fef
commit ab31777e9c
26 changed files with 38 additions and 111 deletions

View File

@ -48,7 +48,7 @@ Description
#include "fvCFD.H"
#include "singlePhaseTransportModel.H"
#include "turbulentTransportModel.H"
#include "radiationModel.H"
#include "noRadiation.H"
#include "fvOptions.H"
#include "pimpleControl.H"

View File

@ -48,7 +48,7 @@ Description
#include "fvCFD.H"
#include "singlePhaseTransportModel.H"
#include "turbulentTransportModel.H"
#include "radiationModel.H"
#include "noRadiation.H"
#include "fvOptions.H"
#include "simpleControl.H"

View File

@ -15,9 +15,7 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
radiation off;
radiationModel P1;
radiationModel none; // P1;
solverFreq 1;

View File

@ -15,9 +15,7 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
radiation off;
radiationModel P1;
radiationModel none; // P1;
solverFreq 1;

View File

@ -10,7 +10,7 @@
1.0
);
if (radiation->radiation())
if (!isType<radiation::noRadiation>(radiation()))
{
IOdictionary transportProperties
(

View File

@ -68,16 +68,20 @@ Foam::radiation::noRadiation::~noRadiation()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::radiation::noRadiation::read()
{
return radiationModel::read();
}
void Foam::radiation::noRadiation::correct()
{}
void Foam::radiation::noRadiation::calculate()
{}
bool Foam::radiation::noRadiation::read()
{
return radiationModel::read();
}
Foam::tmp<Foam::volScalarField> Foam::radiation::noRadiation::Rp() const
{
return tmp<volScalarField>

View File

@ -85,6 +85,9 @@ public:
// Edit
//- Main update/correction routine
void correct();
//- Solve radiation equation(s)
void calculate();

View File

@ -74,19 +74,16 @@ Foam::IOobject Foam::radiation::radiationModel::createIOobject
void Foam::radiation::radiationModel::initialise()
{
if (radiation_)
{
solverFreq_ = max(1, lookupOrDefault<label>("solverFreq", 1));
solverFreq_ = max(1, lookupOrDefault<label>("solverFreq", 1));
absorptionEmission_.reset
(
absorptionEmissionModel::New(*this, mesh_).ptr()
);
absorptionEmission_.reset
(
absorptionEmissionModel::New(*this, mesh_).ptr()
);
scatter_.reset(scatterModel::New(*this, mesh_).ptr());
scatter_.reset(scatterModel::New(*this, mesh_).ptr());
soot_.reset(sootModel::New(*this, mesh_).ptr());
}
soot_.reset(sootModel::New(*this, mesh_).ptr());
}
@ -108,7 +105,6 @@ Foam::radiation::radiationModel::radiationModel(const volScalarField& T)
mesh_(T.mesh()),
time_(T.time()),
T_(T),
radiation_(false),
coeffs_(dictionary::null),
solverFreq_(0),
firstIter_(true),
@ -128,7 +124,6 @@ Foam::radiation::radiationModel::radiationModel
mesh_(T.mesh()),
time_(T.time()),
T_(T),
radiation_(lookupOrDefault("radiation", true)),
coeffs_(subOrEmptyDict(type + "Coeffs")),
solverFreq_(1),
firstIter_(true),
@ -136,11 +131,6 @@ Foam::radiation::radiationModel::radiationModel
scatter_(nullptr),
soot_(nullptr)
{
if (readOpt() == IOobject::NO_READ)
{
radiation_ = false;
}
initialise();
}
@ -167,7 +157,6 @@ Foam::radiation::radiationModel::radiationModel
mesh_(T.mesh()),
time_(T.time()),
T_(T),
radiation_(lookupOrDefault("radiation", true)),
coeffs_(subOrEmptyDict(type + "Coeffs")),
solverFreq_(1),
firstIter_(true),
@ -187,11 +176,25 @@ Foam::radiation::radiationModel::~radiationModel()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::radiation::radiationModel::correct()
{
if (firstIter_ || (time_.timeIndex() % solverFreq_ == 0))
{
calculate();
firstIter_ = false;
}
if (!soot_.empty())
{
soot_->correct();
}
}
bool Foam::radiation::radiationModel::read()
{
if (regIOobject::read())
{
lookup("radiation") >> radiation_;
coeffs_ = subOrEmptyDict(type() + "Coeffs");
solverFreq_ = lookupOrDefault<label>("solverFreq", 1);
@ -206,26 +209,6 @@ bool Foam::radiation::radiationModel::read()
}
void Foam::radiation::radiationModel::correct()
{
if (!radiation_)
{
return;
}
if (firstIter_ || (time_.timeIndex() % solverFreq_ == 0))
{
calculate();
firstIter_ = false;
}
if (!soot_.empty())
{
soot_->correct();
}
}
Foam::tmp<Foam::fvScalarMatrix> Foam::radiation::radiationModel::Sh
(
const basicThermo& thermo,

View File

@ -86,9 +86,6 @@ protected:
//- Reference to the temperature field
const volScalarField& T_;
//- Radiation model on/off flag
Switch radiation_;
//- Radiation model dictionary
dictionary coeffs_;
@ -211,12 +208,6 @@ public:
// Access
//- Radiation model on/off flag
const Switch radiation() const
{
return radiation_;
}
//- Source term component (for power of T^4)
virtual tmp<volScalarField> Rp() const = 0;

View File

@ -16,10 +16,6 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
radiation off;
radiationModel none;
// ************************************************************************* //

View File

@ -14,9 +14,6 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
radiation off;
radiationModel none;
// ************************************************************************* //

View File

@ -15,9 +15,6 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
radiation off;
radiationModel none;
// ************************************************************************* //

View File

@ -15,9 +15,6 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
radiation off;
radiationModel none;
// ************************************************************************* //

View File

@ -14,9 +14,6 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
radiation off;
radiationModel none;
// ************************************************************************* //

View File

@ -16,9 +16,6 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
radiation off;
radiationModel none;
// ************************************************************************* //

View File

@ -15,8 +15,6 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
radiation off;
radiationModel none;
// ************************************************************************* //

View File

@ -15,9 +15,6 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
radiation off;
radiationModel none;
// ************************************************************************* //

View File

@ -15,10 +15,6 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
radiation off;
radiationModel none;
// ************************************************************************* //

View File

@ -15,9 +15,6 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
radiation off;
radiationModel none;
// ************************************************************************* //

View File

@ -15,8 +15,6 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
radiation off;
radiationModel none;
// ************************************************************************* //

View File

@ -15,9 +15,6 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
radiation off;
radiationModel none;
// ************************************************************************* //

View File

@ -15,9 +15,6 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
radiation off;
radiationModel none;
// ************************************************************************* //

View File

@ -15,10 +15,6 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
radiation off;
radiationModel none;
solverFreq 10;
// ************************************************************************* //

View File

@ -15,8 +15,6 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
radiation off;
radiationModel none;
// ************************************************************************* //

View File

@ -15,8 +15,6 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
radiation off;
radiationModel none;
// ************************************************************************* //

View File

@ -15,9 +15,6 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
radiation off;
radiationModel none;
// ************************************************************************* //