Backported lagrangian solvers and tutorials (vanilla OF 3.0.1)

This commit is contained in:
Vanja Skuric 2016-05-27 22:07:30 +02:00
parent 9811dd7d25
commit c9fea670b6
41 changed files with 116 additions and 118 deletions

View file

@ -11,7 +11,7 @@
UEqn.relax();
if (momentumPredictor)
if (pimple.momentumPredictor())
{
solve(UEqn == -fvc::grad(p));
}

View file

@ -44,6 +44,7 @@ Description
#include "chemistrySolver.H"
#include "timeActivatedExplicitSource.H"
#include "radiationModel.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -53,6 +54,9 @@ int main(int argc, char *argv[])
#include "createTime.H"
#include "createMesh.H"
pimpleControl pimple(mesh);
#include "readChemistryProperties.H"
#include "readGravitationalAcceleration.H"
#include "createFields.H"
@ -70,7 +74,6 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readTimeControls.H"
#include "readPISOControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
@ -89,14 +92,14 @@ int main(int argc, char *argv[])
#include "rhoEqn.H"
// --- PIMPLE loop
for (int 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"
}

View file

@ -149,3 +149,5 @@
mesh,
dimensionedScalar("chemistrySh", dimEnergy/dimTime/dimVolume, 0.0)
);
mesh.schemesDict().setFluxRequired(p.name());

View file

@ -3,7 +3,7 @@ rho = thermo.rho();
volScalarField rUA = 1.0/UEqn.A();
U = rUA*UEqn.H();
if (transonic)
if (pimple.transonic())
{
surfaceScalarField phid
(
@ -15,7 +15,7 @@ if (transonic)
)
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix pEqn
(
@ -28,7 +28,7 @@ if (transonic)
pEqn.solve();
if (nonOrth == nNonOrthCorr)
if (pimple.finalNonOrthogonalIter())
{
phi == pEqn.flux();
}
@ -43,7 +43,7 @@ else
+ fvc::ddtPhiCorr(rUA, rho, U, phi)
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix pEqn
(
@ -56,7 +56,7 @@ else
pEqn.solve();
if (nonOrth == nNonOrthCorr)
if (pimple.finalNonOrthogonalIter())
{
phi += pEqn.flux();
}

View file

@ -12,7 +12,7 @@
pZones.addResistance(UEqn);
if (momentumPredictor)
if (piso.momentumPredictor())
{
solve(UEqn == -fvc::grad(p));
}

View file

@ -103,3 +103,5 @@
mesh,
dimensionedScalar("chemistrySh", dimEnergy/dimTime/dimVolume, 0.0)
);
mesh.schemesDict().setFluxRequired(p.name());

View file

@ -23,7 +23,7 @@
);
}
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
while (piso.correctNonOrthogonal())
{
fvScalarMatrix pEqn
(
@ -35,16 +35,9 @@
+ massSource.SuTot()
);
if (corr == nCorr-1 && nonOrth == nNonOrthCorr)
{
pEqn.solve(mesh.solutionDict().solver("pFinal"));
}
else
{
pEqn.solve();
}
pEqn.solve(mesh.solutionDict().solver(p.select(piso.finalInnerIter())));
if (nonOrth == nNonOrthCorr)
if (piso.finalNonOrthogonalIter())
{
phi += pEqn.flux();
}

View file

@ -49,6 +49,7 @@ Description
#include "radiationModel.H"
#include "porousZones.H"
#include "timeActivatedExplicitSource.H"
#include "pisoControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -58,6 +59,9 @@ int main(int argc, char *argv[])
#include "createTime.H"
#include "createMesh.H"
pisoControl piso(mesh);
#include "readChemistryProperties.H"
#include "readGravitationalAcceleration.H"
#include "createFields.H"
@ -77,7 +81,6 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readTimeControls.H"
#include "readPISOControls.H"
#include "readAdditionalSolutionControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
@ -95,7 +98,7 @@ int main(int argc, char *argv[])
#include "hsEqn.H"
// --- PISO loop
for (int corr = 0; corr < nCorr; corr++)
while (piso.correct())
{
#include "pEqn.H"
}

View file

@ -10,7 +10,7 @@
UEqn.relax();
if (momentumPredictor)
if (pimple.momentumPredictor())
{
solve(UEqn == -fvc::grad(p));
}

View file

@ -109,3 +109,5 @@
mesh,
dimensionedScalar("chemistry::Sh", dimEnergy/dimTime/dimVolume, 0.0)
);
mesh.schemesDict().setFluxRequired(p.name());

