Skip to content

Commit

Permalink
[SCons] Remove legacy_rate_constants option
Browse files Browse the repository at this point in the history
  • Loading branch information
ischoegl authored and bryanwweber committed May 28, 2022
1 parent d6b2c22 commit e41449e
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 36 deletions.
14 changes: 0 additions & 14 deletions SConstruct
Expand Up @@ -578,15 +578,6 @@ config_options = [
"verbose_tests",
"If enabled, verbose test output will be shown.",
False),
BoolOption(
"legacy_rate_constants",
"""If enabled, rate constant calculations include third-body concentrations
for three-body reactions, which corresponds to a legacy implementation used
prior to Cantera 3.0. The option is disabled by default, such that rate
constant calculations are consistent with conventional definitions
(see Eq. 9.75 in Kee, Coltrin and Glarborg, 'Chemically Reacting Flow',
Wiley Interscience, 2003).""",
False),
]

config = Configuration()
Expand Down Expand Up @@ -1847,11 +1838,6 @@ if env.get('has_sundials_lapack') and env['use_lapack']:
else:
configh['CT_SUNDIALS_USE_LAPACK'] = 0

if env['legacy_rate_constants']:
configh['CT_LEGACY_RATE_CONSTANTS'] = 1
else:
configh['CT_LEGACY_RATE_CONSTANTS'] = 0

cdefine('LAPACK_FTN_STRING_LEN_AT_END', 'lapack_ftn_string_len_at_end')
cdefine('LAPACK_FTN_TRAILING_UNDERSCORE', 'lapack_ftn_trailing_underscore')
cdefine('FTN_TRAILING_UNDERSCORE', 'lapack_ftn_trailing_underscore')
Expand Down
3 changes: 0 additions & 3 deletions include/cantera/base/config.h.in
Expand Up @@ -65,7 +65,4 @@ typedef int ftnlen; // Fortran hidden string length type
// built to use this option
{CT_SUNDIALS_USE_LAPACK!s}

// Use legacy rate constant by default
{CT_LEGACY_RATE_CONSTANTS!s}

#endif
2 changes: 0 additions & 2 deletions interfaces/cython/cantera/test/test_jacobian.py
Expand Up @@ -20,7 +20,6 @@ class RateExpressionTests:

@classmethod
def setUpClass(cls):
ct.use_legacy_rate_constants(False)
cls.tpx = cls.gas.TPX

cls.r_stoich = cls.gas.reactant_stoich_coeffs
Expand Down Expand Up @@ -534,7 +533,6 @@ class FullTests:

@classmethod
def setUpClass(cls):
ct.use_legacy_rate_constants(False)
cls.tpx = cls.gas.TPX

def setUp(self):
Expand Down
9 changes: 1 addition & 8 deletions interfaces/cython/cantera/test/test_kinetics.py
Expand Up @@ -59,16 +59,9 @@ def test_multiplier(self):
self.assertArrayNear(0.5 * rev_rates0, rev_rates2)

def test_legacy_reaction_rate(self):
ct.use_legacy_rate_constants(True) # set to False for test suite
with self.assertRaisesRegex(ct.CanteraError, "Deprecated: Behavior to change"):
self.phase.forward_rate_constants

ct.suppress_deprecation_warnings() # disable fatal deprecation warnings
ct.use_legacy_rate_constants(True)
fwd_rates_legacy = self.phase.forward_rate_constants

ct.use_legacy_rate_constants(False)
ct.make_deprecation_warnings_fatal() # re-enable fatal deprecation warnings

fwd_rates = self.phase.forward_rate_constants
ix_3b = np.array([r.reaction_type == "three-body" for r in self.phase.reactions()])
ix_other = ix_3b == False
Expand Down
1 change: 0 additions & 1 deletion interfaces/cython/cantera/test/utilities.py
Expand Up @@ -67,7 +67,6 @@ def setUpClass(cls):
cls.using_tempfile = True

cantera.make_deprecation_warnings_fatal()
cantera.use_legacy_rate_constants(False)
cantera.add_directory(cls.test_work_path)
cls.test_data_path = TEST_DATA_PATH
cls.cantera_data_path = CANTERA_DATA_PATH
Expand Down
4 changes: 0 additions & 4 deletions src/base/application.cpp
Expand Up @@ -129,11 +129,7 @@ Application::Application() :
m_suppress_thermo_warnings(false),
m_suppress_warnings(false),
m_fatal_warnings(false),
#if CT_LEGACY_RATE_CONSTANTS
m_use_legacy_rate_constants(true)
#else
m_use_legacy_rate_constants(false)
#endif
{
// install a default logwriter that writes to standard
// output / standard error
Expand Down
2 changes: 0 additions & 2 deletions src/base/application.h
Expand Up @@ -366,8 +366,6 @@ class Application
* and Glarborg, 'Chemically Reacting Flow', Wiley Interscience, 2003). If set to
* 'true', output for rate constants of three-body reactions is multiplied by
* third-body concentrations (legacy behavior prior to Cantera 3.0).
* For user-compiled Cantera, the default behavior can be changed by the SCons flag
* 'legacy_rate_constants'.
*/
void use_legacy_rate_constants(bool legacy=true) {
m_use_legacy_rate_constants = legacy;
Expand Down
1 change: 0 additions & 1 deletion test/general/string_processing.cpp
Expand Up @@ -118,7 +118,6 @@ int main(int argc, char** argv)
printf("Running main() from string_processing.cpp\n");
testing::InitGoogleTest(&argc, argv);
Cantera::make_deprecation_warnings_fatal();
Cantera::use_legacy_rate_constants(false);
int result = RUN_ALL_TESTS();
Cantera::appdelete();
return result;
Expand Down
1 change: 0 additions & 1 deletion test/kinetics/pdep.cpp
Expand Up @@ -226,7 +226,6 @@ int main(int argc, char** argv)
{
printf("Running main() from pdep.cpp\n");
Cantera::make_deprecation_warnings_fatal();
Cantera::use_legacy_rate_constants(false);
testing::InitGoogleTest(&argc, argv);
int result = RUN_ALL_TESTS();
Cantera::appdelete();
Expand Down

0 comments on commit e41449e

Please sign in to comment.