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:
Henry Weller
2015-06-26 18:32:20 +01:00
parent bf95b5c286
commit e00ae44ad0
56 changed files with 291 additions and 468 deletions

View File

@ -15,7 +15,7 @@
( (
1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT), 1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT),
fvc::surfaceSum(amaxSf)().dimensionedInternalField() fvc::surfaceSum(amaxSf)().dimensionedInternalField()
/(2*maxCo*mesh.V()) /((2*maxCo)*mesh.V())
); );
// Update tho boundary values of the reciprocal time-step // Update tho boundary values of the reciprocal time-step

View File

@ -1,10 +1,12 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \ -I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
LIB_LIBS = \ LIB_LIBS = \
-lcompressibleTransportModels \ -lcompressibleTransportModels \
-lfluidThermophysicalModels \ -lfluidThermophysicalModels \
-lspecie \ -lspecie \
-lfiniteVolume -lfiniteVolume \
-lmeshTools

View File

@ -6,11 +6,7 @@
{ {
fvScalarMatrix alpha1Eqn fvScalarMatrix alpha1Eqn
( (
#ifdef LTSSOLVE
fv::localEulerDdtScheme<scalar>(mesh, rDeltaT.name()).fvmDdt(alpha1)
#else
fv::EulerDdtScheme<scalar>(mesh).fvmDdt(alpha1) fv::EulerDdtScheme<scalar>(mesh).fvmDdt(alpha1)
#endif
+ fv::gaussConvectionScheme<scalar> + fv::gaussConvectionScheme<scalar>
( (
mesh, mesh,
@ -34,16 +30,6 @@
{ {
Info<< "Applying the previous iteration correction flux" << endl; Info<< "Applying the previous iteration correction flux" << endl;
#ifdef LTSSOLVE
MULES::LTScorrect
(
alpha1,
phiAlpha,
tphiAlphaCorr0(),
mixture.alphaMax(),
0
);
#else
MULES::correct MULES::correct
( (
alpha1, alpha1,
@ -52,7 +38,6 @@
mixture.alphaMax(), mixture.alphaMax(),
0 0
); );
#endif
phiAlpha += tphiAlphaCorr0(); phiAlpha += tphiAlphaCorr0();
} }
@ -84,16 +69,6 @@
tmp<surfaceScalarField> tphiAlphaCorr(tphiAlphaUn() - phiAlpha); tmp<surfaceScalarField> tphiAlphaCorr(tphiAlphaUn() - phiAlpha);
volScalarField alpha10("alpha10", alpha1); volScalarField alpha10("alpha10", alpha1);
#ifdef LTSSOLVE
MULES::LTScorrect
(
alpha1,
tphiAlphaUn(),
tphiAlphaCorr(),
mixture.alphaMax(),
0
);
#else
MULES::correct MULES::correct
( (
alpha1, alpha1,
@ -102,7 +77,6 @@
mixture.alphaMax(), mixture.alphaMax(),
0 0
); );
#endif
// Under-relax the correction for all but the 1st corrector // Under-relax the correction for all but the 1st corrector
if (aCorr == 0) if (aCorr == 0)
@ -119,16 +93,6 @@
{ {
phiAlpha = tphiAlphaUn; phiAlpha = tphiAlphaUn;
#ifdef LTSSOLVE
MULES::explicitLTSSolve
(
alpha1,
phi,
phiAlpha,
mixture.alphaMax(),
0
);
#else
MULES::explicitSolve MULES::explicitSolve
( (
alpha1, alpha1,
@ -137,7 +101,6 @@
mixture.alphaMax(), mixture.alphaMax(),
0 0
); );
#endif
} }
} }

View File

@ -1,119 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-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/>.
Application
interFoam
Description
Solver for 2 incompressible, isothermal immiscible fluids using a VOF
(volume of fluid) phase-fraction based interface capturing approach.
The momentum and other fluid properties are of the "mixture" and a single
momentum equation is solved.
Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
For a two-fluid approach see twoPhaseEulerFoam.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "CMULES.H"
#include "EulerDdtScheme.H"
#include "localEulerDdtScheme.H"
#include "CrankNicolsonDdtScheme.H"
#include "subCycle.H"
#include "immiscibleIncompressibleTwoPhaseMixture.H"
#include "turbulentTransportModel.H"
#include "fvcSmooth.H"
#include "pimpleControl.H"
#include "fvIOoptionList.H"
#include "CorrectPhi.H"
#include "fixedFluxPressureFvPatchScalarField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
pimpleControl pimple(mesh);
#include "initContinuityErrs.H"
#include "createFields.H"
#include "createMRF.H"
#include "createFvOptions.H"
#include "correctPhi.H"
#include "CourantNo.H"
#include "createRDeltaT.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
{
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "setrDeltaT.H"
// --- Pressure-velocity PIMPLE corrector loop
while (pimple.loop())
{
#include "alphaControls.H"
#define LTSSOLVE
#include "alphaEqnSubCycle.H"
#undef LTSSOLVE
mixture.correct();
turbulence->correct();
#include "UEqn.H"
// --- Pressure corrector loop
while (pimple.correct())
{
#include "pEqn.H"
}
}
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}
Info<< "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -1,3 +0,0 @@
LTSInterFoam.C
EXE = $(FOAM_APPBIN)/LTSInterFoam

View File

@ -1,22 +0,0 @@
EXE_INC = \
-I.. \
-I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/immiscibleIncompressibleTwoPhaseMixture/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/fvOptions/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude
EXE_LIBS = \
-limmiscibleIncompressibleTwoPhaseMixture \
-lturbulenceModels \
-lincompressibleTurbulenceModels \
-lfiniteVolume \
-lmeshTools \
-lfvOptions \
-lsampling

View File

@ -1,31 +0,0 @@
scalar maxDeltaT
(
pimple.dict().lookupOrDefault<scalar>("maxDeltaT", GREAT)
);
volScalarField rDeltaT
(
IOobject
(
"rDeltaT",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT),
zeroGradientFvPatchScalarField::typeName
);
volScalarField rSubDeltaT
(
IOobject
(
"rSubDeltaT",
runTime.timeName(),
mesh
),
mesh,
1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT)
);

View File

@ -77,11 +77,15 @@
{ {
fvScalarMatrix alpha1Eqn fvScalarMatrix alpha1Eqn
( (
#ifdef LTSSOLVE (
fv::localEulerDdtScheme<scalar>(mesh, rDeltaT.name()).fvmDdt(alpha1) LTS
#else ? fv::localEulerDdtScheme<scalar>
fv::EulerDdtScheme<scalar>(mesh).fvmDdt(alpha1) (
#endif mesh,
trSubDeltaT().name()
).fvmDdt(alpha1)
: fv::EulerDdtScheme<scalar>(mesh).fvmDdt(alpha1)
)
+ fv::gaussConvectionScheme<scalar> + fv::gaussConvectionScheme<scalar>
( (
mesh, mesh,
@ -104,11 +108,7 @@
if (alphaApplyPrevCorr && tphiAlphaCorr0.valid()) if (alphaApplyPrevCorr && tphiAlphaCorr0.valid())
{ {
Info<< "Applying the previous iteration compression flux" << endl; Info<< "Applying the previous iteration compression flux" << endl;
#ifdef LTSSOLVE
MULES::LTScorrect(alpha1, phiAlpha, tphiAlphaCorr0(), 1, 0);
#else
MULES::correct(alpha1, phiAlpha, tphiAlphaCorr0(), 1, 0); MULES::correct(alpha1, phiAlpha, tphiAlphaCorr0(), 1, 0);
#endif
phiAlpha += tphiAlphaCorr0(); phiAlpha += tphiAlphaCorr0();
} }
@ -154,11 +154,7 @@
tmp<surfaceScalarField> tphiAlphaCorr(tphiAlphaUn() - phiAlpha); tmp<surfaceScalarField> tphiAlphaCorr(tphiAlphaUn() - phiAlpha);
volScalarField alpha10("alpha10", alpha1); volScalarField alpha10("alpha10", alpha1);
#ifdef LTSSOLVE
MULES::LTScorrect(alpha1, tphiAlphaUn(), tphiAlphaCorr(), 1, 0);
#else
MULES::correct(alpha1, tphiAlphaUn(), tphiAlphaCorr(), 1, 0); MULES::correct(alpha1, tphiAlphaUn(), tphiAlphaCorr(), 1, 0);
#endif
// Under-relax the correction for all but the 1st corrector // Under-relax the correction for all but the 1st corrector
if (aCorr == 0) if (aCorr == 0)
@ -175,11 +171,7 @@
{ {
phiAlpha = tphiAlphaUn; phiAlpha = tphiAlphaUn;
#ifdef LTSSOLVE
MULES::explicitLTSSolve(alpha1, phi, phiAlpha, 1, 0);
#else
MULES::explicitSolve(alpha1, phiCN, phiAlpha, 1, 0); MULES::explicitSolve(alpha1, phiCN, phiAlpha, 1, 0);
#endif
} }
alpha2 = 1.0 - alpha1; alpha2 = 1.0 - alpha1;

View File

@ -0,0 +1,47 @@
bool LTS =
word(mesh.ddtScheme("default"))
== fv::localEulerDdtScheme<scalar>::typeName;
tmp<volScalarField> trDeltaT;
tmp<volScalarField> trSubDeltaT;
if (LTS)
{
scalar maxDeltaT
(
pimple.dict().lookupOrDefault<scalar>("maxDeltaT", GREAT)
);
trDeltaT = tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"rDeltaT",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT),
zeroGradientFvPatchScalarField::typeName
)
);
trSubDeltaT = tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"rSubDeltaT",
runTime.timeName(),
mesh
),
mesh,
1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT)
)
);
}

View File

@ -45,6 +45,8 @@ Description
#include "fvIOoptionList.H" #include "fvIOoptionList.H"
#include "CorrectPhi.H" #include "CorrectPhi.H"
#include "fixedFluxPressureFvPatchScalarField.H" #include "fixedFluxPressureFvPatchScalarField.H"
#include "localEulerDdtScheme.H"
#include "fvcSmooth.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -60,7 +62,6 @@ int main(int argc, char *argv[])
#include "createFields.H" #include "createFields.H"
#include "createMRF.H" #include "createMRF.H"
#include "createFvOptions.H" #include "createFvOptions.H"
#include "readTimeControls.H"
volScalarField rAU volScalarField rAU
( (
@ -78,8 +79,14 @@ int main(int argc, char *argv[])
#include "correctPhi.H" #include "correctPhi.H"
#include "createUf.H" #include "createUf.H"
#include "CourantNo.H" #include "createRDeltaT.H"
#include "setInitialDeltaT.H"
if (!LTS)
{
#include "readTimeControls.H"
#include "CourantNo.H"
#include "setInitialDeltaT.H"
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl; Info<< "\nStarting time loop\n" << endl;
@ -87,10 +94,17 @@ int main(int argc, char *argv[])
while (runTime.run()) while (runTime.run())
{ {
#include "readControls.H" #include "readControls.H"
#include "alphaCourantNo.H"
#include "CourantNo.H"
#include "setDeltaT.H" if (LTS)
{
#include "setRDeltaT.H"
}
else
{
#include "CourantNo.H"
#include "alphaCourantNo.H"
#include "setDeltaT.H"
}
runTime++; runTime++;

View File

@ -49,6 +49,8 @@ Description
#include "fvIOoptionList.H" #include "fvIOoptionList.H"
#include "CorrectPhi.H" #include "CorrectPhi.H"
#include "fixedFluxPressureFvPatchScalarField.H" #include "fixedFluxPressureFvPatchScalarField.H"
#include "localEulerDdtScheme.H"
#include "fvcSmooth.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -64,10 +66,15 @@ int main(int argc, char *argv[])
#include "createFields.H" #include "createFields.H"
#include "createMRF.H" #include "createMRF.H"
#include "createFvOptions.H" #include "createFvOptions.H"
#include "readTimeControls.H"
#include "correctPhi.H" #include "correctPhi.H"
#include "CourantNo.H" #include "createRDeltaT.H"
#include "setInitialDeltaT.H"
if (!LTS)
{
#include "readTimeControls.H"
#include "CourantNo.H"
#include "setInitialDeltaT.H"
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -76,9 +83,17 @@ int main(int argc, char *argv[])
while (runTime.run()) while (runTime.run())
{ {
#include "readTimeControls.H" #include "readTimeControls.H"
#include "CourantNo.H"
#include "alphaCourantNo.H" if (LTS)
#include "setDeltaT.H" {
#include "setRDeltaT.H"
}
else
{
#include "CourantNo.H"
#include "alphaCourantNo.H"
#include "setDeltaT.H"
}
runTime++; runTime++;

View File

@ -72,19 +72,41 @@
phiAlpha1 -= phiAlpha1BD; phiAlpha1 -= phiAlpha1BD;
// Calculate the limiter for alpha1 // Calculate the limiter for alpha1
MULES::limiter if (LTS)
( {
allLambda, const volScalarField& rDeltaT =
1.0/runTime.deltaT().value(), mesh.objectRegistry::lookupObject<volScalarField>("rSubDeltaT");
geometricOneField(),
alpha1, MULES::limiter
phiAlpha1BD, (
phiAlpha1, allLambda,
zeroField(), rDeltaT,
zeroField(), geometricOneField(),
1, alpha1,
0 phiAlpha1BD,
); phiAlpha1,
zeroField(),
zeroField(),
1,
0
);
}
else
{
MULES::limiter
(
allLambda,
1.0/runTime.deltaT().value(),
geometricOneField(),
alpha1,
phiAlpha1BD,
phiAlpha1,
zeroField(),
zeroField(),
1,
0
);
}
// Create the complete flux for alpha2 // Create the complete flux for alpha2
surfaceScalarField phiAlpha2 surfaceScalarField phiAlpha2
@ -113,19 +135,41 @@
phiAlpha2 -= phiAlpha2BD; phiAlpha2 -= phiAlpha2BD;
// Further limit the limiter for alpha2 // Further limit the limiter for alpha2
MULES::limiter if (LTS)
( {
allLambda, const volScalarField& rDeltaT =
1.0/runTime.deltaT().value(), mesh.objectRegistry::lookupObject<volScalarField>("rSubDeltaT");
geometricOneField(),
alpha2, MULES::limiter
phiAlpha2BD, (
phiAlpha2, allLambda,
zeroField(), rDeltaT,
zeroField(), geometricOneField(),
1, alpha2,
0 phiAlpha2BD,
); phiAlpha2,
zeroField(),
zeroField(),
1,
0
);
}
else
{
MULES::limiter
(
allLambda,
1.0/runTime.deltaT().value(),
geometricOneField(),
alpha2,
phiAlpha2BD,
phiAlpha2,
zeroField(),
zeroField(),
1,
0
);
}
// Construct the limited fluxes // Construct the limited fluxes
phiAlpha1 = phiAlpha1BD + lambda*phiAlpha1; phiAlpha1 = phiAlpha1BD + lambda*phiAlpha1;

View File

@ -39,6 +39,8 @@ Description
#include "fvIOoptionList.H" #include "fvIOoptionList.H"
#include "CorrectPhi.H" #include "CorrectPhi.H"
#include "fixedFluxPressureFvPatchScalarField.H" #include "fixedFluxPressureFvPatchScalarField.H"
#include "localEulerDdtScheme.H"
#include "fvcSmooth.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -54,10 +56,15 @@ int main(int argc, char *argv[])
#include "createFields.H" #include "createFields.H"
#include "createMRF.H" #include "createMRF.H"
#include "createFvOptions.H" #include "createFvOptions.H"
#include "readTimeControls.H"
#include "CourantNo.H"
#include "setInitialDeltaT.H"
#include "correctPhi.H" #include "correctPhi.H"
#include "createRDeltaT.H"
if (!LTS)
{
#include "readTimeControls.H"
#include "CourantNo.H"
#include "setInitialDeltaT.H"
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -66,9 +73,17 @@ int main(int argc, char *argv[])
while (runTime.run()) while (runTime.run())
{ {
#include "readTimeControls.H" #include "readTimeControls.H"
#include "CourantNo.H"
#include "alphaCourantNo.H" if (LTS)
#include "setDeltaT.H" {
#include "setRDeltaT.H"
}
else
{
#include "CourantNo.H"
#include "alphaCourantNo.H"
#include "setDeltaT.H"
}
runTime++; runTime++;

View File

@ -1,4 +1,7 @@
{ {
volScalarField& rDeltaT = trDeltaT();
volScalarField& rSubDeltaT = trSubDeltaT();
const dictionary& pimpleDict = pimple.dict(); const dictionary& pimpleDict = pimple.dict();
scalar maxCo scalar maxCo
@ -132,7 +135,8 @@
<< ", " << gMax(1/rDeltaT.internalField()) << endl; << ", " << gMax(1/rDeltaT.internalField()) << endl;
} }
#include "alphaControls.H" const dictionary& alphaControls = mesh.solverDict(alpha1.name());
label nAlphaSubCycles(readLabel(alphaControls.lookup("nAlphaSubCycles")));
rSubDeltaT = rDeltaT*nAlphaSubCycles; rSubDeltaT = rDeltaT*nAlphaSubCycles;
} }

View File

@ -5,9 +5,11 @@ EXE_INC = \
-I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
LIB_LIBS = \ LIB_LIBS = \
-linterfaceProperties \ -linterfaceProperties \
-lincompressibleTransportModels \ -lincompressibleTransportModels \
-lfiniteVolume -lfiniteVolume \
-lmeshTools

View File

@ -8,9 +8,9 @@ EXE_INC = \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \ -I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/fvOptions/lnInclude \ -I$(LIB_SRC)/fvOptions/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude -I$(LIB_SRC)/sampling/lnInclude

View File

@ -3,9 +3,11 @@ EXE_INC = \
-I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
LIB_LIBS = \ LIB_LIBS = \
-linterfaceProperties \ -linterfaceProperties \
-lincompressibleTransportModels \ -lincompressibleTransportModels \
-lfiniteVolume -lfiniteVolume \
-lmeshTools

View File

@ -1,5 +1,5 @@
bool LTS = bool LTS =
word(mesh.ddtScheme("ddt(rho)")) word(mesh.ddtScheme("default"))
== fv::localEulerDdtScheme<scalar>::typeName; == fv::localEulerDdtScheme<scalar>::typeName;
tmp<volScalarField> trDeltaT; tmp<volScalarField> trDeltaT;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License 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
);
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -94,29 +94,6 @@ void correct
const scalar psiMin 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> template<class RdeltaTType, class RhoType, class SpType, class SuType>
void limiterCorr void limiterCorr
( (

View File

@ -25,6 +25,7 @@ License
#include "CMULES.H" #include "CMULES.H"
#include "fvcSurfaceIntegrate.H" #include "fvcSurfaceIntegrate.H"
#include "localEulerDdtScheme.H"
#include "slicedSurfaceFields.H" #include "slicedSurfaceFields.H"
#include "wedgeFvPatch.H" #include "wedgeFvPatch.H"
#include "syncTools.H" #include "syncTools.H"
@ -87,56 +88,49 @@ void Foam::MULES::correct
) )
{ {
const fvMesh& mesh = psi.mesh(); const fvMesh& mesh = psi.mesh();
const scalar rDeltaT = 1.0/mesh.time().deltaTValue();
limitCorr bool LTS =
( word(mesh.ddtScheme("default"))
rDeltaT, == fv::localEulerDdtScheme<scalar>::typeName;
rho,
psi,
phi,
phiCorr,
Sp,
Su,
psiMax,
psiMin
);
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> limitCorr
void Foam::MULES::LTScorrect (
( rDeltaT,
const RhoType& rho, rho,
volScalarField& psi, psi,
const surfaceScalarField& phi, phi,
surfaceScalarField& phiCorr, phiCorr,
const SpType& Sp, Sp,
const SuType& Su, Su,
const scalar psiMax, psiMax,
const scalar psiMin psiMin
) );
{
const fvMesh& mesh = psi.mesh();
const volScalarField& rDeltaT = correct(rDeltaT, rho, psi, phi, phiCorr, Sp, Su);
mesh.objectRegistry::lookupObject<volScalarField>("rSubDeltaT"); }
limitCorr
(
rDeltaT,
rho,
psi,
phi,
phiCorr,
Sp,
Su,
psiMax,
psiMin
);
correct(rDeltaT, rho, psi, phi, phiCorr, Sp, Su);
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License 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) void Foam::MULES::limitSum(UPtrList<scalarField>& phiPsiCorrs)
{ {
forAll(phiPsiCorrs[0], facei) forAll(phiPsiCorrs[0], facei)

View File

@ -103,29 +103,6 @@ void explicitSolve
const scalar psiMin 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> template<class RdeltaTType, class RhoType, class SpType, class SuType>
void limiter void limiter
( (

View File

@ -26,6 +26,7 @@ License
#include "MULES.H" #include "MULES.H"
#include "upwind.H" #include "upwind.H"
#include "fvcSurfaceIntegrate.H" #include "fvcSurfaceIntegrate.H"
#include "localEulerDdtScheme.H"
#include "slicedSurfaceFields.H" #include "slicedSurfaceFields.H"
#include "wedgeFvPatch.H" #include "wedgeFvPatch.H"
#include "syncTools.H" #include "syncTools.H"
@ -107,63 +108,54 @@ void Foam::MULES::explicitSolve
) )
{ {
const fvMesh& mesh = psi.mesh(); const fvMesh& mesh = psi.mesh();
const scalar rDeltaT = 1.0/mesh.time().deltaTValue();
psi.correctBoundaryConditions(); psi.correctBoundaryConditions();
limit bool LTS =
( word(mesh.ddtScheme("default"))
rDeltaT, == fv::localEulerDdtScheme<scalar>::typeName;
rho,
psi,
phi,
phiPsi,
Sp,
Su,
psiMax,
psiMin,
false
);
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> explicitSolve(rDeltaT, rho, psi, phiPsi, Sp, Su);
void Foam::MULES::explicitLTSSolve }
( else
const RhoType& rho, {
volScalarField& psi, const scalar rDeltaT = 1.0/mesh.time().deltaTValue();
const surfaceScalarField& phi,
surfaceScalarField& phiPsi,
const SpType& Sp,
const SuType& Su,
const scalar psiMax,
const scalar psiMin
)
{
const fvMesh& mesh = psi.mesh();
const volScalarField& rDeltaT = limit
mesh.objectRegistry::lookupObject<volScalarField>("rSubDeltaT"); (
rDeltaT,
rho,
psi,
phi,
phiPsi,
Sp,
Su,
psiMax,
psiMin,
false
);
psi.correctBoundaryConditions(); explicitSolve(rDeltaT, rho, psi, phiPsi, Sp, Su);
}
limit
(
rDeltaT,
rho,
psi,
phi,
phiPsi,
Sp,
Su,
psiMax,
psiMin,
false
);
explicitSolve(rDeltaT, rho, psi, phiPsi, Sp, Su);
} }

View File

@ -15,7 +15,7 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application LTSInterFoam; application interFoam;
startFrom startTime; startFrom startTime;