Backported steadyCompressibleFoam, steadyCompressibleMRFFoam, steadyCompressibleSRFFoam and tutorials (vanilla OF 3.0.1)
This commit is contained in:
parent
620e1ce085
commit
3cd148c0c5
33 changed files with 52 additions and 175 deletions
|
@ -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;
|
||||
}
|
||||
|
|
@ -53,3 +53,5 @@
|
|||
thermo
|
||||
)
|
||||
);
|
||||
|
||||
mesh.schemesDict().setFluxRequired(p.name());
|
||||
|
|
|
@ -24,8 +24,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,7 +21,7 @@
|
|||
|
||||
p.storePrevIter();
|
||||
|
||||
for (int nonOrth = 0; nonOrth <= nNonOrthCorr; nonOrth++)
|
||||
while (pimple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
|
@ -31,16 +31,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;
|
||||
}
|
||||
|
|
@ -94,3 +94,5 @@
|
|||
h
|
||||
);
|
||||
i -= 0.5*magSqr(Urot);
|
||||
|
||||
mesh.schemesDict().setFluxRequired(p.name());
|
||||
|
|
|
@ -20,9 +20,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();
|
||||
|
|
|
@ -35,8 +35,7 @@
|
|||
|
||||
iEqn.relax();
|
||||
|
||||
eqnResidual = iEqn.solve().initialResidual();
|
||||
maxResidual = max(eqnResidual, maxResidual);
|
||||
iEqn.solve();
|
||||
|
||||
// Calculate enthalpy out of rothalpy
|
||||
h = i + 0.5*magSqr(Urot);
|
||||
|
|
|
@ -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.
|
||||
surfaceScalarField rhoReff = rhof - psisf*fvc::interpolate(p);
|
||||
|
||||
for (int corr = 0; corr < nCorr; corr++)
|
||||
while (pimple.correct())
|
||||
{
|
||||
U = rUA*UEqn.H();
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
|||
|
||||
p.storePrevIter();
|
||||
|
||||
for (int nonOrth = 0; nonOrth <= nNonOrthCorr; nonOrth++)
|
||||
while (pimple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
|
@ -35,16 +35,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;
|
||||
}
|
||||
|
|
@ -101,3 +101,5 @@
|
|||
h
|
||||
);
|
||||
i -= 0.5*magSqr(SRF->U());
|
||||
|
||||
mesh.schemesDict().setFluxRequired(p.name());
|
||||
|
|
|
@ -24,8 +24,7 @@
|
|||
|
||||
iEqn.relax();
|
||||
|
||||
eqnResidual = iEqn.solve().initialResidual();
|
||||
maxResidual = max(eqnResidual, maxResidual);
|
||||
iEqn.solve();
|
||||
|
||||
// Calculate enthalpy out of rothalpy
|
||||
volVectorField Urot("Urot", SRF->U());
|
||||
|
|
|
@ -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.
|
||||
surfaceScalarField rhoReff = rhof - psisf*fvc::interpolate(p);
|
||||
|
||||
for (int corr = 0; corr < nCorr; corr++)
|
||||
while (pimple.correct())
|
||||
{
|
||||
Urel = rUrelA*UrelEqn.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*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 "iEqn.H"
|
||||
# include "pEqn.H"
|
||||
|
@ -80,8 +80,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;
|
||||
|
|
|
@ -48,7 +48,7 @@ divSchemes
|
|||
|
||||
div(phi,k) Gauss upwind;
|
||||
div(phi,epsilon) Gauss upwind;
|
||||
div((muEff*dev2(grad(U).T()))) Gauss linear;
|
||||
div((muEff*dev2(T(grad(U))))) Gauss linear;
|
||||
}
|
||||
|
||||
laplacianSchemes
|
||||
|
@ -66,10 +66,4 @@ snGradSchemes
|
|||
default corrected;
|
||||
}
|
||||
|
||||
fluxRequired
|
||||
{
|
||||
default no;
|
||||
p;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | foam-extend: Open Source CFD |
|
||||
| \\ / O peration | Version: 3.2 |
|
||||
| \\ / O peration | Version: 4.0 |
|
||||
| \\ / A nd | Web: http://www.foam-extend.org |
|
||||
| \\/ M anipulation | |
|
||||
| \\/ M anipulation | For copyright notice see file Copyright |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
|
|
|
@ -48,7 +48,7 @@ divSchemes
|
|||
|
||||
div(phi,k) Gauss upwind;
|
||||
div(phi,epsilon) Gauss upwind;
|
||||
div((muEff*dev2(grad(U).T()))) Gauss linear;
|
||||
div((muEff*dev2(T(grad(U))))) Gauss linear;
|
||||
|
||||
div(U,p) Gauss linear;
|
||||
|
||||
|
@ -70,10 +70,4 @@ snGradSchemes
|
|||
default corrected;
|
||||
}
|
||||
|
||||
fluxRequired
|
||||
{
|
||||
default no;
|
||||
p;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | foam-extend: Open Source CFD |
|
||||
| \\ / O peration | Version: 3.2 |
|
||||
| \\ / O peration | Version: 4.0 |
|
||||
| \\ / A nd | Web: http://www.foam-extend.org |
|
||||
| \\/ M anipulation | |
|
||||
| \\/ M anipulation | For copyright notice see file Copyright |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
|
|
|
@ -48,7 +48,7 @@ divSchemes
|
|||
|
||||
div(phi,k) Gauss upwind;
|
||||
div(phi,epsilon) Gauss upwind;
|
||||
div((muEff*dev2(grad(U).T()))) Gauss linear;
|
||||
div((muEff*dev2(T(grad(U))))) Gauss linear;
|
||||
|
||||
div(U,p) Gauss linear;
|
||||
}
|
||||
|
@ -68,10 +68,4 @@ snGradSchemes
|
|||
default corrected;
|
||||
}
|
||||
|
||||
fluxRequired
|
||||
{
|
||||
default no;
|
||||
p;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | foam-extend: Open Source CFD |
|
||||
| \\ / O peration | Version: 3.2 |
|
||||
| \\ / O peration | Version: 4.0 |
|
||||
| \\ / A nd | Web: http://www.foam-extend.org |
|
||||
| \\/ M anipulation | |
|
||||
| \\/ M anipulation | For copyright notice see file Copyright |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
|
|
|
@ -44,7 +44,7 @@ divSchemes
|
|||
|
||||
div(phi,k) Gauss upwind;
|
||||
div(phi,epsilon) Gauss upwind;
|
||||
div((muEff*dev2(grad(U).T()))) Gauss linear;
|
||||
div((muEff*dev2(T(grad(U))))) Gauss linear;
|
||||
|
||||
div(U,p) Gauss linear;
|
||||
}
|
||||
|
@ -64,10 +64,4 @@ snGradSchemes
|
|||
default corrected;
|
||||
}
|
||||
|
||||
fluxRequired
|
||||
{
|
||||
default no;
|
||||
p;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | foam-extend: Open Source CFD |
|
||||
| \\ / O peration | Version: 3.2 |
|
||||
| \\ / O peration | Version: 4.0 |
|
||||
| \\ / A nd | Web: http://www.foam-extend.org |
|
||||
| \\/ M anipulation | |
|
||||
| \\/ M anipulation | For copyright notice see file Copyright |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
|
|
|
@ -44,7 +44,7 @@ divSchemes
|
|||
|
||||
div(phi,k) Gauss upwind;
|
||||
div(phi,epsilon) Gauss upwind;
|
||||
div((muEff*dev2(grad(Urel).T()))) Gauss linear;
|
||||
div((muEff*dev2(T(grad(Urel))))) Gauss linear;
|
||||
|
||||
div(U,p) Gauss linear;
|
||||
|
||||
|
@ -65,10 +65,4 @@ snGradSchemes
|
|||
default corrected;
|
||||
}
|
||||
|
||||
fluxRequired
|
||||
{
|
||||
default no;
|
||||
p;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | foam-extend: Open Source CFD |
|
||||
| \\ / O peration | Version: 3.2 |
|
||||
| \\ / O peration | Version: 4.0 |
|
||||
| \\ / A nd | Web: http://www.foam-extend.org |
|
||||
| \\/ M anipulation | |
|
||||
| \\/ M anipulation | For copyright notice see file Copyright |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
|
|
|
@ -44,7 +44,7 @@ divSchemes
|
|||
|
||||
div(phi,k) Gauss upwind;
|
||||
div(phi,epsilon) Gauss upwind;
|
||||
div((muEff*dev2(grad(Urel).T()))) Gauss linear;
|
||||
div((muEff*dev2(T(grad(Urel))))) Gauss linear;
|
||||
|
||||
div(U,p) Gauss linear;
|
||||
|
||||
|
@ -65,10 +65,4 @@ snGradSchemes
|
|||
default corrected;
|
||||
}
|
||||
|
||||
fluxRequired
|
||||
{
|
||||
default no;
|
||||
p;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
Reference in a new issue