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 "fvCFD.H"
#include "singlePhaseTransportModel.H" #include "singlePhaseTransportModel.H"
#include "turbulentTransportModel.H" #include "turbulentTransportModel.H"
#include "radiationModel.H" #include "noRadiation.H"
#include "fvOptions.H" #include "fvOptions.H"
#include "pimpleControl.H" #include "pimpleControl.H"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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