thermophysicalModels: Implementation of the full algebraic Jacobian

including third-body and pressure dependent derivatives, and derivative of the
temperature term.  The complete Jacobian is more robust than the incomplete and
partially approximate form used previously and improves the efficiency of the
stiff ODE solvers which rely on the Jacobian.

Reaction rate evaluation moved from the chemistryModel to specie library to
simplfy support for alternative reaction rate expressions and associated
Jacobian terms.

Temperature clipping included in the Reaction class. This is inactive by default
but for most cases it is advised to provide temperature limits (high and
low). These are provided in the foamChemistryFile with the keywords Thigh and
Tlow. When using chemkinToFoam these values are set to the limits of the Janaf
thermodynamic data.  With the new Jacobian this temperature clipping has proved
very beneficial for stability and for some cases essential.

Improvement of the TDAC MRU list better integrated in add and grow functions.

To get the most out of this significant development it is important to re-tune
the ODE integration tolerances, in particular the absTol in the odeCoeffs
sub-dictionary of the chemistryProperties dictionary:

odeCoeffs
{
    solver          seulex;
    absTol          1e-12;
    relTol          0.01;
}

Typically absTol can now be set to 1e-8 and relTol to 0.1 except for ignition
time problems, and with theses settings the integration is still robust but for
many cases a lot faster than previously.

Code development and integration undertaken by
Francesco Contino
Henry G. Weller, CFD Direct
This commit is contained in:
Henry Weller
2018-06-15 12:26:59 +01:00
parent aad024163d
commit 4dc35c6810
84 changed files with 3380 additions and 906 deletions

View File

@ -33,7 +33,7 @@ EulerImplicitCoeffs
odeCoeffs
{
solver seulex;
absTol 1e-14;
absTol 1e-12;
relTol 1e-1;
}

View File

@ -28,7 +28,7 @@ initialChemicalTimeStep 1e-07;
odeCoeffs
{
solver seulex;
absTol 1e-12;
absTol 1e-8;
relTol 0.01;
}

View File

@ -35,9 +35,9 @@ initialChemicalTimeStep 1e-07;
odeCoeffs
{
solver Rosenbrock34; // Rosenbrock34, seulex or rodas23
absTol 1e-12;
relTol 1e-7;
solver seulex;
absTol 1e-08;
relTol 0.1;
}
reduction
@ -86,7 +86,7 @@ tabulation
printNumRetrieve off;
// Tolerance used for retrieve and grow
tolerance 1e-4;
tolerance 0.003;
// ISAT is the only method currently available
method ISAT;
@ -97,24 +97,24 @@ tabulation
otherSpecies 1;
Temperature 1000;
Pressure 1e15;
deltaT 0.5;
deltaT 1;
}
// Maximum number of leafs stored in the binary tree
maxNLeafs 2000;
maxNLeafs 5000;
// Maximum life time of the leafs (in time steps) used in unsteady
// simulations to force renewal of the stored chemPoints and keep the tree
// small
chPMaxLifeTime 100;
chPMaxLifeTime 1000;
// Maximum number of growth allowed on a chemPoint to avoid distorted
// chemPoints
maxGrowth 10;
maxGrowth 100;
// Number of time steps between analysis of the tree to remove old
// chemPoints or try to balance it
checkEntireTreeInterval 5;
checkEntireTreeInterval 500;
// Parameters used to decide whether to balance or not if the tree's depth
// is larger than maxDepthFactor*log2(nLeafs) then balance the tree
@ -123,7 +123,6 @@ tabulation
// Try to balance the tree only if the size of the tree is greater
minBalanceThreshold 30;
// Activate the use of a MRU (most recently used) list
MRURetrieve false;

View File

