Commit 89335fa1 authored by andy's avatar andy
Browse files

ENH: Further solver PIMPLE updates

parent fd5e0cc7
......@@ -64,6 +64,7 @@ Description
#include "ignition.H"
#include "Switch.H"
#include "bound.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -81,6 +82,8 @@ int main(int argc, char *argv[])
#include "compressibleCourantNo.H"
#include "setInitialDeltaT.H"
pimpleControl pimple(mesh);
scalar StCoNum = 0.0;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -90,7 +93,6 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readTimeControls.H"
#include "readPISOControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
......@@ -98,26 +100,34 @@ int main(int argc, char *argv[])
Info<< "\n\nTime = " << runTime.timeName() << endl;
#include "rhoEqn.H"
#include "UEqn.H"
// --- PISO loop
for (int corr=1; corr<=nCorr; corr++)
// --- Pressure-velocity PIMPLE corrector loop
for (pimple.start(); pimple.loop(); pimple++)
{
#include "bEqn.H"
#include "ftEqn.H"
#include "huEqn.H"
#include "hEqn.H"
#include "UEqn.H"
if (!ign.ignited())
// --- PISO loop
for (int corr=1; corr<=pimple.nCorr(); corr++)
{
hu == h;
#include "bEqn.H"
#include "ftEqn.H"
#include "huEqn.H"
#include "hEqn.H"
if (!ign.ignited())
{
hu == h;
}
#include "pEqn.H"
}
#include "pEqn.H"
if (pimple.turbCorr())
{
turbulence->correct();
}
}
turbulence->correct();
runTime.write();
Info<< "\nExecutionTime = "
......
......@@ -9,7 +9,7 @@
volSymmTensorField invA(inv(I*UEqn.A() + drag->Dcu()));
if (momentumPredictor)
if (pimple.momentumPredictor())
{
U = invA & (UEqn.H() - betav*fvc::grad(p));
U.correctBoundaryConditions();
......
......@@ -3,7 +3,7 @@ rho = thermo.rho();
volScalarField rAU(1.0/UEqn.A());
U = invA & UEqn.H();
if (transonic)
if (pimple.transonic())
{
surfaceScalarField phid
(
......@@ -15,7 +15,7 @@ if (transonic)
)
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix pEqn
(
......@@ -24,9 +24,12 @@ if (transonic)
- fvm::laplacian(rho*invA, p)
);
pEqn.solve();
pEqn.solve
(
mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr)
if (nonOrth == pimple.nNonOrthCorr())
{
phi == pEqn.flux();
}
......@@ -41,7 +44,7 @@ else
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix pEqn
(
......@@ -50,9 +53,12 @@ else
- fvm::laplacian(rho*invA, p)
);
pEqn.solve();
pEqn.solve
(
mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr)
if (nonOrth == pimple.nNonOrthCorr())
{
phi += pEqn.flux();
}
......
......@@ -88,10 +88,11 @@ int main(int argc, char *argv[])
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "rhoEqn.H"
// --- Pressure-velocity PIMPLE corrector loop
for (pimple.start(); pimple.loop(); pimple++)
{
#include "rhoEqn.H"
#include "UEqn.H"
#include "ftEqn.H"
......@@ -110,7 +111,10 @@ int main(int argc, char *argv[])
#include "pEqn.H"
}
turbulence->correct();
if (pimple.turbCorr())
{
turbulence->correct();
}
}
rho = thermo.rho();
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -35,6 +35,7 @@ Description
#include "basicPsiThermo.H"
#include "turbulenceModel.H"
#include "OFstream.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -51,13 +52,14 @@ int main(int argc, char *argv[])
#include "setInitialDeltaT.H"
#include "startSummary.H"
pimpleControl pimple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
{
#include "readPISOControls.H"
#include "readEngineTimeControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
......@@ -71,17 +73,24 @@ int main(int argc, char *argv[])
#include "rhoEqn.H"
#include "UEqn.H"
// --- PISO loop
for (int corr=1; corr<=nCorr; corr++)
// --- Pressure-velocity PIMPLE corrector loop
for (pimple.start(); pimple.loop(); pimple++)
{
#include "hEqn.H"
#include "pEqn.H"
#include "UEqn.H"
// --- PISO loop
for (int corr=1; corr<=pimple.nCorr(); corr++)
{
#include "hEqn.H"
#include "pEqn.H"
}
if (pimple.turbCorr())
{
turbulence->correct();
}
}
turbulence->correct();
runTime.write();
#include "logSummary.H"
......
......@@ -79,10 +79,6 @@ int main(int argc, char *argv[])
Info<< "Crank angle = " << runTime.theta() << " CA-deg" << endl;
mesh.move();
const_cast<volPointInterpolation&>
(
volPointInterpolation::New(mesh)
).updateMesh();
dieselSpray.evolve();
......@@ -122,9 +118,12 @@ int main(int argc, char *argv[])
{
#include "pEqn.H"
}
}
turbulence->correct();
if (pimple.turbCorr())
{
turbulence->correct();
}
}
#include "logSummary.H"
#include "spraySummary.H"
......
......@@ -101,6 +101,7 @@ int main(int argc, char *argv[])
#include "rhoEqn.H"
// --- Pressure-velocity PIMPLE corrector loop
for (pimple.start(); pimple.loop(); pimple++)
{
#include "UEqn.H"
......@@ -112,9 +113,12 @@ int main(int argc, char *argv[])
{
#include "pEqn.H"
}
}
turbulence->correct();
if (pimple.turbCorr())
{
turbulence->correct();
}
}
#include "spraySummary.H"
......
......@@ -5,7 +5,7 @@
+ turbulence->divDevRhoReff(U)
);
if (momentumPredictor)
if (pimple.momentumPredictor())
{
solve(UEqn == -fvc::grad(p));
}
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -58,6 +58,7 @@ Description
#include "Switch.H"
#include "OFstream.H"
#include "mathematicalConstants.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -75,13 +76,14 @@ int main(int argc, char *argv[])
#include "setInitialDeltaT.H"
#include "startSummary.H"
pimpleControl pimple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
{
#include "readPISOControls.H"
#include "readEngineTimeControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
......@@ -94,11 +96,11 @@ int main(int argc, char *argv[])
#include "rhoEqn.H"
#include "UEqn.H"
// --- PISO loop
for (int corr=1; corr<=nCorr; corr++)
// --- Pressure-velocity PIMPLE corrector loop
for (pimple.start(); pimple.loop(); pimple++)
{
#include "UEqn.H"
#include "ftEqn.H"
#include "bEqn.H"
#include "huEqn.H"
......@@ -109,10 +111,17 @@ int main(int argc, char *argv[])
hu == h;
}
#include "pEqn.H"
}
// --- PISO loop
for (int corr=1; corr<=pimple.nCorr(); corr++)
{
#include "pEqn.H"
}
turbulence->correct();
if (pimple.turbCorr())
{
turbulence->correct();
}
}
#include "logSummary.H"
......
......@@ -3,7 +3,7 @@ rho = thermo.rho();
volScalarField rAU(1.0/UEqn.A());
U = rAU*UEqn.H();
if (transonic)
if (pimple.transonic())
{
surfaceScalarField phid
(
......@@ -12,18 +12,21 @@ if (transonic)
*((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U))
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix pEqn
(
fvm::ddt(psi, p)
+ fvm::div(phid, p, "div(phid,p)")
+ fvm::div(phid, p)
- fvm::laplacian(rho*rAU, p)
);
pEqn.solve();
pEqn.solve
(
mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr)
if (nonOrth == pimple.nNonOrthCorr())
{
phi == pEqn.flux();
}
......@@ -34,7 +37,7 @@ else
phi = fvc::interpolate(rho)
*((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U));
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix pEqn
(
......@@ -43,9 +46,12 @@ else
- fvm::laplacian(rho*rAU, p)
);
pEqn.solve();
pEqn.solve
(
mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr)
if (nonOrth == pimple.nNonOrthCorr())
{
phi += pEqn.flux();
}
......
......@@ -81,9 +81,12 @@ int main(int argc, char *argv[])
{
#include "pEqn.H"
}
}
turbulence->correct();
if (pimple.turbCorr())
{
turbulence->correct();
}
}
rho = thermo.rho();
......
......@@ -81,9 +81,12 @@ int main(int argc, char *argv[])
{
#include "pEqn.H"
}
}
turbulence->correct();
if (pimple.turbCorr())
{
turbulence->correct();
}
}
if (runTime.write())
{
......
......@@ -83,9 +83,12 @@ int main(int argc, char *argv[])
{
#include "pEqn.H"
}
}
turbulence->correct();
if (pimple.turbCorr())
{
turbulence->correct();
}
}
rho = thermo.rho();
......
......@@ -83,7 +83,10 @@ int main(int argc, char *argv[])
#include "pEqn.H"
}
turbulence->correct();
if (pimple.turbCorr())
{
turbulence->correct();
}
}
runTime.write();
......
......@@ -88,7 +88,10 @@ int main(int argc, char *argv[])
#include "pEqn.H"
}
turbulence->correct();
if (pimple.turbCorr())
{
turbulence->correct();
}
}
runTime.write();
......
......@@ -95,7 +95,10 @@ int main(int argc, char *argv[])
#include "pEqn.H"
}
turbulence->correct();
if (pimple.turbCorr())
{
turbulence->correct();
}
}
runTime.write();
......
......@@ -88,11 +88,14 @@ int main(int argc, char *argv[])
#include "pEqn.H"
}
turbulence->correct();
rho = thermo.rho();
if (pimple.turbCorr())
{
turbulence->correct();
}
}
rho = thermo.rho();
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
......
......@@ -101,7 +101,10 @@ int main(int argc, char *argv[])
#include "pEqn.H"
}
turbulence->correct();
if (pimple.turbCorr())
{
turbulence->correct();
}
}
runTime.write();
......
......@@ -79,7 +79,10 @@ int main(int argc, char *argv[])
#include "pEqn.H"
}
turbulence->correct();
if (pimple.turbCorr())
{
turbulence->correct();
}
}
runTime.write();
......
......@@ -57,6 +57,7 @@ int main(int argc, char *argv[])
#include "CourantNo.H"
// --- Pressure-velocity PIMPLE corrector loop
for (pimple.start(); pimple.loop(); pimple++)
{
surfaceScalarField phiv("phiv", phi/fvc::interpolate(h));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment