LTS: Simplify the selection of LTS operation

This commit is contained in:
Henry Weller
2015-06-29 11:53:20 +01:00
parent 34c3b2f656
commit fd9d07413a
8 changed files with 19 additions and 20 deletions

View File

@ -73,7 +73,6 @@ License
} }
// Reaction source time scale // Reaction source time scale
if (alphaTemp < 1.0)
{ {
volScalarField::DimensionedInternalField rDeltaTT volScalarField::DimensionedInternalField rDeltaTT
( (

View File

@ -175,9 +175,7 @@ void Foam::twoPhaseSystem::solve()
label nAlphaSubCycles(readLabel(alphaControls.lookup("nAlphaSubCycles"))); label nAlphaSubCycles(readLabel(alphaControls.lookup("nAlphaSubCycles")));
label nAlphaCorr(readLabel(alphaControls.lookup("nAlphaCorr"))); label nAlphaCorr(readLabel(alphaControls.lookup("nAlphaCorr")));
bool LTS = bool LTS = fv::localEulerDdt::enabled(mesh);
word(mesh.ddtScheme("default"))
== fv::localEulerDdtScheme<scalar>::typeName;
word alphaScheme("div(phi," + alpha1.name() + ')'); word alphaScheme("div(phi," + alpha1.name() + ')');
word alpharScheme("div(phir," + alpha1.name() + ')'); word alpharScheme("div(phir," + alpha1.name() + ')');

View File

@ -78,9 +78,7 @@ void Foam::combustionModels::laminar<Type>::correct()
{ {
if (integrateReactionRate_) if (integrateReactionRate_)
{ {
word ddtScheme(this->mesh().ddtScheme("Yi")); if (fv::localEulerDdt::enabled(this->mesh()))
if (ddtScheme == fv::localEulerDdtScheme<scalar>::typeName)
{ {
const scalarField& rDeltaT = const scalarField& rDeltaT =
fv::localEulerDdt::localRDeltaT(this->mesh()); fv::localEulerDdt::localRDeltaT(this->mesh());

View File

@ -1,6 +1,4 @@
bool LTS = bool LTS = fv::localEulerDdt::enabled(mesh);
word(mesh.ddtScheme("default"))
== fv::localEulerDdtScheme<scalar>::typeName;
tmp<volScalarField> trDeltaT; tmp<volScalarField> trDeltaT;

View File

@ -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 Foam::volScalarField& Foam::fv::localEulerDdt::localRDeltaT
( (
const fvMesh& mesh const fvMesh& mesh

View File

@ -37,6 +37,7 @@ See Also
Foam::fv::CoEulerDdtScheme Foam::fv::CoEulerDdtScheme
SourceFiles SourceFiles
localEulerDdt.C
localEulerDdtScheme.C localEulerDdtScheme.C
localEulerDdtSchemes.C localEulerDdtSchemes.C
@ -71,13 +72,18 @@ public:
//- Name of the reciprocal local sub-cycling time-step field //- Name of the reciprocal local sub-cycling time-step field
static word rSubDeltaTName; static word rSubDeltaTName;
// Constructors // Constructors
localEulerDdt() localEulerDdt()
{} {}
// Member Functions // Member Functions
//- Return true if LTS is enabled
static bool enabled(const fvMesh& mesh);
//- Return the reciprocal of the local time-step //- Return the reciprocal of the local time-step
// looked-up from the objectRegistry // looked-up from the objectRegistry
static const volScalarField& localRDeltaT(const fvMesh& mesh); static const volScalarField& localRDeltaT(const fvMesh& mesh);

View File

@ -89,11 +89,7 @@ void Foam::MULES::correct
{ {
const fvMesh& mesh = psi.mesh(); const fvMesh& mesh = psi.mesh();
bool LTS = if (fv::localEulerDdt::enabled(mesh))
word(mesh.ddtScheme("default"))
== fv::localEulerDdtScheme<scalar>::typeName;
if (LTS)
{ {
const volScalarField& rDeltaT = fv::localEulerDdt::localRDeltaT(mesh); const volScalarField& rDeltaT = fv::localEulerDdt::localRDeltaT(mesh);

View File

@ -111,11 +111,7 @@ void Foam::MULES::explicitSolve
psi.correctBoundaryConditions(); psi.correctBoundaryConditions();
bool LTS = if (fv::localEulerDdt::enabled(mesh))
word(mesh.ddtScheme("default"))
== fv::localEulerDdtScheme<scalar>::typeName;
if (LTS)
{ {
const volScalarField& rDeltaT = fv::localEulerDdt::localRDeltaT(mesh); const volScalarField& rDeltaT = fv::localEulerDdt::localRDeltaT(mesh);