From d7734e3f1922cc980847dae37069e394ec2fb8f9 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Thu, 10 Jan 2019 22:56:19 -0500 Subject: [PATCH] [Input] Allow "=" as a delimiter for reversible reactions in YAML --- src/kinetics/Reaction.cpp | 4 ++-- test/kinetics/kineticsFromYaml.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/kinetics/Reaction.cpp b/src/kinetics/Reaction.cpp index 3898d5f4d..e3540933e 100644 --- a/src/kinetics/Reaction.cpp +++ b/src/kinetics/Reaction.cpp @@ -446,7 +446,7 @@ void setupReaction(Reaction& R, const AnyMap& node) bool reactants = true; for (size_t i = 1; i < tokens.size(); i++) { if (tokens[i] == "+" || ba::starts_with(tokens[i], "(+") || - tokens[i] == "<=>" || tokens[i] == "=>") { + tokens[i] == "<=>" || tokens[i] == "=" || tokens[i] == "=>") { std::string species = tokens[i-1]; double stoich; @@ -480,7 +480,7 @@ void setupReaction(Reaction& R, const AnyMap& node) } // Tokens after this point are part of the products string - if (tokens[i] == "<=>") { + if (tokens[i] == "<=>" || tokens[i] == "=") { R.reversible = true; reactants = false; } else if (tokens[i] == "=>") { diff --git a/test/kinetics/kineticsFromYaml.cpp b/test/kinetics/kineticsFromYaml.cpp index f0b15f96a..21c970320 100644 --- a/test/kinetics/kineticsFromYaml.cpp +++ b/test/kinetics/kineticsFromYaml.cpp @@ -32,7 +32,7 @@ TEST(Reaction, ThreeBodyFromYaml1) { IdealGasMix gas("gri30.xml"); AnyMap rxn = AnyMap::fromYamlString( - "{equation: 2 O + M <=> O2 + M," + "{equation: 2 O + M = O2 + M," " type: three-body," " rate-constant: [1.20000E+17 cm^6/mol^2/s, -1, 0]," " efficiencies: {AR: 0.83, H2O: 5}}"); @@ -61,7 +61,7 @@ TEST(Reaction, FalloffFromYaml1) { IdealGasMix gas("gri30.xml"); AnyMap rxn = AnyMap::fromYamlString( - "{equation: N2O (+M) <=> N2 + O (+ M)," + "{equation: N2O (+M) = N2 + O (+ M)," " type: falloff," " high-P-rate-constant: [7.91000E+10, 0, 56020]," " low-P-rate-constant: [6.37000E+14, 0, 56640],"