@ -1,142 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object chemistryProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
chemistryType
{
solver ode;
method TDAC;
}
chemistry on;
importantSpecies
{
CH4;
H2O;
O2;
CO2;
}
initialChemicalTimeStep 1e-07;
odeCoeffs
{
solver Rosenbrock34; // Rosenbrock34, seulex or rodas23
absTol 1e-12;
relTol 1e-7;
}
reduction
{
// Activate reduction
active on;
// Switch logging of the reduction statistics and performance
log on;
// Tolerance depends on the reduction method, see details for each method
tolerance 1e-4;
// Available methods: DRG, DAC, DRGEP, PFA, EFA
method DAC;
// Search initiating set (SIS) of species, needed for most methods
initialSet
{
CO;
CH4;
HO2;
}
// For DAC, option to automatically change the SIS switch from HO2 to H2O
// and CO to CO2, + disable fuel
automaticSIS off;
// When automaticSIS, the method needs to know the fuel
fuelSpecies
{
CH4 1;
}
}
tabulation
{
// Activate tabulation
active on;
// Switch logging of the tabulation statistics and performance
log on;
printProportion off;
printNumRetrieve off;
// Tolerance used for retrieve and grow
tolerance 0.003;
// ISAT is the only method currently available
method ISAT;
// Scale factors used in the definition of the ellipsoid of accuracy
scaleFactor
{
otherSpecies 1;
Temperature 10000;
Pressure 1e15;
deltaT 1;
}
// Maximum number of leafs stored in the binary tree
maxNLeafs 5000;
// Maximum life time of the leafs (in time steps) used in unsteady
// simulations to force renewal of the stored chemPoints and keep the tree
// small
chPMaxLifeTime 1000;
// Maximum number of growth allowed on a chemPoint to avoid distorted
// chemPoints
maxGrowth 100;
// Number of time steps between analysis of the tree to remove old
// chemPoints or try to balance it
checkEntireTreeInterval 500;
// Parameters used to decide whether to balance or not if the tree's depth
// is larger than maxDepthFactor*log2(nLeafs) then balance the tree
maxDepthFactor 2;
// Try to balance the tree only if the size of the tree is greater
minBalanceThreshold 30;
// Activate the use of a MRU (most recently used) list
MRURetrieve false;
// Maximum size of the MRU list
maxMRUSize 0;
// Allow to grow points
growPoints true;
// When mechanism reduction is used, new dimensions might be added
// maxNumNewDim set the maximum number of new dimensions added during a
// growth
maxNumNewDim 10;
}
// ************************************************************************* //

View File

@ -3608,3 +3608,6 @@ reactions
Ta 0;
}
}
Tlow 250;
Thigh 5000;

View File

@ -14,16 +14,16 @@ runApplication chemkinToFoam \
runApplication blockMesh
runApplication setFields
# Run the application without chemistry until 1500 to let the flow field develop
foamDictionary -entry "startTime" -set "0" system/controlDict
foamDictionary -entry "writeInterval" -set "1500" system/controlDict
foamDictionary -entry "endTime" -set "1500" system/controlDict
foamDictionary -entry "chemistry" -set "off" constant/chemistryProperties
runApplication $application
# Run with chemistry until flame reach its full size
foamDictionary -entry "startTime" -set "1500" system/controlDict
foamDictionary -entry "writeInterval" -set "100" system/controlDict
foamDictionary -entry "endTime" -set "5000" system/controlDict
foamDictionary -entry "chemistry" -set "on" constant/chemistryProperties

View File

@ -20,7 +20,7 @@ chemistryType
method TDAC;
}
chemistry off;
chemistry on;
importantSpecies
{
@ -35,8 +35,8 @@ initialChemicalTimeStep 1e-07;
odeCoeffs
{
solver seulex;
absTol 1e-12;
relTol 1e-07;
absTol 1e-08;
relTol 0.1;
}
reduction

View File

@ -3608,3 +3608,6 @@ reactions
Ta 0;
}
}
Tlow 250;
Thigh 5000;

View File

@ -16,19 +16,19 @@ FoamFile
application reactingFoam;
startFrom latestTime;
startFrom startTime;
startTime 0;
startTime 1500;
stopAt endTime;
endTime 1500;
endTime 5000;
deltaT 1;
writeControl runTime;
writeInterval 1500;
writeInterval 100;
purgeWrite 0;

View File

@ -33,7 +33,7 @@ EulerImplicitCoeffs
odeCoeffs
{
solver Rosenbrock43;
absTol 1e-12;
absTol 1e-8;
relTol 0.01;
}

View File

@ -33,7 +33,7 @@ EulerImplicitCoeffs
odeCoeffs
{
solver Rosenbrock43;
absTol 1e-12;
absTol 1e-8;
relTol 0.01;
}

View File

