Merge branch 'master' of /home/noisy3/OpenFOAM/OpenFOAM-dev

This commit is contained in:
mattijs
2011-04-18 16:41:57 +01:00
70 changed files with 678 additions and 397 deletions

View File

@ -53,6 +53,18 @@ Description
PDR (porosity/distributed resistance) modelling is included to handle
regions containing blockages which cannot be resolved by the mesh.
The fields used by this solver are:
betav: Volume porosity
Lobs: Average diameter of obstacle in cell (m)
Aw: Obstacle surface area per unit volume (1/m)
CR: Drag tensor (1/m)
CT: Turbulence generation parameter (1/m)
Nv: Number of obstacles in cell per unit volume (m^-2)
nsv: Tensor whose diagonal indicates the number to substract from
Nv to get the number of obstacles crossing the flow in each
direction.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
@ -64,6 +76,7 @@ Description
#include "ignition.H"
#include "Switch.H"
#include "bound.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -81,6 +94,8 @@ int main(int argc, char *argv[])
#include "compressibleCourantNo.H"
#include "setInitialDeltaT.H"
pimpleControl pimple(mesh);
scalar StCoNum = 0.0;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -90,7 +105,6 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readTimeControls.H"
#include "readPISOControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
@ -98,26 +112,34 @@ int main(int argc, char *argv[])
Info<< "\n\nTime = " << runTime.timeName() << endl;
#include "rhoEqn.H"
#include "UEqn.H"
// --- PISO loop
for (int corr=1; corr<=nCorr; corr++)
// --- Pressure-velocity PIMPLE corrector loop
for (pimple.start(); pimple.loop(); pimple++)
{
#include "bEqn.H"
#include "ftEqn.H"
#include "huEqn.H"
#include "hEqn.H"
#include "UEqn.H"
if (!ign.ignited())
// --- PISO loop
for (int corr=1; corr<=pimple.nCorr(); corr++)
{
hu == h;
#include "bEqn.H"
#include "ftEqn.H"
#include "huEqn.H"
#include "hEqn.H"
if (!ign.ignited())
{
hu == h;
}
#include "pEqn.H"
}
#include "pEqn.H"
if (pimple.turbCorr())
{
turbulence->correct();
}
}
turbulence->correct();
runTime.write();
Info<< "\nExecutionTime = "

View File

@ -9,7 +9,7 @@
volSymmTensorField invA(inv(I*UEqn.A() + drag->Dcu()));
if (momentumPredictor)
if (pimple.momentumPredictor())
{
U = invA & (UEqn.H() - betav*fvc::grad(p));
U.correctBoundaryConditions();

View File

@ -3,7 +3,7 @@ rho = thermo.rho();
volScalarField rAU(1.0/UEqn.A());
U = invA & UEqn.H();
if (transonic)
if (pimple.transonic())
{
surfaceScalarField phid
(
@ -15,7 +15,7 @@ if (transonic)
)
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix pEqn
(
@ -24,9 +24,12 @@ if (transonic)
- fvm::laplacian(rho*invA, p)
);
pEqn.solve();
pEqn.solve
(
mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr)
if (nonOrth == pimple.nNonOrthCorr())
{
phi == pEqn.flux();
}
@ -41,7 +44,7 @@ else
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix pEqn
(
@ -50,9 +53,12 @@ else
- fvm::laplacian(rho*invA, p)
);
pEqn.solve();
pEqn.solve
(
mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr)
if (nonOrth == pimple.nNonOrthCorr())
{
phi += pEqn.flux();
}

View File

@ -88,10 +88,11 @@ int main(int argc, char *argv[])
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "rhoEqn.H"
// --- Pressure-velocity PIMPLE corrector loop
for (pimple.start(); pimple.loop(); pimple++)
{
#include "rhoEqn.H"
#include "UEqn.H"
#include "ftEqn.H"
@ -110,7 +111,10 @@ int main(int argc, char *argv[])
#include "pEqn.H"
}
turbulence->correct();
if (pimple.turbCorr())
{
turbulence->correct();
}
}
rho = thermo.rho();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -35,6 +35,7 @@ Description
#include "basicPsiThermo.H"
#include "turbulenceModel.H"
#include "OFstream.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -51,13 +52,14 @@ int main(int argc, char *argv[])
#include "setInitialDeltaT.H"
#include "startSummary.H"
pimpleControl pimple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
{
#include "readPISOControls.H"
#include "readEngineTimeControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
@ -71,16 +73,23 @@ int main(int argc, char *argv[])
#include "rhoEqn.H"
#include "UEqn.H"
// --- PISO loop
for (int corr=1; corr<=nCorr; corr++)
// --- Pressure-velocity PIMPLE corrector loop
for (pimple.start(); pimple.loop(); pimple++)
{
#include "hEqn.H"
#include "pEqn.H"
}
#include "UEqn.H"
turbulence->correct();
// --- PISO loop
for (int corr=1; corr<=pimple.nCorr(); corr++)
{
#include "hEqn.H"
#include "pEqn.H"
}
if (pimple.turbCorr())
{
turbulence->correct();
}
}
runTime.write();

View File

@ -79,10 +79,6 @@ int main(int argc, char *argv[])
Info<< "Crank angle = " << runTime.theta() << " CA-deg" << endl;
mesh.move();
const_cast<volPointInterpolation&>
(
volPointInterpolation::New(mesh)
).updateMesh();
dieselSpray.evolve();
@ -122,9 +118,12 @@ int main(int argc, char *argv[])
{
#include "pEqn.H"
}
}
turbulence->correct();
if (pimple.turbCorr())
{
turbulence->correct();
}
}
#include "logSummary.H"
#include "spraySummary.H"

