Backported sonicFoam, sonicDyMFoam, sonicLiquidFoam and tutorials (vanilla OF 3.0.1)
This commit is contained in:
parent
1296dcd3ad
commit
620e1ce085
26 changed files with 97 additions and 156 deletions
|
@ -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
|
||||
pEqn.solve
|
||||
(
|
||||
// oCorr == nOuterCorr - 1
|
||||
corr == nCorr - 1
|
||||
&& nonOrth == nNonOrthCorr
|
||||
)
|
||||
{
|
||||
pEqn.solve
|
||||
(
|
||||
mesh.solutionDict().solver(p.name() + "Final")
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
pEqn.solve(mesh.solutionDict().solver(p.name()));
|
||||
}
|
||||
mesh.solutionDict().solver(p.select(pimple.finalInnerIter()))
|
||||
);
|
||||
|
||||
// Calculate the flux
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
phi = phid2 + pEqn.flux();
|
||||
}
|
||||
|
|
|
@ -1,14 +1,5 @@
|
|||
# include "readTimeControls.H"
|
||||
# include "readPIMPLEControls.H"
|
||||
#include "readTimeControls.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();
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*--------------------------------*- 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 | For copyright notice see file Copyright |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
|
|
@ -31,7 +31,7 @@ divSchemes
|
|||
div(phi,U) Gauss upwind;
|
||||
div(phid,p) Gauss upwind;
|
||||
div(phi,e) Gauss upwind;
|
||||
div((muEff*dev2(grad(U).T()))) Gauss linear;
|
||||
div((muEff*dev2(T(grad(U))))) Gauss linear;
|
||||
}
|
||||
|
||||
laplacianSchemes
|
||||
|
@ -49,10 +49,4 @@ snGradSchemes
|
|||
default corrected;
|
||||
}
|
||||
|
||||
fluxRequired
|
||||
{
|
||||
default no;
|
||||
p;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
@ -52,4 +52,12 @@ PIMPLE
|
|||
nNonOrthogonalCorrectors 0;
|
||||
}
|
||||
|
||||
relaxationFactors
|
||||
{
|
||||
U 1;
|
||||
UFinal 1;
|
||||
e 1;
|
||||
eFinal 1;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
@ -32,7 +32,7 @@ divSchemes
|
|||
div(phid,p) Gauss vanLeer;
|
||||
div(phi,e) Gauss vanLeer;
|
||||
div(phiU,p) Gauss vanLeer;
|
||||
div((muEff*dev2(grad(U).T()))) Gauss linear;
|
||||
div((muEff*dev2(T(grad(U))))) Gauss linear;
|
||||
|
||||
div(interpolate(rho),U) Gauss linear;
|
||||
}
|
||||
|
@ -52,10 +52,4 @@ snGradSchemes
|
|||
default corrected;
|
||||
}
|
||||
|
||||
fluxRequired
|
||||
{
|
||||
default no;
|
||||
p ;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
@ -57,4 +57,12 @@ PIMPLE
|
|||
nNonOrthogonalCorrectors 0;
|
||||
}
|
||||
|
||||
relaxationFactors
|
||||
{
|
||||
U 1;
|
||||
UFinal 1;
|
||||
e 1;
|
||||
eFinal 1;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*--------------------------------*- 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 | For copyright notice see file Copyright |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
|
|
@ -36,7 +36,7 @@ divSchemes
|
|||
div(phid,p) Gauss limitedLinear 1;
|
||||
div(phiU,p) Gauss limitedLinear 1;
|
||||
div(phi,e) Gauss limitedLinear 1;
|
||||
div((muEff*dev2(grad(U).T()))) Gauss linear;
|
||||
div((muEff*dev2(T(grad(U))))) Gauss linear;
|
||||
}
|
||||
|
||||
laplacianSchemes
|
||||
|
@ -54,10 +54,4 @@ snGradSchemes
|
|||
default corrected;
|
||||
}
|
||||
|
||||
fluxRequired
|
||||
{
|
||||
default no;
|
||||
p;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
@ -85,9 +85,11 @@ PIMPLE
|
|||
|
||||
relaxationFactors
|
||||
{
|
||||
U 0.8;
|
||||
p 0.8;
|
||||
e 0.8;
|
||||
U 0.8;
|
||||
UFinal 1;
|
||||
p 0.8;
|
||||
e 0.8;
|
||||
eFinal 1;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*--------------------------------*- 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 | For copyright notice see file Copyright |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
|
|
@ -31,7 +31,7 @@ divSchemes
|
|||
div(phi,U) Gauss upwind;
|
||||
div(phid,p) Gauss upwind;
|
||||
div(phi,e) Gauss upwind;
|
||||
div((muEff*dev2(grad(U).T()))) Gauss linear;
|
||||
div((muEff*dev2(T(grad(U))))) Gauss linear;
|
||||
|
||||
div(phi,k) Gauss upwind;
|
||||
div(phi,epsilon) Gauss upwind;
|
||||
|
@ -54,10 +54,4 @@ snGradSchemes
|
|||
default corrected;
|
||||
}
|
||||
|
||||
fluxRequired
|
||||
{
|
||||
default no;
|
||||
p;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
@ -76,4 +76,12 @@ PIMPLE
|
|||
nNonOrthogonalCorrectors 0;
|
||||
}
|
||||
|
||||
relaxationFactors
|
||||
{
|
||||
U 1;
|
||||
UFinal 1;
|
||||
e 1;
|
||||
eFinal 1;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
@ -50,10 +50,4 @@ snGradSchemes
|
|||
default corrected;
|
||||
}
|
||||
|
||||
fluxRequired
|
||||
{
|
||||
default no;
|
||||
p ;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
Reference in a new issue