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

View File

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

View File

@ -24,47 +24,16 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
// Maximum flow Courant number // Maximum flow Courant number
scalar maxCo(readScalar(runTime.controlDict().lookup("maxCo"))); scalar maxCo(readScalar(pimple.dict().lookup("maxCo")));
// Maximum time scale // 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 // Smoothing parameter (0-1) when smoothing iterations > 0
scalar alphaTauSmooth scalar alphaTauSmooth(pimple.dict().lookupOrDefault("alphaTauSmooth", 0.1));
(
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)
);
// Maximum change in cell temperature per iteration (relative to previous value) // Maximum change in cell temperature per iteration (relative to previous value)
scalar alphaTauTemp scalar alphaTauTemp(pimple.dict().lookupOrDefault("alphaTauTemp", 0.05));
(
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)
);
// ************************************************************************* // // ************************************************************************* //

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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