mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Updated bubbleFoam solver and tutorial
This commit is contained in:
@ -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
|
||||||
@ -34,6 +34,7 @@ Description
|
|||||||
#include "nearWallDist.H"
|
#include "nearWallDist.H"
|
||||||
#include "wallFvPatch.H"
|
#include "wallFvPatch.H"
|
||||||
#include "Switch.H"
|
#include "Switch.H"
|
||||||
|
#include "pimpleControl.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -47,6 +48,8 @@ int main(int argc, char *argv[])
|
|||||||
#include "createFields.H"
|
#include "createFields.H"
|
||||||
#include "initContinuityErrs.H"
|
#include "initContinuityErrs.H"
|
||||||
|
|
||||||
|
pimpleControl pimple(mesh);
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Info<< "\nStarting time loop\n" << endl;
|
Info<< "\nStarting time loop\n" << endl;
|
||||||
@ -58,13 +61,15 @@ int main(int argc, char *argv[])
|
|||||||
#include "readBubbleFoamControls.H"
|
#include "readBubbleFoamControls.H"
|
||||||
#include "CourantNo.H"
|
#include "CourantNo.H"
|
||||||
|
|
||||||
|
// --- Pressure-velocity PIMPLE corrector loop
|
||||||
|
for (pimple.start(); pimple.loop(); pimple++)
|
||||||
|
{
|
||||||
#include "alphaEqn.H"
|
#include "alphaEqn.H"
|
||||||
#include "liftDragCoeffs.H"
|
#include "liftDragCoeffs.H"
|
||||||
#include "UEqns.H"
|
#include "UEqns.H"
|
||||||
|
|
||||||
// --- PISO loop
|
// --- PISO loop
|
||||||
|
for (int corr=0; corr<pimple.nCorr(); corr++)
|
||||||
for (int corr=0; corr<nCorr; corr++)
|
|
||||||
{
|
{
|
||||||
#include "pEqn.H"
|
#include "pEqn.H"
|
||||||
|
|
||||||
@ -76,7 +81,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"
|
||||||
|
|
||||||
|
|||||||
@ -192,4 +192,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);
|
||||||
|
|||||||
@ -42,7 +42,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
|
||||||
(
|
(
|
||||||
@ -50,9 +50,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);
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
#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"));
|
||||||
|
|||||||
@ -22,27 +22,33 @@ solvers
|
|||||||
solver PCG;
|
solver PCG;
|
||||||
preconditioner DIC;
|
preconditioner DIC;
|
||||||
tolerance 1e-10;
|
tolerance 1e-10;
|
||||||
|
relTol 0.1;
|
||||||
|
}
|
||||||
|
|
||||||
|
pFinal
|
||||||
|
{
|
||||||
|
$p;
|
||||||
|
tolerance 1e-10;
|
||||||
relTol 0;
|
relTol 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
"(Ua|Ub|k|epsilon)"
|
alpha
|
||||||
{
|
{
|
||||||
solver PBiCG;
|
solver PBiCG;
|
||||||
preconditioner DILU;
|
preconditioner DILU;
|
||||||
tolerance 1e-05;
|
tolerance 1e-10;
|
||||||
relTol 0;
|
relTol 0.1;
|
||||||
}
|
}
|
||||||
|
|
||||||
"(alpha|beta)"
|
alphaFinal
|
||||||
{
|
{
|
||||||
solver PBiCG;
|
$alpha;
|
||||||
preconditioner DILU;
|
|
||||||
tolerance 1e-10;
|
tolerance 1e-10;
|
||||||
relTol 0;
|
relTol 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PISO
|
PIMPLE
|
||||||
{
|
{
|
||||||
nCorrectors 2;
|
nCorrectors 2;
|
||||||
nNonOrthogonalCorrectors 0;
|
nNonOrthogonalCorrectors 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user