View File

@ -101,6 +101,7 @@ int main(int argc, char *argv[])
#include "rhoEqn.H"
// --- Pressure-velocity PIMPLE corrector loop
for (pimple.start(); pimple.loop(); pimple++)
{
#include "UEqn.H"
@ -112,9 +113,12 @@ int main(int argc, char *argv[])
{
#include "pEqn.H"
}
}
turbulence->correct();
if (pimple.turbCorr())
{
turbulence->correct();
}
}
#include "spraySummary.H"

View File

@ -5,7 +5,7 @@
+ turbulence->divDevRhoReff(U)
);
if (momentumPredictor)
if (pimple.momentumPredictor())
{
solve(UEqn == -fvc::grad(p));
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -58,6 +58,7 @@ Description
#include "Switch.H"
#include "OFstream.H"
#include "mathematicalConstants.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -75,13 +76,14 @@ int main(int argc, char *argv[])
#include "setInitialDeltaT.H"
#include "startSummary.H"
pimpleControl pimple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
{
#include "readPISOControls.H"
#include "readEngineTimeControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
@ -94,11 +96,11 @@ int main(int argc, char *argv[])
#include "rhoEqn.H"
#include "UEqn.H"
// --- PISO loop
for (int corr=1; corr<=nCorr; corr++)
// --- Pressure-velocity PIMPLE corrector loop
for (pimple.start(); pimple.loop(); pimple++)
{
#include "UEqn.H"
#include "ftEqn.H"
#include "bEqn.H"
#include "huEqn.H"
@ -109,10 +111,17 @@ int main(int argc, char *argv[])
hu == h;
}
#include "pEqn.H"
}
// --- PISO loop
for (int corr=1; corr<=pimple.nCorr(); corr++)
{
#include "pEqn.H"
}
turbulence->correct();
if (pimple.turbCorr())
{
turbulence->correct();
}
}
#include "logSummary.H"

View File

@ -3,7 +3,7 @@ rho = thermo.rho();
volScalarField rAU(1.0/UEqn.A());
U = rAU*UEqn.H();
if (transonic)
if (pimple.transonic())
{
surfaceScalarField phid
(
@ -12,18 +12,21 @@ if (transonic)
*((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U))
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix pEqn
(
fvm::ddt(psi, p)
+ fvm::div(phid, p, "div(phid,p)")
+ fvm::div(phid, p)
- fvm::laplacian(rho*rAU, p)
);
pEqn.solve();
pEqn.solve
(
mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr)
if (nonOrth == pimple.nNonOrthCorr())
{
phi == pEqn.flux();
}
@ -34,7 +37,7 @@ else
phi = fvc::interpolate(rho)
*((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U));
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix pEqn
(
@ -43,9 +46,12 @@ else
- fvm::laplacian(rho*rAU, p)
);
pEqn.solve();
pEqn.solve
(
mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr)
if (nonOrth == pimple.nNonOrthCorr())
{
phi += pEqn.flux();
}

View File

@ -81,9 +81,12 @@ int main(int argc, char *argv[])
{
#include "pEqn.H"
}
}
turbulence->correct();
if (pimple.turbCorr())
{
turbulence->correct();
}
}
rho = thermo.rho();

View File

@ -81,9 +81,12 @@ int main(int argc, char *argv[])
{
#include "pEqn.H"
}
}
turbulence->correct();
if (pimple.turbCorr())
{
turbulence->correct();
}
}
if (runTime.write())
{

View File

@ -83,9 +83,12 @@ int main(int argc, char *argv[])
{
#include "pEqn.H"
}
}
turbulence->correct();
if (pimple.turbCorr())
{
turbulence->correct();
}
}
rho = thermo.rho();

View File