@ -24,11 +24,12 @@ chemistryType
chemistry on;
initialChemicalTimeStep 1e-7;
//maxChemicalTimeStep 1E-3;
odeCoeffs
{
solver seulex;
absTol 1e-12;
absTol 1e-8;
relTol 1e-1;
}
@ -78,7 +79,7 @@ tabulation
printNumRetrieve off;
// Tolerance used for retrieve and grow
tolerance 1e-3;
tolerance 3e-3;
// ISAT is the only method currently available
method ISAT;
@ -87,7 +88,7 @@ tabulation
scaleFactor
{
otherSpecies 1;
Temperature 25000;
Temperature 10000;
Pressure 1e15;
deltaT 1;
}

View File

@ -5588,3 +5588,6 @@ reactions
}
}
}
Thigh 5000;
Tlow 200;

View File

@ -23,7 +23,7 @@ startTime 0;
stopAt endTime;
endTime 1000;
endTime 1500;
deltaT 1;

View File

@ -7,29 +7,28 @@
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object chemistryProperties;
version 2;
format ascii;
class dictionary;
location "constant";
object chemistryProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
chemistryType
{
solver ode;
solver ode;
}
chemistry on;
initialChemicalTimeStep 1e-7;
maxChemicalTimeStep 1e-4;
initialChemicalTimeStep 1e-07;
odeCoeffs
{
solver seulex;
absTol 1e-12;
relTol 1e-1;
absTol 1e-8;
relTol 0.1;
}
// ************************************************************************* //

View File

