Commit 44c040df authored by Henry Weller's avatar Henry Weller
Browse files

LTS: Simplify the selection of LTS operation

parent 5e3a0cdb
......@@ -73,7 +73,6 @@ License
}
// Reaction source time scale
if (alphaTemp < 1.0)
{
volScalarField::DimensionedInternalField rDeltaTT
(
......
......@@ -175,9 +175,7 @@ void Foam::twoPhaseSystem::solve()
label nAlphaSubCycles(readLabel(alphaControls.lookup("nAlphaSubCycles")));
label nAlphaCorr(readLabel(alphaControls.lookup("nAlphaCorr")));
bool LTS =
word(mesh.ddtScheme("default"))
== fv::localEulerDdtScheme<scalar>::typeName;
bool LTS = fv::localEulerDdt::enabled(mesh);
word alphaScheme("div(phi," + alpha1.name() + ')');
word alpharScheme("div(phir," + alpha1.name() + ')');
......
......@@ -78,9 +78,7 @@ void Foam::combustionModels::laminar<Type>::correct()
{
if (integrateReactionRate_)
{
word ddtScheme(this->mesh().ddtScheme("Yi"));
if (ddtScheme == fv::localEulerDdtScheme<scalar>::typeName)
if (fv::localEulerDdt::enabled(this->mesh()))
{
const scalarField& rDeltaT =
fv::localEulerDdt::localRDeltaT(this->mesh());
......
bool LTS =
word(mesh.ddtScheme("default"))
== fv::localEulerDdtScheme<scalar>::typeName;
bool LTS = fv::localEulerDdt::enabled(mesh);
tmp<volScalarField> trDeltaT;
......
......@@ -33,6 +33,14 @@ Foam::word Foam::fv::localEulerDdt::rSubDeltaTName("rSubDeltaTName");
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
bool Foam::fv::localEulerDdt::enabled(const fvMesh& mesh)
{
return
word(mesh.ddtScheme("default"))
== fv::localEulerDdtScheme<scalar>::typeName;
}
const Foam::volScalarField& Foam::fv::localEulerDdt::localRDeltaT
(
const fvMesh& mesh
......
......@@ -37,6 +37,7 @@ See Also
Foam::fv::CoEulerDdtScheme
SourceFiles
localEulerDdt.C
localEulerDdtScheme.C
localEulerDdtSchemes.C
......@@ -71,13 +72,18 @@ public:
//- Name of the reciprocal local sub-cycling time-step field
static word rSubDeltaTName;
// Constructors
localEulerDdt()
{}
// Member Functions
//- Return true if LTS is enabled
static bool enabled(const fvMesh& mesh);
//- Return the reciprocal of the local time-step
// looked-up from the objectRegistry
static const volScalarField& localRDeltaT(const fvMesh& mesh);
......
......@@ -89,11 +89,7 @@ void Foam::MULES::correct
{
const fvMesh& mesh = psi.mesh();
bool LTS =
word(mesh.ddtScheme("default"))
== fv::localEulerDdtScheme<scalar>::typeName;
if (LTS)
if (fv::localEulerDdt::enabled(mesh))
{
const volScalarField& rDeltaT = fv::localEulerDdt::localRDeltaT(mesh);
......
......@@ -111,11 +111,7 @@ void Foam::MULES::explicitSolve
psi.correctBoundaryConditions();
bool LTS =
word(mesh.ddtScheme("default"))
== fv::localEulerDdtScheme<scalar>::typeName;
if (LTS)
if (fv::localEulerDdt::enabled(mesh))
{
const volScalarField& rDeltaT = fv::localEulerDdt::localRDeltaT(mesh);
......
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