@ -83,7 +83,10 @@ int main(int argc, char *argv[])
#include "pEqn.H"
}
turbulence->correct();
if (pimple.turbCorr())
{
turbulence->correct();
}
}
runTime.write();

View File

@ -88,7 +88,10 @@ int main(int argc, char *argv[])
#include "pEqn.H"
}
turbulence->correct();
if (pimple.turbCorr())
{
turbulence->correct();
}
}
runTime.write();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -34,10 +34,11 @@ Description
int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
# include "setRootCase.H"
# include "createTime.H"
# include "createMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nReading field U\n" << endl;
volVectorField U
@ -57,9 +58,9 @@ int main(int argc, char *argv[])
moleculeCloud molecules(mesh, pot);
# include "temperatureAndPressureVariables.H"
#include "temperatureAndPressureVariables.H"
# include "readmdEquilibrationDict.H"
#include "readmdEquilibrationDict.H"
label nAveragingSteps = 0;
@ -67,18 +68,17 @@ int main(int argc, char *argv[])
while (runTime.loop())
{
nAveragingSteps++;
Info<< "Time = " << runTime.timeName() << endl;
molecules.evolve();
# include "meanMomentumEnergyAndNMols.H"
#include "meanMomentumEnergyAndNMols.H"
# include "temperatureAndPressure.H"
#include "temperatureAndPressure.H"
# include "temperatureEquilibration.H"
#include "temperatureEquilibration.H"
runTime.write();
@ -96,3 +96,6 @@ int main(int argc, char *argv[])
return 0;
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -34,10 +34,11 @@ Description
int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
# include "setRootCase.H"
# include "createTime.H"
# include "createMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nReading field U\n" << endl;
volVectorField U
@ -57,7 +58,7 @@ int main(int argc, char *argv[])
moleculeCloud molecules(mesh, pot);
# include "temperatureAndPressureVariables.H"
#include "temperatureAndPressureVariables.H"
label nAveragingSteps = 0;
@ -65,16 +66,15 @@ int main(int argc, char *argv[])
while (runTime.loop())
{
nAveragingSteps++;
Info<< "Time = " << runTime.timeName() << endl;
molecules.evolve();
# include "meanMomentumEnergyAndNMols.H"
#include "meanMomentumEnergyAndNMols.H"
# include "temperatureAndPressure.H"
#include "temperatureAndPressure.H"
runTime.write();
@ -92,3 +92,6 @@ int main(int argc, char *argv[])
return 0;
}
// ************************************************************************* //

View File

@ -95,7 +95,10 @@ int main(int argc, char *argv[])
#include "pEqn.H"
}
turbulence->correct();
if (pimple.turbCorr())
{
turbulence->correct();
}
}
runTime.write();

View File

@ -88,11 +88,14 @@ int main(int argc, char *argv[])
#include "pEqn.H"
}
turbulence->correct();
rho = thermo.rho();
if (pimple.turbCorr())
{
turbulence->correct();
}
}
rho = thermo.rho();
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"

View File

@ -101,7 +101,10 @@ int main(int argc, char *argv[])
#include "pEqn.H"
}
turbulence->correct();
if (pimple.turbCorr())
{
turbulence->correct();
}
}
runTime.write();

View File

@ -79,7 +79,10 @@ int main(int argc, char *argv[])
#include "pEqn.H"
}
turbulence->correct();
if (pimple.turbCorr())
{
turbulence->correct();
}
}
runTime.write();

View File

@ -57,6 +57,7 @@ int main(int argc, char *argv[])
#include "CourantNo.H"
// --- Pressure-velocity PIMPLE corrector loop
for (pimple.start(); pimple.loop(); pimple++)
{
surfaceScalarField phiv("phiv", phi/fvc::interpolate(h));

View File

@ -103,9 +103,12 @@ int main(int argc, char *argv[])
{
#include "pEqn.H"
}
}
turbulence->correct();
if (pimple.turbCorr())
{
turbulence->correct();
}
}
rho = thermo.rho();

View File

@ -12,7 +12,7 @@
pZones.addResistance(UEqn);
if (momentumPredictor)
if (pimple.momentumPredictor())
{
solve(UEqn == -fvc::grad(p));
}

View File