@ -2349,7 +2349,7 @@ reactions
A 1.2e+11;
beta -1;
Ta 0;
coeffs
coeffs
53
(
(CH4 2)
@ -2415,7 +2415,7 @@ reactions
A 5e+11;
beta -1;
Ta 0;
coeffs
coeffs
53
(
(CH4 2)
@ -2481,7 +2481,7 @@ reactions
A 2.8e+12;
beta -0.86;
Ta 0;
coeffs
coeffs
53
(
(CH4 1)
@ -2547,7 +2547,7 @@ reactions
A 1e+12;
beta -1;
Ta 0;
coeffs
coeffs
53
(
(CH4 2)
@ -2613,7 +2613,7 @@ reactions
A 2.2e+16;
beta -2;
Ta 0;
coeffs
coeffs
53
(
(CH4 2)
@ -2679,7 +2679,7 @@ reactions
A 1.87e+14;
beta -1;
Ta 8554.25;
coeffs
coeffs
53
(
(CH4 2)
@ -2745,7 +2745,7 @@ reactions
A 1.06e+14;
beta -1.41;
Ta 0;
coeffs
coeffs
53
(
(CH4 2)
@ -2811,7 +2811,7 @@ reactions
A 1.3e+11;
beta -0.11;
Ta 2505.89;
coeffs
coeffs
53
(
(CH4 2)
@ -2877,7 +2877,7 @@ reactions
A 4.48e+13;
beta -1.32;
Ta 372.362;
coeffs
coeffs
53
(
(CH4 2)
@ -2943,7 +2943,7 @@ reactions
A 3.1e+11;
beta 0;
Ta 27197.5;
coeffs
coeffs
53
(
(CH4 2)
@ -3009,7 +3009,7 @@ reactions
A 1.04e+26;
beta -3.3;
Ta 63704;
coeffs
coeffs
53
(
(CH4 2)
@ -3075,7 +3075,7 @@ reactions
A 1.18e+13;
beta 0;
Ta 42630.4;
coeffs
coeffs
53
(
(CH4 2)
@ -3155,7 +3155,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -3240,7 +3240,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -3325,7 +3325,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 3)
@ -3410,7 +3410,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -3495,7 +3495,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -3580,7 +3580,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -3665,7 +3665,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -3750,7 +3750,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -3835,7 +3835,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -3920,7 +3920,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -4005,7 +4005,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -4090,7 +4090,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -4175,7 +4175,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -4260,7 +4260,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -4345,7 +4345,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -4430,7 +4430,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -4515,7 +4515,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -4600,7 +4600,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -4685,7 +4685,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -4770,7 +4770,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -4851,7 +4851,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -4932,7 +4932,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -5017,7 +5017,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -5102,7 +5102,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -5187,7 +5187,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -5272,7 +5272,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -5357,7 +5357,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -5442,7 +5442,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -5527,7 +5527,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -5588,3 +5588,6 @@ reactions
}
}
}
Thigh 5000;
Tlow 200;

View File

@ -24,12 +24,12 @@ chemistryType
chemistry on;
initialChemicalTimeStep 1e-7;
maxChemicalTimeStep 1e-4;
//maxChemicalTimeStep 1E-3;
odeCoeffs
{
solver seulex;
absTol 1e-12;
absTol 1e-8;
relTol 1e-1;
}
@ -79,7 +79,7 @@ tabulation
printNumRetrieve off;
// Tolerance used for retrieve and grow
tolerance 1e-4;
tolerance 3e-3;
// ISAT is the only method currently available
method ISAT;
@ -88,7 +88,7 @@ tabulation
scaleFactor
{
otherSpecies 1;
Temperature 2500;
Temperature 10000;
Pressure 1e15;
deltaT 1;
}

View File

@ -28,7 +28,7 @@ initialChemicalTimeStep 1e-7;
odeCoeffs
{
solver seulex;
absTol 1e-12;
absTol 1e-8;
relTol 1e-1;
}

View File

@ -2349,7 +2349,7 @@ reactions
A 1.2e+11;
beta -1;
Ta 0;
coeffs
coeffs
53
(
(CH4 2)
@ -2415,7 +2415,7 @@ reactions
A 5e+11;
beta -1;
Ta 0;
coeffs
coeffs
53
(
(CH4 2)
@ -2481,7 +2481,7 @@ reactions
A 2.8e+12;
beta -0.86;
Ta 0;
coeffs
coeffs
53
(
(CH4 1)
@ -2547,7 +2547,7 @@ reactions
A 1e+12;
beta -1;
Ta 0;
coeffs
coeffs
53
(
(CH4 2)
@ -2613,7 +2613,7 @@ reactions
A 2.2e+16;
beta -2;
Ta 0;
coeffs
coeffs
53
(
(CH4 2)
@ -2679,7 +2679,7 @@ reactions
A 1.87e+14;
beta -1;
Ta 8554.25;
coeffs
coeffs
53
(
(CH4 2)
@ -2745,7 +2745,7 @@ reactions
A 1.06e+14;
beta -1.41;
Ta 0;
coeffs
coeffs
53
(
(CH4 2)
@ -2811,7 +2811,7 @@ reactions
A 1.3e+11;
beta -0.11;
Ta 2505.89;
coeffs
coeffs
53
(
(CH4 2)
@ -2877,7 +2877,7 @@ reactions
A 4.48e+13;
beta -1.32;
Ta 372.362;
coeffs
coeffs
53
(
(CH4 2)
@ -2943,7 +2943,7 @@ reactions
A 3.1e+11;
beta 0;
Ta 27197.5;
coeffs
coeffs
53
(
(CH4 2)
@ -3009,7 +3009,7 @@ reactions
A 1.04e+26;
beta -3.3;
Ta 63704;
coeffs
coeffs
53
(
(CH4 2)
@ -3075,7 +3075,7 @@ reactions
A 1.18e+13;
beta 0;
Ta 42630.4;
coeffs
coeffs
53
(
(CH4 2)
@ -3155,7 +3155,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -3240,7 +3240,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -3325,7 +3325,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 3)
@ -3410,7 +3410,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -3495,7 +3495,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -3580,7 +3580,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -3665,7 +3665,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -3750,7 +3750,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -3835,7 +3835,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -3920,7 +3920,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -4005,7 +4005,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -4090,7 +4090,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -4175,7 +4175,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -4260,7 +4260,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -4345,7 +4345,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -4430,7 +4430,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -4515,7 +4515,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -4600,7 +4600,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -4685,7 +4685,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -4770,7 +4770,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -4851,7 +4851,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -4932,7 +4932,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -5017,7 +5017,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -5102,7 +5102,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -5187,7 +5187,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -5272,7 +5272,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -5357,7 +5357,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -5442,7 +5442,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -5527,7 +5527,7 @@ reactions
}
thirdBodyEfficiencies
{
coeffs
coeffs
53
(
(CH4 2)
@ -5588,3 +5588,6 @@ reactions
}
}
}
Thigh 5000;
Tlow 200;

View File

@ -33,7 +33,7 @@ EulerImplicitCoeffs
odeCoeffs
{
solver Rosenbrock43;
absTol 1e-12;
absTol 1e-8;
relTol 0.01;
}

View File

@ -33,7 +33,7 @@ EulerImplicitCoeffs
odeCoeffs
{
solver Rosenbrock43;
absTol 1e-12;
absTol 1e-8;
relTol 0.01;
}