View file

@ -3,7 +3,7 @@ rho = thermo.rho();
volScalarField rUA = 1.0/UEqn.A();
U = rUA*UEqn.H();
if (transonic)
if (pimple.transonic())
{
surfaceScalarField phid
(
@ -15,7 +15,7 @@ if (transonic)
)
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix pEqn
(
@ -28,7 +28,7 @@ if (transonic)
pEqn.solve();
if (nonOrth == nNonOrthCorr)
if (pimple.finalNonOrthogonalIter())
{
phi == pEqn.flux();
}
@ -43,7 +43,7 @@ else
+ fvc::ddtPhiCorr(rUA, rho, U, phi)
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix pEqn
(
@ -56,7 +56,7 @@ else
pEqn.solve();
if (nonOrth == nNonOrthCorr)
if (pimple.finalNonOrthogonalIter())
{
phi += pEqn.flux();
}

View file

@ -37,6 +37,7 @@ Description
#include "psiChemistryModel.H"
#include "chemistrySolver.H"
#include "radiationModel.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -46,6 +47,9 @@ int main(int argc, char *argv[])
#include "createTime.H"
#include "createMesh.H"
pimpleControl pimple(mesh);
#include "readChemistryProperties.H"
#include "readGravitationalAcceleration.H"
#include "createFields.H"
@ -63,7 +67,6 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readTimeControls.H"
#include "readPISOControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
@ -77,13 +80,13 @@ int main(int argc, char *argv[])
#include "rhoEqn.H"
// --- PIMPLE loop
for (int ocorr=1; ocorr<=nOuterCorr; ocorr++)
while (pimple.loop())
{
#include "UEqn.H"
#include "YEqn.H"
// --- PISO loop
for (int corr=1; corr<=nCorr; corr++)
while (pimple.correct())
{
#include "hsEqn.H"
#include "pEqn.H"

View file

@ -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
{

View file

@ -36,7 +36,7 @@ divSchemes
div(phi,k) Gauss upwind;
div(phi,epsilon) Gauss upwind;
div(U) Gauss linear;
div((muEff*dev2(grad(U).T()))) Gauss linear;
div((muEff*dev2(T(grad(U))))) Gauss linear;
div(phi,Yi_h) Gauss upwind;
}
@ -62,10 +62,4 @@ snGradSchemes
default corrected;
}
fluxRequired
{
default no;
p ;
}
// ************************************************************************* //

View file

@ -50,7 +50,7 @@ solvers
}
}
PISO
PIMPLE
{
transonic yes;
nCorrectors 2;

View file

@ -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
{
@ -38,7 +38,6 @@ FoamFile
frontAndBack
{
type empty;
physicalType empty;
nFaces 2000;
startFace 2110;
}

View file

@ -49,10 +49,4 @@ snGradSchemes
default corrected;
}
fluxRequired
{
default no;
p;
}
// ************************************************************************* //

View file

@ -53,6 +53,8 @@
label pRefCell = 0;
scalar pRefValue = 0.0;
setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue);
mesh.schemesDict().setFluxRequired(p.name());
dimensionedScalar rhoVal
(
transportProperties.lookup("rho")

View file

@ -31,6 +31,7 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "pisoControl.H"
#include "basicKinematicCloud.H"
@ -42,6 +43,9 @@ int main(int argc, char *argv[])
# include "createTime.H"
# include "createMesh.H"
pisoControl piso(mesh);
# include "createFields.H"
# include "initContinuityErrs.H"
@ -53,7 +57,6 @@ int main(int argc, char *argv[])
{
Info<< "Time = " << runTime.timeName() << nl << endl;
# include "readPISOControls.H"
# include "CourantNo.H"
Info<< "Evolving kinematicCloud" << endl;
@ -73,7 +76,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();
@ -83,7 +86,7 @@ int main(int argc, char *argv[])
adjustPhi(phi, U, p);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
while (piso.correctNonOrthogonal())
{
fvScalarMatrix pEqn
(
@ -93,7 +96,7 @@ int main(int argc, char *argv[])
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve();
if (nonOrth == nNonOrthCorr)
if (piso.finalNonOrthogonalIter())
{
phi -= pEqn.flux();
}

View file

@ -6,7 +6,7 @@
cleanCase
# remove 0 directory
rm -rf 0
rm -rf 0 postProcessing
# copy 0.org to 0
cp -r 0.org 0

View file

@ -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
{
@ -21,39 +21,39 @@ FoamFile
{
type wall;
nFaces 172;
startFace 3334;
startFace 3314;
}
inlet
{
type patch;
nFaces 20;
startFace 3506;
startFace 3486;
}
outlet
{
type patch;
nFaces 20;
startFace 3526;
startFace 3506;
}
cycLeft
{
type cyclic;
nFaces 0;
startFace 3546;
nFaces 40;
startFace 3526;
featureCos 0.9;
}
cycRight
{
type cyclic;
nFaces 0;
startFace 3546;
startFace 3566;
featureCos 0.9;
}
frontAndBack
{
type empty;
nFaces 3440;
startFace 3546;
startFace 3566;
}
)

View file

@ -36,7 +36,7 @@ divSchemes
div(phi,k) Gauss upwind;
div(phi,epsilon) Gauss upwind;
div(U) Gauss linear;
div((muEff*dev2(grad(U).T()))) Gauss linear;
div((muEff*dev2(T(grad(U))))) Gauss linear;
div(phi,Yi_h) Gauss upwind;
}
@ -62,10 +62,4 @@ snGradSchemes
default corrected;
}
fluxRequired
{
default no;
p ;
}
// ************************************************************************* //

View file

@ -47,6 +47,10 @@ boundaryField
emissivity 1;
value uniform 0;
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //

View file

@ -44,6 +44,10 @@ boundaryField
type fixedValue;
value uniform 0.01;
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //

View file

@ -43,6 +43,10 @@ boundaryField
type fixedValue;
value uniform 473.0;
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //

View file

@ -43,6 +43,10 @@ boundaryField
type fixedValue;
value uniform (0 1e-8 0);
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //

View file

@ -44,6 +44,10 @@ boundaryField
type fixedValue;
value uniform 0.99;
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //

View file

@ -42,6 +42,10 @@ boundaryField
{
type zeroGradient;
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //

View file

@ -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
{

View file

@ -37,7 +37,7 @@ divSchemes
div(phi,epsilon) Gauss upwind;
div(phi,omega) Gauss upwind;
// div(U) Gauss linear;
div((muEff*dev2(grad(U).T()))) Gauss linear;
div((muEff*dev2(T(grad(U))))) Gauss linear;
div(phi,Yi_h) Gauss upwind;
}
@ -56,10 +56,4 @@ snGradSchemes
default uncorrected;
}
fluxRequired
{
default no;
p;
}
// ************************************************************************* //

View file

@ -38,7 +38,7 @@ divSchemes
div(phi,k) Gauss upwind;
div(phi,epsilon) Gauss upwind;
div(phi,omega) Gauss upwind;
div((muEff*dev2(grad(U).T()))) Gauss linear;
div((muEff*dev2(T(grad(U))))) Gauss linear;
div(phi,Yi_h) Gauss upwind;
}
@ -57,10 +57,4 @@ snGradSchemes
default uncorrected;
}
fluxRequired
{
default no;
p;
}
// ************************************************************************* //

View file

@ -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
{

View file

@ -36,7 +36,7 @@ divSchemes
div(phi,k) Gauss upwind;
div(phi,epsilon) Gauss upwind;
div(U) Gauss linear;
div((muEff*dev2(grad(U).T()))) Gauss linear;
div((muEff*dev2(T(grad(U))))) Gauss linear;
div(phi,Yi_h) Gauss upwind;
}
@ -62,10 +62,4 @@ snGradSchemes
default corrected;
}
fluxRequired
{
default no;
p;
}
// ************************************************************************* //

View file

@ -96,7 +96,7 @@ solvers
}
}
PISO
PIMPLE
{
transonic no;
nCorrectors 2;

View file

@ -11,7 +11,7 @@
UEqn.relax();
if (momentumPredictor)
if (pimple.momentumPredictor())
{
solve(UEqn == -fvc::grad(p));
}

View file

@ -57,3 +57,5 @@
Info<< "Creating field DpDt\n" << endl;
volScalarField DpDt =
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
mesh.schemesDict().setFluxRequired(p.name());

View file

@ -3,7 +3,7 @@ rho = thermo.rho();
volScalarField rUA = 1.0/UEqn.A();
U = rUA*UEqn.H();
if (transonic)
if (pimple.transonic())
{
surfaceScalarField phid
(
@ -15,7 +15,7 @@ if (transonic)
)
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix pEqn
(
@ -26,7 +26,7 @@ if (transonic)
pEqn.solve();
if (nonOrth == nNonOrthCorr)
if (pimple.finalNonOrthogonalIter())
{
phi == pEqn.flux();
}
@ -41,7 +41,7 @@ else
+ fvc::ddtPhiCorr(rUA, rho, U, phi)
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix pEqn
(
@ -52,7 +52,7 @@ else
pEqn.solve();
if (nonOrth == nNonOrthCorr)
if (pimple.finalNonOrthogonalIter())
{
phi += pEqn.flux();
}

View file

@ -32,6 +32,7 @@ Description
#include "fvCFD.H"
#include "basicPsiThermo.H"
#include "turbulenceModel.H"
#include "pimpleControl.H"
#include "basicThermoCloud.H"
#include "basicKinematicCloud.H"
@ -44,12 +45,14 @@ int main(int argc, char *argv[])
#include "createTime.H"
#include "createMesh.H"
pimpleControl pimple(mesh);
#include "readGravitationalAcceleration.H"
#include "createFields.H"
#include "createClouds.H"
#include "readPISOControls.H"
#include "initContinuityErrs.H"
#include "readTimeControls.H"
#include "createTimeControls.H"
#include "compressibleCourantNo.H"
#include "setInitialDeltaT.H"
@ -60,7 +63,6 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readTimeControls.H"
#include "readPISOControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
@ -78,12 +80,12 @@ int main(int argc, char *argv[])
#include "rhoEqn.H"
// --- PIMPLE loop
for (int ocorr=1; ocorr<=nOuterCorr; ocorr++)
while (pimple.loop())
{
#include "UEqn.H"
// --- PISO loop
for (int corr=1; corr<=nCorr; corr++)
while (pimple.correct())
{
#include "hsEqn.H"
#include "pEqn.H"

View file

@ -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
{

View file

@ -36,7 +36,7 @@ divSchemes
div(phi,k) Gauss upwind;
div(phi,epsilon) Gauss upwind;
div(U) Gauss linear;
div((muEff*dev2(grad(U).T()))) Gauss linear;
div((muEff*dev2(T(grad(U))))) Gauss linear;
div(phi,Yi_h) Gauss upwind;
}
@ -62,10 +62,4 @@ snGradSchemes
default corrected;
}
fluxRequired
{
default no;
p ;
}
// ************************************************************************* //

View file

@ -74,7 +74,7 @@ solvers
}
}
PISO
PIMPLE
{
transonic yes;
nCorrectors 2;