Backported dieselFoam, dieselEngineFoam, fireFoam, reactingFoam and tutorials (vanilla OF 3.0.1)

This commit is contained in:
Vanja Skuric 2016-05-08 11:28:13 +02:00
parent 53dcbea597
commit f609442e99
34 changed files with 132 additions and 102 deletions

View file

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

View file

@ -107,3 +107,5 @@ DimensionedField<scalar, volMesh> chemistrySh
mesh,
dimensionedScalar("chemistrySh", dimEnergy/dimTime/dimVolume, 0.0)
);
mesh.schemesDict().setFluxRequired(p.name());

View file

@ -42,6 +42,7 @@ Description
#include "OFstream.H"
#include "volPointInterpolation.H"
#include "thermoPhysicsTypes.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -50,6 +51,9 @@ int main(int argc, char *argv[])
# include "setRootCase.H"
# include "createEngineTime.H"
# include "createEngineMesh.H"
pimpleControl pimple(mesh);
# include "createFields.H"
# include "readGravitationalAcceleration.H"
# include "readCombustionProperties.H"
@ -67,7 +71,6 @@ int main(int argc, char *argv[])
while (runTime.run())
{
# include "readPISOControls.H"
# include "readEngineTimeControls.H"
# include "compressibleCourantNo.H"
# include "setDeltaT.H"
@ -103,13 +106,13 @@ int main(int argc, char *argv[])
# include "rhoEqn.H"
# include "UEqn.H"
for (label ocorr=1; ocorr <= nOuterCorr; ocorr++)
while (pimple.loop())
{
# include "YEqn.H"
# include "hsEqn.H"
// --- PISO loop
for (int corr=1; corr<=nCorr; corr++)
while (pimple.correct())
{
# include "pEqn.H"
}

View file

@ -3,7 +3,7 @@ rho = thermo.rho();
volScalarField A = UEqn.A();
U = UEqn.H()/A;
if (transonic)
if (pimple.transonic())
{
surfaceScalarField phid
(
@ -12,7 +12,7 @@ if (transonic)
*((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U))
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix pEqn
(
@ -25,7 +25,7 @@ if (transonic)
pEqn.solve();
if (nonOrth == nNonOrthCorr)
if (pimple.finalNonOrthogonalIter())
{
phi == pEqn.flux();
}
@ -36,7 +36,7 @@ else
phi = fvc::interpolate(rho)
*((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U));
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix pEqn
(
@ -49,7 +49,7 @@ else
pEqn.solve();
if (nonOrth == nNonOrthCorr)
if (pimple.finalNonOrthogonalIter())
{
phi += pEqn.flux();
}

View file

@ -40,6 +40,7 @@ Description
#include "IFstream.H"
#include "OFstream.H"
#include "Switch.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -48,6 +49,9 @@ int main(int argc, char *argv[])
# include "setRootCase.H"
# include "createTime.H"
# include "createMesh.H"
pimpleControl pimple(mesh);
# include "createFields.H"
# include "readGravitationalAcceleration.H"
# include "readCombustionProperties.H"
@ -63,7 +67,6 @@ int main(int argc, char *argv[])
while (runTime.run())
{
# include "readPISOControls.H"
# include "compressibleCourantNo.H"
# include "setDeltaT.H"
@ -97,13 +100,13 @@ int main(int argc, char *argv[])
# include "rhoEqn.H"
# include "UEqn.H"
for (label ocorr=1; ocorr <= nOuterCorr; ocorr++)
while (pimple.loop())
{
# include "YEqn.H"
# include "hsEqn.H"
// --- PISO loop
for (int corr=1; corr<=nCorr; corr++)
while (pimple.correct())
{
# include "pEqn.H"
}

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

@ -7,30 +7,14 @@ fvVectorMatrix UEqn
UEqn.relax();
if (oCorr == nOuterCorr - 1)
{
solve
solve
(
UEqn
==
fvc::reconstruct
(
UEqn
==
fvc::reconstruct
(
fvc::interpolate(rho)*(g & mesh.Sf())
- fvc::snGrad(p)*mesh.magSf()
),
mesh.solutionDict().solver("UFinal")
);
}
else
{
solve
(
UEqn
==
fvc::reconstruct
(
fvc::interpolate(rho)*(g & mesh.Sf())
- fvc::snGrad(p)*mesh.magSf()
)
);
}
fvc::interpolate(rho)*(g & mesh.Sf())
- fvc::snGrad(p)*mesh.magSf()
),
mesh.solutionDict().solver((U.select(pimple.finalIter())))
);

View file

@ -128,3 +128,5 @@ if (composition.contains("fu"))
}
fields.add(hs);
mesh.schemesDict().setFluxRequired(p.name());

View file

@ -33,6 +33,7 @@ Description
#include "hsCombustionThermo.H"
#include "turbulenceModel.H"
#include "combustionModel.H"
#include "pimpleControl.H"
#include "radiationModel.H"
@ -43,6 +44,9 @@ int main(int argc, char *argv[])
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
pimpleControl pimple(mesh);
#include "readGravitationalAcceleration.H"
#include "initContinuityErrs.H"
#include "createFields.H"
@ -57,7 +61,6 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readPISOControls.H"
#include "readTimeControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
@ -68,7 +71,7 @@ int main(int argc, char *argv[])
#include "rhoEqn.H"
// --- Pressure-velocity PIMPLE corrector loop
for (int oCorr=0; oCorr<nOuterCorr; oCorr++)
while (pimple.loop())
{
#include "UEqn.H"
@ -76,7 +79,7 @@ int main(int argc, char *argv[])
#include "fuhsEqn.H"
// --- PISO loop
for (int corr = 0; corr < nCorr; corr++)
while (pimple.correct())
{
#include "pEqn.H"
}

View file

@ -17,7 +17,7 @@ surfaceScalarField phiU
phi = phiU + rhorUAf*fvc::interpolate(rho)*(g & mesh.Sf());
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
while (pimple.correctNonOrthogonal())
{
surfaceScalarField rhorUAf = fvc::interpolate(rho*rUA);
@ -30,16 +30,12 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
closedVolume = p.needReference();
if (corr == nCorr-1 && nonOrth == nNonOrthCorr)
{
pEqn.solve(mesh.solutionDict().solver(p.name() + "Final"));
}
else
{
pEqn.solve(mesh.solutionDict().solver(p.name()));
}
pEqn.solve
(
mesh.solutionDict().solver(p.select(pimple.finalInnerIter()))
);
if (nonOrth == nNonOrthCorr)
if (pimple.finalNonOrthogonalIter())
{
phi += pEqn.flux();
}

View file

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

View file

@ -96,3 +96,5 @@ DimensionedField<scalar, volMesh> chemistrySh
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
(
@ -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

@ -35,6 +35,7 @@ Description
#include "psiChemistryModel.H"
#include "chemistrySolver.H"
#include "multivariateScheme.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -43,6 +44,9 @@ int main(int argc, char *argv[])
# include "setRootCase.H"
# include "createTime.H"
# include "createMesh.H"
pimpleControl pimple(mesh);
# include "readChemistryProperties.H"
# include "readGravitationalAcceleration.H"
# include "createFields.H"
@ -58,7 +62,6 @@ int main(int argc, char *argv[])
while (runTime.run())
{
# include "readTimeControls.H"
# include "readPISOControls.H"
# include "compressibleCourantNo.H"
# include "setDeltaT.H"
@ -68,14 +71,14 @@ int main(int argc, char *argv[])
# include "chemistry.H"
# include "rhoEqn.H"
for (label 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

@ -20,7 +20,7 @@ internalField uniform 0;
boundaryField
{
fixedWalls
walls
{
type zeroGradient;
}

View file

@ -20,7 +20,7 @@ internalField uniform 0;
boundaryField
{
fixedWalls
walls
{
type zeroGradient;
}

View file

@ -42,7 +42,7 @@ divSchemes
ft vanLeer;
hs vanLeer;
};
div((muEff*dev2(grad(U).T()))) Gauss linear;
div((muEff*dev2(T(grad(U))))) Gauss linear;
}
laplacianSchemes
@ -68,10 +68,4 @@ snGradSchemes
default corrected;
}
fluxRequired
{
default no;
p;
}
// ************************************************************************* //

View file

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

View file

@ -20,13 +20,38 @@ internalField uniform 0;
boundaryField
{
".*"
outlet
{
type MarshakRadiation;
T T;
emissivity 1;
value uniform 0;
}
sides
{
type MarshakRadiation;
T T;
emissivity 1;
value uniform 0;
}
base
{
type MarshakRadiation;
T T;
emissivity 1;
value uniform 0;
}
inlet
{
type MarshakRadiation;
T T;
emissivity 1;
value uniform 0;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //

View file

@ -20,13 +20,38 @@ internalField uniform 0;
boundaryField
{
".*"
outlet
{
type greyDiffusiveRadiation;
T T;
emissivity 1.0
value uniform 0;
}
sides
{
type greyDiffusiveRadiation;
T T;
emissivity 1.0
value uniform 0;
}
base
{
type greyDiffusiveRadiation;
T T;
emissivity 1.0
value uniform 0;
}
inlet
{
type greyDiffusiveRadiation;
T T;
emissivity 1.0
value uniform 0;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //

View file

@ -42,7 +42,7 @@ boundaryField
type fixedValue;
value uniform 300;
}
frontBack
frontAndBack
{
type empty;
}

View file

@ -45,7 +45,7 @@ boundaryField
type fixedValue;
value uniform (0 0.05 0);
}
frontBack
frontAndBack
{
type empty;
}

View file

@ -37,7 +37,7 @@ boundaryField
{
type zeroGradient;
}
frontBack
frontAndBack
{
type empty;
}

View file

@ -37,7 +37,7 @@ boundaryField
{
type zeroGradient;
}
frontBack
frontAndBack
{
type empty;
}

View file

@ -42,7 +42,7 @@ boundaryField
type fixedValue;
value uniform 1.0;
}
frontBack
frontAndBack
{
type empty;
}

View file

@ -42,7 +42,7 @@ boundaryField
type fixedValue;
value uniform 1.0;
}
frontBack
frontAndBack
{
type empty;
}

View file

@ -43,7 +43,7 @@ boundaryField
type fixedValue;
value uniform 1e-4;
}
frontBack
frontAndBack
{
type empty;
}

View file

@ -37,7 +37,7 @@ boundaryField
{
type zeroGradient;
}
frontBack
frontAndBack
{
type empty;
}

View file

@ -45,7 +45,7 @@ boundaryField
type buoyantPressure;
value $internalField;
}
frontBack
frontAndBack
{
type empty;
}

View file

@ -37,7 +37,7 @@ divSchemes
ft limitedLinear01 1;
hs limitedLinear 1;
};
div((muEff*dev2(grad(U).T()))) Gauss linear;
div((muEff*dev2(T(grad(U))))) Gauss linear;
div(phiU,p) Gauss linear;
div(Ji,Ii_h) Gauss upwind;
}
@ -66,10 +66,4 @@ snGradSchemes
default corrected;
}
fluxRequired
{
default no;
p;
}
// ************************************************************************* //

View file

@ -124,7 +124,7 @@ solvers
}
PISO
PIMPLE
{
momentumPredictor yes;
nOuterCorrectors 1;

View file

View file

@ -37,7 +37,7 @@ divSchemes
div(phid,p) Gauss limitedLinear 1;
div(phi,epsilon) Gauss limitedLinear 1;
div(phi,k) Gauss limitedLinear 1;
div((muEff*dev2(grad(U).T()))) Gauss linear;
div((muEff*dev2(T(grad(U))))) Gauss linear;
}
laplacianSchemes
@ -61,10 +61,4 @@ snGradSchemes
default uncorrected;
}
fluxRequired
{
default no;
p;
}
// ************************************************************************* //

View file

@ -41,7 +41,7 @@ solvers
}
}
PISO
PIMPLE
{
nCorrectors 2;
nNonOrthogonalCorrectors 0;