@ -32,7 +32,7 @@
+ massSource.SuTot()
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix pEqn
(
@ -42,17 +42,10 @@
pEqn.solve
(
mesh.solver
(
p.select
(
corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr)
if (nonOrth == pimple.nNonOrthCorr())
{
phi += pEqn.flux();
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -49,6 +49,7 @@ Description
#include "porousZones.H"
#include "timeActivatedExplicitSource.H"
#include "SLGThermo.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -70,6 +71,8 @@ int main(int argc, char *argv[])
#include "compressibleCourantNo.H"
#include "setInitialDeltaT.H"
pimpleControl pimple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
@ -77,7 +80,6 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readTimeControls.H"
#include "readPISOControls.H"
#include "readAdditionalSolutionControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
@ -90,17 +92,25 @@ int main(int argc, char *argv[])
#include "chemistry.H"
#include "rhoEqn.H"
#include "UEqn.H"
#include "YEqn.H"
#include "hsEqn.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
// --- Pressure-velocity PIMPLE corrector loop
for (pimple.start(); pimple.loop(); pimple++)
{
#include "pEqn.H"
}
#include "UEqn.H"
#include "YEqn.H"
#include "hsEqn.H"
turbulence->correct();
// --- PISO loop
for (int corr=0; corr<pimple.nCorr(); corr++)
{
#include "pEqn.H"
}
if (pimple.turbCorr())
{
turbulence->correct();
}
}
rho = thermo.rho();

View File

@ -98,9 +98,12 @@ int main(int argc, char *argv[])
{
#include "pEqn.H"
}
}
turbulence->correct();
if (pimple.turbCorr())
{
turbulence->correct();
}
}
rho = thermo.rho();

View File

@ -92,11 +92,14 @@ int main(int argc, char *argv[])
#include "pEqn.H"
}
turbulence->correct();
rho = thermo.rho();
if (pimple.turbCorr())
{
turbulence->correct();
}
}
rho = thermo.rho();
if (runTime.write())
{
chemistry.dQ()().write();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -34,6 +34,7 @@ Description
#include "nearWallDist.H"
#include "wallFvPatch.H"
#include "Switch.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -47,6 +48,8 @@ int main(int argc, char *argv[])
#include "createFields.H"
#include "initContinuityErrs.H"
pimpleControl pimple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
@ -58,26 +61,32 @@ int main(int argc, char *argv[])
#include "readBubbleFoamControls.H"
#include "CourantNo.H"
#include "alphaEqn.H"
#include "liftDragCoeffs.H"
#include "UEqns.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
// --- Pressure-velocity PIMPLE corrector loop
for (pimple.start(); pimple.loop(); pimple++)
{
#include "pEqn.H"
#include "alphaEqn.H"
#include "liftDragCoeffs.H"
#include "UEqns.H"
if (correctAlpha)
// --- PISO loop
for (int corr=0; corr<pimple.nCorr(); corr++)
{
#include "alphaEqn.H"
#include "pEqn.H"
if (correctAlpha)
{
#include "alphaEqn.H"
}
}
#include "DDtU.H"
if (pimple.turbCorr())
{
#include "kEpsilon.H"
}
}
#include "DDtU.H"
#include "kEpsilon.H"
#include "write.H"
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"

View File

@ -192,4 +192,4 @@
label pRefCell = 0;
scalar pRefValue = 0.0;
setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue);
setRefCell(p, mesh.solutionDict().subDict("PIMPLE"), pRefCell, pRefValue);

View File

@ -42,7 +42,7 @@
alphaf*rUaAf/rhoa + betaf*rUbAf/rhob
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix pEqn
(
@ -50,9 +50,13 @@
);
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);

View File

@ -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"));

View File

@ -78,9 +78,12 @@ int main(int argc, char *argv[])
{
#include "pEqn.H"
}
}
turbulence->correct();
if (pimple.turbCorr())
{
turbulence->correct();
}
}
runTime.write();

View File

@ -88,12 +88,15 @@ int main(int argc, char *argv[])
{
#include "pEqn.H"
}
if (pimple.turbCorr())
{
turbulence->correct();
}
}
rho = alpha1*rho1 + alpha2*rho2;
turbulence->correct();
runTime.write();
Info<< "ExecutionTime = "

View File

@ -93,9 +93,12 @@ int main(int argc, char *argv[])
{
#include "pEqn.H"
}
}
turbulence->correct();
if (pimple.turbCorr())
{
turbulence->correct();
}
}
runTime.write();

View File

@ -118,9 +118,12 @@ int main(int argc, char *argv[])
{
#include "pEqn.H"
}
}
turbulence->correct();
if (pimple.turbCorr())
{
turbulence->correct();
}
}
runTime.write();

View File

@ -93,9 +93,12 @@ int main(int argc, char *argv[])
{
#include "pEqn.H"
}
}
turbulence->correct();
if (pimple.turbCorr())
{
turbulence->correct();
}
}
runTime.write();

View File

@ -94,9 +94,12 @@ int main(int argc, char *argv[])
{
#include "pEqn.H"
}
}
turbulence->correct();
if (pimple.turbCorr())
{
turbulence->correct();
}
}
runTime.write();

View File

