Commit f92d657a authored by Henry Weller's avatar Henry Weller
Browse files

LTS: Formalize the naming of the rDeltaT and rSubDeltaT fields

Now the specification of the LTS time scheme is simply:

ddtSchemes
{
    default         localEuler;
}
parent af8185c0
......@@ -77,11 +77,7 @@ int main(int argc, char *argv[])
{
#include "readTimeControls.H"
if (LTS)
{
#include "setRDeltaT.H"
}
else
if (!LTS)
{
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
......@@ -93,6 +89,11 @@ int main(int argc, char *argv[])
parcels.evolve();
if (LTS)
{
#include "setRDeltaT.H"
}
#include "rhoEqn.H"
// --- Pressure-velocity PIMPLE corrector loop
......
......@@ -79,11 +79,7 @@
(
(
LTS
? fv::localEulerDdtScheme<scalar>
(
mesh,
nAlphaSubCycles > 1 ? "rSubDeltaT" : "rDeltaT"
).fvmDdt(alpha1)
? fv::localEulerDdtScheme<scalar>(mesh).fvmDdt(alpha1)
: fv::EulerDdtScheme<scalar>(mesh).fvmDdt(alpha1)
)
+ fv::gaussConvectionScheme<scalar>
......
......@@ -17,10 +17,8 @@ if (nAlphaSubCycles > 1)
if (LTS)
{
trSubDeltaT = tmp<volScalarField>
(
new volScalarField("rSubDeltaT", trDeltaT()*nAlphaSubCycles)
);
trSubDeltaT =
fv::localEulerDdt::localRSubDeltaT(mesh, nAlphaSubCycles);
}
for
......
......@@ -75,7 +75,7 @@
if (LTS)
{
const volScalarField& rDeltaT =
mesh.objectRegistry::lookupObject<volScalarField>("rSubDeltaT");
fv::localEulerDdt::localRDeltaT(mesh);
MULES::limiter
(
......@@ -138,7 +138,7 @@
if (LTS)
{
const volScalarField& rDeltaT =
mesh.objectRegistry::lookupObject<volScalarField>("rSubDeltaT");
fv::localEulerDdt::localRDeltaT(mesh);
MULES::limiter
(
......
......@@ -324,16 +324,8 @@ void Foam::twoPhaseSystem::solve()
if (LTS)
{
const volScalarField& rDeltaT =
mesh.objectRegistry::lookupObject<volScalarField>
(
"rDeltaT"
);
trSubDeltaT = tmp<volScalarField>
(
new volScalarField("rSubDeltaT", rDeltaT*nAlphaSubCycles)
);
trSubDeltaT =
fv::localEulerDdt::localRSubDeltaT(mesh, nAlphaSubCycles);
}
for
......
......@@ -83,11 +83,7 @@ void Foam::combustionModels::laminar<Type>::correct()
if (ddtScheme == fv::localEulerDdtScheme<scalar>::typeName)
{
const scalarField& rDeltaT =
this->mesh().objectRegistry::
template lookupObject<volScalarField>
(
"rDeltaT"
);
fv::localEulerDdt::localRDeltaT(this->mesh());
if (this->coeffs().found("maxIntegrationTime"))
{
......
......@@ -335,6 +335,7 @@ $(ddtSchemes)/steadyStateDdtScheme/steadyStateDdtSchemes.C
$(ddtSchemes)/EulerDdtScheme/EulerDdtSchemes.C
$(ddtSchemes)/CoEulerDdtScheme/CoEulerDdtSchemes.C
$(ddtSchemes)/SLTSDdtScheme/SLTSDdtSchemes.C
$(ddtSchemes)/localEulerDdtScheme/localEulerDdt.C
$(ddtSchemes)/localEulerDdtScheme/localEulerDdtSchemes.C
$(ddtSchemes)/backwardDdtScheme/backwardDdtSchemes.C
$(ddtSchemes)/CrankNicolsonDdtScheme/CrankNicolsonDdtSchemes.C
......
......@@ -14,7 +14,7 @@ if (LTS)
(
IOobject
(
"rDeltaT",
fv::localEulerDdt::rDeltaTName,
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
......
......@@ -33,7 +33,8 @@ Description
using transient codes where local time-stepping is preferably to
under-relaxation for transport consistency reasons.
See also CoEulerDdtScheme.
See Also
Foam::fv::CoEulerDdtScheme
SourceFiles
SLTSDdtScheme.C
......
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "localEulerDdtScheme.H"
#include "fvMesh.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
Foam::word Foam::fv::localEulerDdt::rDeltaTName("rDeltaT");
Foam::word Foam::fv::localEulerDdt::rSubDeltaTName("rSubDeltaTName");
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
const Foam::volScalarField& Foam::fv::localEulerDdt::localRDeltaT
(
const fvMesh& mesh
)
{
return mesh.objectRegistry::template lookupObject<volScalarField>
(
mesh.time().subCycling() ? rSubDeltaTName : rDeltaTName
);
}
Foam::tmp<Foam::volScalarField> Foam::fv::localEulerDdt::localRSubDeltaT
(
const fvMesh& mesh,
const label nAlphaSubCycles
)
{
return tmp<volScalarField>
(
new volScalarField
(
rSubDeltaTName,
nAlphaSubCycles
*mesh.objectRegistry::template lookupObject<volScalarField>
(
rDeltaTName
)
)
);
}
// ************************************************************************* //
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -42,8 +42,7 @@ namespace fv
template<class Type>
const volScalarField& localEulerDdtScheme<Type>::localRDeltaT() const
{
return mesh().objectRegistry::template lookupObject<volScalarField>
(rDeltaTName_);
return localEulerDdt::localRDeltaT(mesh());
}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -26,14 +26,15 @@ Class
Description
Local time-step first-order Euler implicit/explicit ddt.
The reciprocal of the local time-step field is looked-up from the
database with the name provided.
This scheme should only be used for steady-state computations
using transient codes where local time-stepping is preferably to
under-relaxation for transport consistency reasons.
The reciprocal of the local time-step field is looked-up from the database.
See also CoEulerDdtScheme.
This scheme should only be used for steady-state computations using
transient codes where local time-stepping is preferably to under-relaxation
for transport consistency reasons.
See Also
Foam::fv::CoEulerDdtScheme
SourceFiles
localEulerDdtScheme.C
......@@ -56,6 +57,41 @@ namespace Foam
namespace fv
{
/*---------------------------------------------------------------------------*\
Class localEulerDdt Declaration
\*---------------------------------------------------------------------------*/
class localEulerDdt
{
public:
//- Name of the reciprocal local time-step field
static word rDeltaTName;
//- Name of the reciprocal local sub-cycling time-step field
static word rSubDeltaTName;
// Constructors
localEulerDdt()
{}
// Member Functions
//- Return the reciprocal of the local time-step
// looked-up from the objectRegistry
static const volScalarField& localRDeltaT(const fvMesh& mesh);
//- Calculate and return the reciprocal of the local sub-cycling
// time-step
static tmp<volScalarField> localRSubDeltaT
(
const fvMesh& mesh,
const label nAlphaSubCycles
);
};
/*---------------------------------------------------------------------------*\
Class localEulerDdtScheme Declaration
\*---------------------------------------------------------------------------*/
......@@ -63,14 +99,9 @@ namespace fv
template<class Type>
class localEulerDdtScheme
:
public localEulerDdt,
public fv::ddtScheme<Type>
{
// Private Data
//- Name of the reciprocal local time-step field
word rDeltaTName_;
// Private Member Functions
//- Disallow default bitwise copy construct
......@@ -91,18 +122,16 @@ public:
// Constructors
//- Construct from mesh and name of the rDeltaT field
localEulerDdtScheme(const fvMesh& mesh, const word& rDeltaTName)
//- Construct from mesh
localEulerDdtScheme(const fvMesh& mesh)
:
ddtScheme<Type>(mesh),
rDeltaTName_(rDeltaTName)
ddtScheme<Type>(mesh)
{}
//- Construct from mesh and Istream
localEulerDdtScheme(const fvMesh& mesh, Istream& is)
:
ddtScheme<Type>(mesh, is),
rDeltaTName_(is)
ddtScheme<Type>(mesh, is)
{}
......
......@@ -95,11 +95,7 @@ void Foam::MULES::correct
if (LTS)
{
const volScalarField& rDeltaT =
mesh.objectRegistry::lookupObject<volScalarField>
(
mesh.time().subCycling() ? "rSubDeltaT" : "rDeltaT"
);
const volScalarField& rDeltaT = fv::localEulerDdt::localRDeltaT(mesh);
limitCorr
(
......
......@@ -117,11 +117,7 @@ void Foam::MULES::explicitSolve
if (LTS)
{
const volScalarField& rDeltaT =
mesh.objectRegistry::lookupObject<volScalarField>
(
mesh.time().subCycling() ? "rSubDeltaT" : "rDeltaT"
);
const volScalarField& rDeltaT = fv::localEulerDdt::localRDeltaT(mesh);
limit
(
......
......@@ -17,7 +17,7 @@ FoamFile
ddtSchemes
{
default localEuler rDeltaT;
default localEuler;
}
gradSchemes
......
......@@ -19,7 +19,7 @@ fluxScheme Kurganov;
ddtSchemes
{
default localEuler rDeltaT;
default localEuler;
}
gradSchemes
......
......@@ -17,7 +17,7 @@ FoamFile
ddtSchemes
{
default localEuler rDeltaT;
default localEuler;
}
gradSchemes
......
......@@ -17,7 +17,7 @@ FoamFile
ddtSchemes
{
default localEuler rDeltaT;
default localEuler;
}
gradSchemes
......
......@@ -17,7 +17,7 @@ FoamFile
ddtSchemes
{
default localEuler rDeltaT;
default localEuler;
}
gradSchemes
......
......@@ -17,7 +17,7 @@ FoamFile
ddtSchemes
{
default localEuler rDeltaT;
default localEuler;
}
gradSchemes
......
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