Backported steadyUniversalFoam, steadyUniversalMRFFoam and tutorials (vanilla OF 3.0.1)

This commit is contained in:
Vanja Skuric 2016-06-05 01:28:13 +02:00
parent 406346f1b9
commit bc0dc681ad
16 changed files with 25 additions and 111 deletions

View file

@ -10,9 +10,4 @@
UEqn.relax();
eqnResidual = solve
(
UEqn == -fvc::grad(p)
).initialResidual();
maxResidual = max(eqnResidual, maxResidual);
solve(UEqn == -fvc::grad(p));

View file

@ -1,9 +0,0 @@
// check convergence
if (maxResidual < convergenceCriterion)
{
Info<< "reached convergence criterion: " << convergenceCriterion << endl;
runTime.writeAndEnd();
Info<< "latestTime = " << runTime.timeName() << endl;
}

View file

@ -39,3 +39,5 @@
thermo
)
);
mesh.schemesDict().setFluxRequired(p.name());

View file

@ -23,8 +23,7 @@
hEqn.relax();
eqnResidual = hEqn.solve().initialResidual();
maxResidual = max(eqnResidual, maxResidual);
hEqn.solve();
// Bounding of enthalpy taken out
thermo.correct();

View file

@ -1,7 +0,0 @@
// initialize values for convergence checks
scalar eqnResidual = 1, maxResidual = 0;
scalar convergenceCriterion = 0;
pimple.readIfPresent("convergence", convergenceCriterion);

View file

@ -7,7 +7,7 @@
// Needs to be outside of loop since p is changing, but psi and rho are not
surfaceScalarField rhoReff = rhof - psisf*fvc::interpolate(p);
for (int corr = 0; corr < nCorr; corr++)
while (pimple.correct())
{
U = rUA*UEqn.H();
@ -20,7 +20,7 @@
p.storePrevIter();
for (int nonOrth = 0; nonOrth <= nNonOrthCorr; nonOrth++)
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix pEqn
(
@ -30,16 +30,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();
}

View file

@ -36,6 +36,7 @@ Author
#include "basicPsiThermo.H"
#include "basicRhoThermo.H"
#include "RASModel.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -46,9 +47,11 @@ int main(int argc, char *argv[])
# include "createTime.H"
# include "createMesh.H"
pimpleControl pimple(mesh);
# include "createThermo.H"
# 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"
@ -79,8 +79,6 @@ int main(int argc, char *argv[])
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
# include "convergenceCheck.H"
}
# include "clearThermo.H"

View file

@ -13,9 +13,4 @@
UEqn.relax();
eqnResidual = solve
(
UEqn == -fvc::grad(p)
).initialResidual();
maxResidual = max(eqnResidual, maxResidual);
solve(UEqn == -fvc::grad(p));

View file

@ -1,9 +0,0 @@
// check convergence
if (maxResidual < convergenceCriterion)
{
Info<< "reached convergence criterion: " << convergenceCriterion << endl;
runTime.writeAndEnd();
Info<< "latestTime = " << runTime.timeName() << endl;
}

View file

@ -80,3 +80,5 @@
mesh
);
i == h - 0.5*(magSqr(Urot) - magSqr(Urel));
mesh.schemesDict().setFluxRequired(p.name());

View file

@ -18,8 +18,7 @@
iEqn.relax();
eqnResidual = iEqn.solve().initialResidual();
maxResidual = max(eqnResidual, maxResidual);
iEqn.solve();
// From rothalpy, calculate enthalpy after solution of rothalpy equation
h = i + 0.5*(magSqr(Urot) - magSqr(Urel));

View file

@ -1,7 +0,0 @@
// initialize values for convergence checks
scalar eqnResidual = 1, maxResidual = 0;
scalar convergenceCriterion = 0;
pimple.readIfPresent("convergence", convergenceCriterion);

View file

@ -7,7 +7,7 @@
// Needs to be outside of loop since p is changing, but psi and rho are not
surfaceScalarField rhoReff = rhof - psisf*fvc::interpolate(p);
for (int corr = 0; corr < nCorr; corr++)
while (pimple.correct())
{
U = rUA*UEqn.H();
@ -20,7 +20,7 @@
p.storePrevIter();
for (int nonOrth = 0; nonOrth <= nNonOrthCorr; nonOrth++)
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix pEqn
(
@ -30,16 +30,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();
}

View file

@ -43,6 +43,7 @@ GE CONFIDENTIAL INFORMATION 2016 General Electric Company. All Rights Reserved
#include "basicRhoThermo.H"
#include "RASModel.H"
#include "MRFZones.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -53,9 +54,11 @@ int main(int argc, char *argv[])
# include "createTime.H"
# include "createMesh.H"
pimpleControl pimple(mesh);
# include "createThermo.H"
# include "createFields.H"
# include "readPIMPLEControls.H"
# include "initContinuityErrs.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -66,11 +69,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"
@ -86,8 +86,6 @@ int main(int argc, char *argv[])
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
# include "convergenceCheck.H"
}
# include "clearThermo.H"

View file

@ -72,12 +72,6 @@ snGradSchemes
default limited 0.5;
}
fluxRequired
{
default no;
p;
}
mixingPlane
{
default areaAveraging;
@ -86,22 +80,4 @@ mixingPlane
omega areaAveraging;
}
// ************************************************************************* //

View file

@ -72,12 +72,6 @@ snGradSchemes
default limited 0.5;
}
fluxRequired
{
default no;
p;
}
mixingPlane
{
default areaAveraging;