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

This commit is contained in:
andy
2011-05-12 13:14:58 +01:00
1211 changed files with 64192 additions and 59969 deletions

View File

@ -120,6 +120,8 @@
+ reuses tracking state in interpolation - improves consistency and speed + reuses tracking state in interpolation - improves consistency and speed
*** *Updated* split cyclics into two separate patches. *** *Updated* split cyclics into two separate patches.
See [[./doc/changes/splitCyclic.txt]] See [[./doc/changes/splitCyclic.txt]]
* *New* cyclics (and all coupled patches) have optional
matchTolerance entry to allow looser area matching tolerance.
* *Updated* interpolation (volPointInterpolation) now works without the * *Updated* interpolation (volPointInterpolation) now works without the
globalPointPatch. Moving mesh cases can now be run non-parallel and globalPointPatch. Moving mesh cases can now be run non-parallel and
continued in parallel and reconstructed without any limitation. continued in parallel and reconstructed without any limitation.
@ -264,8 +266,6 @@
internal field instead of boundary field. internal field instead of boundary field.
+ =ensight=: new output format for all sampledSurfaces. + =ensight=: new output format for all sampledSurfaces.
+ Function objects: + Function objects:
+ =residualControl=: new function object to allow users to terminate steady
state calculations when the defined residual levels are achieved
+ =abortCalculation=: watches for presence of the named file in the + =abortCalculation=: watches for presence of the named file in the
$FOAM_CASE directory and aborts the calculation if it is present $FOAM_CASE directory and aborts the calculation if it is present
+ =timeActivatedFileUpdate=: performs a file copy/replacement once a + =timeActivatedFileUpdate=: performs a file copy/replacement once a
@ -312,8 +312,3 @@
* Other * Other
+ compilable with =clang= + compilable with =clang=
In your prefs.sh set the WM_COMPILER to Clang In your prefs.sh set the WM_COMPILER to Clang
+ dlclose error: upon exit of e.g. paraFoam you can get the error
Inconsistency detected by ld.so: dl-close.c: 731: _dl_close: Assertion
`map->l_init_called' failed!
This seems to happen with a mix of system libraries and a thirdParty
compiler.

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
@ -110,7 +110,12 @@ int main(int argc, char *argv[])
if (runTime.outputTime()) if (runTime.outputTime())
{ {
calcEk(U, K).write(runTime.timePath()/"Ek", runTime.graphFormat()); calcEk(U, K).write
(
runTime.path()/"graphs"/runTime.timeName(),
"Ek",
runTime.graphFormat()
);
} }
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"

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 "setRootCase.H"
#include "createTime.H" #include "createTime.H"
#include "createMesh.H" #include "createMesh.H"
#include "createFields.H" #include "createFields.H"
simpleControl simple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
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,10 +112,14 @@ int main(int argc, char *argv[])
Info<< "\n\nTime = " << runTime.timeName() << endl; Info<< "\n\nTime = " << runTime.timeName() << endl;
#include "rhoEqn.H" #include "rhoEqn.H"
// --- Pressure-velocity PIMPLE corrector loop
for (pimple.start(); pimple.loop(); pimple++)
{
#include "UEqn.H" #include "UEqn.H"
// --- PISO loop // --- PISO loop
for (int corr=1; corr<=nCorr; corr++) for (int corr=1; corr<=pimple.nCorr(); corr++)
{ {
#include "bEqn.H" #include "bEqn.H"
#include "ftEqn.H" #include "ftEqn.H"
@ -116,7 +134,11 @@ int main(int argc, char *argv[])
#include "pEqn.H" #include "pEqn.H"
} }
if (pimple.turbCorr())
{
turbulence->correct(); turbulence->correct();
}
}
runTime.write(); runTime.write();

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

@ -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) 1991-2011 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

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) 1991-2011 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

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;
// --- Pressure-velocity PIMPLE corrector loop
for (int oCorr=0; oCorr<nOuterCorr; oCorr++)
{
#include "rhoEqn.H" #include "rhoEqn.H"
// --- Pressure-velocity PIMPLE corrector loop
for (pimple.start(); pimple.loop(); pimple++)
{
#include "UEqn.H" #include "UEqn.H"
#include "ftEqn.H" #include "ftEqn.H"
@ -103,13 +106,16 @@ 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"
} }
if (pimple.turbCorr())
{
turbulence->correct(); 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"
// --- Pressure-velocity PIMPLE corrector loop
for (pimple.start(); pimple.loop(); pimple++)
{
#include "UEqn.H" #include "UEqn.H"
// --- PISO loop // --- PISO loop
for (int corr=1; corr<=nCorr; corr++) for (int corr=1; corr<=pimple.nCorr(); corr++)
{ {
#include "hEqn.H" #include "hEqn.H"
#include "pEqn.H" #include "pEqn.H"
} }
if (pimple.turbCorr())
{
turbulence->correct(); 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"
} }
}
if (pimple.turbCorr())
{
turbulence->correct(); 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"
} }
}
if (pimple.turbCorr())
{
turbulence->correct(); 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"
// --- Pressure-velocity PIMPLE corrector loop
for (pimple.start(); pimple.loop(); pimple++)
{
#include "UEqn.H" #include "UEqn.H"
// --- PISO loop
for (int corr=1; corr<=nCorr; corr++)
{
#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;
} }
// --- PISO loop
for (int corr=1; corr<=pimple.nCorr(); corr++)
{
#include "pEqn.H" #include "pEqn.H"
} }
if (pimple.turbCorr())
{
turbulence->correct(); 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"
} }
}
if (pimple.turbCorr())
{
turbulence->correct(); 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

@ -1,3 +1,4 @@
if (chemistry.chemistry())
{ {
Info<< "Solving chemistry" << endl; Info<< "Solving chemistry" << endl;
@ -10,17 +11,29 @@
// turbulent time scale // turbulent time scale
if (turbulentReaction) if (turbulentReaction)
{ {
volScalarField tk tmp<volScalarField> tepsilon(turbulence->epsilon());
( const volScalarField& epsilon = tepsilon();
Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon()) tmp<volScalarField> tmuEff(turbulence->muEff());
); const volScalarField& muEff = tmuEff();
volScalarField tc tmp<volScalarField> ttc(chemistry.tc());
( const volScalarField& tc = ttc();
chemistry.tc()
);
forAll(epsilon, i)
{
if (epsilon[i] > 0)
{
// Chalmers PaSR model // Chalmers PaSR model
kappa = (runTime.deltaT() + tc)/(runTime.deltaT() + tc + tk); scalar tk = Cmix.value()*Foam::sqrt(muEff[i]/rho[i]/epsilon[i]);
kappa[i] =
(runTime.deltaTValue() + tc[i])
/(runTime.deltaTValue() + tc[i] + tk);
}
else
{
// Return to laminar combustion
kappa[i] = 1.0;
}
}
} }
else else
{ {

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"
} }
}
if (pimple.turbCorr())
{
turbulence->correct(); turbulence->correct();
}
}
if (runTime.write()) if (runTime.write())
{ {

View File

@ -5,7 +5,9 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
-I$(LIB_SRC)/ODE/lnInclude \ -I$(LIB_SRC)/ODE/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(FOAM_SOLVERS)/combustion/reactingFoam
EXE_LIBS = \ EXE_LIBS = \
-lcompressibleTurbulenceModel \ -lcompressibleTurbulenceModel \

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

@ -1,28 +0,0 @@
{
Info<< "Solving chemistry" << endl;
chemistry.solve
(
runTime.value() - runTime.deltaTValue(),
runTime.deltaTValue()
);
// turbulent time scale
if (turbulentReaction)
{
volScalarField tk
(
Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon())
);
volScalarField tc(chemistry.tc());
// Chalmers PaSR model
kappa = (runTime.deltaT() + tc)/(runTime.deltaT() + tc + tk);
}
else
{
kappa = 1.0;
}
chemistrySh = kappa*chemistry.Sh()();
}

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"
} }
}
if (pimple.turbCorr())
{
turbulence->correct(); 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,13 +78,16 @@ 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"
} }
if (pimple.turbCorr())
{
turbulence->correct(); 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,13 +83,16 @@ 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"
} }
if (pimple.turbCorr())
{
turbulence->correct(); 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,11 +34,12 @@ Description
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
#include "setRootCase.H" #include "setRootCase.H"
#include "createTime.H" #include "createTime.H"
#include "createMesh.H" #include "createMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nReading field U\n" << endl; Info<< "\nReading field U\n" << endl;
volVectorField U volVectorField U
( (
@ -67,7 +68,6 @@ int main(int argc, char *argv[])
while (runTime.loop()) while (runTime.loop())
{ {
nAveragingSteps++; nAveragingSteps++;
Info<< "Time = " << runTime.timeName() << endl; Info<< "Time = " << runTime.timeName() << endl;
@ -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,11 +34,12 @@ Description
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
#include "setRootCase.H" #include "setRootCase.H"
#include "createTime.H" #include "createTime.H"
#include "createMesh.H" #include "createMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nReading field U\n" << endl; Info<< "\nReading field U\n" << endl;
volVectorField U volVectorField U
( (
@ -65,7 +66,6 @@ int main(int argc, char *argv[])
while (runTime.loop()) while (runTime.loop())
{ {
nAveragingSteps++; nAveragingSteps++;
Info<< "Time = " << runTime.timeName() << endl; Info<< "Time = " << runTime.timeName() << endl;
@ -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,13 +90,16 @@ 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"
} }
if (pimple.turbCorr())
{
turbulence->correct(); 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,15 +83,18 @@ 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"
} }
if (pimple.turbCorr())
{
turbulence->correct(); turbulence->correct();
}
}
rho = thermo.rho(); rho = thermo.rho();
}
runTime.write(); runTime.write();

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

@ -8,10 +8,10 @@
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the under the terms of the GNU General Public License as published by
Free Software Foundation; either version 2 of the License, or (at your the Free Software Foundation, either version 3 of the License, or
option) any later version. (at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@ -19,8 +19,7 @@ License
for more details. for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation, along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

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,13 +96,16 @@ 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"
} }
if (pimple.turbCorr())
{
turbulence->correct(); 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,13 +74,16 @@ 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"
} }
if (pimple.turbCorr())
{
turbulence->correct(); 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"
// --- PISO loop
for (int corr=1; corr<=nCorr; corr++)
{
#include "hsEqn.H"
#include "pEqn.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,23 +1,26 @@
{ {
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();
} }
@ -29,6 +32,6 @@
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

@ -33,7 +33,6 @@
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

@ -19,7 +19,8 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
-I$(LIB_SRC)/ODE/lnInclude \ -I$(LIB_SRC)/ODE/lnInclude \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \ -I$(LIB_SRC)/regionModels/regionModel/lnInclude \
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
@ -42,4 +43,5 @@ EXE_LIBS = \
-lradiationModels \ -lradiationModels \
-lODE \ -lODE \
-lregionModels \ -lregionModels \
-lsurfaceFilmModels -lsurfaceFilmModels \
-lsampling

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));
} }

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