Backported steadyUniversalFoam, steadyUniversalMRFFoam and tutorials (vanilla OF 3.0.1)
This commit is contained in:
parent
406346f1b9
commit
bc0dc681ad
16 changed files with 25 additions and 111 deletions
|
@ -10,9 +10,4 @@
|
||||||
|
|
||||||
UEqn.relax();
|
UEqn.relax();
|
||||||
|
|
||||||
eqnResidual = solve
|
solve(UEqn == -fvc::grad(p));
|
||||||
(
|
|
||||||
UEqn == -fvc::grad(p)
|
|
||||||
).initialResidual();
|
|
||||||
|
|
||||||
maxResidual = max(eqnResidual, maxResidual);
|
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
// check convergence
|
|
||||||
|
|
||||||
if (maxResidual < convergenceCriterion)
|
|
||||||
{
|
|
||||||
Info<< "reached convergence criterion: " << convergenceCriterion << endl;
|
|
||||||
runTime.writeAndEnd();
|
|
||||||
Info<< "latestTime = " << runTime.timeName() << endl;
|
|
||||||
}
|
|
||||||
|
|
|
@ -39,3 +39,5 @@
|
||||||
thermo
|
thermo
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
mesh.schemesDict().setFluxRequired(p.name());
|
||||||
|
|
|
@ -23,8 +23,7 @@
|
||||||
|
|
||||||
hEqn.relax();
|
hEqn.relax();
|
||||||
|
|
||||||
eqnResidual = hEqn.solve().initialResidual();
|
hEqn.solve();
|
||||||
maxResidual = max(eqnResidual, maxResidual);
|
|
||||||
|
|
||||||
// Bounding of enthalpy taken out
|
// Bounding of enthalpy taken out
|
||||||
thermo.correct();
|
thermo.correct();
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
// initialize values for convergence checks
|
|
||||||
|
|
||||||
scalar eqnResidual = 1, maxResidual = 0;
|
|
||||||
scalar convergenceCriterion = 0;
|
|
||||||
|
|
||||||
pimple.readIfPresent("convergence", convergenceCriterion);
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
// 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);
|
surfaceScalarField rhoReff = rhof - psisf*fvc::interpolate(p);
|
||||||
|
|
||||||
for (int corr = 0; corr < nCorr; corr++)
|
while (pimple.correct())
|
||||||
{
|
{
|
||||||
U = rUA*UEqn.H();
|
U = rUA*UEqn.H();
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
|
|
||||||
p.storePrevIter();
|
p.storePrevIter();
|
||||||
|
|
||||||
for (int nonOrth = 0; nonOrth <= nNonOrthCorr; nonOrth++)
|
while (pimple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
fvScalarMatrix pEqn
|
fvScalarMatrix pEqn
|
||||||
(
|
(
|
||||||
|
@ -30,16 +30,10 @@
|
||||||
- fvm::laplacian(rho*rUA, p)
|
- fvm::laplacian(rho*rUA, p)
|
||||||
);
|
);
|
||||||
|
|
||||||
// Retain the residual from the first pressure solution
|
pEqn.solve();
|
||||||
eqnResidual = pEqn.solve().initialResidual();
|
|
||||||
|
|
||||||
if (corr == 0 && nonOrth == 0)
|
|
||||||
{
|
|
||||||
maxResidual = max(eqnResidual, maxResidual);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Calculate the flux
|
// Calculate the flux
|
||||||
if (nonOrth == nNonOrthCorr)
|
if (pimple.finalNonOrthogonalIter())
|
||||||
{
|
{
|
||||||
phi = phid2 + pEqn.flux();
|
phi = phid2 + pEqn.flux();
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,6 +36,7 @@ Author
|
||||||
#include "basicPsiThermo.H"
|
#include "basicPsiThermo.H"
|
||||||
#include "basicRhoThermo.H"
|
#include "basicRhoThermo.H"
|
||||||
#include "RASModel.H"
|
#include "RASModel.H"
|
||||||
|
#include "pimpleControl.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
@ -46,9 +47,11 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
# include "createMesh.H"
|
# include "createMesh.H"
|
||||||
|
|
||||||
|
pimpleControl pimple(mesh);
|
||||||
|
|
||||||
# include "createThermo.H"
|
# include "createThermo.H"
|
||||||
# include "createFields.H"
|
# include "createFields.H"
|
||||||
# include "readPIMPLEControls.H"
|
|
||||||
# include "initContinuityErrs.H"
|
# include "initContinuityErrs.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
@ -59,11 +62,8 @@ int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||||
|
|
||||||
# include "readPIMPLEControls.H"
|
|
||||||
# include "readFieldBounds.H"
|
# include "readFieldBounds.H"
|
||||||
|
|
||||||
# include "initConvergenceCheck.H"
|
|
||||||
|
|
||||||
# include "UEqn.H"
|
# include "UEqn.H"
|
||||||
# include "pEqn.H"
|
# include "pEqn.H"
|
||||||
|
|
||||||
|
@ -79,8 +79,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"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# include "clearThermo.H"
|
# include "clearThermo.H"
|
||||||
|
|
|
@ -13,9 +13,4 @@
|
||||||
|
|
||||||
UEqn.relax();
|
UEqn.relax();
|
||||||
|
|
||||||
eqnResidual = solve
|
solve(UEqn == -fvc::grad(p));
|
||||||
(
|
|
||||||
UEqn == -fvc::grad(p)
|
|
||||||
).initialResidual();
|
|
||||||
|
|
||||||
maxResidual = max(eqnResidual, maxResidual);
|
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
// check convergence
|
|
||||||
|
|
||||||
if (maxResidual < convergenceCriterion)
|
|
||||||
{
|
|
||||||
Info<< "reached convergence criterion: " << convergenceCriterion << endl;
|
|
||||||
runTime.writeAndEnd();
|
|
||||||
Info<< "latestTime = " << runTime.timeName() << endl;
|
|
||||||
}
|
|
||||||
|
|
|
@ -80,3 +80,5 @@
|
||||||
mesh
|
mesh
|
||||||
);
|
);
|
||||||
i == h - 0.5*(magSqr(Urot) - magSqr(Urel));
|
i == h - 0.5*(magSqr(Urot) - magSqr(Urel));
|
||||||
|
|
||||||
|
mesh.schemesDict().setFluxRequired(p.name());
|
||||||
|
|
|
@ -18,8 +18,7 @@
|
||||||
|
|
||||||
iEqn.relax();
|
iEqn.relax();
|
||||||
|
|
||||||
eqnResidual = iEqn.solve().initialResidual();
|
iEqn.solve();
|
||||||
maxResidual = max(eqnResidual, maxResidual);
|
|
||||||
|
|
||||||
// From rothalpy, calculate enthalpy after solution of rothalpy equation
|
// From rothalpy, calculate enthalpy after solution of rothalpy equation
|
||||||
h = i + 0.5*(magSqr(Urot) - magSqr(Urel));
|
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);
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
// 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);
|
surfaceScalarField rhoReff = rhof - psisf*fvc::interpolate(p);
|
||||||
|
|
||||||
for (int corr = 0; corr < nCorr; corr++)
|
while (pimple.correct())
|
||||||
{
|
{
|
||||||
U = rUA*UEqn.H();
|
U = rUA*UEqn.H();
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
|
|
||||||
p.storePrevIter();
|
p.storePrevIter();
|
||||||
|
|
||||||
for (int nonOrth = 0; nonOrth <= nNonOrthCorr; nonOrth++)
|
while (pimple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
fvScalarMatrix pEqn
|
fvScalarMatrix pEqn
|
||||||
(
|
(
|
||||||
|
@ -30,16 +30,10 @@
|
||||||
- fvm::laplacian(rho*rUA, p)
|
- fvm::laplacian(rho*rUA, p)
|
||||||
);
|
);
|
||||||
|
|
||||||
// Retain the residual from the first pressure solution
|
pEqn.solve();
|
||||||
eqnResidual = pEqn.solve().initialResidual();
|
|
||||||
|
|
||||||
if (corr == 0 && nonOrth == 0)
|
|
||||||
{
|
|
||||||
maxResidual = max(eqnResidual, maxResidual);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Calculate the flux
|
// Calculate the flux
|
||||||
if (nonOrth == nNonOrthCorr)
|
if (pimple.finalNonOrthogonalIter())
|
||||||
{
|
{
|
||||||
phi = phid2 + pEqn.flux();
|
phi = phid2 + pEqn.flux();
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,7 @@ GE CONFIDENTIAL INFORMATION 2016 General Electric Company. All Rights Reserved
|
||||||
#include "basicRhoThermo.H"
|
#include "basicRhoThermo.H"
|
||||||
#include "RASModel.H"
|
#include "RASModel.H"
|
||||||
#include "MRFZones.H"
|
#include "MRFZones.H"
|
||||||
|
#include "pimpleControl.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
@ -53,9 +54,11 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
# include "createMesh.H"
|
# include "createMesh.H"
|
||||||
|
|
||||||
|
pimpleControl pimple(mesh);
|
||||||
|
|
||||||
# include "createThermo.H"
|
# include "createThermo.H"
|
||||||
# include "createFields.H"
|
# include "createFields.H"
|
||||||
# include "readPIMPLEControls.H"
|
|
||||||
# include "initContinuityErrs.H"
|
# include "initContinuityErrs.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
@ -66,11 +69,8 @@ int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||||
|
|
||||||
# include "readPIMPLEControls.H"
|
|
||||||
# include "readFieldBounds.H"
|
# include "readFieldBounds.H"
|
||||||
|
|
||||||
# include "initConvergenceCheck.H"
|
|
||||||
|
|
||||||
# include "UEqn.H"
|
# include "UEqn.H"
|
||||||
# include "pEqn.H"
|
# include "pEqn.H"
|
||||||
|
|
||||||
|
@ -86,8 +86,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"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# include "clearThermo.H"
|
# include "clearThermo.H"
|
||||||
|
|
|
@ -72,12 +72,6 @@ snGradSchemes
|
||||||
default limited 0.5;
|
default limited 0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
fluxRequired
|
|
||||||
{
|
|
||||||
default no;
|
|
||||||
p;
|
|
||||||
}
|
|
||||||
|
|
||||||
mixingPlane
|
mixingPlane
|
||||||
{
|
{
|
||||||
default areaAveraging;
|
default areaAveraging;
|
||||||
|
@ -86,22 +80,4 @@ mixingPlane
|
||||||
omega areaAveraging;
|
omega areaAveraging;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|
|
@ -72,12 +72,6 @@ snGradSchemes
|
||||||
default limited 0.5;
|
default limited 0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
fluxRequired
|
|
||||||
{
|
|
||||||
default no;
|
|
||||||
p;
|
|
||||||
}
|
|
||||||
|
|
||||||
mixingPlane
|
mixingPlane
|
||||||
{
|
{
|
||||||
default areaAveraging;
|
default areaAveraging;
|
||||||
|
|
Reference in a new issue