@ -87,12 +87,15 @@ int main(int argc, char *argv[])
{
#include "pEqn.H"
}
if (pimple.turbCorr())
{
turbulence->correct();
}
}
#include "continuityErrs.H"
turbulence->correct();
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"

View File

@ -85,9 +85,12 @@ int main(int argc, char *argv[])
{
#include "pEqn.H"
}
}
turbulence->correct();
if (pimple.turbCorr())
{
turbulence->correct();
}
}
runTime.write();

View File

@ -82,9 +82,12 @@ int main(int argc, char *argv[])
{
#include "pEqn.H"
}
}
turbulence->correct();
if (pimple.turbCorr())
{
turbulence->correct();
}
}
runTime.write();

View File

@ -81,7 +81,10 @@ int main(int argc, char *argv[])
#include "pEqn.H"
}
#include "kEpsilon.H"
if (pimple.turbCorr())
{
#include "kEpsilon.H"
}
}
runTime.write();

View File

@ -81,7 +81,10 @@ int main(int argc, char *argv[])
#include "pEqn.H"
}
turbulence->correct();
if (pimple.turbCorr())
{
turbulence->correct();
}
}
runTime.write();

View File

@ -234,4 +234,4 @@
label pRefCell = 0;
scalar pRefValue = 0.0;
setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue);
setRefCell(p, mesh.solutionDict().subDict("PIMPLE"), pRefCell, pRefValue);

View File

@ -58,7 +58,7 @@
alphaf*rUaAf/rhoa + betaf*rUbAf/rhob
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix pEqn
(
@ -66,9 +66,13 @@
);
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);

View File

@ -10,27 +10,12 @@
)
);
scalar preAlphaExp
(
readScalar(ppProperties.lookup("preAlphaExp"))
);
scalar preAlphaExp(readScalar(ppProperties.lookup("preAlphaExp")));
scalar alphaMax
(
readScalar(ppProperties.lookup("alphaMax"))
);
scalar alphaMax(readScalar(ppProperties.lookup("alphaMax")));
scalar expMax
(
readScalar(ppProperties.lookup("expMax"))
);
scalar expMax(readScalar(ppProperties.lookup("expMax")));
dimensionedScalar g0
(
ppProperties.lookup("g0")
);
dimensionedScalar g0(ppProperties.lookup("g0"));
Switch packingLimiter
(
ppProperties.lookup("packingLimiter")
);
Switch packingLimiter(ppProperties.lookup("packingLimiter"));

View File

@ -1,6 +1,5 @@
#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"));

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -42,6 +42,8 @@ Description
#include "phaseModel.H"
#include "kineticTheoryModel.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
@ -58,6 +60,8 @@ int main(int argc, char *argv[])
#include "CourantNo.H"
#include "setInitialDeltaT.H"
pimpleControl pimple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
@ -71,27 +75,34 @@ int main(int argc, char *argv[])
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "alphaEqn.H"
#include "liftDragCoeffs.H"
#include "UEqns.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
// --- Pressure-velocity PIMPLE corrector loop
for (pimple.start(); pimple.loop(); pimple++)
{
#include "pEqn.H"
#include "alphaEqn.H"
if (correctAlpha && corr<nCorr-1)
#include "liftDragCoeffs.H"
#include "UEqns.H"
// --- PISO loop
for (int corr=0; corr<pimple.nCorr(); corr++)
{
#include "alphaEqn.H"
#include "pEqn.H"
if (correctAlpha && !pimple.finalIter())
{
#include "alphaEqn.H"
}
}
#include "DDtU.H"
if (pimple.turbCorr())
{
#include "kEpsilon.H"
}
}
#include "DDtU.H"
#include "kEpsilon.H"
#include "write.H"
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"

View File

@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "pimpleControl.H"
#include "Switch.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -43,6 +44,8 @@ void Foam::pimpleControl::read()
const dictionary& pimpleDict = dict();
nOuterCorr_ = pimpleDict.lookupOrDefault<label>("nOuterCorrectors", 1);
nCorr_ = pimpleDict.lookupOrDefault<label>("nCorrectors", 1);
turbOnFinalIterOnly_ =
pimpleDict.lookupOrDefault<Switch>("turbOnFinalIterOnly", true);
}
@ -118,7 +121,8 @@ Foam::pimpleControl::pimpleControl(fvMesh& mesh)
solutionControl(mesh, "PIMPLE"),
nOuterCorr_(0),
nCorr_(0),
corr_(0)
corr_(0),
turbOnFinalIterOnly_(true)
{
read();

View File

@ -63,6 +63,9 @@ protected:
//- Current PIMPLE corrector
label corr_;
//- Flag to indicate whether to only solve turbulence on final iter
bool turbOnFinalIterOnly_;
// Protected Member Functions
@ -130,6 +133,9 @@ public:
const label nonOrth
) const;
//- Helper function to identify whether to solve for turbulence
inline bool turbCorr() const;
// Member Operators

