mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Updated twoPhaseEulerFoam solver and tutorials
This commit is contained in:
@ -234,4 +234,4 @@
|
|||||||
|
|
||||||
label pRefCell = 0;
|
label pRefCell = 0;
|
||||||
scalar pRefValue = 0.0;
|
scalar pRefValue = 0.0;
|
||||||
setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue);
|
setRefCell(p, mesh.solutionDict().subDict("PIMPLE"), pRefCell, pRefValue);
|
||||||
|
|||||||
@ -58,7 +58,7 @@
|
|||||||
alphaf*rUaAf/rhoa + betaf*rUbAf/rhob
|
alphaf*rUaAf/rhoa + betaf*rUbAf/rhob
|
||||||
);
|
);
|
||||||
|
|
||||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
|
||||||
{
|
{
|
||||||
fvScalarMatrix pEqn
|
fvScalarMatrix pEqn
|
||||||
(
|
(
|
||||||
@ -66,9 +66,13 @@
|
|||||||
);
|
);
|
||||||
|
|
||||||
pEqn.setReference(pRefCell, pRefValue);
|
pEqn.setReference(pRefCell, pRefValue);
|
||||||
pEqn.solve();
|
|
||||||
|
|
||||||
if (nonOrth == nNonOrthCorr)
|
pEqn.solve
|
||||||
|
(
|
||||||
|
mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
|
||||||
|
);
|
||||||
|
|
||||||
|
if (nonOrth == pimple.nNonOrthCorr())
|
||||||
{
|
{
|
||||||
surfaceScalarField SfGradp(pEqn.flux()/Dp);
|
surfaceScalarField SfGradp(pEqn.flux()/Dp);
|
||||||
|
|
||||||
|
|||||||
@ -10,27 +10,12 @@
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
scalar preAlphaExp
|
scalar preAlphaExp(readScalar(ppProperties.lookup("preAlphaExp")));
|
||||||
(
|
|
||||||
readScalar(ppProperties.lookup("preAlphaExp"))
|
|
||||||
);
|
|
||||||
|
|
||||||
scalar alphaMax
|
scalar alphaMax(readScalar(ppProperties.lookup("alphaMax")));
|
||||||
(
|
|
||||||
readScalar(ppProperties.lookup("alphaMax"))
|
|
||||||
);
|
|
||||||
|
|
||||||
scalar expMax
|
scalar expMax(readScalar(ppProperties.lookup("expMax")));
|
||||||
(
|
|
||||||
readScalar(ppProperties.lookup("expMax"))
|
|
||||||
);
|
|
||||||
|
|
||||||
dimensionedScalar g0
|
dimensionedScalar g0(ppProperties.lookup("g0"));
|
||||||
(
|
|
||||||
ppProperties.lookup("g0")
|
|
||||||
);
|
|
||||||
|
|
||||||
Switch packingLimiter
|
Switch packingLimiter(ppProperties.lookup("packingLimiter"));
|
||||||
(
|
|
||||||
ppProperties.lookup("packingLimiter")
|
|
||||||
);
|
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
#include "readTimeControls.H"
|
#include "readTimeControls.H"
|
||||||
#include "readPISOControls.H"
|
|
||||||
|
|
||||||
int nAlphaCorr(readInt(pisoDict.lookup("nAlphaCorr")));
|
int nAlphaCorr(readInt(pimple.dict().lookup("nAlphaCorr")));
|
||||||
|
|
||||||
Switch correctAlpha(pisoDict.lookup("correctAlpha"));
|
Switch correctAlpha(pimple.dict().lookup("correctAlpha"));
|
||||||
|
|||||||
@ -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) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -42,6 +42,8 @@ Description
|
|||||||
#include "phaseModel.H"
|
#include "phaseModel.H"
|
||||||
#include "kineticTheoryModel.H"
|
#include "kineticTheoryModel.H"
|
||||||
|
|
||||||
|
#include "pimpleControl.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
@ -58,6 +60,8 @@ int main(int argc, char *argv[])
|
|||||||
#include "CourantNo.H"
|
#include "CourantNo.H"
|
||||||
#include "setInitialDeltaT.H"
|
#include "setInitialDeltaT.H"
|
||||||
|
|
||||||
|
pimpleControl pimple(mesh);
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Info<< "\nStarting time loop\n" << endl;
|
Info<< "\nStarting time loop\n" << endl;
|
||||||
@ -71,6 +75,9 @@ int main(int argc, char *argv[])
|
|||||||
runTime++;
|
runTime++;
|
||||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||||
|
|
||||||
|
// --- Pressure-velocity PIMPLE corrector loop
|
||||||
|
for (pimple.start(); pimple.loop(); pimple++)
|
||||||
|
{
|
||||||
#include "alphaEqn.H"
|
#include "alphaEqn.H"
|
||||||
|
|
||||||
#include "liftDragCoeffs.H"
|
#include "liftDragCoeffs.H"
|
||||||
@ -78,11 +85,11 @@ int main(int argc, char *argv[])
|
|||||||
#include "UEqns.H"
|
#include "UEqns.H"
|
||||||
|
|
||||||
// --- PISO loop
|
// --- PISO loop
|
||||||
for (int corr=0; corr<nCorr; corr++)
|
for (int corr=0; corr<pimple.nCorr(); corr++)
|
||||||
{
|
{
|
||||||
#include "pEqn.H"
|
#include "pEqn.H"
|
||||||
|
|
||||||
if (correctAlpha && corr<nCorr-1)
|
if (correctAlpha && !pimple.finalIter())
|
||||||
{
|
{
|
||||||
#include "alphaEqn.H"
|
#include "alphaEqn.H"
|
||||||
}
|
}
|
||||||
@ -90,7 +97,11 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
#include "DDtU.H"
|
#include "DDtU.H"
|
||||||
|
|
||||||
|
if (pimple.turbCorr())
|
||||||
|
{
|
||||||
#include "kEpsilon.H"
|
#include "kEpsilon.H"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#include "write.H"
|
#include "write.H"
|
||||||
|
|
||||||
|
|||||||
@ -21,7 +21,7 @@ solvers
|
|||||||
{
|
{
|
||||||
solver GAMG;
|
solver GAMG;
|
||||||
tolerance 1e-08;
|
tolerance 1e-08;
|
||||||
relTol 0;
|
relTol 0.1;
|
||||||
smoother DIC;
|
smoother DIC;
|
||||||
nPreSweeps 0;
|
nPreSweeps 0;
|
||||||
nPostSweeps 2;
|
nPostSweeps 2;
|
||||||
@ -32,7 +32,22 @@ solvers
|
|||||||
mergeLevels 1;
|
mergeLevels 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
"(Ua|Ub|Theta|k|epsilon)"
|
pFinal
|
||||||
|
{
|
||||||
|
$p;
|
||||||
|
tolerance 1e-08;
|
||||||
|
relTol 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
"(k|epsilon)"
|
||||||
|
{
|
||||||
|
solver PBiCG;
|
||||||
|
preconditioner DILU;
|
||||||
|
tolerance 1e-05;
|
||||||
|
relTol 0.1;
|
||||||
|
}
|
||||||
|
|
||||||
|
"(k|epsilon)Final"
|
||||||
{
|
{
|
||||||
solver PBiCG;
|
solver PBiCG;
|
||||||
preconditioner DILU;
|
preconditioner DILU;
|
||||||
@ -40,7 +55,15 @@ solvers
|
|||||||
relTol 0;
|
relTol 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
"(alpha|beta)"
|
alpha
|
||||||
|
{
|
||||||
|
solver PBiCG;
|
||||||
|
preconditioner DILU;
|
||||||
|
tolerance 1e-10;
|
||||||
|
relTol 0.1;
|
||||||
|
}
|
||||||
|
|
||||||
|
alphaFinal
|
||||||
{
|
{
|
||||||
solver PBiCG;
|
solver PBiCG;
|
||||||
preconditioner DILU;
|
preconditioner DILU;
|
||||||
@ -49,7 +72,7 @@ solvers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PISO
|
PIMPLE
|
||||||
{
|
{
|
||||||
nCorrectors 2;
|
nCorrectors 2;
|
||||||
nNonOrthogonalCorrectors 0;
|
nNonOrthogonalCorrectors 0;
|
||||||
|
|||||||
@ -21,7 +21,7 @@ solvers
|
|||||||
{
|
{
|
||||||
solver GAMG;
|
solver GAMG;
|
||||||
tolerance 1e-08;
|
tolerance 1e-08;
|
||||||
relTol 0;
|
relTol 0.1;
|
||||||
smoother DIC;
|
smoother DIC;
|
||||||
nPreSweeps 0;
|
nPreSweeps 0;
|
||||||
nPostSweeps 2;
|
nPostSweeps 2;
|
||||||
@ -32,7 +32,22 @@ solvers
|
|||||||
mergeLevels 1;
|
mergeLevels 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
"(Ua|Ub|Theta|k|epsilon)"
|
pFinal
|
||||||
|
{
|
||||||
|
$p;
|
||||||
|
tolerance 1e-08;
|
||||||
|
relTol 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
"(k|epsilon)"
|
||||||
|
{
|
||||||
|
solver PBiCG;
|
||||||
|
preconditioner DILU;
|
||||||
|
tolerance 1e-05;
|
||||||
|
relTol 0.1;
|
||||||
|
}
|
||||||
|
|
||||||
|
"(k|epsilon)Final"
|
||||||
{
|
{
|
||||||
solver PBiCG;
|
solver PBiCG;
|
||||||
preconditioner DILU;
|
preconditioner DILU;
|
||||||
@ -40,7 +55,15 @@ solvers
|
|||||||
relTol 0;
|
relTol 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
"(alpha|beta)"
|
alpha
|
||||||
|
{
|
||||||
|
solver PBiCG;
|
||||||
|
preconditioner DILU;
|
||||||
|
tolerance 1e-10;
|
||||||
|
relTol 0.1;
|
||||||
|
}
|
||||||
|
|
||||||
|
alphaFinal
|
||||||
{
|
{
|
||||||
solver PBiCG;
|
solver PBiCG;
|
||||||
preconditioner DILU;
|
preconditioner DILU;
|
||||||
@ -49,7 +72,7 @@ solvers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PISO
|
PIMPLE
|
||||||
{
|
{
|
||||||
nCorrectors 2;
|
nCorrectors 2;
|
||||||
nNonOrthogonalCorrectors 0;
|
nNonOrthogonalCorrectors 0;
|
||||||
@ -59,15 +82,5 @@ PISO
|
|||||||
pRefValue 0;
|
pRefValue 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
relaxationFactors
|
|
||||||
{
|
|
||||||
Ua 1;
|
|
||||||
Ub 1;
|
|
||||||
alpha 1;
|
|
||||||
beta 1;
|
|
||||||
Theta 1;
|
|
||||||
"(k|epsilon)" 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -21,7 +21,7 @@ solvers
|
|||||||
{
|
{
|
||||||
solver GAMG;
|
solver GAMG;
|
||||||
tolerance 1e-08;
|
tolerance 1e-08;
|
||||||
relTol 0;
|
relTol 0.1;
|
||||||
smoother DIC;
|
smoother DIC;
|
||||||
nPreSweeps 0;
|
nPreSweeps 0;
|
||||||
nPostSweeps 2;
|
nPostSweeps 2;
|
||||||
@ -32,7 +32,22 @@ solvers
|
|||||||
mergeLevels 1;
|
mergeLevels 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
"(Ua|Ub|Theta|k|epsilon)"
|
pFinal
|
||||||
|
{
|
||||||
|
$p;
|
||||||
|
tolerance 1e-08;
|
||||||
|
relTol 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
"(k|epsilon)"
|
||||||
|
{
|
||||||
|
solver PBiCG;
|
||||||
|
preconditioner DILU;
|
||||||
|
tolerance 1e-05;
|
||||||
|
relTol 0.1;
|
||||||
|
}
|
||||||
|
|
||||||
|
"(k|epsilon)Final"
|
||||||
{
|
{
|
||||||
solver PBiCG;
|
solver PBiCG;
|
||||||
preconditioner DILU;
|
preconditioner DILU;
|
||||||
@ -40,7 +55,15 @@ solvers
|
|||||||
relTol 0;
|
relTol 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
"(alpha|beta)"
|
alpha
|
||||||
|
{
|
||||||
|
solver PBiCG;
|
||||||
|
preconditioner DILU;
|
||||||
|
tolerance 1e-10;
|
||||||
|
relTol 0.1;
|
||||||
|
}
|
||||||
|
|
||||||
|
alphaFinal
|
||||||
{
|
{
|
||||||
solver PBiCG;
|
solver PBiCG;
|
||||||
preconditioner DILU;
|
preconditioner DILU;
|
||||||
@ -49,12 +72,12 @@ solvers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PISO
|
PIMPLE
|
||||||
{
|
{
|
||||||
nCorrectors 2;
|
nCorrectors 2;
|
||||||
nNonOrthogonalCorrectors 0;
|
nNonOrthogonalCorrectors 0;
|
||||||
nAlphaCorr 2;
|
nAlphaCorr 2;
|
||||||
correctAlpha no;
|
correctAlpha yes;
|
||||||
pRefCell 0;
|
pRefCell 0;
|
||||||
pRefValue 0;
|
pRefValue 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user