Merge branch 'master' into cvm

Conflicts:
	tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/system/extrudeToRegionMeshDict
	tutorials/lagrangian/reactingParcelFilmFoam/panel/system/extrudeToRegionMeshDict
This commit is contained in:
graham
2011-04-21 12:02:49 +01:00
779 changed files with 53481 additions and 57675 deletions

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) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -30,6 +30,7 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "fvCFD.H" #include "fvCFD.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -41,17 +42,17 @@ int main(int argc, char *argv[])
#include "createMesh.H" #include "createMesh.H"
#include "createFields.H" #include "createFields.H"
simpleControl simple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nCalculating temperature distribution\n" << endl; Info<< "\nCalculating temperature distribution\n" << endl;
while (runTime.loop()) while (simple.loop())
{ {
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readSIMPLEControls.H" for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{ {
solve solve
( (

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) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -30,32 +30,30 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "fvCFD.H" #include "fvCFD.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
# include "setRootCase.H" simpleControl simple(mesh);
# include "createTime.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
# include "createMesh.H"
# include "createFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nCalculating scalar transport\n" << endl; Info<< "\nCalculating scalar transport\n" << endl;
# include "CourantNo.H" #include "CourantNo.H"
while (runTime.loop()) while (simple.loop())
{ {
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
# include "readSIMPLEControls.H" for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{ {
solve solve
( (

View File

@ -53,6 +53,18 @@ Description
PDR (porosity/distributed resistance) modelling is included to handle PDR (porosity/distributed resistance) modelling is included to handle
regions containing blockages which cannot be resolved by the mesh. 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" #include "fvCFD.H"
@ -64,6 +76,7 @@ Description
#include "ignition.H" #include "ignition.H"
#include "Switch.H" #include "Switch.H"
#include "bound.H" #include "bound.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -81,6 +94,8 @@ int main(int argc, char *argv[])
#include "compressibleCourantNo.H" #include "compressibleCourantNo.H"
#include "setInitialDeltaT.H" #include "setInitialDeltaT.H"
pimpleControl pimple(mesh);
scalar StCoNum = 0.0; scalar StCoNum = 0.0;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -90,7 +105,6 @@ int main(int argc, char *argv[])
while (runTime.run()) while (runTime.run())
{ {
#include "readTimeControls.H" #include "readTimeControls.H"
#include "readPISOControls.H"
#include "compressibleCourantNo.H" #include "compressibleCourantNo.H"
#include "setDeltaT.H" #include "setDeltaT.H"
@ -98,26 +112,34 @@ int main(int argc, char *argv[])
Info<< "\n\nTime = " << runTime.timeName() << endl; Info<< "\n\nTime = " << runTime.timeName() << endl;
#include "rhoEqn.H" #include "rhoEqn.H"
#include "UEqn.H"
// --- PISO loop // --- Pressure-velocity PIMPLE corrector loop
for (int corr=1; corr<=nCorr; corr++) for (pimple.start(); pimple.loop(); pimple++)
{ {
#include "bEqn.H" #include "UEqn.H"
#include "ftEqn.H"
#include "huEqn.H"
#include "hEqn.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(); runTime.write();
Info<< "\nExecutionTime = " Info<< "\nExecutionTime = "

View File

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

View File

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

View File

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

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) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -55,6 +55,7 @@ Description
#include "laminarFlameSpeed.H" #include "laminarFlameSpeed.H"
#include "ignition.H" #include "ignition.H"
#include "Switch.H" #include "Switch.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -72,6 +73,8 @@ int main(int argc, char *argv[])
#include "compressibleCourantNo.H" #include "compressibleCourantNo.H"
#include "setInitialDeltaT.H" #include "setInitialDeltaT.H"
pimpleControl pimple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl; Info<< "\nStarting time loop\n" << endl;
@ -79,17 +82,17 @@ int main(int argc, char *argv[])
while (runTime.run()) while (runTime.run())
{ {
#include "readTimeControls.H" #include "readTimeControls.H"
#include "readPISOControls.H"
#include "compressibleCourantNo.H" #include "compressibleCourantNo.H"
#include "setDeltaT.H" #include "setDeltaT.H"
runTime++; runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
#include "rhoEqn.H"
// --- Pressure-velocity PIMPLE corrector loop // --- Pressure-velocity PIMPLE corrector loop
for (int oCorr=0; oCorr<nOuterCorr; oCorr++) for (pimple.start(); pimple.loop(); pimple++)
{ {
#include "rhoEqn.H"
#include "UEqn.H" #include "UEqn.H"
#include "ftEqn.H" #include "ftEqn.H"
@ -103,12 +106,15 @@ int main(int argc, char *argv[])
} }
// --- PISO loop // --- PISO loop
for (int corr=1; corr<=nCorr; corr++) for (int corr=0; corr<pimple.nCorr(); corr++)
{ {
#include "pEqn.H" #include "pEqn.H"
} }
turbulence->correct(); if (pimple.turbCorr())
{
turbulence->correct();
}
} }
rho = thermo.rho(); rho = thermo.rho();

View File

@ -3,7 +3,7 @@ rho = thermo.rho();
volScalarField rAU(1.0/UEqn.A()); volScalarField rAU(1.0/UEqn.A());
U = rAU*UEqn.H(); U = rAU*UEqn.H();
if (transonic) if (pimple.transonic())
{ {
surfaceScalarField phid 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 fvScalarMatrix pEqn
( (
@ -24,9 +24,12 @@ if (transonic)
- fvm::laplacian(rho*rAU, 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(); phi == pEqn.flux();
} }
@ -41,7 +44,7 @@ else
+ fvc::ddtPhiCorr(rAU, rho, U, phi) + fvc::ddtPhiCorr(rAU, rho, U, phi)
); );
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
@ -50,9 +53,12 @@ else
- fvm::laplacian(rho*rAU, 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(); phi += pEqn.flux();
} }

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

View File

@ -8,7 +8,7 @@
+ dieselSpray.momentumSource() + dieselSpray.momentumSource()
); );
if (momentumPredictor) if (pimple.momentumPredictor())
{ {
solve(UEqn == -fvc::grad(p)); solve(UEqn == -fvc::grad(p));
} }

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) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -43,6 +43,7 @@ Description
#include "volPointInterpolation.H" #include "volPointInterpolation.H"
#include "thermoPhysicsTypes.H" #include "thermoPhysicsTypes.H"
#include "mathematicalConstants.H" #include "mathematicalConstants.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -61,13 +62,14 @@ int main(int argc, char *argv[])
#include "setInitialDeltaT.H" #include "setInitialDeltaT.H"
#include "startSummary.H" #include "startSummary.H"
pimpleControl pimple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl; Info<< "\nStarting time loop\n" << endl;
while (runTime.run()) while (runTime.run())
{ {
#include "readPISOControls.H"
#include "readEngineTimeControls.H" #include "readEngineTimeControls.H"
#include "compressibleCourantNo.H" #include "compressibleCourantNo.H"
#include "setDeltaT.H" #include "setDeltaT.H"
@ -77,10 +79,6 @@ int main(int argc, char *argv[])
Info<< "Crank angle = " << runTime.theta() << " CA-deg" << endl; Info<< "Crank angle = " << runTime.theta() << " CA-deg" << endl;
mesh.move(); mesh.move();
const_cast<volPointInterpolation&>
(
volPointInterpolation::New(mesh)
).updateMesh();
dieselSpray.evolve(); dieselSpray.evolve();
@ -106,22 +104,26 @@ int main(int argc, char *argv[])
chemistrySh = kappa*chemistry.Sh()(); chemistrySh = kappa*chemistry.Sh()();
#include "rhoEqn.H"
#include "UEqn.H"
for (label ocorr=1; ocorr <= nOuterCorr; ocorr++) #include "rhoEqn.H"
for (pimple.start(); pimple.loop(); pimple++)
{ {
#include "UEqn.H"
#include "YEqn.H" #include "YEqn.H"
#include "hsEqn.H" #include "hsEqn.H"
// --- PISO loop // --- PISO loop
for (int corr=1; corr<=nCorr; corr++) for (int corr=1; corr<=pimple.nCorr(); corr++)
{ {
#include "pEqn.H" #include "pEqn.H"
} }
}
turbulence->correct(); if (pimple.turbCorr())
{
turbulence->correct();
}
}
#include "logSummary.H" #include "logSummary.H"
#include "spraySummary.H" #include "spraySummary.H"

View File

@ -3,7 +3,7 @@ rho = thermo.rho();
volScalarField A(UEqn.A()); volScalarField A(UEqn.A());
U = UEqn.H()/A; U = UEqn.H()/A;
if (transonic) if (pimple.transonic())
{ {
surfaceScalarField phid surfaceScalarField phid
( (
@ -12,7 +12,7 @@ if (transonic)
*((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U)) *((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 fvScalarMatrix pEqn
( (
@ -23,9 +23,12 @@ if (transonic)
Sevap Sevap
); );
pEqn.solve(); pEqn.solve
(
mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr) if (nonOrth == pimple.nNonOrthCorr())
{ {
phi == pEqn.flux(); phi == pEqn.flux();
} }
@ -36,7 +39,7 @@ else
phi = fvc::interpolate(rho) phi = fvc::interpolate(rho)
*((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U)); *((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 fvScalarMatrix pEqn
( (
@ -47,9 +50,12 @@ else
Sevap Sevap
); );
pEqn.solve(); pEqn.solve
(
mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr) if (nonOrth == pimple.nNonOrthCorr())
{ {
phi += pEqn.flux(); phi += pEqn.flux();
} }

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) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -41,6 +41,7 @@ Description
#include "OFstream.H" #include "OFstream.H"
#include "Switch.H" #include "Switch.H"
#include "mathematicalConstants.H" #include "mathematicalConstants.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -58,13 +59,14 @@ int main(int argc, char *argv[])
#include "compressibleCourantNo.H" #include "compressibleCourantNo.H"
#include "setInitialDeltaT.H" #include "setInitialDeltaT.H"
pimpleControl pimple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl; Info<< "\nStarting time loop\n" << endl;
while (runTime.run()) while (runTime.run())
{ {
#include "readPISOControls.H"
#include "compressibleCourantNo.H" #include "compressibleCourantNo.H"
#include "setDeltaT.H" #include "setDeltaT.H"
@ -98,21 +100,25 @@ int main(int argc, char *argv[])
chemistrySh = kappa*chemistry.Sh()(); chemistrySh = kappa*chemistry.Sh()();
#include "rhoEqn.H" #include "rhoEqn.H"
#include "UEqn.H"
for (label ocorr=1; ocorr <= nOuterCorr; ocorr++) // --- Pressure-velocity PIMPLE corrector loop
for (pimple.start(); pimple.loop(); pimple++)
{ {
#include "UEqn.H"
#include "YEqn.H" #include "YEqn.H"
#include "hsEqn.H" #include "hsEqn.H"
// --- PISO loop // --- PISO loop
for (int corr=1; corr<=nCorr; corr++) for (int corr=0; corr<pimple.nCorr(); corr++)
{ {
#include "pEqn.H" #include "pEqn.H"
} }
}
turbulence->correct(); if (pimple.turbCorr())
{
turbulence->correct();
}
}
#include "spraySummary.H" #include "spraySummary.H"

View File

@ -3,7 +3,7 @@ rho = thermo.rho();
volScalarField rAU(1.0/UEqn.A()); volScalarField rAU(1.0/UEqn.A());
U = rAU*UEqn.H(); U = rAU*UEqn.H();
if (transonic) if (pimple.transonic())
{ {
surfaceScalarField phid 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 fvScalarMatrix pEqn
( (
@ -26,9 +26,12 @@ if (transonic)
Sevap Sevap
); );
pEqn.solve(); pEqn.solve
(
mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr) if (nonOrth == pimple.nNonOrthCorr())
{ {
phi == pEqn.flux(); phi == pEqn.flux();
} }
@ -43,7 +46,7 @@ else
+ fvc::ddtPhiCorr(rAU, rho, U, phi) + fvc::ddtPhiCorr(rAU, rho, U, phi)
); );
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
@ -54,9 +57,12 @@ else
Sevap Sevap
); );
pEqn.solve(); pEqn.solve
(
mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr) if (nonOrth == pimple.nNonOrthCorr())
{ {
phi += pEqn.flux(); phi += pEqn.flux();
} }

View File

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

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

View File

@ -3,7 +3,7 @@ rho = thermo.rho();
volScalarField rAU(1.0/UEqn.A()); volScalarField rAU(1.0/UEqn.A());
U = rAU*UEqn.H(); U = rAU*UEqn.H();
if (transonic) if (pimple.transonic())
{ {
surfaceScalarField phid surfaceScalarField phid
( (
@ -12,18 +12,21 @@ if (transonic)
*((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U)) *((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 fvScalarMatrix pEqn
( (
fvm::ddt(psi, p) fvm::ddt(psi, p)
+ fvm::div(phid, p, "div(phid,p)") + fvm::div(phid, p)
- fvm::laplacian(rho*rAU, 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(); phi == pEqn.flux();
} }
@ -34,7 +37,7 @@ else
phi = fvc::interpolate(rho) phi = fvc::interpolate(rho)
*((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U)); *((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 fvScalarMatrix pEqn
( (
@ -43,9 +46,12 @@ else
- fvm::laplacian(rho*rAU, 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(); phi += pEqn.flux();
} }

View File

@ -34,7 +34,7 @@ Description
#include "turbulenceModel.H" #include "turbulenceModel.H"
#include "combustionModel.H" #include "combustionModel.H"
#include "radiationModel.H" #include "radiationModel.H"
#include "pimpleLoop.H" #include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -51,13 +51,14 @@ int main(int argc, char *argv[])
#include "compressibleCourantNo.H" #include "compressibleCourantNo.H"
#include "setInitialDeltaT.H" #include "setInitialDeltaT.H"
pimpleControl pimple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl; Info<< "\nStarting time loop\n" << endl;
while (runTime.run()) while (runTime.run())
{ {
#include "readPIMPLEControls.H"
#include "readTimeControls.H" #include "readTimeControls.H"
#include "compressibleCourantNo.H" #include "compressibleCourantNo.H"
#include "setDeltaT.H" #include "setDeltaT.H"
@ -68,12 +69,7 @@ int main(int argc, char *argv[])
#include "rhoEqn.H" #include "rhoEqn.H"
// --- Pressure-velocity PIMPLE corrector loop // --- Pressure-velocity PIMPLE corrector loop
for for (pimple.start(); pimple.loop(); pimple++)
(
pimpleLoop pimpleCorr(mesh, nOuterCorr);
pimpleCorr.loop();
pimpleCorr++
)
{ {
#include "UEqn.H" #include "UEqn.H"
@ -81,13 +77,16 @@ int main(int argc, char *argv[])
#include "fuhsEqn.H" #include "fuhsEqn.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"
} }
}
turbulence->correct(); if (pimple.turbCorr())
{
turbulence->correct();
}
}
rho = thermo.rho(); rho = thermo.rho();

View File

@ -15,7 +15,7 @@ surfaceScalarField phiU
phi = phiU - rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf(); phi = phiU - rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf();
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{ {
surfaceScalarField rhorAUf(fvc::interpolate(rho*rAU)); surfaceScalarField rhorAUf(fvc::interpolate(rho*rAU));
@ -28,20 +28,10 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
p_rghEqn.solve p_rghEqn.solve
( (
mesh.solver mesh.solver(p_rgh.select(pimple.finalInnerIter(corr, nonOrth)))
(
p_rgh.select
(
(
pimpleCorr.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
)
); );
if (nonOrth == nNonOrthCorr) if (nonOrth == pimple.nNonOrthCorr())
{ {
phi += p_rghEqn.flux(); phi += p_rghEqn.flux();
} }

View File

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

View File

@ -3,7 +3,7 @@ rho = thermo.rho();
volScalarField rAU(1.0/UEqn.A()); volScalarField rAU(1.0/UEqn.A());
U = rAU*UEqn.H(); U = rAU*UEqn.H();
if (transonic) if (pimple.transonic())
{ {
surfaceScalarField phid 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 fvScalarMatrix pEqn
( (
@ -24,9 +24,12 @@ if (transonic)
- fvm::laplacian(rho*rAU, 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(); phi == pEqn.flux();
} }
@ -41,7 +44,7 @@ else
+ fvc::ddtPhiCorr(rAU, rho, U, phi) + fvc::ddtPhiCorr(rAU, rho, U, phi)
); );
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
@ -50,9 +53,12 @@ else
- fvm::laplacian(rho*rAU, 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(); phi += pEqn.flux();
} }

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) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -35,6 +35,7 @@ Description
#include "psiChemistryModel.H" #include "psiChemistryModel.H"
#include "chemistrySolver.H" #include "chemistrySolver.H"
#include "multivariateScheme.H" #include "multivariateScheme.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -51,6 +52,8 @@ int main(int argc, char *argv[])
#include "compressibleCourantNo.H" #include "compressibleCourantNo.H"
#include "setInitialDeltaT.H" #include "setInitialDeltaT.H"
pimpleControl pimple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl; Info<< "\nStarting time loop\n" << endl;
@ -58,7 +61,6 @@ int main(int argc, char *argv[])
while (runTime.run()) while (runTime.run())
{ {
#include "readTimeControls.H" #include "readTimeControls.H"
#include "readPISOControls.H"
#include "compressibleCourantNo.H" #include "compressibleCourantNo.H"
#include "setDeltaT.H" #include "setDeltaT.H"
@ -68,20 +70,23 @@ int main(int argc, char *argv[])
#include "chemistry.H" #include "chemistry.H"
#include "rhoEqn.H" #include "rhoEqn.H"
for (label ocorr=1; ocorr <= nOuterCorr; ocorr++) for (pimple.start(); pimple.loop(); pimple++)
{ {
#include "UEqn.H" #include "UEqn.H"
#include "YEqn.H" #include "YEqn.H"
#include "hsEqn.H" #include "hsEqn.H"
// --- PISO loop // --- PISO loop
for (int corr=1; corr<=nCorr; corr++) for (int corr=0; corr<pimple.nCorr(); corr++)
{ {
#include "pEqn.H" #include "pEqn.H"
} }
}
turbulence->correct(); if (pimple.turbCorr())
{
turbulence->correct();
}
}
if (runTime.write()) if (runTime.write())
{ {

View File

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

View File

@ -8,7 +8,7 @@
volScalarField rAU(1.0/UEqn.A()); volScalarField rAU(1.0/UEqn.A());
U = rAU*UEqn.H(); U = rAU*UEqn.H();
if (transonic) if (pimple.transonic())
{ {
surfaceScalarField phiv surfaceScalarField phiv
( (
@ -30,7 +30,7 @@
+ correction(fvm::ddt(psi, p) + fvm::div(phid, p)) + correction(fvm::ddt(psi, p) + fvm::div(phid, p))
); );
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
@ -40,20 +40,10 @@
pEqn.solve pEqn.solve
( (
mesh.solver mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
(
p.select
(
(
pimpleCorr.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
)
); );
if (nonOrth == nNonOrthCorr) if (nonOrth == pimple.nNonOrthCorr())
{ {
phi += pEqn.flux(); phi += pEqn.flux();
} }
@ -74,7 +64,7 @@
+ fvc::div(phi) + fvc::div(phi)
); );
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
@ -84,20 +74,10 @@
pEqn.solve pEqn.solve
( (
mesh.solver mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
(
p.select
(
(
pimpleCorr.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
)
); );
if (nonOrth == nNonOrthCorr) if (nonOrth == pimple.nNonOrthCorr())
{ {
phi += pEqn.flux(); phi += pEqn.flux();
} }

View File

@ -36,7 +36,7 @@ Description
#include "rhoChemistryModel.H" #include "rhoChemistryModel.H"
#include "chemistrySolver.H" #include "chemistrySolver.H"
#include "multivariateScheme.H" #include "multivariateScheme.H"
#include "pimpleLoop.H" #include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -53,6 +53,8 @@ int main(int argc, char *argv[])
#include "compressibleCourantNo.H" #include "compressibleCourantNo.H"
#include "setInitialDeltaT.H" #include "setInitialDeltaT.H"
pimpleControl pimple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl; Info<< "\nStarting time loop\n" << endl;
@ -60,7 +62,6 @@ int main(int argc, char *argv[])
while (runTime.run()) while (runTime.run())
{ {
#include "readTimeControls.H" #include "readTimeControls.H"
#include "readPISOControls.H"
#include "compressibleCourantNo.H" #include "compressibleCourantNo.H"
#include "setDeltaT.H" #include "setDeltaT.H"
@ -71,25 +72,23 @@ int main(int argc, char *argv[])
#include "rhoEqn.H" #include "rhoEqn.H"
// --- Pressure-velocity PIMPLE corrector loop // --- Pressure-velocity PIMPLE corrector loop
for for (pimple.start(); pimple.loop(); pimple++)
(
pimpleLoop pimpleCorr(mesh, nOuterCorr);
pimpleCorr.loop();
pimpleCorr++
)
{ {
#include "UEqn.H" #include "UEqn.H"
#include "YEqn.H" #include "YEqn.H"
#include "hsEqn.H" #include "hsEqn.H"
// --- PISO loop // --- PISO loop
for (int corr=1; corr<=nCorr; corr++) for (int corr=1; corr<=pimple.nCorr(); corr++)
{ {
#include "pEqn.H" #include "pEqn.H"
} }
}
turbulence->correct(); if (pimple.turbCorr())
{
turbulence->correct();
}
}
rho = thermo.rho(); rho = thermo.rho();

View File

@ -11,7 +11,7 @@ UEqn().relax();
volScalarField rAU(1.0/UEqn().A()); volScalarField rAU(1.0/UEqn().A());
if (momentumPredictor) if (pimple.momentumPredictor())
{ {
solve(UEqn() == -fvc::grad(p)); solve(UEqn() == -fvc::grad(p));
} }

View File

@ -5,12 +5,12 @@ rho.relax();
U = rAU*UEqn().H(); U = rAU*UEqn().H();
if (nCorr <= 1) if (pimple.nCorr() <= 1)
{ {
UEqn.clear(); UEqn.clear();
} }
if (transonic) if (pimple.transonic())
{ {
surfaceScalarField phid surfaceScalarField phid
( (
@ -22,7 +22,7 @@ if (transonic)
) )
); );
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
@ -33,18 +33,10 @@ if (transonic)
pEqn.solve pEqn.solve
( (
mesh.solver mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
(
p.select
(
pimpleCorr.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
); );
if (nonOrth == nNonOrthCorr) if (nonOrth == pimple.nNonOrthCorr())
{ {
phi == pEqn.flux(); phi == pEqn.flux();
} }
@ -59,7 +51,7 @@ else
+ fvc::ddtPhiCorr(rAU, rho, U, phi) + fvc::ddtPhiCorr(rAU, rho, U, phi)
); );
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{ {
// Pressure corrector // Pressure corrector
fvScalarMatrix pEqn fvScalarMatrix pEqn
@ -71,18 +63,10 @@ else
pEqn.solve pEqn.solve
( (
mesh.solver mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
(
p.select
(
pimpleCorr.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
); );
if (nonOrth == nNonOrthCorr) if (nonOrth == pimple.nNonOrthCorr())
{ {
phi += pEqn.flux(); phi += pEqn.flux();
} }

View File

@ -37,7 +37,7 @@ Description
#include "basicPsiThermo.H" #include "basicPsiThermo.H"
#include "turbulenceModel.H" #include "turbulenceModel.H"
#include "bound.H" #include "bound.H"
#include "pimpleLoop.H" #include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -49,12 +49,13 @@ 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;
while (runTime.run()) while (runTime.run())
{ {
#include "readTimeControls.H" #include "readTimeControls.H"
#include "readPIMPLEControls.H"
#include "compressibleCourantNo.H" #include "compressibleCourantNo.H"
#include "setDeltaT.H" #include "setDeltaT.H"
@ -65,14 +66,9 @@ int main(int argc, char *argv[])
#include "rhoEqn.H" #include "rhoEqn.H"
// --- Pressure-velocity PIMPLE corrector loop // --- Pressure-velocity PIMPLE corrector loop
for for (pimple.start(); pimple.loop(); pimple++)
(
pimpleLoop pimpleCorr(mesh, nOuterCorr);
pimpleCorr.loop();
pimpleCorr++
)
{ {
if (nOuterCorr != 1) if (pimple.nOuterCorr() != 1)
{ {
p.storePrevIter(); p.storePrevIter();
rho.storePrevIter(); rho.storePrevIter();
@ -82,12 +78,15 @@ int main(int argc, char *argv[])
#include "hEqn.H" #include "hEqn.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"
} }
turbulence->correct(); if (pimple.turbCorr())
{
turbulence->correct();
}
} }
runTime.write(); runTime.write();

View File

@ -40,7 +40,7 @@ Description
#include "MRFZones.H" #include "MRFZones.H"
#include "porousZones.H" #include "porousZones.H"
#include "fvcSmooth.H" #include "fvcSmooth.H"
#include "pimpleLoop.H" #include "pimpleControl.H"
#include "bound.H" #include "bound.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -50,18 +50,21 @@ int main(int argc, char *argv[])
#include "setRootCase.H" #include "setRootCase.H"
#include "createTime.H" #include "createTime.H"
#include "createMesh.H" #include "createMesh.H"
#include "readPIMPLEControls.H"
pimpleControl pimple(mesh);
#include "setInitialrDeltaT.H" #include "setInitialrDeltaT.H"
#include "createFields.H" #include "createFields.H"
#include "createZones.H" #include "createZones.H"
#include "initContinuityErrs.H" #include "initContinuityErrs.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl; Info<< "\nStarting time loop\n" << endl;
while (runTime.run()) while (runTime.run())
{ {
#include "readTimeControls.H" #include "readTimeControls.H"
#include "readPIMPLEControls.H"
#include "compressibleCourantNo.H" #include "compressibleCourantNo.H"
#include "setDeltaT.H" #include "setDeltaT.H"
@ -74,14 +77,9 @@ int main(int argc, char *argv[])
#include "rhoEqn.H" #include "rhoEqn.H"
// --- Pressure-velocity PIMPLE corrector loop // --- Pressure-velocity PIMPLE corrector loop
for for (pimple.start(); pimple.loop(); pimple++)
(
pimpleLoop pimpleCorr(mesh, nOuterCorr);
pimpleCorr.loop();
pimpleCorr++
)
{ {
if (nOuterCorr != 1) if (pimple.nOuterCorr() != 1)
{ {
p.storePrevIter(); p.storePrevIter();
rho.storePrevIter(); rho.storePrevIter();
@ -93,7 +91,7 @@ int main(int argc, char *argv[])
#include "hEqn.H" #include "hEqn.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"
} }

View File

@ -1,6 +1,6 @@
scalar maxDeltaT scalar maxDeltaT
( (
pimple.lookupOrDefault<scalar>("maxDeltaT", GREAT) pimple.dict().lookupOrDefault<scalar>("maxDeltaT", GREAT)
); );
volScalarField rDeltaT volScalarField rDeltaT

View File

@ -1,22 +1,24 @@
{ {
const dictionary& pimpleDict = pimple.dict();
scalar maxCo scalar maxCo
( (
pimple.lookupOrDefault<scalar>("maxCo", 0.8) pimpleDict.lookupOrDefault<scalar>("maxCo", 0.8)
); );
scalar rDeltaTSmoothingCoeff scalar rDeltaTSmoothingCoeff
( (
pimple.lookupOrDefault<scalar>("rDeltaTSmoothingCoeff", 0.02) pimpleDict.lookupOrDefault<scalar>("rDeltaTSmoothingCoeff", 0.02)
); );
scalar rDeltaTDampingCoeff scalar rDeltaTDampingCoeff
( (
pimple.lookupOrDefault<scalar>("rDeltaTDampingCoeff", 1.0) pimpleDict.lookupOrDefault<scalar>("rDeltaTDampingCoeff", 1.0)
); );
scalar maxDeltaT scalar maxDeltaT
( (
pimple.lookupOrDefault<scalar>("maxDeltaT", GREAT) pimpleDict.lookupOrDefault<scalar>("maxDeltaT", GREAT)
); );
volScalarField rDeltaT0("rDeltaT0", rDeltaT); volScalarField rDeltaT0("rDeltaT0", rDeltaT);
@ -29,7 +31,7 @@
/((2*maxCo)*mesh.V()*rho.dimensionedInternalField()) /((2*maxCo)*mesh.V()*rho.dimensionedInternalField())
); );
if (transonic) if (pimple.transonic())
{ {
surfaceScalarField phid surfaceScalarField phid
( (

View File

@ -15,7 +15,7 @@ pZones.addResistance(UEqn());
volScalarField rAU(1.0/UEqn().A()); volScalarField rAU(1.0/UEqn().A());
if (momentumPredictor) if (pimple.momentumPredictor())
{ {
solve(UEqn() == -fvc::grad(p)); solve(UEqn() == -fvc::grad(p));
} }

View File

@ -6,12 +6,12 @@ rho.relax();
volScalarField rAU(1.0/UEqn().A()); volScalarField rAU(1.0/UEqn().A());
U = rAU*UEqn().H(); U = rAU*UEqn().H();
if (nCorr <= 1) if (pimple.nCorr() <= 1)
{ {
UEqn.clear(); UEqn.clear();
} }
if (transonic) if (pimple.transonic())
{ {
surfaceScalarField phid surfaceScalarField phid
( (
@ -24,7 +24,7 @@ if (transonic)
); );
mrfZones.relativeFlux(fvc::interpolate(psi), phid); mrfZones.relativeFlux(fvc::interpolate(psi), phid);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
@ -35,20 +35,10 @@ if (transonic)
pEqn.solve pEqn.solve
( (
mesh.solver mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
(
p.select
(
(
pimpleCorr.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
)
); );
if (nonOrth == nNonOrthCorr) if (nonOrth == pimple.nNonOrthCorr())
{ {
phi == pEqn.flux(); phi == pEqn.flux();
} }
@ -64,7 +54,7 @@ else
); );
mrfZones.relativeFlux(fvc::interpolate(rho), phi); mrfZones.relativeFlux(fvc::interpolate(rho), phi);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{ {
// Pressure corrector // Pressure corrector
fvScalarMatrix pEqn fvScalarMatrix pEqn
@ -76,20 +66,10 @@ else
pEqn.solve pEqn.solve
( (
mesh.solver mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
(
p.select
(
(
pimpleCorr.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
)
); );
if (nonOrth == nNonOrthCorr) if (nonOrth == pimple.nNonOrthCorr())
{ {
phi += pEqn.flux(); phi += pEqn.flux();
} }

View File

@ -39,7 +39,7 @@ Description
#include "bound.H" #include "bound.H"
#include "MRFZones.H" #include "MRFZones.H"
#include "porousZones.H" #include "porousZones.H"
#include "pimpleLoop.H" #include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -52,6 +52,8 @@ int main(int argc, char *argv[])
#include "createZones.H" #include "createZones.H"
#include "initContinuityErrs.H" #include "initContinuityErrs.H"
pimpleControl pimple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl; Info<< "\nStarting time loop\n" << endl;
@ -59,7 +61,6 @@ int main(int argc, char *argv[])
while (runTime.run()) while (runTime.run())
{ {
#include "readTimeControls.H" #include "readTimeControls.H"
#include "readPIMPLEControls.H"
#include "compressibleCourantNo.H" #include "compressibleCourantNo.H"
#include "setDeltaT.H" #include "setDeltaT.H"
@ -70,14 +71,9 @@ int main(int argc, char *argv[])
#include "rhoEqn.H" #include "rhoEqn.H"
// --- Pressure-velocity PIMPLE corrector loop // --- Pressure-velocity PIMPLE corrector loop
for for (pimple.start(); pimple.loop(); pimple++)
(
pimpleLoop pimpleCorr(mesh, nOuterCorr);
pimpleCorr.loop();
pimpleCorr++
)
{ {
if (nOuterCorr != 1) if (pimple.nOuterCorr() != 1)
{ {
p.storePrevIter(); p.storePrevIter();
rho.storePrevIter(); rho.storePrevIter();
@ -87,12 +83,15 @@ int main(int argc, char *argv[])
#include "hEqn.H" #include "hEqn.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"
} }
turbulence->correct(); if (pimple.turbCorr())
{
turbulence->correct();
}
} }
runTime.write(); runTime.write();

View File

@ -9,7 +9,7 @@ UEqn.clear();
bool closedVolume = false; bool closedVolume = false;
if (transonic) if (simple.transonic())
{ {
surfaceScalarField phid surfaceScalarField phid
( (
@ -17,7 +17,7 @@ if (transonic)
fvc::interpolate(psi)*(fvc::interpolate(U) & mesh.Sf()) fvc::interpolate(psi)*(fvc::interpolate(U) & mesh.Sf())
); );
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
@ -32,7 +32,7 @@ if (transonic)
pEqn.solve(); pEqn.solve();
if (nonOrth == nNonOrthCorr) if (nonOrth == simple.nNonOrthCorr())
{ {
phi == pEqn.flux(); phi == pEqn.flux();
} }
@ -43,7 +43,7 @@ else
phi = fvc::interpolate(rho)*(fvc::interpolate(U) & mesh.Sf()); phi = fvc::interpolate(rho)*(fvc::interpolate(U) & mesh.Sf());
closedVolume = adjustPhi(phi, U, p); closedVolume = adjustPhi(phi, U, p);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
@ -54,7 +54,7 @@ else
pEqn.solve(); pEqn.solve();
if (nonOrth == nNonOrthCorr) if (nonOrth == simple.nNonOrthCorr())
{ {
phi -= pEqn.flux(); phi -= pEqn.flux();
} }

View File

@ -11,7 +11,7 @@ UEqn.clear();
bool closedVolume = false; bool closedVolume = false;
if (transonic) if (simple.transonic())
{ {
surfaceScalarField phid surfaceScalarField phid
( (
@ -20,7 +20,7 @@ if (transonic)
); );
mrfZones.relativeFlux(fvc::interpolate(psi), phid); mrfZones.relativeFlux(fvc::interpolate(psi), phid);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
{ {
tmp<fvScalarMatrix> tpEqn; tmp<fvScalarMatrix> tpEqn;
@ -37,7 +37,7 @@ if (transonic)
tpEqn().solve(); tpEqn().solve();
if (nonOrth == nNonOrthCorr) if (nonOrth == simple.nNonOrthCorr())
{ {
phi == tpEqn().flux(); phi == tpEqn().flux();
} }
@ -50,7 +50,7 @@ else
closedVolume = adjustPhi(phi, U, p); closedVolume = adjustPhi(phi, U, p);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
{ {
tmp<fvScalarMatrix> tpEqn; tmp<fvScalarMatrix> tpEqn;
@ -67,7 +67,7 @@ else
tpEqn().solve(); tpEqn().solve();
if (nonOrth == nNonOrthCorr) if (nonOrth == simple.nNonOrthCorr())
{ {
phi -= tpEqn().flux(); phi -= tpEqn().flux();
} }

View File

@ -36,6 +36,7 @@ Description
#include "RASModel.H" #include "RASModel.H"
#include "MRFZones.H" #include "MRFZones.H"
#include "thermalPorousZones.H" #include "thermalPorousZones.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -48,16 +49,16 @@ int main(int argc, char *argv[])
#include "createZones.H" #include "createZones.H"
#include "initContinuityErrs.H" #include "initContinuityErrs.H"
simpleControl simple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl; Info<< "\nStarting time loop\n" << endl;
while (runTime.loop()) while (simple.loop())
{ {
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readSIMPLEControls.H"
p.storePrevIter(); p.storePrevIter();
rho.storePrevIter(); rho.storePrevIter();

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) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -33,6 +33,7 @@ Description
#include "fvCFD.H" #include "fvCFD.H"
#include "basicPsiThermo.H" #include "basicPsiThermo.H"
#include "RASModel.H" #include "RASModel.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -44,16 +45,16 @@ int main(int argc, char *argv[])
#include "createFields.H" #include "createFields.H"
#include "initContinuityErrs.H" #include "initContinuityErrs.H"
simpleControl simple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl; Info<< "\nStarting time loop\n" << endl;
while (runTime.loop()) while (simple.loop())
{ {
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readSIMPLEControls.H"
p.storePrevIter(); p.storePrevIter();
rho.storePrevIter(); rho.storePrevIter();

View File

@ -12,9 +12,9 @@ UEqn.clear();
bool closedVolume = false; bool closedVolume = false;
if (transonic) if (simple.transonic())
{ {
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
{ {
surfaceScalarField phid surfaceScalarField phid
( (
@ -54,7 +54,7 @@ if (transonic)
pEqn.solve(); pEqn.solve();
} }
if (nonOrth == nNonOrthCorr) if (nonOrth == simple.nNonOrthCorr())
{ {
phi == phic + pEqn.flux(); phi == phic + pEqn.flux();
} }
@ -62,7 +62,7 @@ if (transonic)
} }
else else
{ {
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
{ {
phi = fvc::interpolate(rho*U) & mesh.Sf(); phi = fvc::interpolate(rho*U) & mesh.Sf();
closedVolume = adjustPhi(phi, U, p); closedVolume = adjustPhi(phi, U, p);
@ -88,7 +88,7 @@ else
} }
if (nonOrth == nNonOrthCorr) if (nonOrth == simple.nNonOrthCorr())
{ {
phi += pEqn.flux(); phi += pEqn.flux();
} }
@ -119,7 +119,7 @@ rho = thermo.rho();
rho = max(rho, rhoMin); rho = max(rho, rhoMin);
rho = min(rho, rhoMax); rho = min(rho, rhoMax);
if (!transonic) if (!simple.transonic())
{ {
rho.relax(); rho.relax();
} }

View File

@ -35,6 +35,7 @@ Description
#include "RASModel.H" #include "RASModel.H"
#include "mixedFvPatchFields.H" #include "mixedFvPatchFields.H"
#include "bound.H" #include "bound.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -46,20 +47,20 @@ int main(int argc, char *argv[])
#include "createFields.H" #include "createFields.H"
#include "initContinuityErrs.H" #include "initContinuityErrs.H"
simpleControl simple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl; Info<< "\nStarting time loop\n" << endl;
while (runTime.loop()) while (simple.loop())
{ {
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readSIMPLEControls.H"
p.storePrevIter(); p.storePrevIter();
rho.storePrevIter(); rho.storePrevIter();
if (!transonic) if (!simple.transonic())
{ {
rho.storePrevIter(); rho.storePrevIter();
} }

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

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

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) 2010-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -38,6 +38,7 @@ Description
#include "OSspecific.H" #include "OSspecific.H"
#include "magnet.H" #include "magnet.H"
#include "electromagneticConstants.H" #include "electromagneticConstants.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -65,7 +66,8 @@ int main(int argc, char *argv[])
#include "createTime.H" #include "createTime.H"
#include "createMesh.H" #include "createMesh.H"
#include "createFields.H" #include "createFields.H"
#include "readSIMPLEControls.H"
simpleControl simple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -73,7 +75,7 @@ int main(int argc, char *argv[])
runTime++; runTime++;
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
{ {
solve(fvm::laplacian(murf, psi) + fvc::div(murf*Mrf)); solve(fvm::laplacian(murf, psi) + fvc::div(murf*Mrf));
} }

View File

@ -9,7 +9,7 @@
UEqn.relax(); UEqn.relax();
if (momentumPredictor) if (pimple.momentumPredictor())
{ {
solve solve
( (

View File

@ -48,7 +48,7 @@ Description
#include "fvCFD.H" #include "fvCFD.H"
#include "singlePhaseTransportModel.H" #include "singlePhaseTransportModel.H"
#include "RASModel.H" #include "RASModel.H"
#include "pimpleLoop.H" #include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -64,6 +64,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;
@ -73,19 +75,13 @@ int main(int argc, char *argv[])
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readTimeControls.H" #include "readTimeControls.H"
#include "readPIMPLEControls.H"
#include "CourantNo.H" #include "CourantNo.H"
#include "setDeltaT.H" #include "setDeltaT.H"
// --- Pressure-velocity PIMPLE corrector loop // --- Pressure-velocity PIMPLE corrector loop
for for (pimple.start(); pimple.loop(); pimple++)
(
pimpleLoop pimpleCorr(mesh, nOuterCorr);
pimpleCorr.loop();
pimpleCorr++
)
{ {
if (nOuterCorr != 1) if (pimple.nOuterCorr() != 1)
{ {
p_rgh.storePrevIter(); p_rgh.storePrevIter();
} }
@ -94,12 +90,15 @@ int main(int argc, char *argv[])
#include "TEqn.H" #include "TEqn.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"
} }
turbulence->correct(); if (pimple.turbCorr())
{
turbulence->correct();
}
} }
runTime.write(); runTime.write();

View File

@ -10,7 +10,7 @@
surfaceScalarField buoyancyPhi(rAUf*ghf*fvc::snGrad(rhok)*mesh.magSf()); surfaceScalarField buoyancyPhi(rAUf*ghf*fvc::snGrad(rhok)*mesh.magSf());
phi -= buoyancyPhi; phi -= buoyancyPhi;
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{ {
fvScalarMatrix p_rghEqn fvScalarMatrix p_rghEqn
( (
@ -21,20 +21,10 @@
p_rghEqn.solve p_rghEqn.solve
( (
mesh.solver mesh.solver(p_rgh.select(pimple.finalInnerIter(corr, nonOrth)))
(
p_rgh.select
(
(
pimpleCorr.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
)
); );
if (nonOrth == nNonOrthCorr) if (nonOrth == pimple.nNonOrthCorr())
{ {
// Calculate the conservative fluxes // Calculate the conservative fluxes
phi -= p_rghEqn.flux(); phi -= p_rghEqn.flux();

View File

@ -8,7 +8,7 @@
UEqn().relax(); UEqn().relax();
if (momentumPredictor) if (simple.momentumPredictor())
{ {
solve solve
( (

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) 2008-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -48,6 +48,7 @@ Description
#include "fvCFD.H" #include "fvCFD.H"
#include "singlePhaseTransportModel.H" #include "singlePhaseTransportModel.H"
#include "RASModel.H" #include "RASModel.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -60,16 +61,16 @@ int main(int argc, char *argv[])
#include "createFields.H" #include "createFields.H"
#include "initContinuityErrs.H" #include "initContinuityErrs.H"
simpleControl simple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl; Info<< "\nStarting time loop\n" << endl;
while (runTime.loop()) while (simple.loop())
{ {
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readSIMPLEControls.H"
p_rgh.storePrevIter(); p_rgh.storePrevIter();
// Pressure-velocity SIMPLE corrector // Pressure-velocity SIMPLE corrector

View File

@ -11,7 +11,7 @@
surfaceScalarField buoyancyPhi(rAUf*ghf*fvc::snGrad(rhok)*mesh.magSf()); surfaceScalarField buoyancyPhi(rAUf*ghf*fvc::snGrad(rhok)*mesh.magSf());
phi -= buoyancyPhi; phi -= buoyancyPhi;
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
{ {
fvScalarMatrix p_rghEqn fvScalarMatrix p_rghEqn
( (
@ -22,7 +22,7 @@
p_rghEqn.solve(); p_rghEqn.solve();
if (nonOrth == nNonOrthCorr) if (nonOrth == simple.nNonOrthCorr())
{ {
// Calculate the conservative fluxes // Calculate the conservative fluxes
phi -= p_rghEqn.flux(); phi -= p_rghEqn.flux();

View File

@ -9,7 +9,7 @@
UEqn.relax(); UEqn.relax();
if (momentumPredictor) if (pimple.momentumPredictor())
{ {
solve solve
( (

View File

@ -37,7 +37,7 @@ Description
#include "basicRhoThermo.H" #include "basicRhoThermo.H"
#include "turbulenceModel.H" #include "turbulenceModel.H"
#include "fixedGradientFvPatchFields.H" #include "fixedGradientFvPatchFields.H"
#include "pimpleLoop.H" #include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -53,6 +53,8 @@ int main(int argc, char *argv[])
#include "compressibleCourantNo.H" #include "compressibleCourantNo.H"
#include "setInitialDeltaT.H" #include "setInitialDeltaT.H"
pimpleControl pimple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl; Info<< "\nStarting time loop\n" << endl;
@ -60,7 +62,6 @@ int main(int argc, char *argv[])
while (runTime.run()) while (runTime.run())
{ {
#include "readTimeControls.H" #include "readTimeControls.H"
#include "readPIMPLEControls.H"
#include "compressibleCourantNo.H" #include "compressibleCourantNo.H"
#include "setDeltaT.H" #include "setDeltaT.H"
@ -71,14 +72,9 @@ int main(int argc, char *argv[])
#include "rhoEqn.H" #include "rhoEqn.H"
// --- Pressure-velocity PIMPLE corrector loop // --- Pressure-velocity PIMPLE corrector loop
for for (pimple.start(); pimple.loop(); pimple++)
(
pimpleLoop pimpleCorr(mesh, nOuterCorr);
pimpleCorr.loop();
pimpleCorr++
)
{ {
if (nOuterCorr != 1) if (pimple.nOuterCorr() != 1)
{ {
p_rgh.storePrevIter(); p_rgh.storePrevIter();
} }
@ -87,16 +83,19 @@ int main(int argc, char *argv[])
#include "hEqn.H" #include "hEqn.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"
} }
turbulence->correct(); if (pimple.turbCorr())
{
rho = thermo.rho(); turbulence->correct();
}
} }
rho = thermo.rho();
runTime.write(); runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"

View File

@ -25,7 +25,7 @@
+ fvc::div(phi) + fvc::div(phi)
); );
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{ {
fvScalarMatrix p_rghEqn fvScalarMatrix p_rghEqn
( (
@ -35,20 +35,10 @@
p_rghEqn.solve p_rghEqn.solve
( (
mesh.solver mesh.solver(p_rgh.select(pimple.finalInnerIter(corr, nonOrth)))
(
p_rgh.select
(
(
pimpleCorr.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
)
); );
if (nonOrth == nNonOrthCorr) if (nonOrth == pimple.nNonOrthCorr())
{ {
// Calculate the conservative fluxes // Calculate the conservative fluxes
phi += p_rghEqn.flux(); phi += p_rghEqn.flux();

View File

@ -8,7 +8,7 @@
UEqn().relax(); UEqn().relax();
if (momentumPredictor) if (simple.momentumPredictor())
{ {
solve solve
( (

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) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -33,6 +33,7 @@ Description
#include "basicPsiThermo.H" #include "basicPsiThermo.H"
#include "RASModel.H" #include "RASModel.H"
#include "fixedGradientFvPatchFields.H" #include "fixedGradientFvPatchFields.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -45,16 +46,16 @@ int main(int argc, char *argv[])
#include "createFields.H" #include "createFields.H"
#include "initContinuityErrs.H" #include "initContinuityErrs.H"
simpleControl simple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl; Info<< "\nStarting time loop\n" << endl;
while (runTime.loop()) while (simple.loop())
{ {
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readSIMPLEControls.H"
p_rgh.storePrevIter(); p_rgh.storePrevIter();
rho.storePrevIter(); rho.storePrevIter();

View File

@ -14,7 +14,7 @@
surfaceScalarField buoyancyPhi(rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf()); surfaceScalarField buoyancyPhi(rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf());
phi -= buoyancyPhi; phi -= buoyancyPhi;
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
{ {
fvScalarMatrix p_rghEqn fvScalarMatrix p_rghEqn
( (
@ -24,7 +24,7 @@
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell)); p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
p_rghEqn.solve(); p_rghEqn.solve();
if (nonOrth == nNonOrthCorr) if (nonOrth == simple.nNonOrthCorr())
{ {
// Calculate the conservative fluxes // Calculate the conservative fluxes
phi -= p_rghEqn.flux(); phi -= p_rghEqn.flux();

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) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -35,6 +35,7 @@ Description
#include "RASModel.H" #include "RASModel.H"
#include "fixedGradientFvPatchFields.H" #include "fixedGradientFvPatchFields.H"
#include "radiationModel.H" #include "radiationModel.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -48,16 +49,16 @@ int main(int argc, char *argv[])
#include "createRadiationModel.H" #include "createRadiationModel.H"
#include "initContinuityErrs.H" #include "initContinuityErrs.H"
simpleControl simple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl; Info<< "\nStarting time loop\n" << endl;
while (runTime.loop()) while (simple.loop())
{ {
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readSIMPLEControls.H"
p_rgh.storePrevIter(); p_rgh.storePrevIter();
rho.storePrevIter(); rho.storePrevIter();

View File

@ -48,6 +48,7 @@ Description
#include "fvCFD.H" #include "fvCFD.H"
#include "singlePhaseTransportModel.H" #include "singlePhaseTransportModel.H"
#include "RASModel.H" #include "RASModel.H"
#include "simpleControl.H"
template<class Type> template<class Type>
void zeroCells void zeroCells
@ -74,16 +75,16 @@ int main(int argc, char *argv[])
#include "createFields.H" #include "createFields.H"
#include "initContinuityErrs.H" #include "initContinuityErrs.H"
simpleControl simple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl; Info<< "\nStarting time loop\n" << endl;
while (runTime.loop()) while (simple.loop())
{ {
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readSIMPLEControls.H"
p.storePrevIter(); p.storePrevIter();
laminarTransport.lookup("lambda") >> lambda; laminarTransport.lookup("lambda") >> lambda;
@ -121,7 +122,7 @@ int main(int argc, char *argv[])
adjustPhi(phi, U, p); adjustPhi(phi, U, p);
// Non-orthogonal pressure corrector loop // Non-orthogonal pressure corrector loop
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
@ -131,7 +132,7 @@ int main(int argc, char *argv[])
pEqn.setReference(pRefCell, pRefValue); pEqn.setReference(pRefCell, pRefValue);
pEqn.solve(); pEqn.solve();
if (nonOrth == nNonOrthCorr) if (nonOrth == simple.nNonOrthCorr())
{ {
phi -= pEqn.flux(); phi -= pEqn.flux();
} }
@ -184,7 +185,7 @@ int main(int argc, char *argv[])
adjustPhi(phia, Ua, pa); adjustPhi(phia, Ua, pa);
// Non-orthogonal pressure corrector loop // Non-orthogonal pressure corrector loop
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
{ {
fvScalarMatrix paEqn fvScalarMatrix paEqn
( (
@ -194,7 +195,7 @@ int main(int argc, char *argv[])
paEqn.setReference(paRefCell, paRefValue); paEqn.setReference(paRefCell, paRefValue);
paEqn.solve(); paEqn.solve();
if (nonOrth == nNonOrthCorr) if (nonOrth == simple.nNonOrthCorr())
{ {
phia -= paEqn.flux(); phia -= paEqn.flux();
} }

View File

@ -11,7 +11,7 @@ UEqn().relax();
volScalarField rAU(1.0/UEqn().A()); volScalarField rAU(1.0/UEqn().A());
if (momentumPredictor) if (pimple.momentumPredictor())
{ {
solve(UEqn() == -fvc::grad(p)); solve(UEqn() == -fvc::grad(p));
} }

View File

@ -1,6 +1,6 @@
U = rAU*UEqn().H(); U = rAU*UEqn().H();
if (nCorr <= 1) if (pimple.nCorr() <= 1)
{ {
UEqn.clear(); UEqn.clear();
} }
@ -11,7 +11,7 @@ phi = (fvc::interpolate(U) & mesh.Sf())
adjustPhi(phi, U, p); adjustPhi(phi, U, p);
// Non-orthogonal pressure corrector loop // Non-orthogonal pressure corrector loop
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{ {
// Pressure corrector // Pressure corrector
fvScalarMatrix pEqn fvScalarMatrix pEqn
@ -23,18 +23,10 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
pEqn.solve pEqn.solve
( (
mesh.solver mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
(
p.select
(
pimpleCorr.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
); );
if (nonOrth == nNonOrthCorr) if (nonOrth == pimple.nNonOrthCorr())
{ {
phi -= pEqn.flux(); phi -= pEqn.flux();
} }

View File

@ -11,7 +11,7 @@ UEqn().relax();
rAU = 1.0/UEqn().A(); rAU = 1.0/UEqn().A();
if (momentumPredictor) if (pimple.momentumPredictor())
{ {
solve(UEqn() == -fvc::grad(p)); solve(UEqn() == -fvc::grad(p));
} }

View File

@ -50,7 +50,7 @@
pcorrTypes pcorrTypes
); );
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{ {
fvScalarMatrix pcorrEqn fvScalarMatrix pcorrEqn
( (
@ -60,7 +60,7 @@
pcorrEqn.setReference(pRefCell, pRefValue); pcorrEqn.setReference(pRefCell, pRefValue);
pcorrEqn.solve(); pcorrEqn.solve();
if (nonOrth == nNonOrthCorr) if (nonOrth == pimple.nNonOrthCorr())
{ {
phi -= pcorrEqn.flux(); phi -= pcorrEqn.flux();
} }

View File

@ -1,6 +1,6 @@
U = rAU*UEqn().H(); U = rAU*UEqn().H();
if (nCorr <= 1) if (pimple.nCorr() <= 1)
{ {
UEqn.clear(); UEqn.clear();
} }
@ -14,7 +14,7 @@ if (p.needReference())
fvc::makeAbsolute(phi, U); fvc::makeAbsolute(phi, U);
} }
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
@ -25,20 +25,10 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
pEqn.solve pEqn.solve
( (
mesh.solver mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
(
p.select
(
(
pimpleCorr.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
)
); );
if (nonOrth == nNonOrthCorr) if (nonOrth == pimple.nNonOrthCorr())
{ {
phi -= pEqn.flux(); phi -= pEqn.flux();
} }

View File

@ -36,7 +36,7 @@ Description
#include "singlePhaseTransportModel.H" #include "singlePhaseTransportModel.H"
#include "turbulenceModel.H" #include "turbulenceModel.H"
#include "dynamicFvMesh.H" #include "dynamicFvMesh.H"
#include "pimpleLoop.H" #include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -46,11 +46,12 @@ int main(int argc, char *argv[])
#include "createTime.H" #include "createTime.H"
#include "createDynamicFvMesh.H" #include "createDynamicFvMesh.H"
#include "readPIMPLEControls.H"
#include "initContinuityErrs.H" #include "initContinuityErrs.H"
#include "createFields.H" #include "createFields.H"
#include "readTimeControls.H" #include "readTimeControls.H"
pimpleControl pimple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl; Info<< "\nStarting time loop\n" << endl;
@ -85,14 +86,9 @@ int main(int argc, char *argv[])
} }
// --- Pressure-velocity PIMPLE corrector loop // --- Pressure-velocity PIMPLE corrector loop
for for (pimple.start(); pimple.loop(); pimple++)
(
pimpleLoop pimpleCorr(mesh, nOuterCorr);
pimpleCorr.loop();
pimpleCorr++
)
{ {
if (nOuterCorr != 1) if (pimple.nOuterCorr() != 1)
{ {
p.storePrevIter(); p.storePrevIter();
} }
@ -100,12 +96,15 @@ int main(int argc, char *argv[])
#include "UEqn.H" #include "UEqn.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"
} }
turbulence->correct(); if (pimple.turbCorr())
{
turbulence->correct();
}
} }
runTime.write(); runTime.write();

View File

@ -1,9 +1,10 @@
#include "readTimeControls.H" #include "readTimeControls.H"
#include "readPIMPLEControls.H"
const dictionary& pimpleDict = pimple.dict();
const bool correctPhi = const bool correctPhi =
pimple.lookupOrDefault("correctPhi", false); pimpleDict.lookupOrDefault("correctPhi", false);
const bool checkMeshCourantNo = const bool checkMeshCourantNo =
pimple.lookupOrDefault("checkMeshCourantNo", false); pimpleDict.lookupOrDefault("checkMeshCourantNo", false);

View File

@ -35,7 +35,7 @@ Description
#include "fvCFD.H" #include "fvCFD.H"
#include "singlePhaseTransportModel.H" #include "singlePhaseTransportModel.H"
#include "turbulenceModel.H" #include "turbulenceModel.H"
#include "pimpleLoop.H" #include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -47,12 +47,15 @@ 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;
while (runTime.run()) while (runTime.run())
{ {
#include "readTimeControls.H" #include "readTimeControls.H"
#include "readPIMPLEControls.H"
#include "CourantNo.H" #include "CourantNo.H"
#include "setDeltaT.H" #include "setDeltaT.H"
@ -61,14 +64,9 @@ int main(int argc, char *argv[])
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
// --- Pressure-velocity PIMPLE corrector loop // --- Pressure-velocity PIMPLE corrector loop
for for (pimple.start(); pimple.loop(); pimple++)
(
pimpleLoop pimpleCorr(mesh, nOuterCorr);
pimpleCorr.loop();
pimpleCorr++
)
{ {
if (nOuterCorr != 1) if (pimple.nOuterCorr() != 1)
{ {
p.storePrevIter(); p.storePrevIter();
} }
@ -76,12 +74,15 @@ int main(int argc, char *argv[])
#include "UEqn.H" #include "UEqn.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"
} }
turbulence->correct(); if (pimple.turbCorr())
{
turbulence->correct();
}
} }
runTime.write(); runTime.write();

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) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -33,6 +33,7 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "fvCFD.H" #include "fvCFD.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -44,6 +45,8 @@ int main(int argc, char *argv[])
#include "readGravitationalAcceleration.H" #include "readGravitationalAcceleration.H"
#include "createFields.H" #include "createFields.H"
pimpleControl pimple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl; Info<< "\nStarting time loop\n" << endl;
@ -52,10 +55,10 @@ int main(int argc, char *argv[])
{ {
Info<< "\n Time = " << runTime.timeName() << nl << endl; Info<< "\n Time = " << runTime.timeName() << nl << endl;
#include "readPISOControls.H"
#include "CourantNo.H" #include "CourantNo.H"
for (int ucorr=0; ucorr<nOuterCorr; ucorr++) // --- Pressure-velocity PIMPLE corrector loop
for (pimple.start(); pimple.loop(); pimple++)
{ {
surfaceScalarField phiv("phiv", phi/fvc::interpolate(h)); surfaceScalarField phiv("phiv", phi/fvc::interpolate(h));
@ -67,7 +70,7 @@ int main(int argc, char *argv[])
hUEqn.relax(); hUEqn.relax();
if (momentumPredictor) if (pimple.momentumPredictor())
{ {
if (rotating) if (rotating)
{ {
@ -87,7 +90,7 @@ int main(int argc, char *argv[])
} }
// --- PISO loop // --- PISO loop
for (int corr=0; corr<nCorr; corr++) for (int corr=0; corr<pimple.nCorr(); corr++)
{ {
volScalarField rAU(1.0/hUEqn.A()); volScalarField rAU(1.0/hUEqn.A());
surfaceScalarField ghrAUf(magg*fvc::interpolate(h*rAU)); surfaceScalarField ghrAUf(magg*fvc::interpolate(h*rAU));
@ -107,7 +110,7 @@ int main(int argc, char *argv[])
+ fvc::ddtPhiCorr(rAU, h, hU, phi) + fvc::ddtPhiCorr(rAU, h, hU, phi)
- phih0; - phih0;
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{ {
fvScalarMatrix hEqn fvScalarMatrix hEqn
( (
@ -116,16 +119,15 @@ int main(int argc, char *argv[])
- fvm::laplacian(ghrAUf, h) - fvm::laplacian(ghrAUf, h)
); );
if (ucorr < nOuterCorr-1 || corr < nCorr-1) hEqn.solve
{ (
hEqn.solve(); mesh.solver
} (
else h.select(pimple.finalInnerIter(corr, nonOrth))
{ )
hEqn.solve(mesh.solver(h.name() + "Final")); );
}
if (nonOrth == nNonOrthCorr) if (nonOrth == pimple.nNonOrthCorr())
{ {
phi += hEqn.flux(); phi += hEqn.flux();
} }

View File

@ -3,6 +3,10 @@ cd ${0%/*} || exit 1 # run from this directory
set -x set -x
wmake wmake
wmake SRFSimpleFoam
wmake MRFSimpleFoam
wmake windSimpleFoam
wmake porousSimpleFoam wmake porousSimpleFoam
# ----------------------------------------------------------------- end-of-file # ----------------------------------------------------------------- end-of-file

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) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -22,19 +22,19 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application Application
rhoPisoTwinParcelFoam MRFSimpleFoam
Description Description
Transient solver for compressible, turbulent flow with two thermo-clouds. Steady-state solver for incompressible, turbulent flow of non-Newtonian
fluids with MRF regions.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "fvCFD.H" #include "fvCFD.H"
#include "basicPsiThermo.H" #include "singlePhaseTransportModel.H"
#include "turbulenceModel.H" #include "RASModel.H"
#include "MRFZones.H"
#include "basicThermoCloud.H" #include "simpleControl.H"
#include "basicKinematicCloud.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -44,54 +44,32 @@ int main(int argc, char *argv[])
#include "createTime.H" #include "createTime.H"
#include "createMesh.H" #include "createMesh.H"
#include "readGravitationalAcceleration.H"
#include "createFields.H" #include "createFields.H"
#include "createClouds.H"
#include "readPISOControls.H"
#include "initContinuityErrs.H" #include "initContinuityErrs.H"
#include "readTimeControls.H"
#include "compressibleCourantNo.H" MRFZones mrfZones(mesh);
#include "setInitialDeltaT.H" mrfZones.correctBoundaryVelocity(U);
simpleControl simple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl; Info<< "\nStarting time loop\n" << endl;
while (runTime.run()) while (simple.loop())
{ {
#include "readTimeControls.H"
#include "readPISOControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
thermoCloud1.evolve(); p.storePrevIter();
kinematicCloud1.evolve(); // --- Pressure-velocity SIMPLE corrector
#include "rhoEqn.H"
// --- PIMPLE loop
for (int ocorr=1; ocorr<=nOuterCorr; ocorr++)
{ {
#include "UEqn.H" #include "UEqn.H"
#include "pEqn.H"
// --- PISO loop
for (int corr=1; corr<=nCorr; corr++)
{
#include "hsEqn.H"
#include "pEqn.H"
}
} }
turbulence->correct(); turbulence->correct();
rho = thermo.rho();
runTime.write(); runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"

View File

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

View File

@ -1,4 +1,5 @@
EXE_INC = \ EXE_INC = \
-I.. \
-I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/incompressible/RAS/RASModel \ -I$(LIB_SRC)/turbulenceModels/incompressible/RAS/RASModel \
-I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels \

View File

@ -0,0 +1,12 @@
// Momentum predictor
tmp<fvVectorMatrix> UEqn
(
fvm::div(phi, U)
+ turbulence->divDevReff(U)
);
mrfZones.addCoriolis(UEqn());
UEqn().relax();
solve(UEqn() == -fvc::grad(p));

View File

@ -0,0 +1,37 @@
{
p.boundaryField().updateCoeffs();
volScalarField rAU(1.0/UEqn().A());
U = rAU*UEqn().H();
UEqn.clear();
phi = fvc::interpolate(U, "interpolate(HbyA)") & mesh.Sf();
mrfZones.relativeFlux(phi);
adjustPhi(phi, U, p);
// Non-orthogonal pressure corrector loop
for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix pEqn
(
fvm::laplacian(rAU, p) == fvc::div(phi)
);
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve();
if (nonOrth == simple.nNonOrthCorr())
{
phi -= pEqn.flux();
}
}
#include "continuityErrs.H"
// Explicitly relax pressure for momentum corrector
p.relax();
// Momentum corrector
U -= rAU*fvc::grad(p);
U.correctBoundaryConditions();
}

View File

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

View File

@ -1,4 +1,5 @@
EXE_INC = \ EXE_INC = \
-I.. \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/incompressible/RAS/RASModel \ -I$(LIB_SRC)/turbulenceModels/incompressible/RAS/RASModel \

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) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application Application
simpleSRFFoam SRFSimpleFoam
Description Description
Steady-state solver for incompressible, turbulent flow of non-Newtonian Steady-state solver for incompressible, turbulent flow of non-Newtonian
@ -34,6 +34,7 @@ Description
#include "singlePhaseTransportModel.H" #include "singlePhaseTransportModel.H"
#include "RASModel.H" #include "RASModel.H"
#include "SRFModel.H" #include "SRFModel.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -45,20 +46,19 @@ int main(int argc, char *argv[])
#include "createFields.H" #include "createFields.H"
#include "initContinuityErrs.H" #include "initContinuityErrs.H"
simpleControl simple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl; Info<< "\nStarting time loop\n" << endl;
while (runTime.loop()) while (simple.loop())
{ {
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readSIMPLEControls.H"
#include "initConvergenceCheck.H"
p.storePrevIter(); p.storePrevIter();
// Pressure-velocity SIMPLE corrector // --- Pressure-velocity SIMPLE corrector
{ {
#include "UrelEqn.H" #include "UrelEqn.H"
#include "pEqn.H" #include "pEqn.H"
@ -87,8 +87,6 @@ int main(int argc, char *argv[])
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl; << nl << endl;
#include "convergenceCheck.H"
} }
Info<< "End\n" << endl; Info<< "End\n" << endl;

View File

@ -1,4 +1,5 @@
// Relative momentum predictor // Relative momentum predictor
tmp<fvVectorMatrix> UrelEqn tmp<fvVectorMatrix> UrelEqn
( (
fvm::div(phi, Urel) fvm::div(phi, Urel)
@ -8,9 +9,4 @@
UrelEqn().relax(); UrelEqn().relax();
eqnResidual = solve solve(UrelEqn() == -fvc::grad(p));
(
UrelEqn() == -fvc::grad(p)
).initialResidual();
maxResidual = max(eqnResidual, maxResidual);

View File

@ -1,34 +1,37 @@
{ {
p.boundaryField().updateCoeffs(); p.boundaryField().updateCoeffs();
volScalarField AUrel = UrelEqn().A();
Urel = UrelEqn().H()/AUrel; volScalarField rAUrel(1.0/UrelEqn().A());
Urel = rAUrel*UrelEqn().H();
UrelEqn.clear(); UrelEqn.clear();
phi = fvc::interpolate(Urel) & mesh.Sf();
phi = fvc::interpolate(Urel, "interpolate(HbyA)") & mesh.Sf();
adjustPhi(phi, Urel, p); adjustPhi(phi, Urel, p);
// Non-orthogonal pressure corrector loop // Non-orthogonal pressure corrector loop
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
fvm::laplacian(1.0/AUrel, p) == fvc::div(phi) fvm::laplacian(rAUrel, p) == fvc::div(phi)
); );
pEqn.setReference(pRefCell, pRefValue); pEqn.setReference(pRefCell, pRefValue);
pEqn.solve(); pEqn.solve();
if (nonOrth == nNonOrthCorr) if (nonOrth == simple.nNonOrthCorr())
{ {
phi -= pEqn.flux(); phi -= pEqn.flux();
} }
} }
# include "continuityErrs.H" #include "continuityErrs.H"
// Explicitly relax pressure for momentum corrector // Explicitly relax pressure for momentum corrector
p.relax(); p.relax();
// Momentum corrector // Momentum corrector
Urel -= fvc::grad(p)/AUrel; Urel -= rAUrel*fvc::grad(p);
Urel.correctBoundaryConditions(); Urel.correctBoundaryConditions();
} }

View File

@ -1,4 +1,4 @@
// Solve the Momentum equation // Momentum predictor
tmp<fvVectorMatrix> UEqn tmp<fvVectorMatrix> UEqn
( (

View File

@ -26,14 +26,13 @@
mesh mesh
); );
# include "createPhi.H" #include "createPhi.H"
label pRefCell = 0; label pRefCell = 0;
scalar pRefValue = 0.0; scalar pRefValue = 0.0;
setRefCell(p, mesh.solutionDict().subDict("SIMPLE"), pRefCell, pRefValue); setRefCell(p, mesh.solutionDict().subDict("SIMPLE"), pRefCell, pRefValue);
singlePhaseTransportModel laminarTransport(U, phi); singlePhaseTransportModel laminarTransport(U, phi);
autoPtr<incompressible::RASModel> turbulence autoPtr<incompressible::RASModel> turbulence

View File

@ -1,24 +1,26 @@
{
p.boundaryField().updateCoeffs(); p.boundaryField().updateCoeffs();
volScalarField AU(UEqn().A()); volScalarField rAU(1.0/UEqn().A());
U = UEqn().H()/AU; U = rAU*UEqn().H();
UEqn.clear(); UEqn.clear();
phi = fvc::interpolate(U) & mesh.Sf();
phi = fvc::interpolate(U, "interpolate(HbyA)") & mesh.Sf();
adjustPhi(phi, U, p); adjustPhi(phi, U, p);
// Non-orthogonal pressure corrector loop // Non-orthogonal pressure corrector loop
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
fvm::laplacian(1.0/AU, p) == fvc::div(phi) fvm::laplacian(rAU, p) == fvc::div(phi)
); );
pEqn.setReference(pRefCell, pRefValue); pEqn.setReference(pRefCell, pRefValue);
pEqn.solve(); pEqn.solve();
if (nonOrth == nNonOrthCorr) if (nonOrth == simple.nNonOrthCorr())
{ {
phi -= pEqn.flux(); phi -= pEqn.flux();
} }
@ -30,5 +32,6 @@
p.relax(); p.relax();
// Momentum corrector // Momentum corrector
U -= fvc::grad(p)/AU; U -= rAU*fvc::grad(p);
U.correctBoundaryConditions(); U.correctBoundaryConditions();
}

View File

@ -6,13 +6,7 @@
if (pZones.size()) if (pZones.size())
{ {
// nUCorrectors for pressureImplicitPorosity // nUCorrectors for pressureImplicitPorosity
if (mesh.solutionDict().subDict("SIMPLE").found("nUCorrectors")) nUCorr = simple.dict().lookupOrDefault<int>("nUCorrectors", 0);
{
nUCorr = readInt
(
mesh.solutionDict().subDict("SIMPLE").lookup("nUCorrectors")
);
}
if (nUCorr > 0) if (nUCorr > 0)
{ {

View File

@ -11,7 +11,7 @@ UEqn.clear();
phi = fvc::interpolate(U) & mesh.Sf(); phi = fvc::interpolate(U) & mesh.Sf();
adjustPhi(phi, U, p); adjustPhi(phi, U, p);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
{ {
tmp<fvScalarMatrix> tpEqn; tmp<fvScalarMatrix> tpEqn;
@ -35,7 +35,7 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
tpEqn().solve(); tpEqn().solve();
} }
if (nonOrth == nNonOrthCorr) if (nonOrth == simple.nNonOrthCorr())
{ {
phi -= tpEqn().flux(); phi -= tpEqn().flux();
} }

View File

@ -34,6 +34,7 @@ Description
#include "singlePhaseTransportModel.H" #include "singlePhaseTransportModel.H"
#include "RASModel.H" #include "RASModel.H"
#include "porousZones.H" #include "porousZones.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -42,6 +43,9 @@ int main(int argc, char *argv[])
#include "setRootCase.H" #include "setRootCase.H"
#include "createTime.H" #include "createTime.H"
#include "createMesh.H" #include "createMesh.H"
simpleControl simple(mesh);
#include "createFields.H" #include "createFields.H"
#include "createPorousZones.H" #include "createPorousZones.H"
#include "initContinuityErrs.H" #include "initContinuityErrs.H"
@ -50,12 +54,10 @@ int main(int argc, char *argv[])
Info<< "\nStarting time loop\n" << endl; Info<< "\nStarting time loop\n" << endl;
while (runTime.loop()) while (simple.loop())
{ {
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readSIMPLEControls.H"
p.storePrevIter(); p.storePrevIter();
// Pressure-velocity SIMPLE corrector // Pressure-velocity SIMPLE corrector

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) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -32,6 +32,7 @@ Description
#include "fvCFD.H" #include "fvCFD.H"
#include "singlePhaseTransportModel.H" #include "singlePhaseTransportModel.H"
#include "RASModel.H" #include "RASModel.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -43,19 +44,19 @@ int main(int argc, char *argv[])
#include "createFields.H" #include "createFields.H"
#include "initContinuityErrs.H" #include "initContinuityErrs.H"
simpleControl simple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl; Info<< "\nStarting time loop\n" << endl;
while (runTime.loop()) while (simple.loop())
{ {
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readSIMPLEControls.H"
p.storePrevIter(); p.storePrevIter();
// Pressure-velocity SIMPLE corrector // --- Pressure-velocity SIMPLE corrector
{ {
#include "UEqn.H" #include "UEqn.H"
#include "pEqn.H" #include "pEqn.H"

View File

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

View File

@ -1,4 +1,5 @@
EXE_INC = \ EXE_INC = \
-I.. \
-I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/incompressible/RAS/RASModel \ -I$(LIB_SRC)/turbulenceModels/incompressible/RAS/RASModel \
-I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels \

View File

@ -11,9 +11,4 @@
// Add resistance on the actuation disks // Add resistance on the actuation disks
actuationDisks.addSu(UEqn()); actuationDisks.addSu(UEqn());
eqnResidual = solve solve(UEqn() == -fvc::grad(p));
(
UEqn() == -fvc::grad(p)
).initialResidual();
maxResidual = max(eqnResidual, maxResidual);

View File

@ -34,6 +34,7 @@ Description
#include "singlePhaseTransportModel.H" #include "singlePhaseTransportModel.H"
#include "RASModel.H" #include "RASModel.H"
#include "IObasicSourceList.H" #include "IObasicSourceList.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -45,17 +46,18 @@ int main(int argc, char *argv[])
#include "createFields.H" #include "createFields.H"
#include "initContinuityErrs.H" #include "initContinuityErrs.H"
IObasicSourceList actuationDisks(mesh);
simpleControl simple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl; Info<< "\nStarting time loop\n" << endl;
while (runTime.loop()) while (simple.loop())
{ {
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readSIMPLEControls.H"
#include "initConvergenceCheck.H"
p.storePrevIter(); p.storePrevIter();
// Pressure-velocity SIMPLE corrector // Pressure-velocity SIMPLE corrector
@ -71,9 +73,6 @@ int main(int argc, char *argv[])
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl; << nl << endl;
#include "convergenceCheck.H"
} }
Info<< "End\n" << endl; Info<< "End\n" << endl;

View File

@ -46,7 +46,7 @@ Description
#include "timeActivatedExplicitSource.H" #include "timeActivatedExplicitSource.H"
#include "SLGThermo.H" #include "SLGThermo.H"
#include "fvcSmooth.H" #include "fvcSmooth.H"
#include "pimpleLoop.H" #include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -57,6 +57,9 @@ int main(int argc, char *argv[])
#include "createTime.H" #include "createTime.H"
#include "createMesh.H" #include "createMesh.H"
#include "readGravitationalAcceleration.H" #include "readGravitationalAcceleration.H"
pimpleControl pimple(mesh);
#include "readTimeControls.H" #include "readTimeControls.H"
#include "readAdditionalSolutionControls.H" #include "readAdditionalSolutionControls.H"
#include "createFields.H" #include "createFields.H"
@ -72,7 +75,6 @@ int main(int argc, char *argv[])
while (runTime.run()) while (runTime.run())
{ {
#include "readPIMPLEControls.H"
#include "readChemistryProperties.H" #include "readChemistryProperties.H"
#include "readAdditionalSolutionControls.H" #include "readAdditionalSolutionControls.H"
#include "readTimeControls.H" #include "readTimeControls.H"
@ -89,14 +91,9 @@ int main(int argc, char *argv[])
#include "rhoEqn.H" #include "rhoEqn.H"
// --- Pressure-velocity PIMPLE corrector loop // --- Pressure-velocity PIMPLE corrector loop
for for (pimple.start(); pimple.loop(); pimple++)
(
pimpleLoop pimpleCorr(mesh, nOuterCorr);
pimpleCorr.loop();
pimpleCorr++
)
{ {
if (nOuterCorr != 1) if (pimple.nOuterCorr() != 1)
{ {
p.storePrevIter(); p.storePrevIter();
} }
@ -108,7 +105,7 @@ int main(int argc, char *argv[])
#include "hsEqn.H" #include "hsEqn.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"
} }

View File

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

View File

@ -116,11 +116,11 @@
dimensionedScalar("chemistrySh", dimEnergy/dimTime/dimVolume, 0.0) dimensionedScalar("chemistrySh", dimEnergy/dimTime/dimVolume, 0.0)
); );
volScalarField invTau volScalarField rDeltaT
( (
IOobject IOobject
( (
"invTau", "rDeltaT",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,

View File

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

View File

@ -24,47 +24,16 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
// Maximum flow Courant number // Maximum flow Courant number
scalar maxCo(readScalar(runTime.controlDict().lookup("maxCo"))); scalar maxCo(readScalar(pimple.dict().lookup("maxCo")));
// Maximum time scale // Maximum time scale
scalar maxDeltaT = readScalar(runTime.controlDict().lookup("maxDeltaT")); scalar maxDeltaT = readScalar(pimple.dict().lookup("maxDeltaT"));
// Smoothing parameter (0-1) when smoothing iterations > 0 // Smoothing parameter (0-1) when smoothing iterations > 0
scalar alphaTauSmooth scalar alphaTauSmooth(pimple.dict().lookupOrDefault("alphaTauSmooth", 0.1));
(
runTime.controlDict().lookupOrDefault("alphaTauSmooth", 0.1)
);
// Maximum change in cell density per iteration (relative to previous value)
scalar alphaTauRho
(
runTime.controlDict().lookupOrDefault("alphaTauRho", 0.05)
);
// Maximum change in cell velocity per iteration (relative to previous value)
scalar alphaTauU
(
runTime.controlDict().lookupOrDefault("alphaTauU", 0.05)
);
// Maximum change in cell temperature per iteration (relative to previous value) // Maximum change in cell temperature per iteration (relative to previous value)
scalar alphaTauTemp scalar alphaTauTemp(pimple.dict().lookupOrDefault("alphaTauTemp", 0.05));
(
runTime.controlDict().lookupOrDefault("alphaTauTemp", 0.05)
);
// Max specie mass fraction that can be consumed/gained per chemistry
// integration step
scalar alphaTauSpecie
(
runTime.controlDict().lookupOrDefault("alphaTauSpecie", 0.05)
);
// Maximum unboundedness allowed (fraction of 1)
scalar specieMaxUnbound
(
runTime.controlDict().lookupOrDefault("specieMaxUnbound", 0.01)
);
// ************************************************************************* // // ************************************************************************* //

View File

@ -28,40 +28,40 @@ Info<< "Time scales min/max:" << endl;
{ {
// Cache old time scale field // Cache old time scale field
tmp<volScalarField> tinvTau0 tmp<volScalarField> trDeltaT
( (
new volScalarField new volScalarField
( (
IOobject IOobject
( (
"invTau0", "rDeltaT0",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false false
), ),
invTau rDeltaT
) )
); );
const volScalarField& invTau0 = tinvTau0(); const volScalarField& rDeltaT0 = trDeltaT();
// Flow time scale // Flow time scale
// ~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~
{ {
invTau = rDeltaT =
fvc::surfaceSum fvc::surfaceSum
( (
mag(phi)*mesh.deltaCoeffs()/(maxCo*mesh.magSf()) mag(phi)*mesh.deltaCoeffs()/(maxCo*mesh.magSf())
) )
/rho; /rho;
invTau.max(1.0/maxDeltaT); rDeltaT.max(1.0/maxDeltaT);
Info<< " Flow = " Info<< " Flow = "
<< gMin(1/invTau.internalField()) << ", " << gMin(1/rDeltaT.internalField()) << ", "
<< gMax(1/invTau.internalField()) << endl; << gMax(1/rDeltaT.internalField()) << endl;
} }
@ -87,7 +87,7 @@ Info<< "Time scales min/max:" << endl;
Info<< " Temperature = " << min(maxDeltaT, gMin(tau)) << ", " Info<< " Temperature = " << min(maxDeltaT, gMin(tau)) << ", "
<< min(maxDeltaT, gMax(tau)) << endl; << min(maxDeltaT, gMax(tau)) << endl;
invTau.internalField() = max(invTau.internalField(), 1/tau); rDeltaT.internalField() = max(rDeltaT.internalField(), 1/tau);
} }
@ -95,21 +95,20 @@ Info<< "Time scales min/max:" << endl;
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// - reduce as much as required for flow, but limit source contributions // - reduce as much as required for flow, but limit source contributions
const dimensionedScalar deltaTRamp("deltaTRamp", dimless, 1/(1 + 0.2)); const dimensionedScalar deltaTRamp("deltaTRamp", dimless, 1/(1 + 0.2));
invTau = max(invTau, invTau0*deltaTRamp); rDeltaT = max(rDeltaT, rDeltaT0*deltaTRamp);
tinvTau0.clear();
// Limit the largest time scale // Limit the largest time scale
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
invTau.max(1/maxDeltaT); rDeltaT.max(1/maxDeltaT);
// Spatially smooth the time scale field // Spatially smooth the time scale field
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fvc::smooth(invTau, alphaTauSmooth); fvc::smooth(rDeltaT, alphaTauSmooth);
Info<< " Overall = " << min(1/invTau).value() Info<< " Overall = " << min(1/rDeltaT).value()
<< ", " << max(1/invTau).value() << nl << endl; << ", " << max(1/rDeltaT).value() << nl << endl;
} }

View File

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

View File

@ -45,7 +45,7 @@ Description
#include "timeActivatedExplicitSource.H" #include "timeActivatedExplicitSource.H"
#include "radiationModel.H" #include "radiationModel.H"
#include "SLGThermo.H" #include "SLGThermo.H"
#include "pimpleLoop.H" #include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -65,6 +65,8 @@ int main(int argc, char *argv[])
#include "compressibleCourantNo.H" #include "compressibleCourantNo.H"
#include "setInitialDeltaT.H" #include "setInitialDeltaT.H"
pimpleControl pimple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl; Info<< "\nStarting time loop\n" << endl;
@ -72,7 +74,6 @@ int main(int argc, char *argv[])
while (runTime.run()) while (runTime.run())
{ {
#include "readTimeControls.H" #include "readTimeControls.H"
#include "readPISOControls.H"
#include "compressibleCourantNo.H" #include "compressibleCourantNo.H"
#include "setDeltaT.H" #include "setDeltaT.H"
@ -91,25 +92,23 @@ int main(int argc, char *argv[])
#include "rhoEqn.H" #include "rhoEqn.H"
// --- Pressure-velocity PIMPLE corrector loop // --- Pressure-velocity PIMPLE corrector loop
for for (pimple.start(); pimple.loop(); pimple++)
(
pimpleLoop pimpleCorr(mesh, nOuterCorr);
pimpleCorr.loop();
pimpleCorr++
)
{ {
#include "UEqn.H" #include "UEqn.H"
#include "YEqn.H" #include "YEqn.H"
#include "hsEqn.H" #include "hsEqn.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"
} }
}
turbulence->correct(); if (pimple.turbCorr())
{
turbulence->correct();
}
}
rho = thermo.rho(); rho = thermo.rho();

View File

@ -3,7 +3,7 @@ rho = thermo.rho();
volScalarField rAU(1.0/UEqn.A()); volScalarField rAU(1.0/UEqn.A());
U = rAU*UEqn.H(); U = rAU*UEqn.H();
if (transonic) if (pimple.transonic())
{ {
surfaceScalarField phid 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 fvScalarMatrix pEqn
( (
@ -28,18 +28,10 @@ if (transonic)
pEqn.solve pEqn.solve
( (
mesh.solver mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
(
p.select
(
pimpleCorr.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
); );
if (nonOrth == nNonOrthCorr) if (nonOrth == pimple.nNonOrthCorr())
{ {
phi == pEqn.flux(); phi == pEqn.flux();
} }
@ -54,7 +46,7 @@ else
+ fvc::ddtPhiCorr(rAU, rho, U, phi) + fvc::ddtPhiCorr(rAU, rho, U, phi)
); );
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
@ -67,18 +59,10 @@ else
pEqn.solve pEqn.solve
( (
mesh.solver mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
(
p.select
(
pimpleCorr.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
); );
if (nonOrth == nNonOrthCorr) if (nonOrth == pimple.nNonOrthCorr())
{ {
phi += pEqn.flux(); phi += pEqn.flux();
} }

View File

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

View File

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

Some files were not shown because too many files have changed in this diff Show More