View File

@ -110,6 +110,12 @@ inline bool Foam::pimpleControl::finalInnerIter
}
inline bool Foam::pimpleControl::turbCorr() const
{
return !turbOnFinalIterOnly_ || finalIter();
}
inline void Foam::pimpleControl::operator++(int)
{
if (finalIter())

View File

@ -55,7 +55,7 @@ Foam::C3H6O::C3H6O()
1.9774e+4
),
rho_(71.426784, 0.2576, 508.2, 0.29903),
pv_(70.72, -5.685, -7.351, 6.3e-06, 2.0),
pv_(70.72, -5685, -7.351, 6.3e-06, 2.0),
hl_(508.20, 846590.909090909, 1.036, -1.294, 0.672, 0.0),
Cp_
(

View File

@ -22,6 +22,13 @@ solvers
solver PCG;
preconditioner DIC;
tolerance 1e-05;
relTol 0.1;
};
rhoFinal
{
$rho;
tolerance 1e-05;
relTol 0;
};
@ -30,10 +37,25 @@ solvers
solver PCG;
preconditioner DIC;
tolerance 1e-6;
relTol 0.1;
};
pFinal
{
$p;
tolerance 1e-6;
relTol 0;
};
"(U|ft|fu|b|Xi|Su|h|hu|R|k|epsilon)"
"(b|Xi|ft|h|hu|k|epsilon)"
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-05;
relTol 0.1;
}
"(b|Xi|ft|h|hu|k|epsilon)Final"
{
solver PBiCG;
preconditioner DILU;
@ -42,7 +64,7 @@ solvers
}
}
PISO
PIMPLE
{
nCorrectors 2;
nNonOrthogonalCorrectors 0;

View File

@ -32,15 +32,7 @@ solvers
relTol 0;
}
"(Yi|k|epsilon)"
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-06;
relTol 0;
}
"(U|hs)"
"(k|epsilon)"
{
solver PBiCG;
preconditioner DILU;
@ -48,12 +40,32 @@ solvers
relTol 0.1;
}
"(U|hs)Final"
"(k|epsilon)Final"
{
$k;
tolerance 1e-06;
relTol 0;
}
"(U|hs)"
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-06;
relTol 0.1;
}
"(U|hs)Final"
{
$U;
tolerance 1e-06;
relTol 0;
}
Yi
{
$hsFinal;
}
}
PIMPLE

View File

@ -22,26 +22,47 @@ solvers
solver PCG;
preconditioner DIC;
tolerance 1e-06;
relTol 0.1;
}
pFinal
{
$p;
tolerance 1e-06;
relTol 0;
}
rho
{
$p;
solver PCG;
preconditioner DIC;
tolerance 1e-05;
relTol 0.1;
}
rhoFinal
{
$rho;
tolerance 1e-05;
relTol 0;
}
"(U|ft|fu|b|Xi|Su|h|hu|R|k|epsilon)"
"(U|ft|h|k|epsilon)"
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-05;
relTol 0.1;
}
"(U|ft|h|k|epsilon)Final"
{
$U;
tolerance 1e-05;
relTol 0;
}
}
PISO
PIMPLE
{
nCorrectors 2;
nNonOrthogonalCorrectors 1;

View File

@ -47,7 +47,15 @@ solvers
relTol 0.0;
}
"(U|hs)"
"(U|hs||k|epsilon)"
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-06;
relTol 0.1;
}
"(U|hs||k|epsilon)Final"
{
solver PBiCG;
preconditioner DILU;
@ -55,20 +63,9 @@ solvers
relTol 0;
}
"(U|hs)Final"
Yi
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-06;
relTol 0;
}
"(Yi|k|epsilon)"
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-06;
relTol 0;
$hsFinal;
}
}

View File

