mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
interFoam family: Added run-time selectable LTS support
LTS is selected by the ddt scheme e.g. in the
tutorials/multiphase/interFoam/ras/DTCHull case:
ddtSchemes
{
default localEuler rDeltaT;
}
LTSInterFoam is no longer needed now that interFoam includes LTS
support.
This commit is contained in:
28
src/finiteVolume/cfdTools/general/include/createRDeltaT.H
Normal file
28
src/finiteVolume/cfdTools/general/include/createRDeltaT.H
Normal file
@ -0,0 +1,28 @@
|
||||
bool LTS =
|
||||
word(mesh.ddtScheme("default"))
|
||||
== fv::localEulerDdtScheme<scalar>::typeName;
|
||||
|
||||
tmp<volScalarField> trDeltaT;
|
||||
|
||||
if (LTS)
|
||||
{
|
||||
Info<< "Using LTS" << endl;
|
||||
|
||||
trDeltaT = tmp<volScalarField>
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rDeltaT",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("one", dimless/dimTime, 1),
|
||||
zeroGradientFvPatchScalarField::typeName
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -48,25 +48,4 @@ void Foam::MULES::correct
|
||||
}
|
||||
|
||||
|
||||
void Foam::MULES::LTScorrect
|
||||
(
|
||||
volScalarField& psi,
|
||||
const surfaceScalarField& phi,
|
||||
surfaceScalarField& phiPsiCorr,
|
||||
const scalar psiMax,
|
||||
const scalar psiMin
|
||||
)
|
||||
{
|
||||
LTScorrect
|
||||
(
|
||||
geometricOneField(),
|
||||
psi,
|
||||
phi,
|
||||
phiPsiCorr,
|
||||
zeroField(), zeroField(),
|
||||
psiMax, psiMin
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -94,29 +94,6 @@ void correct
|
||||
const scalar psiMin
|
||||
);
|
||||
|
||||
template<class RhoType, class SpType, class SuType>
|
||||
void LTScorrect
|
||||
(
|
||||
const RhoType& rho,
|
||||
volScalarField& psi,
|
||||
const surfaceScalarField& phi,
|
||||
surfaceScalarField& phiCorr,
|
||||
const SpType& Sp,
|
||||
const SuType& Su,
|
||||
const scalar psiMax,
|
||||
const scalar psiMin
|
||||
);
|
||||
|
||||
void LTScorrect
|
||||
(
|
||||
volScalarField& psi,
|
||||
const surfaceScalarField& phi,
|
||||
surfaceScalarField& phiCorr,
|
||||
const scalar psiMax,
|
||||
const scalar psiMin
|
||||
);
|
||||
|
||||
|
||||
template<class RdeltaTType, class RhoType, class SpType, class SuType>
|
||||
void limiterCorr
|
||||
(
|
||||
|
||||
@ -25,6 +25,7 @@ License
|
||||
|
||||
#include "CMULES.H"
|
||||
#include "fvcSurfaceIntegrate.H"
|
||||
#include "localEulerDdtScheme.H"
|
||||
#include "slicedSurfaceFields.H"
|
||||
#include "wedgeFvPatch.H"
|
||||
#include "syncTools.H"
|
||||
@ -87,56 +88,49 @@ void Foam::MULES::correct
|
||||
)
|
||||
{
|
||||
const fvMesh& mesh = psi.mesh();
|
||||
const scalar rDeltaT = 1.0/mesh.time().deltaTValue();
|
||||
|
||||
limitCorr
|
||||
(
|
||||
rDeltaT,
|
||||
rho,
|
||||
psi,
|
||||
phi,
|
||||
phiCorr,
|
||||
Sp,
|
||||
Su,
|
||||
psiMax,
|
||||
psiMin
|
||||
);
|
||||
bool LTS =
|
||||
word(mesh.ddtScheme("default"))
|
||||
== fv::localEulerDdtScheme<scalar>::typeName;
|
||||
|
||||
correct(rDeltaT, rho, psi, phi, phiCorr, Sp, Su);
|
||||
}
|
||||
if (LTS)
|
||||
{
|
||||
const volScalarField& rDeltaT =
|
||||
mesh.objectRegistry::lookupObject<volScalarField>("rSubDeltaT");
|
||||
|
||||
limitCorr
|
||||
(
|
||||
rDeltaT,
|
||||
rho,
|
||||
psi,
|
||||
phi,
|
||||
phiCorr,
|
||||
Sp,
|
||||
Su,
|
||||
psiMax,
|
||||
psiMin
|
||||
);
|
||||
correct(rDeltaT, rho, psi, phi, phiCorr, Sp, Su);
|
||||
}
|
||||
else
|
||||
{
|
||||
const scalar rDeltaT = 1.0/mesh.time().deltaTValue();
|
||||
|
||||
template<class RhoType, class SpType, class SuType>
|
||||
void Foam::MULES::LTScorrect
|
||||
(
|
||||
const RhoType& rho,
|
||||
volScalarField& psi,
|
||||
const surfaceScalarField& phi,
|
||||
surfaceScalarField& phiCorr,
|
||||
const SpType& Sp,
|
||||
const SuType& Su,
|
||||
const scalar psiMax,
|
||||
const scalar psiMin
|
||||
)
|
||||
{
|
||||
const fvMesh& mesh = psi.mesh();
|
||||
limitCorr
|
||||
(
|
||||
rDeltaT,
|
||||
rho,
|
||||
psi,
|
||||
phi,
|
||||
phiCorr,
|
||||
Sp,
|
||||
Su,
|
||||
psiMax,
|
||||
psiMin
|
||||
);
|
||||
|
||||
const volScalarField& rDeltaT =
|
||||
mesh.objectRegistry::lookupObject<volScalarField>("rSubDeltaT");
|
||||
|
||||
limitCorr
|
||||
(
|
||||
rDeltaT,
|
||||
rho,
|
||||
psi,
|
||||
phi,
|
||||
phiCorr,
|
||||
Sp,
|
||||
Su,
|
||||
psiMax,
|
||||
psiMin
|
||||
);
|
||||
correct(rDeltaT, rho, psi, phi, phiCorr, Sp, Su);
|
||||
correct(rDeltaT, rho, psi, phi, phiCorr, Sp, Su);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -48,27 +48,6 @@ void Foam::MULES::explicitSolve
|
||||
}
|
||||
|
||||
|
||||
void Foam::MULES::explicitLTSSolve
|
||||
(
|
||||
volScalarField& psi,
|
||||
const surfaceScalarField& phi,
|
||||
surfaceScalarField& phiPsi,
|
||||
const scalar psiMax,
|
||||
const scalar psiMin
|
||||
)
|
||||
{
|
||||
explicitLTSSolve
|
||||
(
|
||||
geometricOneField(),
|
||||
psi,
|
||||
phi,
|
||||
phiPsi,
|
||||
zeroField(), zeroField(),
|
||||
psiMax, psiMin
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
void Foam::MULES::limitSum(UPtrList<scalarField>& phiPsiCorrs)
|
||||
{
|
||||
forAll(phiPsiCorrs[0], facei)
|
||||
|
||||
@ -103,29 +103,6 @@ void explicitSolve
|
||||
const scalar psiMin
|
||||
);
|
||||
|
||||
template<class RhoType, class SpType, class SuType>
|
||||
void explicitLTSSolve
|
||||
(
|
||||
const RhoType& rho,
|
||||
volScalarField& psi,
|
||||
const surfaceScalarField& phiBD,
|
||||
surfaceScalarField& phiPsi,
|
||||
const SpType& Sp,
|
||||
const SuType& Su,
|
||||
const scalar psiMax,
|
||||
const scalar psiMin
|
||||
);
|
||||
|
||||
void explicitLTSSolve
|
||||
(
|
||||
volScalarField& psi,
|
||||
const surfaceScalarField& phiBD,
|
||||
surfaceScalarField& phiPsi,
|
||||
const scalar psiMax,
|
||||
const scalar psiMin
|
||||
);
|
||||
|
||||
|
||||
template<class RdeltaTType, class RhoType, class SpType, class SuType>
|
||||
void limiter
|
||||
(
|
||||
|
||||
@ -26,6 +26,7 @@ License
|
||||
#include "MULES.H"
|
||||
#include "upwind.H"
|
||||
#include "fvcSurfaceIntegrate.H"
|
||||
#include "localEulerDdtScheme.H"
|
||||
#include "slicedSurfaceFields.H"
|
||||
#include "wedgeFvPatch.H"
|
||||
#include "syncTools.H"
|
||||
@ -107,63 +108,54 @@ void Foam::MULES::explicitSolve
|
||||
)
|
||||
{
|
||||
const fvMesh& mesh = psi.mesh();
|
||||
const scalar rDeltaT = 1.0/mesh.time().deltaTValue();
|
||||
|
||||
psi.correctBoundaryConditions();
|
||||
|
||||
limit
|
||||
(
|
||||
rDeltaT,
|
||||
rho,
|
||||
psi,
|
||||
phi,
|
||||
phiPsi,
|
||||
Sp,
|
||||
Su,
|
||||
psiMax,
|
||||
psiMin,
|
||||
false
|
||||
);
|
||||
bool LTS =
|
||||
word(mesh.ddtScheme("default"))
|
||||
== fv::localEulerDdtScheme<scalar>::typeName;
|
||||
|
||||
explicitSolve(rDeltaT, rho, psi, phiPsi, Sp, Su);
|
||||
}
|
||||
if (LTS)
|
||||
{
|
||||
const volScalarField& rDeltaT =
|
||||
mesh.objectRegistry::lookupObject<volScalarField>("rSubDeltaT");
|
||||
|
||||
limit
|
||||
(
|
||||
rDeltaT,
|
||||
rho,
|
||||
psi,
|
||||
phi,
|
||||
phiPsi,
|
||||
Sp,
|
||||
Su,
|
||||
psiMax,
|
||||
psiMin,
|
||||
false
|
||||
);
|
||||
|
||||
template<class RhoType, class SpType, class SuType>
|
||||
void Foam::MULES::explicitLTSSolve
|
||||
(
|
||||
const RhoType& rho,
|
||||
volScalarField& psi,
|
||||
const surfaceScalarField& phi,
|
||||
surfaceScalarField& phiPsi,
|
||||
const SpType& Sp,
|
||||
const SuType& Su,
|
||||
const scalar psiMax,
|
||||
const scalar psiMin
|
||||
)
|
||||
{
|
||||
const fvMesh& mesh = psi.mesh();
|
||||
explicitSolve(rDeltaT, rho, psi, phiPsi, Sp, Su);
|
||||
}
|
||||
else
|
||||
{
|
||||
const scalar rDeltaT = 1.0/mesh.time().deltaTValue();
|
||||
|
||||
const volScalarField& rDeltaT =
|
||||
mesh.objectRegistry::lookupObject<volScalarField>("rSubDeltaT");
|
||||
limit
|
||||
(
|
||||
rDeltaT,
|
||||
rho,
|
||||
psi,
|
||||
phi,
|
||||
phiPsi,
|
||||
Sp,
|
||||
Su,
|
||||
psiMax,
|
||||
psiMin,
|
||||
false
|
||||
);
|
||||
|
||||
psi.correctBoundaryConditions();
|
||||
|
||||
limit
|
||||
(
|
||||
rDeltaT,
|
||||
rho,
|
||||
psi,
|
||||
phi,
|
||||
phiPsi,
|
||||
Sp,
|
||||
Su,
|
||||
psiMax,
|
||||
psiMin,
|
||||
false
|
||||
);
|
||||
|
||||
explicitSolve(rDeltaT, rho, psi, phiPsi, Sp, Su);
|
||||
explicitSolve(rDeltaT, rho, psi, phiPsi, Sp, Su);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user