Merge PISO/PIMPLE solver updates. Author: Vanja Skuric. Merge: Henrik Rusche
Conflicts: applications/solvers/compressible/rhoPorousMRFPimpleFoam/rhoPorousMRFPimpleFoam.C applications/solvers/compressible/steadyCompressibleFoam/pEqn.H applications/solvers/compressible/steadyCompressibleMRFFoam/createFields.H applications/solvers/compressible/steadyCompressibleMRFFoam/pEqn.H applications/solvers/compressible/steadyCompressibleSRFFoam/createFields.H applications/solvers/compressible/steadyCompressibleSRFFoam/pEqn.H applications/solvers/coupled/MRFPorousFoam/createFields.H applications/solvers/coupled/pUCoupledFoam/createFields.H tutorials/compressible/rhoPorousMRFPimpleFoam/mixerVessel2D/system/fvSolution tutorials/compressible/steadyCompressibleFoam/transonicBump/system/fvSchemes tutorials/compressible/steadyCompressibleSRFFoam/bentBlade/system/fvSchemes tutorials/compressible/steadyCompressibleSRFFoam/simpleBlade/system/fvSchemes tutorials/coupled/conjugateHeatFoam/conjugateCavity/system/fvSchemes tutorials/coupled/conjugateHeatSimpleFoam/conjugateCavity/system/fvSchemes tutorials/equationReader/equationReaderDemo/pitzDaily/system/fvSchemes tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/system/fvSchemes tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/system/fvSchemes tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/fvSchemes tutorials/incompressible/pUCoupledFoam/backwardFacingStepLaminar/system/fvSchemes tutorials/incompressible/pUCoupledFoam/backwardFacingStepTurbulent/system/fvSchemes tutorials/incompressible/pUCoupledFoam/cavity/system/fvSchemes tutorials/viscoelastic/viscoelasticFluidFoam/XPP_SE/system/fvSchemes
This commit is contained in:
commit
c0dc374d98
505 changed files with 1453 additions and 3039 deletions
|
@ -27,3 +27,5 @@
|
|||
);
|
||||
|
||||
# include "createPhi.H"
|
||||
|
||||
mesh.schemesDict().setFluxRequired(p.name());
|
||||
|
|
|
@ -35,6 +35,7 @@ Description
|
|||
#include "fft.H"
|
||||
#include "calcEk.H"
|
||||
#include "graph.H"
|
||||
#include "pisoControl.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
@ -44,6 +45,9 @@ int main(int argc, char *argv[])
|
|||
|
||||
#include "createTime.H"
|
||||
#include "createMeshNoClear.H"
|
||||
|
||||
pisoControl piso(mesh);
|
||||
|
||||
#include "readTransportProperties.H"
|
||||
#include "createFields.H"
|
||||
#include "readTurbulenceProperties.H"
|
||||
|
@ -57,8 +61,6 @@ int main(int argc, char *argv[])
|
|||
{
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
#include "readPISOControls.H"
|
||||
|
||||
force.internalField() = ReImSum
|
||||
(
|
||||
fft::reverseTransform
|
||||
|
@ -83,7 +85,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
// --- PISO loop
|
||||
|
||||
for (int corr=1; corr<=1; corr++)
|
||||
while (piso.correct())
|
||||
{
|
||||
volScalarField rUA = 1.0/UEqn.A();
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
Info<< "\nCalculating temperature distribution\n" << endl;
|
||||
|
||||
while (runTime.loop())
|
||||
while (simple.loop())
|
||||
{
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
|
|
|
@ -47,5 +47,5 @@
|
|||
|
||||
label pRefCell = 0;
|
||||
scalar pRefValue = 0.0;
|
||||
setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue);
|
||||
setRefCell(p, piso.dict(), pRefCell, pRefValue);
|
||||
mesh.schemesDict().setFluxRequired(p.name());
|
||||
|
|
|
@ -80,8 +80,6 @@ int main(int argc, char *argv[])
|
|||
|
||||
while (piso.correctNonOrthogonal())
|
||||
{
|
||||
p.storePrevIter();
|
||||
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
fvm::laplacian
|
||||
|
|
|
@ -49,5 +49,5 @@
|
|||
|
||||
label pRefCell = 0;
|
||||
scalar pRefValue = 0.0;
|
||||
setRefCell(p, mesh.solutionDict().subDict("SIMPLE"), pRefCell, pRefValue);
|
||||
setRefCell(p, simple.dict(), pRefCell, pRefValue);
|
||||
mesh.schemesDict().setFluxRequired(p.name());
|
||||
|
|
|
@ -52,7 +52,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
# include "CourantNo.H"
|
||||
|
||||
while (runTime.loop())
|
||||
while (simple.loop())
|
||||
{
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
|
|
|
@ -64,6 +64,7 @@ Description
|
|||
#include "ignition.H"
|
||||
#include "Switch.H"
|
||||
#include "bound.H"
|
||||
#include "pisoControl.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
@ -73,6 +74,9 @@ int main(int argc, char *argv[])
|
|||
|
||||
# include "createTime.H"
|
||||
# include "createMesh.H"
|
||||
|
||||
pisoControl piso(mesh);
|
||||
|
||||
# include "readCombustionProperties.H"
|
||||
# include "readGravitationalAcceleration.H"
|
||||
# include "createFields.H"
|
||||
|
@ -90,7 +94,6 @@ int main(int argc, char *argv[])
|
|||
while (runTime.run())
|
||||
{
|
||||
# include "readTimeControls.H"
|
||||
# include "readPISOControls.H"
|
||||
# include "CourantNo.H"
|
||||
# include "setDeltaT.H"
|
||||
|
||||
|
@ -102,7 +105,7 @@ int main(int argc, char *argv[])
|
|||
# include "UEqn.H"
|
||||
|
||||
// --- PISO loop
|
||||
for (int corr=1; corr<=nCorr; corr++)
|
||||
while (piso.correct())
|
||||
{
|
||||
# include "bEqn.H"
|
||||
# include "ftEqn.H"
|
||||
|
|
|
@ -66,6 +66,7 @@ Description
|
|||
#include "Switch.H"
|
||||
#include "bound.H"
|
||||
#include "dynamicRefineFvMesh.H"
|
||||
#include "pisoControl.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
@ -75,10 +76,12 @@ int main(int argc, char *argv[])
|
|||
|
||||
# include "createTime.H"
|
||||
# include "createDynamicFvMesh.H"
|
||||
|
||||
pisoControl piso(mesh);
|
||||
|
||||
# include "readCombustionProperties.H"
|
||||
# include "readGravitationalAcceleration.H"
|
||||
# include "createFields.H"
|
||||
# include "readPISOControls.H"
|
||||
# include "initContinuityErrs.H"
|
||||
# include "createTimeControls.H"
|
||||
# include "setInitialDeltaT.H"
|
||||
|
@ -92,7 +95,6 @@ int main(int argc, char *argv[])
|
|||
while (runTime.run())
|
||||
{
|
||||
# include "readTimeControls.H"
|
||||
# include "readPISOControls.H"
|
||||
# include "CourantNo.H"
|
||||
|
||||
# include "setDeltaT.H"
|
||||
|
@ -168,7 +170,7 @@ int main(int argc, char *argv[])
|
|||
# include "UEqn.H"
|
||||
|
||||
// --- PISO loop
|
||||
for (int corr=1; corr<=nCorr; corr++)
|
||||
while (piso.correct())
|
||||
{
|
||||
# include "bEqn.H"
|
||||
# include "ftEqn.H"
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
volSymmTensorField invA = inv(I*UEqn.A() + drag->Dcu());
|
||||
|
||||
if (momentumPredictor)
|
||||
if (piso.momentumPredictor())
|
||||
{
|
||||
U = invA & (UEqn.H() - betav*fvc::grad(p));
|
||||
U.correctBoundaryConditions();
|
||||
|
|
|
@ -163,3 +163,5 @@
|
|||
fields.add(h);
|
||||
fields.add(hu);
|
||||
flameWrinkling->addXi(fields);
|
||||
|
||||
mesh.schemesDict().setFluxRequired(p.name());
|
||||
|
|
|
@ -3,7 +3,7 @@ rho = thermo.rho();
|
|||
volScalarField rUA = 1.0/UEqn.A();
|
||||
U = invA & UEqn.H();
|
||||
|
||||
if (transonic)
|
||||
if (piso.transonic())
|
||||
{
|
||||
surfaceScalarField phid
|
||||
(
|
||||
|
@ -15,7 +15,7 @@ if (transonic)
|
|||
)
|
||||
);
|
||||
|
||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||
while (piso.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
|
@ -26,7 +26,7 @@ if (transonic)
|
|||
|
||||
pEqn.solve();
|
||||
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
if (piso.finalNonOrthogonalIter())
|
||||
{
|
||||
phi == pEqn.flux();
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ else
|
|||
+ fvc::ddtPhiCorr(rUA, rho, U, phi)
|
||||
);
|
||||
|
||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||
while (piso.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
|
@ -52,7 +52,7 @@ else
|
|||
|
||||
pEqn.solve();
|
||||
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
if (piso.finalNonOrthogonalIter())
|
||||
{
|
||||
phi += pEqn.flux();
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
UEqn.relax();
|
||||
|
||||
if (momentumPredictor)
|
||||
if (pimple.momentumPredictor())
|
||||
{
|
||||
solve(UEqn == -fvc::grad(p));
|
||||
}
|
||||
|
|
|
@ -97,3 +97,5 @@ DimensionedField<scalar, volMesh> chemistrySh
|
|||
mesh,
|
||||
dimensionedScalar("chemistrySh", dimEnergy/dimTime/dimVolume, 0.0)
|
||||
);
|
||||
|
||||
mesh.schemesDict().setFluxRequired(p.name());
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
volScalarField rUA = 1.0/UEqn.A();
|
||||
U = rUA*UEqn.H();
|
||||
|
||||
if (transonic)
|
||||
if (pimple.transonic())
|
||||
{
|
||||
surfaceScalarField phiv =
|
||||
(fvc::interpolate(U) & mesh.Sf())
|
||||
|
@ -22,7 +22,7 @@
|
|||
fvc::interpolate(thermo.psi())*phiv
|
||||
);
|
||||
|
||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||
while (pimple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
|
@ -31,21 +31,12 @@
|
|||
- fvm::laplacian(rho*rUA, p)
|
||||
);
|
||||
|
||||
if
|
||||
pEqn.solve
|
||||
(
|
||||
ocorr == nOuterCorr
|
||||
&& corr == nCorr
|
||||
&& nonOrth == nNonOrthCorr
|
||||
)
|
||||
{
|
||||
pEqn.solve(mesh.solutionDict().solver(p.name() + "Final"));
|
||||
}
|
||||
else
|
||||
{
|
||||
pEqn.solve();
|
||||
}
|
||||
mesh.solutionDict().solver(p.select(pimple.finalInnerIter()))
|
||||
);
|
||||
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
phi += pEqn.flux();
|
||||
}
|
||||
|
@ -60,7 +51,7 @@
|
|||
+ fvc::ddtPhiCorr(rUA, rho, U, phi)
|
||||
);
|
||||
|
||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||
while (pimple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
|
@ -69,21 +60,12 @@
|
|||
- fvm::laplacian(rho*rUA, p)
|
||||
);
|
||||
|
||||
if
|
||||
pEqn.solve
|
||||
(
|
||||
ocorr == nOuterCorr
|
||||
&& corr == nCorr
|
||||
&& nonOrth == nNonOrthCorr
|
||||
)
|
||||
{
|
||||
pEqn.solve(mesh.solutionDict().solver(p.name() + "Final"));
|
||||
}
|
||||
else
|
||||
{
|
||||
pEqn.solve();
|
||||
}
|
||||
mesh.solutionDict().solver(p.select(pimple.finalInnerIter()))
|
||||
);
|
||||
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
phi += pEqn.flux();
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@ Description
|
|||
#include "rhoChemistryModel.H"
|
||||
#include "chemistrySolver.H"
|
||||
#include "multivariateScheme.H"
|
||||
#include "pimpleControl.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
@ -44,6 +45,9 @@ int main(int argc, char *argv[])
|
|||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
# include "createMesh.H"
|
||||
|
||||
pimpleControl pimple(mesh);
|
||||
|
||||
# include "readChemistryProperties.H"
|
||||
# include "readGravitationalAcceleration.H"
|
||||
# include "createFields.H"
|
||||
|
@ -59,7 +63,6 @@ int main(int argc, char *argv[])
|
|||
while (runTime.run())
|
||||
{
|
||||
# include "readTimeControls.H"
|
||||
# include "readPISOControls.H"
|
||||
# include "compressibleCourantNo.H"
|
||||
# include "setDeltaT.H"
|
||||
|
||||
|
@ -69,14 +72,14 @@ int main(int argc, char *argv[])
|
|||
# include "chemistry.H"
|
||||
# include "rhoEqn.H"
|
||||
|
||||
for (label ocorr=1; ocorr <= nOuterCorr; ocorr++)
|
||||
while (pimple.loop())
|
||||
{
|
||||
# include "UEqn.H"
|
||||
# include "YEqn.H"
|
||||
# include "hsEqn.H"
|
||||
|
||||
// --- PISO loop
|
||||
for (int corr=1; corr<=nCorr; corr++)
|
||||
while (pimple.correct())
|
||||
{
|
||||
# include "pEqn.H"
|
||||
}
|
||||
|
|
|
@ -39,10 +39,7 @@
|
|||
|
||||
# include "compressibleCreatePhi.H"
|
||||
|
||||
dimensionedScalar pMin
|
||||
(
|
||||
mesh.solutionDict().subDict("PIMPLE").lookup("pMin")
|
||||
);
|
||||
dimensionedScalar pMin(pimple.dict().lookup("pMin"));
|
||||
|
||||
Info<< "Creating turbulence model\n" << endl;
|
||||
autoPtr<compressible::turbulenceModel> turbulence
|
||||
|
|
|
@ -67,12 +67,6 @@ int main(int argc, char *argv[])
|
|||
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
if (!pimple.firstIter())
|
||||
{
|
||||
p.storePrevIter();
|
||||
rho.storePrevIter();
|
||||
}
|
||||
|
||||
#include "rhoEqn.H"
|
||||
|
||||
// --- Pressure-velocity PIMPLE corrector loop
|
||||
|
|
|
@ -39,10 +39,7 @@
|
|||
|
||||
#include "compressibleCreatePhi.H"
|
||||
|
||||
dimensionedScalar pMin
|
||||
(
|
||||
mesh.solutionDict().subDict("PIMPLE").lookup("pMin")
|
||||
);
|
||||
dimensionedScalar pMin(pimple.dict().lookup("pMin"));
|
||||
|
||||
Info<< "Creating turbulence model\n" << endl;
|
||||
autoPtr<compressible::turbulenceModel> turbulence
|
||||
|
@ -68,3 +65,5 @@
|
|||
|
||||
porousZones pZones(mesh);
|
||||
Switch pressureImplicitPorosity(false);
|
||||
|
||||
mesh.schemesDict().setFluxRequired(p.name());
|
||||
|
|
|
@ -34,12 +34,7 @@
|
|||
{
|
||||
pZones.addResistance(UEqn());
|
||||
|
||||
eqnResidual = solve
|
||||
(
|
||||
UEqn() == -fvc::grad(p)
|
||||
). initialResidual();
|
||||
|
||||
maxResidual = max(eqnResidual, maxResidual);
|
||||
solve(UEqn() == -fvc::grad(p));
|
||||
|
||||
trAU = 1.0/UEqn().A();
|
||||
trAU().rename("rAU");
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
// check convergence
|
||||
|
||||
if (maxResidual < convergenceCriterion)
|
||||
{
|
||||
Info<< "reached convergence criterion: " << convergenceCriterion << endl;
|
||||
runTime.writeAndEnd();
|
||||
Info<< "latestTime = " << runTime.timeName() << endl;
|
||||
}
|
||||
|
|
@ -43,12 +43,10 @@
|
|||
|
||||
label pRefCell = 0;
|
||||
scalar pRefValue = 0.0;
|
||||
setRefCell(p, mesh.solutionDict().subDict("SIMPLE"), pRefCell, pRefValue);
|
||||
setRefCell(p, simple.dict(), pRefCell, pRefValue);
|
||||
mesh.schemesDict().setFluxRequired(p.name());
|
||||
|
||||
dimensionedScalar pMin
|
||||
(
|
||||
mesh.solutionDict().subDict("SIMPLE").lookup("pMin")
|
||||
);
|
||||
dimensionedScalar pMin(simple.dict().lookup("pMin"));
|
||||
|
||||
Info<< "Creating turbulence model\n" << endl;
|
||||
autoPtr<compressible::RASModel> turbulence
|
||||
|
@ -71,12 +69,9 @@
|
|||
if (pZones.size())
|
||||
{
|
||||
// nUCorrectors for pressureImplicitPorosity
|
||||
if (mesh.solutionDict().subDict("SIMPLE").found("nUCorrectors"))
|
||||
if (simple.dict().found("nUCorrectors"))
|
||||
{
|
||||
nUCorr = readInt
|
||||
(
|
||||
mesh.solutionDict().subDict("SIMPLE").lookup("nUCorrectors")
|
||||
);
|
||||
nUCorr = readInt(simple.dict().lookup("nUCorrectors"));
|
||||
}
|
||||
|
||||
if (nUCorr > 0)
|
||||
|
|
|
@ -11,8 +11,7 @@
|
|||
|
||||
hEqn.relax();
|
||||
|
||||
eqnResidual = hEqn.solve().initialResidual();
|
||||
maxResidual = max(eqnResidual, maxResidual);
|
||||
hEqn.solve().initialResidual();
|
||||
|
||||
thermo.correct();
|
||||
}
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
// initialize values for convergence checks
|
||||
|
||||
scalar eqnResidual = 1, maxResidual = 0;
|
||||
scalar convergenceCriterion = 0;
|
||||
|
||||
simple.readIfPresent("convergence", convergenceCriterion);
|
||||
|
|
@ -12,7 +12,7 @@ UEqn.clear();
|
|||
phi = fvc::interpolate(rho*U) & mesh.Sf();
|
||||
bool closedVolume = adjustPhi(phi, U, p);
|
||||
|
||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||
while (simple.correctNonOrthogonal())
|
||||
{
|
||||
tmp<fvScalarMatrix> tpEqn;
|
||||
|
||||
|
@ -26,18 +26,10 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
|||
}
|
||||
|
||||
tpEqn().setReference(pRefCell, pRefValue);
|
||||
// retain the residual from the first iteration
|
||||
if (nonOrth == 0)
|
||||
{
|
||||
eqnResidual = tpEqn().solve().initialResidual();
|
||||
maxResidual = max(eqnResidual, maxResidual);
|
||||
}
|
||||
else
|
||||
{
|
||||
tpEqn().solve();
|
||||
}
|
||||
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
tpEqn().solve();
|
||||
|
||||
if (simple.finalNonOrthogonalIter())
|
||||
{
|
||||
phi -= tpEqn().flux();
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@ Description
|
|||
#include "basicPsiThermo.H"
|
||||
#include "RASModel.H"
|
||||
#include "porousZones.H"
|
||||
#include "simpleControl.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
@ -42,6 +43,9 @@ int main(int argc, char *argv[])
|
|||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
#include "createMesh.H"
|
||||
|
||||
simpleControl simple(mesh);
|
||||
|
||||
#include "createFields.H"
|
||||
#include "initContinuityErrs.H"
|
||||
|
||||
|
@ -49,16 +53,10 @@ int main(int argc, char *argv[])
|
|||
|
||||
Info<< "\nStarting time loop\n" << endl;
|
||||
|
||||
while (runTime.loop())
|
||||
while (simple.loop())
|
||||
{
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
#include "readSIMPLEControls.H"
|
||||
#include "initConvergenceCheck.H"
|
||||
|
||||
p.storePrevIter();
|
||||
rho.storePrevIter();
|
||||
|
||||
// Pressure-velocity SIMPLE corrector
|
||||
{
|
||||
#include "UEqn.H"
|
||||
|
@ -72,8 +70,6 @@ int main(int argc, char *argv[])
|
|||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< nl << endl;
|
||||
|
||||
#include "convergenceCheck.H"
|
||||
}
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
|
|
@ -8,9 +8,4 @@
|
|||
|
||||
UEqn().relax();
|
||||
|
||||
eqnResidual = solve
|
||||
(
|
||||
UEqn() == -fvc::grad(p)
|
||||
).initialResidual();
|
||||
|
||||
maxResidual = max(eqnResidual, maxResidual);
|
||||
solve(UEqn() == -fvc::grad(p));
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
// check convergence
|
||||
|
||||
if (maxResidual < convergenceCriterion)
|
||||
{
|
||||
Info<< "reached convergence criterion: " << convergenceCriterion << endl;
|
||||
runTime.writeAndEnd();
|
||||
Info<< "latestTime = " << runTime.timeName() << endl;
|
||||
}
|
||||
|
|
@ -42,17 +42,11 @@
|
|||
|
||||
label pRefCell = 0;
|
||||
scalar pRefValue = 0.0;
|
||||
setRefCell(p, mesh.solutionDict().subDict("SIMPLE"), pRefCell, pRefValue);
|
||||
setRefCell(p, simple.dict(), pRefCell, pRefValue);
|
||||
mesh.schemesDict().setFluxRequired(p.name());
|
||||
|
||||
dimensionedScalar rhoMax
|
||||
(
|
||||
mesh.solutionDict().subDict("SIMPLE").lookup("rhoMax")
|
||||
);
|
||||
|
||||
dimensionedScalar rhoMin
|
||||
(
|
||||
mesh.solutionDict().subDict("SIMPLE").lookup("rhoMin")
|
||||
);
|
||||
dimensionedScalar rhoMax(simple.dict().lookup("rhoMax"));
|
||||
dimensionedScalar rhoMin(simple.dict().lookup("rhoMin"));
|
||||
|
||||
Info<< "Creating turbulence model\n" << endl;
|
||||
autoPtr<compressible::RASModel> turbulence
|
||||
|
|
|
@ -11,8 +11,7 @@
|
|||
|
||||
hEqn.relax();
|
||||
|
||||
eqnResidual = hEqn.solve().initialResidual();
|
||||
maxResidual = max(eqnResidual, maxResidual);
|
||||
hEqn.solve();
|
||||
|
||||
thermo.correct();
|
||||
}
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
// initialize values for convergence checks
|
||||
|
||||
scalar eqnResidual = 1, maxResidual = 0;
|
||||
scalar convergenceCriterion = 0;
|
||||
|
||||
simple.readIfPresent("convergence", convergenceCriterion);
|
||||
|
|
@ -9,7 +9,7 @@ UEqn.clear();
|
|||
|
||||
bool closedVolume = false;
|
||||
|
||||
if (transonic)
|
||||
if (simple.transonic())
|
||||
{
|
||||
surfaceScalarField phid
|
||||
(
|
||||
|
@ -17,7 +17,7 @@ if (transonic)
|
|||
fvc::interpolate(psi)*(fvc::interpolate(U) & mesh.Sf())
|
||||
);
|
||||
|
||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||
while (simple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
|
@ -26,22 +26,13 @@ if (transonic)
|
|||
);
|
||||
|
||||
// Relax the pressure equation to ensure diagonal-dominance
|
||||
pEqn.relax(mesh.solutionDict().relaxationFactor("pEqn"));
|
||||
pEqn.relax();
|
||||
|
||||
pEqn.setReference(pRefCell, pRefValue);
|
||||
|
||||
// retain the residual from the first iteration
|
||||
if (nonOrth == 0)
|
||||
{
|
||||
eqnResidual = pEqn.solve().initialResidual();
|
||||
maxResidual = max(eqnResidual, maxResidual);
|
||||
}
|
||||
else
|
||||
{
|
||||
pEqn.solve();
|
||||
}
|
||||
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
if (simple.finalNonOrthogonalIter())
|
||||
{
|
||||
phi == pEqn.flux();
|
||||
}
|
||||
|
@ -52,7 +43,7 @@ else
|
|||
phi = fvc::interpolate(rho)*(fvc::interpolate(U) & mesh.Sf());
|
||||
closedVolume = adjustPhi(phi, U, p);
|
||||
|
||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||
while (simple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
|
@ -61,18 +52,9 @@ else
|
|||
|
||||
pEqn.setReference(pRefCell, pRefValue);
|
||||
|
||||
// Retain the residual from the first iteration
|
||||
if (nonOrth == 0)
|
||||
{
|
||||
eqnResidual = pEqn.solve().initialResidual();
|
||||
maxResidual = max(eqnResidual, maxResidual);
|
||||
}
|
||||
else
|
||||
{
|
||||
pEqn.solve();
|
||||
}
|
||||
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
if (simple.finalNonOrthogonalIter())
|
||||
{
|
||||
phi -= pEqn.flux();
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@ Description
|
|||
#include "fvCFD.H"
|
||||
#include "basicPsiThermo.H"
|
||||
#include "RASModel.H"
|
||||
#include "simpleControl.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
@ -41,6 +42,9 @@ int main(int argc, char *argv[])
|
|||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
#include "createMesh.H"
|
||||
|
||||
simpleControl simple(mesh);
|
||||
|
||||
#include "createFields.H"
|
||||
#include "initContinuityErrs.H"
|
||||
|
||||
|
@ -48,16 +52,10 @@ int main(int argc, char *argv[])
|
|||
|
||||
Info<< "\nStarting time loop\n" << endl;
|
||||
|
||||
while (runTime.loop())
|
||||
while (simple.loop())
|
||||
{
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
# include "readSIMPLEControls.H"
|
||||
# include "initConvergenceCheck.H"
|
||||
|
||||
p.storePrevIter();
|
||||
rho.storePrevIter();
|
||||
|
||||
// Pressure-velocity SIMPLE corrector
|
||||
{
|
||||
# include "UEqn.H"
|
||||
|
@ -72,8 +70,6 @@ int main(int argc, char *argv[])
|
|||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< nl << endl;
|
||||
|
||||
#include "convergenceCheck.H"
|
||||
}
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
|
|
@ -94,3 +94,5 @@
|
|||
rho*Cv*T + 0.5*rho*magSqr(rhoU/rho),
|
||||
T.boundaryField().types()
|
||||
);
|
||||
|
||||
mesh.schemesDict().setFluxRequired(p.name());
|
||||
|
|
|
@ -127,3 +127,4 @@
|
|||
fields.add(magRhoU);
|
||||
fields.add(H);
|
||||
|
||||
mesh.schemesDict().setFluxRequired(p.name());
|
||||
|
|
|
@ -36,6 +36,7 @@ Description
|
|||
#include "MUSCL.H"
|
||||
#include "LimitedScheme.H"
|
||||
#include "boundaryTypes.H"
|
||||
#include "pimpleControl.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
@ -45,6 +46,9 @@ int main(int argc, char *argv[])
|
|||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
# include "createMesh.H"
|
||||
|
||||
pimpleControl pimple(mesh);
|
||||
|
||||
# include "readThermodynamicProperties.H"
|
||||
# include "createFields.H"
|
||||
# include "createTimeControls.H"
|
||||
|
@ -57,8 +61,7 @@ int main(int argc, char *argv[])
|
|||
{
|
||||
Info<< "Time = " << runTime.value() << nl << endl;
|
||||
|
||||
# include "readPISOControls.H"
|
||||
scalar HbyAblend = readScalar(piso.lookup("HbyAblend"));
|
||||
scalar HbyAblend = readScalar(pimple.dict().lookup("HbyAblend"));
|
||||
|
||||
# include "readTimeControls.H"
|
||||
|
||||
|
@ -72,7 +75,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
# include "setDeltaT.H"
|
||||
|
||||
for (int outerCorr = 0; outerCorr < nOuterCorr; outerCorr++)
|
||||
while (pimple.loop())
|
||||
{
|
||||
magRhoU = mag(rhoU);
|
||||
H = (rhoE + p)/rho;
|
||||
|
@ -118,7 +121,7 @@ int main(int argc, char *argv[])
|
|||
psi = 1.0/(R*T);
|
||||
p = rho/psi;
|
||||
|
||||
for (int corr = 0; corr < nCorr; corr++)
|
||||
while (pimple.correct())
|
||||
{
|
||||
volScalarField rrhoUA = 1.0/rhoUEqn.A();
|
||||
surfaceScalarField rrhoUAf("rrhoUAf", fvc::interpolate(rrhoUA));
|
||||
|
|
|
@ -5,20 +5,9 @@
|
|||
+ turbulence->divDevRhoReff(U)
|
||||
);
|
||||
|
||||
if (oCorr == nOuterCorr - 1)
|
||||
{
|
||||
if (mesh.solutionDict().relax("UFinal"))
|
||||
{
|
||||
UEqn.relax(mesh.solutionDict().relaxationFactor("UFinal"));
|
||||
}
|
||||
else
|
||||
{
|
||||
UEqn.relax(1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
UEqn.relax();
|
||||
}
|
||||
UEqn.relax
|
||||
(
|
||||
mesh.solutionDict().relaxationFactor(U.select(pimple.finalIter()))
|
||||
);
|
||||
|
||||
solve(UEqn == -fvc::grad(p));
|
||||
|
|
|
@ -1,14 +1,11 @@
|
|||
# include "createTimeControls.H"
|
||||
# include "readPIMPLEControls.H"
|
||||
|
||||
bool correctPhi = false;
|
||||
if (pimple.found("correctPhi"))
|
||||
{
|
||||
correctPhi = Switch(pimple.lookup("correctPhi"));
|
||||
}
|
||||
bool correctPhi
|
||||
(
|
||||
pimple.dict().lookupOrDefault("correctPhi", false)
|
||||
);
|
||||
|
||||
bool checkMeshCourantNo = false;
|
||||
if (pimple.found("checkMeshCourantNo"))
|
||||
{
|
||||
checkMeshCourantNo = Switch(pimple.lookup("checkMeshCourantNo"));
|
||||
}
|
||||
bool checkMeshCourantNo
|
||||
(
|
||||
pimple.dict().lookupOrDefault("checkMeshCourantNo", false)
|
||||
);
|
||||
|
|
|
@ -51,3 +51,5 @@
|
|||
thermo
|
||||
)
|
||||
);
|
||||
|
||||
mesh.schemesDict().setFluxRequired(p.name());
|
||||
|
|
|
@ -17,21 +17,10 @@
|
|||
// viscous heating?
|
||||
);
|
||||
|
||||
if (oCorr == nOuterCorr - 1)
|
||||
{
|
||||
if (mesh.solutionDict().relax("eFinal"))
|
||||
{
|
||||
eEqn.relax(mesh.solutionDict().relaxationFactor("eFinal"));
|
||||
}
|
||||
else
|
||||
{
|
||||
eEqn.relax(1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
eEqn.relax();
|
||||
}
|
||||
eEqn.relax
|
||||
(
|
||||
mesh.solutionDict().relaxationFactor(e.select(pimple.finalIter()))
|
||||
);
|
||||
|
||||
eEqn.solve();
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
# include "limitU.H"
|
||||
|
||||
for (int nonOrth = 0; nonOrth <= nNonOrthCorr; nonOrth++)
|
||||
while (pimple.correctNonOrthogonal())
|
||||
{
|
||||
// Calculate phi for boundary conditions
|
||||
phi = rhof*
|
||||
|
@ -36,25 +36,13 @@
|
|||
- fvm::laplacian(rho*rUA, p)
|
||||
);
|
||||
|
||||
if
|
||||
(
|
||||
// oCorr == nOuterCorr - 1
|
||||
corr == nCorr - 1
|
||||
&& nonOrth == nNonOrthCorr
|
||||
)
|
||||
{
|
||||
pEqn.solve
|
||||
(
|
||||
mesh.solutionDict().solver(p.name() + "Final")
|
||||
mesh.solutionDict().solver(p.select(pimple.finalInnerIter()))
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
pEqn.solve(mesh.solutionDict().solver(p.name()));
|
||||
}
|
||||
|
||||
// Calculate the flux
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
phi = phid2 + pEqn.flux();
|
||||
}
|
||||
|
|
|
@ -1,14 +1,5 @@
|
|||
#include "readTimeControls.H"
|
||||
# include "readPIMPLEControls.H"
|
||||
|
||||
correctPhi = false;
|
||||
if (pimple.found("correctPhi"))
|
||||
{
|
||||
correctPhi = Switch(pimple.lookup("correctPhi"));
|
||||
}
|
||||
correctPhi = pimple.dict().lookupOrDefault("correctPhi", false);
|
||||
|
||||
checkMeshCourantNo = false;
|
||||
if (pimple.found("checkMeshCourantNo"))
|
||||
{
|
||||
checkMeshCourantNo = Switch(pimple.lookup("checkMeshCourantNo"));
|
||||
}
|
||||
checkMeshCourantNo = pimple.dict().lookupOrDefault("checkMeshCourantNo", false);
|
||||
|
|
|
@ -47,6 +47,7 @@ Author
|
|||
#include "specie.H"
|
||||
#include "basicPsiThermo.H"
|
||||
#include "turbulenceModel.H"
|
||||
#include "pimpleControl.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
@ -56,6 +57,9 @@ int main(int argc, char *argv[])
|
|||
|
||||
# include "createTime.H"
|
||||
# include "createDynamicFvMesh.H"
|
||||
|
||||
pimpleControl pimple(mesh);
|
||||
|
||||
# include "createFields.H"
|
||||
# include "initContinuityErrs.H"
|
||||
# include "createControls.H"
|
||||
|
@ -106,8 +110,7 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
|
||||
// --- PIMPLE loop
|
||||
label oCorr = 0;
|
||||
do
|
||||
while (pimple.loop())
|
||||
{
|
||||
# include "rhoEqn.H"
|
||||
# include "eEqn.H"
|
||||
|
@ -123,13 +126,13 @@ int main(int argc, char *argv[])
|
|||
// but psi and rho are not
|
||||
surfaceScalarField rhoReff = rhof - psisf*fvc::interpolate(p);
|
||||
|
||||
for (int corr = 0; corr < nCorr; corr++)
|
||||
while (pimple.correct())
|
||||
{
|
||||
# include "pEqn.H"
|
||||
}
|
||||
|
||||
turbulence->correct();
|
||||
} while (++oCorr < nOuterCorr);
|
||||
}
|
||||
|
||||
runTime.write();
|
||||
|
||||
|
|
|
@ -5,20 +5,9 @@
|
|||
+ turbulence->divDevRhoReff(U)
|
||||
);
|
||||
|
||||
if (oCorr == nOuterCorr - 1)
|
||||
{
|
||||
if (mesh.solutionDict().relax("UFinal"))
|
||||
{
|
||||
UEqn.relax(mesh.solutionDict().relaxationFactor("UFinal"));
|
||||
}
|
||||
else
|
||||
{
|
||||
UEqn.relax(1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
UEqn.relax();
|
||||
}
|
||||
UEqn.relax
|
||||
(
|
||||
mesh.solutionDict().relaxationFactor(U.select(pimple.finalIter()))
|
||||
);
|
||||
|
||||
solve(UEqn == -fvc::grad(p));
|
||||
|
|
|
@ -50,3 +50,5 @@
|
|||
thermo
|
||||
)
|
||||
);
|
||||
|
||||
mesh.schemesDict().setFluxRequired(p.name());
|
||||
|
|
|
@ -14,21 +14,10 @@
|
|||
// viscous heating?
|
||||
);
|
||||
|
||||
if (oCorr == nOuterCorr - 1)
|
||||
{
|
||||
if (mesh.solutionDict().relax("eFinal"))
|
||||
{
|
||||
eEqn.relax(mesh.solutionDict().relaxationFactor("eFinal"));
|
||||
}
|
||||
else
|
||||
{
|
||||
eEqn.relax(1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
eEqn.relax();
|
||||
}
|
||||
eEqn.relax
|
||||
(
|
||||
mesh.solutionDict().relaxationFactor(e.select(pimple.finalIter()))
|
||||
);
|
||||
|
||||
eEqn.solve();
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
U = UEqn.H()/UEqn.A();
|
||||
|
||||
for (int nonOrth = 0; nonOrth <= nNonOrthCorr; nonOrth++)
|
||||
while (pimple.correctNonOrthogonal())
|
||||
{
|
||||
// Calculate phi for boundary conditions
|
||||
phi = rhof*
|
||||
|
@ -36,7 +36,7 @@
|
|||
pEqn.solve();
|
||||
|
||||
// Calculate the flux
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
phi = phid2 + pEqn.flux();
|
||||
}
|
||||
|
|
|
@ -42,6 +42,7 @@ Author
|
|||
#include "fvCFD.H"
|
||||
#include "basicPsiThermo.H"
|
||||
#include "turbulenceModel.H"
|
||||
#include "pimpleControl.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
@ -50,6 +51,9 @@ int main(int argc, char *argv[])
|
|||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
# include "createMesh.H"
|
||||
|
||||
pimpleControl pimple(mesh);
|
||||
|
||||
# include "createFields.H"
|
||||
# include "initContinuityErrs.H"
|
||||
# include "createTimeControls.H"
|
||||
|
@ -61,7 +65,6 @@ int main(int argc, char *argv[])
|
|||
while (runTime.run())
|
||||
{
|
||||
# include "readTimeControls.H"
|
||||
# include "readPIMPLEControls.H"
|
||||
# include "compressibleCourantNo.H"
|
||||
# include "setDeltaT.H"
|
||||
|
||||
|
@ -70,8 +73,7 @@ int main(int argc, char *argv[])
|
|||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
// --- PIMPLE loop
|
||||
label oCorr = 0;
|
||||
do
|
||||
while (pimple.loop())
|
||||
{
|
||||
# include "rhoEqn.H"
|
||||
# include "eEqn.H"
|
||||
|
@ -87,13 +89,13 @@ int main(int argc, char *argv[])
|
|||
// but psi and rho are not
|
||||
surfaceScalarField rhoReff = rhof - psisf*fvc::interpolate(p);
|
||||
|
||||
for (int corr = 0; corr < nCorr; corr++)
|
||||
while (pimple.correct())
|
||||
{
|
||||
# include "pEqn.H"
|
||||
}
|
||||
|
||||
turbulence->correct();
|
||||
} while (++oCorr < nOuterCorr);
|
||||
}
|
||||
|
||||
runTime.write();
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
scalar sumLocalContErr =
|
||||
sumLocalContErr =
|
||||
(sum(mag(rho - rho0 - psi*(p - p0)))/sum(rho)).value();
|
||||
|
||||
scalar globalContErr = (sum(rho - rho0 - psi*(p - p0))/sum(rho)).value();
|
||||
globalContErr = (sum(rho - rho0 - psi*(p - p0))/sum(rho)).value();
|
||||
|
||||
cumulativeContErr += globalContErr;
|
||||
|
||||
|
|
|
@ -42,3 +42,5 @@
|
|||
|
||||
|
||||
# include "compressibleCreatePhi.H"
|
||||
|
||||
mesh.schemesDict().setFluxRequired(p.name());
|
||||
|
|
|
@ -31,6 +31,7 @@ Description
|
|||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "pimpleControl.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
@ -39,6 +40,9 @@ int main(int argc, char *argv[])
|
|||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
# include "createMesh.H"
|
||||
|
||||
pimpleControl pimple(mesh);
|
||||
|
||||
# include "readThermodynamicProperties.H"
|
||||
# include "readTransportProperties.H"
|
||||
# include "createFields.H"
|
||||
|
@ -52,14 +56,12 @@ int main(int argc, char *argv[])
|
|||
{
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
# include "readPIMPLEControls.H"
|
||||
# include "compressibleCourantNo.H"
|
||||
|
||||
# include "rhoEqn.H"
|
||||
|
||||
// --- PIMPLE loop
|
||||
label oCorr = 0;
|
||||
do
|
||||
while (pimple.loop())
|
||||
{
|
||||
fvVectorMatrix UEqn
|
||||
(
|
||||
|
@ -71,7 +73,7 @@ int main(int argc, char *argv[])
|
|||
solve(UEqn == -fvc::grad(p));
|
||||
|
||||
// --- PISO loop
|
||||
for (int corr = 0; corr < nCorr; corr++)
|
||||
while (pimple.correct())
|
||||
{
|
||||
volScalarField rAU("rAU", 1.0/UEqn.A());
|
||||
surfaceScalarField rhorAUf
|
||||
|
@ -113,7 +115,7 @@ int main(int argc, char *argv[])
|
|||
U -= rAU*fvc::grad(p);
|
||||
U.correctBoundaryConditions();
|
||||
}
|
||||
} while (++oCorr < nOuterCorr);
|
||||
}
|
||||
|
||||
|
||||
// Correct density
|
||||
|
|
|
@ -10,9 +10,4 @@
|
|||
|
||||
UEqn.relax();
|
||||
|
||||
eqnResidual = solve
|
||||
(
|
||||
UEqn == -fvc::grad(p)
|
||||
).initialResidual();
|
||||
|
||||
maxResidual = max(eqnResidual, maxResidual);
|
||||
solve(UEqn == -fvc::grad(p));
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
// check convergence
|
||||
|
||||
if (maxResidual < convergenceCriterion)
|
||||
{
|
||||
Info<< "reached convergence criterion: " << convergenceCriterion << endl;
|
||||
runTime.writeAndEnd();
|
||||
Info<< "latestTime = " << runTime.timeName() << endl;
|
||||
}
|
||||
|
|
@ -60,3 +60,5 @@
|
|||
thermo
|
||||
)
|
||||
);
|
||||
|
||||
mesh.schemesDict().setFluxRequired(p.name());
|
||||
|
|
|
@ -17,8 +17,7 @@
|
|||
|
||||
hEqn.relax();
|
||||
|
||||
eqnResidual = hEqn.solve().initialResidual();
|
||||
maxResidual = max(eqnResidual, maxResidual);
|
||||
hEqn.solve();
|
||||
|
||||
// Bounding of enthalpy taken out
|
||||
thermo.correct();
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
// initialize values for convergence checks
|
||||
|
||||
scalar eqnResidual = 1, maxResidual = 0;
|
||||
scalar convergenceCriterion = 0;
|
||||
|
||||
pimple.readIfPresent("convergence", convergenceCriterion);
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
surfaceScalarField rhoReff = rhof - psisf*fvc::interpolate(p);
|
||||
|
||||
// --- PISO loop
|
||||
for (int corr = 0; corr < nCorr; corr++)
|
||||
while (pimple.correct())
|
||||
{
|
||||
U = rUA*UEqn.H();
|
||||
|
||||
|
@ -21,13 +21,7 @@
|
|||
|
||||
p.storePrevIter();
|
||||
|
||||
volScalarField divPhid
|
||||
(
|
||||
"divPhid",
|
||||
fvc::div(phid)
|
||||
);
|
||||
|
||||
for (int nonOrth = 0; nonOrth <= nNonOrthCorr; nonOrth++)
|
||||
while (pimple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
|
@ -40,16 +34,10 @@
|
|||
- fvm::laplacian(rho*rUA, p)
|
||||
);
|
||||
|
||||
// Retain the residual from the first pressure solution
|
||||
eqnResidual = pEqn.solve().initialResidual();
|
||||
|
||||
if (corr == 0 && nonOrth == 0)
|
||||
{
|
||||
maxResidual = max(eqnResidual, maxResidual);
|
||||
}
|
||||
pEqn.solve();
|
||||
|
||||
// Calculate the flux
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
phi = phid2 + pEqn.flux();
|
||||
}
|
||||
|
|
|
@ -35,6 +35,7 @@ Author
|
|||
#include "fvCFD.H"
|
||||
#include "basicPsiThermo.H"
|
||||
#include "RASModel.H"
|
||||
#include "pimpleControl.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
@ -45,8 +46,10 @@ int main(int argc, char *argv[])
|
|||
|
||||
# include "createTime.H"
|
||||
# include "createMesh.H"
|
||||
|
||||
pimpleControl pimple(mesh);
|
||||
|
||||
# include "createFields.H"
|
||||
# include "readPIMPLEControls.H"
|
||||
# include "initContinuityErrs.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
@ -57,11 +60,8 @@ int main(int argc, char *argv[])
|
|||
{
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
# include "readPIMPLEControls.H"
|
||||
# include "readFieldBounds.H"
|
||||
|
||||
# include "initConvergenceCheck.H"
|
||||
|
||||
# include "UEqn.H"
|
||||
# include "pEqn.H"
|
||||
|
||||
|
@ -77,8 +77,6 @@ int main(int argc, char *argv[])
|
|||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< nl << endl;
|
||||
|
||||
# include "convergenceCheck.H"
|
||||
}
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
|
|
@ -13,9 +13,4 @@
|
|||
|
||||
UEqn.relax();
|
||||
|
||||
eqnResidual = solve
|
||||
(
|
||||
UEqn == -fvc::grad(p)
|
||||
).initialResidual();
|
||||
|
||||
maxResidual = max(eqnResidual, maxResidual);
|
||||
solve(UEqn == -fvc::grad(p));
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
// check convergence
|
||||
|
||||
if (maxResidual < convergenceCriterion)
|
||||
{
|
||||
Info<< "reached convergence criterion: " << convergenceCriterion << endl;
|
||||
runTime.writeAndEnd();
|
||||
Info<< "latestTime = " << runTime.timeName() << endl;
|
||||
}
|
||||
|
|
@ -101,3 +101,5 @@
|
|||
h
|
||||
);
|
||||
i == h - 0.5*(magSqr(Urot) - magSqr(Urel));
|
||||
|
||||
mesh.schemesDict().setFluxRequired(p.name());
|
||||
|
|
|
@ -25,9 +25,6 @@
|
|||
|
||||
hEqn.relax();
|
||||
|
||||
eqnResidual = hEqn.solve().initialResidual();
|
||||
maxResidual = max(eqnResidual, maxResidual);
|
||||
|
||||
// Bounding of enthalpy taken out
|
||||
thermo.correct();
|
||||
psis = thermo.psi()/thermo.Cp()*thermo.Cv();
|
||||
|
|
|
@ -20,8 +20,7 @@
|
|||
|
||||
iEqn.relax();
|
||||
|
||||
eqnResidual = iEqn.solve().initialResidual();
|
||||
maxResidual = max(eqnResidual, maxResidual);
|
||||
iEqn.solve();
|
||||
|
||||
// Calculate enthalpy out of rothalpy
|
||||
h = i + 0.5*(magSqr(Urot) - magSqr(Urel));
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
// initialize values for convergence checks
|
||||
|
||||
scalar eqnResidual = 1, maxResidual = 0;
|
||||
scalar convergenceCriterion = 0;
|
||||
|
||||
pimple.readIfPresent("convergence", convergenceCriterion);
|
||||
|
|
@ -4,11 +4,10 @@
|
|||
surfaceScalarField psisf = fvc::interpolate(psis);
|
||||
surfaceScalarField rhof = fvc::interpolate(rho);
|
||||
|
||||
// Needs to be outside of loop since p is changing, but psi and rho are not
|
||||
// Needs to be outside of loop since p is changing, but psi and rho are not.
|
||||
surfaceScalarField rhoReff = rhof - psisf*fvc::interpolate(p);
|
||||
|
||||
// --- PISO loop
|
||||
for (int corr = 0; corr < nCorr; corr++)
|
||||
while (pimple.correct())
|
||||
{
|
||||
U = rUA*UEqn.H();
|
||||
|
||||
|
@ -26,13 +25,7 @@
|
|||
|
||||
p.storePrevIter();
|
||||
|
||||
volScalarField divPhid
|
||||
(
|
||||
"divPhid",
|
||||
fvc::div(phid)
|
||||
);
|
||||
|
||||
for (int nonOrth = 0; nonOrth <= nNonOrthCorr; nonOrth++)
|
||||
while (pimple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
|
@ -45,16 +38,10 @@
|
|||
- fvm::laplacian(rho*rUA, p)
|
||||
);
|
||||
|
||||
// Retain the residual from the first pressure solution
|
||||
eqnResidual = pEqn.solve().initialResidual();
|
||||
|
||||
if (corr == 0 && nonOrth == 0)
|
||||
{
|
||||
maxResidual = max(eqnResidual, maxResidual);
|
||||
}
|
||||
pEqn.solve();
|
||||
|
||||
// Calculate the flux
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
phi = phid2 + pEqn.flux();
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@ Author
|
|||
#include "basicPsiThermo.H"
|
||||
#include "RASModel.H"
|
||||
#include "MRFZones.H"
|
||||
#include "pimpleControl.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
@ -47,8 +48,10 @@ int main(int argc, char *argv[])
|
|||
|
||||
# include "createTime.H"
|
||||
# include "createMesh.H"
|
||||
|
||||
pimpleControl pimple(mesh);
|
||||
|
||||
# include "createFields.H"
|
||||
# include "readPIMPLEControls.H"
|
||||
# include "initContinuityErrs.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
@ -59,11 +62,8 @@ int main(int argc, char *argv[])
|
|||
{
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
# include "readPIMPLEControls.H"
|
||||
# include "readFieldBounds.H"
|
||||
|
||||
# include "initConvergenceCheck.H"
|
||||
|
||||
# include "UEqn.H"
|
||||
# include "pEqn.H"
|
||||
|
||||
|
@ -81,8 +81,6 @@ int main(int argc, char *argv[])
|
|||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< nl << endl;
|
||||
|
||||
# include "convergenceCheck.H"
|
||||
}
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
|
|
@ -11,9 +11,4 @@
|
|||
|
||||
UrelEqn.relax();
|
||||
|
||||
eqnResidual = solve
|
||||
(
|
||||
UrelEqn == -fvc::grad(p)
|
||||
).initialResidual();
|
||||
|
||||
maxResidual = max(eqnResidual, maxResidual);
|
||||
solve(UrelEqn == -fvc::grad(p));
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
// check convergence
|
||||
|
||||
if (maxResidual < convergenceCriterion)
|
||||
{
|
||||
Info<< "reached convergence criterion: " << convergenceCriterion << endl;
|
||||
runTime.writeAndEnd();
|
||||
Info<< "latestTime = " << runTime.timeName() << endl;
|
||||
}
|
||||
|
|
@ -104,3 +104,5 @@
|
|||
h
|
||||
);
|
||||
i == h - 0.5*(magSqr(Urot) - magSqr(Urel));
|
||||
|
||||
mesh.schemesDict().setFluxRequired(p.name());
|
||||
|
|
|
@ -13,8 +13,7 @@
|
|||
|
||||
iEqn.relax();
|
||||
|
||||
eqnResidual = iEqn.solve().initialResidual();
|
||||
maxResidual = max(eqnResidual, maxResidual);
|
||||
iEqn.solve();
|
||||
|
||||
// Calculate enthalpy out of rothalpy
|
||||
h = i + 0.5*(magSqr(Urot) - magSqr(Urel));
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
// initialize values for convergence checks
|
||||
|
||||
scalar eqnResidual = 1, maxResidual = 0;
|
||||
scalar convergenceCriterion = 0;
|
||||
|
||||
pimple.readIfPresent("convergence", convergenceCriterion);
|
||||
|
|
@ -4,11 +4,10 @@
|
|||
surfaceScalarField psisf = fvc::interpolate(psis);
|
||||
surfaceScalarField rhof = fvc::interpolate(rho);
|
||||
|
||||
// Needs to be outside of loop since p is changing, but psi and rho are not
|
||||
// Needs to be outside of loop since p is changing, but psi and rho are not.
|
||||
surfaceScalarField rhoReff = rhof - psisf*fvc::interpolate(p);
|
||||
|
||||
// --- PISO loop
|
||||
for (int corr = 0; corr < nCorr; corr++)
|
||||
while (pimple.correct())
|
||||
{
|
||||
Urel = rUrelA*UrelEqn.H();
|
||||
|
||||
|
@ -21,13 +20,7 @@
|
|||
|
||||
p.storePrevIter();
|
||||
|
||||
volScalarField divPhid
|
||||
(
|
||||
"divPhid",
|
||||
fvc::div(phid)
|
||||
);
|
||||
|
||||
for (int nonOrth = 0; nonOrth <= nNonOrthCorr; nonOrth++)
|
||||
while (pimple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
|
@ -40,16 +33,10 @@
|
|||
- fvm::laplacian(rho*rUrelA, p)
|
||||
);
|
||||
|
||||
// Retain the residual from the first pressure solution
|
||||
eqnResidual = pEqn.solve().initialResidual();
|
||||
|
||||
if (corr == 0 && nonOrth == 0)
|
||||
{
|
||||
maxResidual = max(eqnResidual, maxResidual);
|
||||
}
|
||||
pEqn.solve();
|
||||
|
||||
// Calculate the flux
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
phi = phid2 + pEqn.flux();
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@ Author
|
|||
#include "basicPsiThermo.H"
|
||||
#include "RASModel.H"
|
||||
#include "SRFModel.H"
|
||||
#include "pimpleControl.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
@ -47,8 +48,10 @@ int main(int argc, char *argv[])
|
|||
|
||||
# include "createTime.H"
|
||||
# include "createMesh.H"
|
||||
|
||||
pimpleControl pimple(mesh);
|
||||
|
||||
# include "createFields.H"
|
||||
# include "readPIMPLEControls.H"
|
||||
# include "initContinuityErrs.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
@ -59,11 +62,8 @@ int main(int argc, char *argv[])
|
|||
{
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
# include "readPIMPLEControls.H"
|
||||
# include "readFieldBounds.H"
|
||||
|
||||
# include "initConvergenceCheck.H"
|
||||
|
||||
# include "UEqn.H"
|
||||
# include "pEqn.H"
|
||||
|
||||
|
@ -87,8 +87,6 @@ int main(int argc, char *argv[])
|
|||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< nl << endl;
|
||||
|
||||
# include "convergenceCheck.H"
|
||||
}
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
|
|
@ -56,3 +56,5 @@ Info<< "Creating field rAU\n" << endl;
|
|||
// will be used. HJ, 1/Mar/2016
|
||||
tmp<volScalarField> trAU;
|
||||
tmp<volTensorField> trTU;
|
||||
|
||||
mesh.schemesDict().setFluxRequired(p.name());
|
||||
|
|
|
@ -39,7 +39,7 @@ Description
|
|||
#include "foamTime.H"
|
||||
#include "fvMesh.H"
|
||||
#include "fvBlockMatrix.H"
|
||||
|
||||
#include "simpleControl.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
@ -49,6 +49,9 @@ int main(int argc, char *argv[])
|
|||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
# include "createMesh.H"
|
||||
|
||||
simpleControl simple(mesh);
|
||||
|
||||
# include "createFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
@ -57,13 +60,11 @@ int main(int argc, char *argv[])
|
|||
|
||||
# include "CourantNo.H"
|
||||
|
||||
for (runTime++; !runTime.end(); runTime++)
|
||||
while (simple.loop())
|
||||
{
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
# include "readSIMPLEControls.H"
|
||||
|
||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||
while (simple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix TEqn
|
||||
(
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
UEqn.relax();
|
||||
|
||||
if (momentumPredictor)
|
||||
if (piso.momentumPredictor())
|
||||
{
|
||||
solve
|
||||
(
|
||||
|
|
|
@ -38,6 +38,8 @@ Description
|
|||
#include "thermalModel.H"
|
||||
#include "singlePhaseTransportModel.H"
|
||||
#include "RASModel.H"
|
||||
#include "pisoControl.H"
|
||||
#include "simpleControl.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
@ -47,6 +49,9 @@ int main(int argc, char *argv[])
|
|||
# include "createTime.H"
|
||||
# include "createFluidMesh.H"
|
||||
# include "createSolidMesh.H"
|
||||
|
||||
pisoControl piso(mesh);
|
||||
|
||||
# include "readGravitationalAcceleration.H"
|
||||
# include "createFields.H"
|
||||
# include "createSolidFields.H"
|
||||
|
@ -64,7 +69,6 @@ int main(int argc, char *argv[])
|
|||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
# include "readTimeControls.H"
|
||||
# include "readPISOControls.H"
|
||||
# include "CourantNo.H"
|
||||
# include "setDeltaT.H"
|
||||
|
||||
|
@ -75,7 +79,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
p_rgh.storePrevIter();
|
||||
|
||||
for (int corr = 0; corr < nCorr; corr++)
|
||||
while (piso.correct())
|
||||
{
|
||||
# include "pEqn.H"
|
||||
}
|
||||
|
|
|
@ -64,13 +64,8 @@
|
|||
|
||||
label pRefCell = 0;
|
||||
scalar pRefValue = 0.0;
|
||||
setRefCell
|
||||
(
|
||||
p_rgh,
|
||||
mesh.solutionDict().subDict("PISO"),
|
||||
pRefCell,
|
||||
pRefValue
|
||||
);
|
||||
setRefCell(p_rgh, piso.dict(), pRefCell, pRefValue);
|
||||
mesh.schemesDict().setFluxRequired(p_rgh.name());
|
||||
|
||||
autoPtr<incompressible::RASModel> turbulence
|
||||
(
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
// initialize values for convergence checks
|
||||
|
||||
scalar eqnResidual = 1, maxResidual = 0;
|
||||
scalar convergenceCriterion = 0;
|
||||
|
||||
simple.readIfPresent("convergence", convergenceCriterion);
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
surfaceScalarField buoyancyPhi(rUAf*ghf*fvc::snGrad(rhok)*mesh.magSf());
|
||||
phi -= buoyancyPhi;
|
||||
|
||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||
while (piso.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix p_rghEqn
|
||||
(
|
||||
|
@ -19,16 +19,15 @@
|
|||
|
||||
p_rghEqn.setReference(pRefCell, pRefValue);
|
||||
|
||||
if (corr == nCorr-1 && nonOrth == nNonOrthCorr)
|
||||
{
|
||||
p_rghEqn.solve(mesh.solutionDict().solver(p_rgh.name() + "Final"));
|
||||
}
|
||||
else
|
||||
{
|
||||
p_rghEqn.solve(mesh.solutionDict().solver(p_rgh.name()));
|
||||
}
|
||||
p_rghEqn.solve
|
||||
(
|
||||
mesh.solutionDict().solver
|
||||
(
|
||||
p_rgh.select(piso.finalInnerIter())
|
||||
)
|
||||
);
|
||||
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
if (piso.finalNonOrthogonalIter())
|
||||
{
|
||||
// Calculate the conservative fluxes
|
||||
phi -= p_rghEqn.flux();
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
const dictionary& simple = solidMesh.solutionDict().subDict("SIMPLE");
|
||||
|
||||
int nNonOrthCorr = 0;
|
||||
if (simple.found("nNonOrthogonalCorrectors"))
|
||||
{
|
||||
nNonOrthCorr = readInt(simple.lookup("nNonOrthogonalCorrectors"));
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
// Solid side
|
||||
# include "readSolidControls.H"
|
||||
simpleControl simpleSolid(solidMesh);
|
||||
|
||||
for (int nonOrth = 0; nonOrth <= nNonOrthCorr; nonOrth++)
|
||||
while (simpleSolid.correctNonOrthogonal())
|
||||
{
|
||||
coupledFvScalarMatrix TEqns(2);
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
UEqn().relax();
|
||||
|
||||
eqnResidual = solve
|
||||
solve
|
||||
(
|
||||
UEqn()
|
||||
==
|
||||
|
@ -22,6 +22,4 @@
|
|||
)*mesh.magSf()
|
||||
)
|
||||
)
|
||||
).initialResidual();
|
||||
|
||||
maxResidual = max(eqnResidual, maxResidual);
|
||||
);
|
||||
|
|
|
@ -38,6 +38,7 @@ Description
|
|||
#include "thermalModel.H"
|
||||
#include "singlePhaseTransportModel.H"
|
||||
#include "RASModel.H"
|
||||
#include "simpleControl.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
@ -47,6 +48,9 @@ int main(int argc, char *argv[])
|
|||
# include "createTime.H"
|
||||
# include "createFluidMesh.H"
|
||||
# include "createSolidMesh.H"
|
||||
|
||||
simpleControl simple(mesh);
|
||||
|
||||
# include "readGravitationalAcceleration.H"
|
||||
# include "createFields.H"
|
||||
# include "createSolidFields.H"
|
||||
|
@ -56,13 +60,10 @@ int main(int argc, char *argv[])
|
|||
|
||||
Info<< "\nStarting time loop\n" << endl;
|
||||
|
||||
while (runTime.loop())
|
||||
while (simple.loop())
|
||||
{
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
# include "readSIMPLEControls.H"
|
||||
# include "initConvergenceCheck.H"
|
||||
|
||||
// Detach patches
|
||||
# include "detachPatches.H"
|
||||
|
||||
|
|
|
@ -64,13 +64,8 @@
|
|||
|
||||
label pRefCell = 0;
|
||||
scalar pRefValue = 0.0;
|
||||
setRefCell
|
||||
(
|
||||
p_rgh,
|
||||
mesh.solutionDict().subDict("SIMPLE"),
|
||||
pRefCell,
|
||||
pRefValue
|
||||
);
|
||||
setRefCell(p_rgh, simple.dict(), pRefCell, pRefValue);
|
||||
mesh.schemesDict().setFluxRequired(p_rgh.name());
|
||||
|
||||
autoPtr<incompressible::RASModel> turbulence
|
||||
(
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
// initialize values for convergence checks
|
||||
|
||||
scalar eqnResidual = 1, maxResidual = 0;
|
||||
scalar convergenceCriterion = 0;
|
||||
|
||||
simple.readIfPresent("convergence", convergenceCriterion);
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
surfaceScalarField buoyancyPhi(rUAf*ghf*fvc::snGrad(rhok)*mesh.magSf());
|
||||
phi -= buoyancyPhi;
|
||||
|
||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||
while (simple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix p_rghEqn
|
||||
(
|
||||
|
@ -20,18 +20,9 @@
|
|||
|
||||
p_rghEqn.setReference(pRefCell, pRefValue);
|
||||
|
||||
// retain the residual from the first iteration
|
||||
if (nonOrth == 0)
|
||||
{
|
||||
eqnResidual = p_rghEqn.solve().initialResidual();
|
||||
maxResidual = max(eqnResidual, maxResidual);
|
||||
}
|
||||
else
|
||||
{
|
||||
p_rghEqn.solve();
|
||||
}
|
||||
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
if (simple.finalNonOrthogonalIter())
|
||||
{
|
||||
// Calculate the conservative fluxes
|
||||
phi -= p_rghEqn.flux();
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
const dictionary& simple = solidMesh.solutionDict().subDict("SIMPLE");
|
||||
|
||||
int nNonOrthCorr = 0;
|
||||
if (simple.found("nNonOrthogonalCorrectors"))
|
||||
{
|
||||
nNonOrthCorr = readInt(simple.lookup("nNonOrthogonalCorrectors"));
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
// Solid side
|
||||
# include "readSolidControls.H"
|
||||
simpleControl simpleSolid(solidMesh);
|
||||
|
||||
for (int nonOrth = 0; nonOrth <= nNonOrthCorr; nonOrth++)
|
||||
while (simpleSolid.correctNonOrthogonal())
|
||||
{
|
||||
coupledFvScalarMatrix TEqns(2);
|
||||
|
||||
|
|
|
@ -65,3 +65,5 @@ volScalarField rAU
|
|||
mesh,
|
||||
runTime.deltaT()
|
||||
);
|
||||
|
||||
mesh.schemesDict().setFluxRequired(p.name());
|
|
@ -104,4 +104,7 @@
|
|||
|
||||
label pRefCell = 0;
|
||||
scalar pRefValue = 0.0;
|
||||
setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue);
|
||||
setRefCell(p, piso.dict(), pRefCell, pRefValue);
|
||||
mesh.schemesDict().setFluxRequired(p.name());
|
||||
|
||||
mesh.schemesDict().setFluxRequired(pB.name());
|
||||
|
|
|
@ -50,6 +50,7 @@ Description
|
|||
|
||||
#include "fvCFD.H"
|
||||
#include "OSspecific.H"
|
||||
#include "pisoControl.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
@ -59,6 +60,9 @@ int main(int argc, char *argv[])
|
|||
|
||||
# include "createTime.H"
|
||||
# include "createMesh.H"
|
||||
|
||||
pisoControl piso(mesh);
|
||||
|
||||
# include "createFields.H"
|
||||
# include "initContinuityErrs.H"
|
||||
|
||||
|
@ -69,7 +73,6 @@ int main(int argc, char *argv[])
|
|||
|
||||
while (runTime.loop())
|
||||
{
|
||||
# include "readPISOControls.H"
|
||||
# include "readBPISOControls.H"
|
||||
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
@ -91,7 +94,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
// --- PISO loop
|
||||
|
||||
for (int corr = 0; corr < nCorr; corr++)
|
||||
while (piso.correct())
|
||||
{
|
||||
volScalarField rUA = 1.0/UEqn.A();
|
||||
|
||||
|
@ -100,7 +103,7 @@ int main(int argc, char *argv[])
|
|||
phi = (fvc::interpolate(U) & mesh.Sf())
|
||||
+ fvc::ddtPhiCorr(rUA, U, phi);
|
||||
|
||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||
while (piso.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
|
@ -110,7 +113,7 @@ int main(int argc, char *argv[])
|
|||
pEqn.setReference(pRefCell, pRefValue);
|
||||
pEqn.solve();
|
||||
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
if (piso.finalNonOrthogonalIter())
|
||||
{
|
||||
phi -= pEqn.flux();
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
|
||||
label pRefCell = 0;
|
||||
scalar pRefValue = 0.0;
|
||||
setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue);
|
||||
setRefCell(p, piso.dict(), pRefCell, pRefValue);
|
||||
mesh.schemesDict().setFluxRequired(p.name());
|
||||
|
||||
scalar totalVolume = sum(mesh.V()).value();
|
||||
|
|
|
@ -6,13 +6,9 @@
|
|||
+ turbulence->divDevRhoReff(U)
|
||||
);
|
||||
|
||||
if (oCorr == nOuterCorr - 1)
|
||||
{
|
||||
UEqn.relax(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
UEqn.relax();
|
||||
}
|
||||
UEqn.relax
|
||||
(
|
||||
mesh.solutionDict().relaxationFactor(U.select(pimple.finalIter()))
|
||||
);
|
||||
|
||||
solve(UEqn == -fvc::grad(p));
|
||||
|
|
|
@ -128,3 +128,5 @@
|
|||
),
|
||||
fvc::interpolate(rho) * fvc::meshPhi(U)
|
||||
);
|
||||
|
||||
mesh.schemesDict().setFluxRequired(p.name());
|
||||
|
|
|
@ -4,18 +4,13 @@
|
|||
rUA = 1.0/UEqn.A();
|
||||
U = rUA*UEqn.H();
|
||||
|
||||
if (nOuterCorr != 1)
|
||||
{
|
||||
p.storePrevIter();
|
||||
}
|
||||
|
||||
if (transonic)
|
||||
if (pimple.transonic())
|
||||
{
|
||||
surfaceScalarField phid =
|
||||
fvc::interpolate(thermo.psi())*
|
||||
((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U));
|
||||
|
||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||
while (pimple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
|
@ -26,7 +21,7 @@
|
|||
|
||||
pEqn.solve();
|
||||
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
phi == pEqn.flux();
|
||||
}
|
||||
|
@ -37,7 +32,7 @@
|
|||
phi = fvc::interpolate(rho)*
|
||||
((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U));
|
||||
|
||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||
while (pimple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
|
@ -48,7 +43,7 @@
|
|||
|
||||
pEqn.solve();
|
||||
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
phi += pEqn.flux();
|
||||
}
|
||||
|
@ -56,7 +51,7 @@
|
|||
}
|
||||
|
||||
// Explicitly relax pressure except for last corrector
|
||||
if (oCorr != nOuterCorr - 1)
|
||||
if (!pimple.finalIter())
|
||||
{
|
||||
p.relax();
|
||||
}
|
||||
|
|
|
@ -39,6 +39,7 @@ Description
|
|||
#include "turbulenceModel.H"
|
||||
#include "Switch.H"
|
||||
#include "OFstream.H"
|
||||
#include "pimpleControl.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
@ -49,7 +50,9 @@ int main(int argc, char *argv[])
|
|||
|
||||
# include "createEngineTime.H"
|
||||
# include "createEngineDynamicMesh.H"
|
||||
# include "readPIMPLEControls.H"
|
||||
|
||||
pimpleControl pimple(mesh);
|
||||
|
||||
# include "createFields.H"
|
||||
# include "initContinuityErrs.H"
|
||||
# include "createTimeControls.H"
|
||||
|
@ -67,7 +70,6 @@ int main(int argc, char *argv[])
|
|||
|
||||
while (runTime.run())
|
||||
{
|
||||
# include "readPIMPLEControls.H"
|
||||
# include "checkTotalVolume.H"
|
||||
# include "readEngineTimeControls.H"
|
||||
# include "compressibleCourantNo.H"
|
||||
|
@ -106,19 +108,18 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
|
||||
// Pressure-velocity corrector
|
||||
int oCorr = 0;
|
||||
do
|
||||
while (pimple.loop())
|
||||
{
|
||||
# include "rhoEqn.H"
|
||||
# include "UEqn.H"
|
||||
|
||||
// --- PISO loop
|
||||
for (int corr = 1; corr <= nCorr; corr++)
|
||||
while (pimple.correct())
|
||||
{
|
||||
# include "pEqn.H"
|
||||
# include "hEqn.H"
|
||||
}
|
||||
} while (++oCorr < nOuterCorr);
|
||||
}
|
||||
|
||||
turbulence->correct();
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
+ turbulence->divDevReff(U)
|
||||
);
|
||||
|
||||
if (momentumPredictor)
|
||||
if (piso.momentumPredictor())
|
||||
{
|
||||
solve(UEqn == -fvc::grad(p));
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
mesh.schemesDict().setFluxRequired(pcorr.name());
|
||||
|
||||
for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||
while (piso.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix pcorrEqn
|
||||
(
|
||||
|
@ -38,7 +38,7 @@
|
|||
pcorrEqn.setReference(pRefCell, pRefValue);
|
||||
pcorrEqn.solve();
|
||||
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
if (piso.finalNonOrthogonalIter())
|
||||
{
|
||||
phi -= pcorrEqn.flux();
|
||||
}
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# include "createTimeControls.H"
|
||||
# include "readPISOControls.H"
|
||||
|
||||
bool checkMeshCourantNo = false;
|
||||
if (piso.found("checkMeshCourantNo"))
|
||||
{
|
||||
checkMeshCourantNo = Switch(piso.lookup("checkMeshCourantNo"));
|
||||
}
|
||||
bool checkMeshCourantNo
|
||||
(
|
||||
piso.dict().lookupOrDefault("checkMeshCourantNo", false)
|
||||
);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Reference in a new issue