@ -17,11 +17,18 @@ FoamFile
solvers
{
"(rho|G)"
rho
{
solver PCG;
preconditioner DIC;
tolerance 1e-05;
relTol 0.1;
}
rhoFinal
{
$rho;
tolerance 1e-05;
relTol 0;
}
@ -29,7 +36,14 @@ solvers
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-05;
tolerance 1e-06;
relTol 0.1;
}
"(U|hs|k|epsilon)Final"
{
$U;
tolerance 1e-06;
relTol 0;
}
@ -56,14 +70,11 @@ solvers
"(Yi|O2|N2|H2O)"
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-06;
relTol 0;
$hsFinal;
}
}
PISO
PIMPLE
{
transonic no;
nOuterCorrectors 1;

View File

@ -17,55 +17,64 @@ FoamFile
solvers
{
p
{
solver GAMG;
tolerance 0;
relTol 0.01;
smoother DICGaussSeidel;
nPreSweeps 0;
nPostSweeps 2;
cacheAgglomeration true;
nCellsInCoarsestLevel 10;
agglomerator faceAreaPair;
mergeLevels 1;
maxIter 20;
};
pFinal
{
$p
tolerance 1e-6;
relTol 0;
};
"(rho|G)"
rho
{
solver PCG;
preconditioner DIC;
tolerance 1e-06;
tolerance 1e-05;
relTol 0.1;
}
rhoFinal
{
$rho;
tolerance 1e-05;
relTol 0;
};
"(Yi|hs)"
}
"(U|hs|k|epsilon)"
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-06;
relTol 0;
};
"(U|k|omega)"
tolerance 1e-05;
relTol 0.1;
}
"(U|hs|k|epsilon)Final"
{
solver smoothSolver;
$U;
tolerance 1e-05;
relTol 0;
}
p
{
solver GAMG;
tolerance 0;
relTol 0.1;
smoother GaussSeidel;
nPreSweeps 0;
nPostSweeps 2;
cacheAgglomeration true;
nCellsInCoarsestLevel 10;
agglomerator faceAreaPair;
mergeLevels 1;
}
pFinal
{
$p;
tolerance 1e-06;
relTol 0;
};
}
"(Yi|O2|N2|H2O)"
{
$hsFinal;
}
}
PISO
PIMPLE
{
nCorrectors 2;
nNonOrthogonalCorrectors 0;

View File

@ -17,57 +17,64 @@ FoamFile
solvers
{
p
{
solver GAMG;
tolerance 0;
relTol 0.01;
smoother DICGaussSeidel;
nPreSweeps 0;
nPostSweeps 2;
cacheAgglomeration true;
nCellsInCoarsestLevel 10;
agglomerator faceAreaPair;
mergeLevels 1;
maxIter 50;
};
pFinal
{
$p
tolerance 1e-6;
relTol 0;
};
"(rho|G)"
rho
{
solver PCG;
preconditioner DIC;
maxIter 200;
tolerance 1e-06;
tolerance 1e-05;
relTol 0.1;
}
rhoFinal
{
$rho;
tolerance 1e-05;
relTol 0;
};
"(Yi|hs)"
}
"(U|hs|k|omega)"
{
solver PBiCG;
preconditioner DILU;
maxIter 200;
tolerance 1e-06;
relTol 0;
};
"(U|k|omega)"
relTol 0.1;
}
"(U|hs|k|omega)Final"
{
solver smoothSolver;
smoother GaussSeidel;
maxIter 200;
$U;
tolerance 1e-06;
relTol 0;
};
}
p
{
solver GAMG;
tolerance 0;
relTol 0.1;
smoother GaussSeidel;
nPreSweeps 0;
nPostSweeps 2;
cacheAgglomeration true;
nCellsInCoarsestLevel 10;
agglomerator faceAreaPair;
mergeLevels 1;
}
pFinal
{
$p;
tolerance 1e-06;
relTol 0;
}
"(Yi|O2|N2|H2O)"
{
$hsFinal;
}
}
PISO
PIMPLE
{
nCorrectors 3;
nNonOrthogonalCorrectors 0;

View File

@ -32,7 +32,7 @@ solvers
relTol 0;
}
"(U|hs)"
"(U|hs|k|epsilon)"
{
solver PBiCG;
preconditioner DILU;
@ -40,18 +40,13 @@ solvers
relTol 0.1;
}
"(U|hs)Final"
"(U|hs|k|epsilon)Final"
{
$U;
relTol 0;
tolerance 1e-05;
}
"(k|epsilon)"
{
$UFinal;
}
p_rgh
{
solver GAMG;

View File

@ -22,27 +22,33 @@ solvers
solver PCG;
preconditioner DIC;
tolerance 1e-10;
relTol 0.1;
}
pFinal
{
$p;
tolerance 1e-10;
relTol 0;
}
"(Ua|Ub|k|epsilon)"
alpha
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-05;
relTol 0;
tolerance 1e-10;
relTol 0.1;
}
"(alpha|beta)"
alphaFinal
{
solver PBiCG;
preconditioner DILU;
$alpha;
tolerance 1e-10;
relTol 0;
}
}
PISO
PIMPLE
{
nCorrectors 2;
nNonOrthogonalCorrectors 0;

View File

@ -55,15 +55,7 @@ solvers
relTol 0;
}
"(k|omega)"
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-08;
relTol 0;
}
U
"(U|k|omega)"
{
solver PBiCG;
preconditioner DILU;
@ -71,7 +63,7 @@ solvers
relTol 0.1;
}
UFinal
"(U|k|omega)Final"
{
solver PBiCG;
preconditioner DILU;

View File

@ -53,7 +53,7 @@ solvers
relTol 0;
}
U
"(U|k|omega)"
{
solver PBiCG;
preconditioner DILU;
@ -61,20 +61,12 @@ solvers
relTol 0.1;
}
UFinal
"(U|k|omega)Final"
{
$U;
tolerance 1e-08;
relTol 0;
}
"(k|omega)"
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-08;
relTol 0;
}
}
PIMPLE

