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:
@ -15,7 +15,7 @@
|
||||
(
|
||||
1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT),
|
||||
fvc::surfaceSum(amaxSf)().dimensionedInternalField()
|
||||
/(2*maxCo*mesh.V())
|
||||
/((2*maxCo)*mesh.V())
|
||||
);
|
||||
|
||||
// Update tho boundary values of the reciprocal time-step
|
||||
|
||||
@ -1,10 +1,12 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
|
||||
LIB_LIBS = \
|
||||
-lcompressibleTransportModels \
|
||||
-lfluidThermophysicalModels \
|
||||
-lspecie \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lmeshTools
|
||||
|
||||
@ -6,11 +6,7 @@
|
||||
{
|
||||
fvScalarMatrix alpha1Eqn
|
||||
(
|
||||
#ifdef LTSSOLVE
|
||||
fv::localEulerDdtScheme<scalar>(mesh, rDeltaT.name()).fvmDdt(alpha1)
|
||||
#else
|
||||
fv::EulerDdtScheme<scalar>(mesh).fvmDdt(alpha1)
|
||||
#endif
|
||||
+ fv::gaussConvectionScheme<scalar>
|
||||
(
|
||||
mesh,
|
||||
@ -34,16 +30,6 @@
|
||||
{
|
||||
Info<< "Applying the previous iteration correction flux" << endl;
|
||||
|
||||
#ifdef LTSSOLVE
|
||||
MULES::LTScorrect
|
||||
(
|
||||
alpha1,
|
||||
phiAlpha,
|
||||
tphiAlphaCorr0(),
|
||||
mixture.alphaMax(),
|
||||
0
|
||||
);
|
||||
#else
|
||||
MULES::correct
|
||||
(
|
||||
alpha1,
|
||||
@ -52,7 +38,6 @@
|
||||
mixture.alphaMax(),
|
||||
0
|
||||
);
|
||||
#endif
|
||||
|
||||
phiAlpha += tphiAlphaCorr0();
|
||||
}
|
||||
@ -84,16 +69,6 @@
|
||||
tmp<surfaceScalarField> tphiAlphaCorr(tphiAlphaUn() - phiAlpha);
|
||||
volScalarField alpha10("alpha10", alpha1);
|
||||
|
||||
#ifdef LTSSOLVE
|
||||
MULES::LTScorrect
|
||||
(
|
||||
alpha1,
|
||||
tphiAlphaUn(),
|
||||
tphiAlphaCorr(),
|
||||
mixture.alphaMax(),
|
||||
0
|
||||
);
|
||||
#else
|
||||
MULES::correct
|
||||
(
|
||||
alpha1,
|
||||
@ -102,7 +77,6 @@
|
||||
mixture.alphaMax(),
|
||||
0
|
||||
);
|
||||
#endif
|
||||
|
||||
// Under-relax the correction for all but the 1st corrector
|
||||
if (aCorr == 0)
|
||||
@ -119,16 +93,6 @@
|
||||
{
|
||||
phiAlpha = tphiAlphaUn;
|
||||
|
||||
#ifdef LTSSOLVE
|
||||
MULES::explicitLTSSolve
|
||||
(
|
||||
alpha1,
|
||||
phi,
|
||||
phiAlpha,
|
||||
mixture.alphaMax(),
|
||||
0
|
||||
);
|
||||
#else
|
||||
MULES::explicitSolve
|
||||
(
|
||||
alpha1,
|
||||
@ -137,7 +101,6 @@
|
||||
mixture.alphaMax(),
|
||||
0
|
||||
);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,3 +0,0 @@
|
||||
LTSInterFoam.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/LTSInterFoam
|
||||
@ -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
|
||||
@ -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)
|
||||
);
|
||||
@ -77,11 +77,15 @@
|
||||
{
|
||||
fvScalarMatrix alpha1Eqn
|
||||
(
|
||||
#ifdef LTSSOLVE
|
||||
fv::localEulerDdtScheme<scalar>(mesh, rDeltaT.name()).fvmDdt(alpha1)
|
||||
#else
|
||||
fv::EulerDdtScheme<scalar>(mesh).fvmDdt(alpha1)
|
||||
#endif
|
||||
(
|
||||
LTS
|
||||
? fv::localEulerDdtScheme<scalar>
|
||||
(
|
||||
mesh,
|
||||
trSubDeltaT().name()
|
||||
).fvmDdt(alpha1)
|
||||
: fv::EulerDdtScheme<scalar>(mesh).fvmDdt(alpha1)
|
||||
)
|
||||
+ fv::gaussConvectionScheme<scalar>
|
||||
(
|
||||
mesh,
|
||||
@ -104,11 +108,7 @@
|
||||
if (alphaApplyPrevCorr && tphiAlphaCorr0.valid())
|
||||
{
|
||||
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);
|
||||
#endif
|
||||
|
||||
phiAlpha += tphiAlphaCorr0();
|
||||
}
|
||||
@ -154,11 +154,7 @@
|
||||
tmp<surfaceScalarField> tphiAlphaCorr(tphiAlphaUn() - phiAlpha);
|
||||
volScalarField alpha10("alpha10", alpha1);
|
||||
|
||||
#ifdef LTSSOLVE
|
||||
MULES::LTScorrect(alpha1, tphiAlphaUn(), tphiAlphaCorr(), 1, 0);
|
||||
#else
|
||||
MULES::correct(alpha1, tphiAlphaUn(), tphiAlphaCorr(), 1, 0);
|
||||
#endif
|
||||
|
||||
// Under-relax the correction for all but the 1st corrector
|
||||
if (aCorr == 0)
|
||||
@ -175,11 +171,7 @@
|
||||
{
|
||||
phiAlpha = tphiAlphaUn;
|
||||
|
||||
#ifdef LTSSOLVE
|
||||
MULES::explicitLTSSolve(alpha1, phi, phiAlpha, 1, 0);
|
||||
#else
|
||||
MULES::explicitSolve(alpha1, phiCN, phiAlpha, 1, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
alpha2 = 1.0 - alpha1;
|
||||
|
||||
47
applications/solvers/multiphase/interFoam/createRDeltaT.H
Normal file
47
applications/solvers/multiphase/interFoam/createRDeltaT.H
Normal 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)
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -45,6 +45,8 @@ Description
|
||||
#include "fvIOoptionList.H"
|
||||
#include "CorrectPhi.H"
|
||||
#include "fixedFluxPressureFvPatchScalarField.H"
|
||||
#include "localEulerDdtScheme.H"
|
||||
#include "fvcSmooth.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -60,7 +62,6 @@ int main(int argc, char *argv[])
|
||||
#include "createFields.H"
|
||||
#include "createMRF.H"
|
||||
#include "createFvOptions.H"
|
||||
#include "readTimeControls.H"
|
||||
|
||||
volScalarField rAU
|
||||
(
|
||||
@ -78,8 +79,14 @@ int main(int argc, char *argv[])
|
||||
|
||||
#include "correctPhi.H"
|
||||
#include "createUf.H"
|
||||
#include "createRDeltaT.H"
|
||||
|
||||
if (!LTS)
|
||||
{
|
||||
#include "readTimeControls.H"
|
||||
#include "CourantNo.H"
|
||||
#include "setInitialDeltaT.H"
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
Info<< "\nStarting time loop\n" << endl;
|
||||
@ -87,10 +94,17 @@ int main(int argc, char *argv[])
|
||||
while (runTime.run())
|
||||
{
|
||||
#include "readControls.H"
|
||||
#include "alphaCourantNo.H"
|
||||
#include "CourantNo.H"
|
||||
|
||||
if (LTS)
|
||||
{
|
||||
#include "setRDeltaT.H"
|
||||
}
|
||||
else
|
||||
{
|
||||
#include "CourantNo.H"
|
||||
#include "alphaCourantNo.H"
|
||||
#include "setDeltaT.H"
|
||||
}
|
||||
|
||||
runTime++;
|
||||
|
||||
|
||||
@ -49,6 +49,8 @@ Description
|
||||
#include "fvIOoptionList.H"
|
||||
#include "CorrectPhi.H"
|
||||
#include "fixedFluxPressureFvPatchScalarField.H"
|
||||
#include "localEulerDdtScheme.H"
|
||||
#include "fvcSmooth.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -64,10 +66,15 @@ int main(int argc, char *argv[])
|
||||
#include "createFields.H"
|
||||
#include "createMRF.H"
|
||||
#include "createFvOptions.H"
|
||||
#include "readTimeControls.H"
|
||||
#include "correctPhi.H"
|
||||
#include "createRDeltaT.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())
|
||||
{
|
||||
#include "readTimeControls.H"
|
||||
|
||||
if (LTS)
|
||||
{
|
||||
#include "setRDeltaT.H"
|
||||
}
|
||||
else
|
||||
{
|
||||
#include "CourantNo.H"
|
||||
#include "alphaCourantNo.H"
|
||||
#include "setDeltaT.H"
|
||||
}
|
||||
|
||||
runTime++;
|
||||
|
||||
|
||||
@ -72,6 +72,27 @@
|
||||
phiAlpha1 -= phiAlpha1BD;
|
||||
|
||||
// Calculate the limiter for alpha1
|
||||
if (LTS)
|
||||
{
|
||||
const volScalarField& rDeltaT =
|
||||
mesh.objectRegistry::lookupObject<volScalarField>("rSubDeltaT");
|
||||
|
||||
MULES::limiter
|
||||
(
|
||||
allLambda,
|
||||
rDeltaT,
|
||||
geometricOneField(),
|
||||
alpha1,
|
||||
phiAlpha1BD,
|
||||
phiAlpha1,
|
||||
zeroField(),
|
||||
zeroField(),
|
||||
1,
|
||||
0
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
MULES::limiter
|
||||
(
|
||||
allLambda,
|
||||
@ -85,6 +106,7 @@
|
||||
1,
|
||||
0
|
||||
);
|
||||
}
|
||||
|
||||
// Create the complete flux for alpha2
|
||||
surfaceScalarField phiAlpha2
|
||||
@ -113,6 +135,27 @@
|
||||
phiAlpha2 -= phiAlpha2BD;
|
||||
|
||||
// Further limit the limiter for alpha2
|
||||
if (LTS)
|
||||
{
|
||||
const volScalarField& rDeltaT =
|
||||
mesh.objectRegistry::lookupObject<volScalarField>("rSubDeltaT");
|
||||
|
||||
MULES::limiter
|
||||
(
|
||||
allLambda,
|
||||
rDeltaT,
|
||||
geometricOneField(),
|
||||
alpha2,
|
||||
phiAlpha2BD,
|
||||
phiAlpha2,
|
||||
zeroField(),
|
||||
zeroField(),
|
||||
1,
|
||||
0
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
MULES::limiter
|
||||
(
|
||||
allLambda,
|
||||
@ -126,6 +169,7 @@
|
||||
1,
|
||||
0
|
||||
);
|
||||
}
|
||||
|
||||
// Construct the limited fluxes
|
||||
phiAlpha1 = phiAlpha1BD + lambda*phiAlpha1;
|
||||
|
||||
@ -39,6 +39,8 @@ Description
|
||||
#include "fvIOoptionList.H"
|
||||
#include "CorrectPhi.H"
|
||||
#include "fixedFluxPressureFvPatchScalarField.H"
|
||||
#include "localEulerDdtScheme.H"
|
||||
#include "fvcSmooth.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -54,10 +56,15 @@ int main(int argc, char *argv[])
|
||||
#include "createFields.H"
|
||||
#include "createMRF.H"
|
||||
#include "createFvOptions.H"
|
||||
#include "correctPhi.H"
|
||||
#include "createRDeltaT.H"
|
||||
|
||||
if (!LTS)
|
||||
{
|
||||
#include "readTimeControls.H"
|
||||
#include "CourantNo.H"
|
||||
#include "setInitialDeltaT.H"
|
||||
#include "correctPhi.H"
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -66,9 +73,17 @@ int main(int argc, char *argv[])
|
||||
while (runTime.run())
|
||||
{
|
||||
#include "readTimeControls.H"
|
||||
|
||||
if (LTS)
|
||||
{
|
||||
#include "setRDeltaT.H"
|
||||
}
|
||||
else
|
||||
{
|
||||
#include "CourantNo.H"
|
||||
#include "alphaCourantNo.H"
|
||||
#include "setDeltaT.H"
|
||||
}
|
||||
|
||||
runTime++;
|
||||
|
||||
|
||||
@ -1,4 +1,7 @@
|
||||
{
|
||||
volScalarField& rDeltaT = trDeltaT();
|
||||
volScalarField& rSubDeltaT = trSubDeltaT();
|
||||
|
||||
const dictionary& pimpleDict = pimple.dict();
|
||||
|
||||
scalar maxCo
|
||||
@ -132,7 +135,8 @@
|
||||
<< ", " << gMax(1/rDeltaT.internalField()) << endl;
|
||||
}
|
||||
|
||||
#include "alphaControls.H"
|
||||
const dictionary& alphaControls = mesh.solverDict(alpha1.name());
|
||||
label nAlphaSubCycles(readLabel(alphaControls.lookup("nAlphaSubCycles")));
|
||||
|
||||
rSubDeltaT = rDeltaT*nAlphaSubCycles;
|
||||
}
|
||||
@ -5,9 +5,11 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
|
||||
LIB_LIBS = \
|
||||
-linterfaceProperties \
|
||||
-lincompressibleTransportModels \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lmeshTools
|
||||
|
||||
@ -8,9 +8,9 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/fvOptions/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/sampling/lnInclude
|
||||
|
||||
@ -3,9 +3,11 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
|
||||
LIB_LIBS = \
|
||||
-linterfaceProperties \
|
||||
-lincompressibleTransportModels \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lmeshTools
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
bool LTS =
|
||||
word(mesh.ddtScheme("ddt(rho)"))
|
||||
word(mesh.ddtScheme("default"))
|
||||
== fv::localEulerDdtScheme<scalar>::typeName;
|
||||
|
||||
tmp<volScalarField> trDeltaT;
|
||||
@ -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,40 +88,13 @@ 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
|
||||
);
|
||||
|
||||
correct(rDeltaT, rho, psi, phi, phiCorr, Sp, Su);
|
||||
}
|
||||
|
||||
|
||||
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();
|
||||
bool LTS =
|
||||
word(mesh.ddtScheme("default"))
|
||||
== fv::localEulerDdtScheme<scalar>::typeName;
|
||||
|
||||
if (LTS)
|
||||
{
|
||||
const volScalarField& rDeltaT =
|
||||
mesh.objectRegistry::lookupObject<volScalarField>("rSubDeltaT");
|
||||
|
||||
@ -137,6 +111,26 @@ void Foam::MULES::LTScorrect
|
||||
psiMin
|
||||
);
|
||||
correct(rDeltaT, rho, psi, phi, phiCorr, Sp, Su);
|
||||
}
|
||||
else
|
||||
{
|
||||
const scalar rDeltaT = 1.0/mesh.time().deltaTValue();
|
||||
|
||||
limitCorr
|
||||
(
|
||||
rDeltaT,
|
||||
rho,
|
||||
psi,
|
||||
phi,
|
||||
phiCorr,
|
||||
Sp,
|
||||
Su,
|
||||
psiMax,
|
||||
psiMin
|
||||
);
|
||||
|
||||
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,47 +108,37 @@ 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
|
||||
);
|
||||
|
||||
explicitSolve(rDeltaT, rho, psi, phiPsi, Sp, Su);
|
||||
}
|
||||
|
||||
|
||||
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();
|
||||
bool LTS =
|
||||
word(mesh.ddtScheme("default"))
|
||||
== fv::localEulerDdtScheme<scalar>::typeName;
|
||||
|
||||
if (LTS)
|
||||
{
|
||||
const volScalarField& rDeltaT =
|
||||
mesh.objectRegistry::lookupObject<volScalarField>("rSubDeltaT");
|
||||
|
||||
psi.correctBoundaryConditions();
|
||||
limit
|
||||
(
|
||||
rDeltaT,
|
||||
rho,
|
||||
psi,
|
||||
phi,
|
||||
phiPsi,
|
||||
Sp,
|
||||
Su,
|
||||
psiMax,
|
||||
psiMin,
|
||||
false
|
||||
);
|
||||
|
||||
explicitSolve(rDeltaT, rho, psi, phiPsi, Sp, Su);
|
||||
}
|
||||
else
|
||||
{
|
||||
const scalar rDeltaT = 1.0/mesh.time().deltaTValue();
|
||||
|
||||
limit
|
||||
(
|
||||
@ -164,6 +155,7 @@ void Foam::MULES::explicitLTSSolve
|
||||
);
|
||||
|
||||
explicitSolve(rDeltaT, rho, psi, phiPsi, Sp, Su);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -15,7 +15,7 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application LTSInterFoam;
|
||||
application interFoam;
|
||||
|
||||
startFrom startTime;
|
||||
|
||||
Reference in New Issue
Block a user