ENH: Upadted LTSReactingParcelFoam solver and tutorials

This commit is contained in:
andy
2011-04-15 17:15:37 +01:00
parent f3b394f5af
commit 9ecae449bf
10 changed files with 34 additions and 69 deletions

View File

@ -57,6 +57,9 @@ int main(int argc, char *argv[])
#include "createTime.H"
#include "createMesh.H"
#include "readGravitationalAcceleration.H"
pimpleControl pimple(mesh);
#include "readTimeControls.H"
#include "readAdditionalSolutionControls.H"
#include "createFields.H"
@ -66,8 +69,6 @@ int main(int argc, char *argv[])
#include "createPorousZones.H"
#include "initContinuityErrs.H"
pimpleControl pimple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;

View File

@ -116,11 +116,11 @@
dimensionedScalar("chemistrySh", dimEnergy/dimTime/dimVolume, 0.0)
);
volScalarField invTau
volScalarField rDeltaT
(
IOobject
(
"invTau",
"rDeltaT",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,

View File

@ -24,47 +24,16 @@ License
\*---------------------------------------------------------------------------*/
// Maximum flow Courant number
scalar maxCo(readScalar(runTime.controlDict().lookup("maxCo")));
scalar maxCo(readScalar(pimple.dict().lookup("maxCo")));
// Maximum time scale
scalar maxDeltaT = readScalar(runTime.controlDict().lookup("maxDeltaT"));
scalar maxDeltaT = readScalar(pimple.dict().lookup("maxDeltaT"));
// Smoothing parameter (0-1) when smoothing iterations > 0
scalar alphaTauSmooth
(
runTime.controlDict().lookupOrDefault("alphaTauSmooth", 0.1)
);
// Maximum change in cell density per iteration (relative to previous value)
scalar alphaTauRho
(
runTime.controlDict().lookupOrDefault("alphaTauRho", 0.05)
);
// Maximum change in cell velocity per iteration (relative to previous value)
scalar alphaTauU
(
runTime.controlDict().lookupOrDefault("alphaTauU", 0.05)
);
scalar alphaTauSmooth(pimple.dict().lookupOrDefault("alphaTauSmooth", 0.1));
// Maximum change in cell temperature per iteration (relative to previous value)
scalar alphaTauTemp
(
runTime.controlDict().lookupOrDefault("alphaTauTemp", 0.05)
);
// Max specie mass fraction that can be consumed/gained per chemistry
// integration step
scalar alphaTauSpecie
(
runTime.controlDict().lookupOrDefault("alphaTauSpecie", 0.05)
);
// Maximum unboundedness allowed (fraction of 1)
scalar specieMaxUnbound
(
runTime.controlDict().lookupOrDefault("specieMaxUnbound", 0.01)
);
scalar alphaTauTemp(pimple.dict().lookupOrDefault("alphaTauTemp", 0.05));
// ************************************************************************* //

View File

@ -28,40 +28,40 @@ Info<< "Time scales min/max:" << endl;
{
// Cache old time scale field
tmp<volScalarField> tinvTau0
tmp<volScalarField> trDeltaT
(
new volScalarField
(
IOobject
(
"invTau0",
"rDeltaT0",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
invTau
rDeltaT
)
);
const volScalarField& invTau0 = tinvTau0();
const volScalarField& rDeltaT0 = trDeltaT();
// Flow time scale
// ~~~~~~~~~~~~~~~
{
invTau =
rDeltaT =
fvc::surfaceSum
(
mag(phi)*mesh.deltaCoeffs()/(maxCo*mesh.magSf())
)
/rho;
invTau.max(1.0/maxDeltaT);
rDeltaT.max(1.0/maxDeltaT);
Info<< " Flow = "
<< gMin(1/invTau.internalField()) << ", "
<< gMax(1/invTau.internalField()) << endl;
<< gMin(1/rDeltaT.internalField()) << ", "
<< gMax(1/rDeltaT.internalField()) << endl;
}
@ -87,7 +87,7 @@ Info<< "Time scales min/max:" << endl;
Info<< " Temperature = " << min(maxDeltaT, gMin(tau)) << ", "
<< min(maxDeltaT, gMax(tau)) << endl;
invTau.internalField() = max(invTau.internalField(), 1/tau);
rDeltaT.internalField() = max(rDeltaT.internalField(), 1/tau);
}
@ -95,21 +95,20 @@ Info<< "Time scales min/max:" << endl;
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// - reduce as much as required for flow, but limit source contributions
const dimensionedScalar deltaTRamp("deltaTRamp", dimless, 1/(1 + 0.2));
invTau = max(invTau, invTau0*deltaTRamp);
tinvTau0.clear();
rDeltaT = max(rDeltaT, rDeltaT0*deltaTRamp);
// Limit the largest time scale
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
invTau.max(1/maxDeltaT);
rDeltaT.max(1/maxDeltaT);
// Spatially smooth the time scale field
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fvc::smooth(invTau, alphaTauSmooth);
fvc::smooth(rDeltaT, alphaTauSmooth);
Info<< " Overall = " << min(1/invTau).value()
<< ", " << max(1/invTau).value() << nl << endl;
Info<< " Overall = " << min(1/rDeltaT).value()
<< ", " << max(1/rDeltaT).value() << nl << endl;
}

View File

@ -47,10 +47,4 @@ runTimeModifiable yes;
adjustTimeStep yes;
maxCo 0.5;
maxDeltaT 1;
alphaTauTemp 0.005;
// ************************************************************************* //

View File

@ -17,7 +17,7 @@ FoamFile
ddtSchemes
{
default localEuler invTau;
default localEuler rDeltaT;
}
gradSchemes

View File

@ -83,6 +83,10 @@ PIMPLE
momentumPredictor yes;
rhoMin rhoMin [1 -3 0 0 0] 0.1;
rhoMax rhoMax [1 -3 0 0 0] 1.5;
maxCo 0.5;
maxDeltaT 1;
alphaTauTemp 0.005;
}
additional

View File

@ -45,13 +45,6 @@ timePrecision 6;
runTimeModifiable yes;
maxCo 5;
alphaTauSmooth 1;
alphaTauTemp 1;
maxDeltaT 1;
functions
{

View File

@ -17,7 +17,7 @@ FoamFile
ddtSchemes
{
default localEuler invTau;
default localEuler rDeltaT;
}
gradSchemes

View File

@ -70,6 +70,11 @@ PIMPLE
momentumPredictor yes;
rhoMin rhoMin [1 -3 0 0 0] 0.1;
rhoMax rhoMax [1 -3 0 0 0] 1.5;
maxCo 5;
alphaTauSmooth 1;
alphaTauTemp 1;
maxDeltaT 1;
}
additional