View File

@ -55,15 +55,7 @@ solvers
relTol 0;
}
"(k|omega)"
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-08;
relTol 0;
}
U
"(U|k|omega)"
{
solver PBiCG;
preconditioner DILU;
@ -71,7 +63,7 @@ solvers
relTol 0.1;
}
UFinal
"(U|k|omega)Final"
{
solver PBiCG;
preconditioner DILU;

View File

@ -91,7 +91,16 @@ solvers
maxIter 20;
}
U
"(U|k|epsilon)"
{
solver smoothSolver;
smoother GaussSeidel;
tolerance 1e-6;
relTol 0.1;
nSweeps 1;
}
"(U|k|epsilon)Final"
{
solver smoothSolver;
smoother GaussSeidel;
@ -99,14 +108,6 @@ solvers
relTol 0;
nSweeps 1;
}
"(k|epsilon|omega|R|nuTilda)"
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-8;
relTol 0;
}
}
PIMPLE

View File

@ -77,16 +77,16 @@ solvers
maxIter 20;
}
U
"(U|k)"
{
solver smoothSolver;
smoother GaussSeidel;
tolerance 1e-06;
relTol 0;
relTol 0.1;
nSweeps 1;
}
"(k|B|nuTilda)"
"(U|k)Final"
{
solver PBiCG;
preconditioner DILU;

View File

@ -41,7 +41,7 @@ solvers
relTol 0;
}
U
"(U|k|epsilon)"
{
solver PBiCG;
preconditioner DILU;
@ -49,7 +49,7 @@ solvers
relTol 0;
}
"(k|epsilon|R|nuTilda)"
"(U|k|epsilon)Final"
{
solver PBiCG;
preconditioner DILU;

View File

@ -21,7 +21,7 @@ solvers
{
solver GAMG;
tolerance 1e-08;
relTol 0;
relTol 0.1;
smoother DIC;
nPreSweeps 0;
nPostSweeps 2;
@ -32,7 +32,22 @@ solvers
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;
preconditioner DILU;
@ -40,7 +55,15 @@ solvers
relTol 0;
}
"(alpha|beta)"
alpha
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-10;
relTol 0.1;
}
alphaFinal
{
solver PBiCG;
preconditioner DILU;
@ -49,7 +72,7 @@ solvers
}
}
PISO
PIMPLE
{
nCorrectors 2;
nNonOrthogonalCorrectors 0;

View File

@ -21,7 +21,7 @@ solvers
{
solver GAMG;
tolerance 1e-08;
relTol 0;
relTol 0.1;
smoother DIC;
nPreSweeps 0;
nPostSweeps 2;
@ -32,7 +32,22 @@ solvers
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;
preconditioner DILU;
@ -40,7 +55,15 @@ solvers
relTol 0;
}
"(alpha|beta)"
alpha
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-10;
relTol 0.1;
}
alphaFinal
{
solver PBiCG;
preconditioner DILU;
@ -49,7 +72,7 @@ solvers
}
}
PISO
PIMPLE
{
nCorrectors 2;
nNonOrthogonalCorrectors 0;
@ -59,15 +82,5 @@ PISO
pRefValue 0;
}
relaxationFactors
{
Ua 1;
Ub 1;
alpha 1;
beta 1;
Theta 1;
"(k|epsilon)" 1;
}
// ************************************************************************* //

View File

@ -21,7 +21,7 @@ solvers
{
solver GAMG;
tolerance 1e-08;
relTol 0;
relTol 0.1;
smoother DIC;
nPreSweeps 0;
nPostSweeps 2;
@ -32,7 +32,22 @@ solvers
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;
preconditioner DILU;
@ -40,7 +55,15 @@ solvers
relTol 0;
}
"(alpha|beta)"
alpha
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-10;
relTol 0.1;
}
alphaFinal
{
solver PBiCG;
preconditioner DILU;
@ -49,12 +72,12 @@ solvers
}
}
PISO
PIMPLE
{
nCorrectors 2;
nNonOrthogonalCorrectors 0;
nAlphaCorr 2;
correctAlpha no;
correctAlpha yes;
pRefCell 0;
pRefValue 0;
}