diff --git a/src/kinetics/FalloffFactory.cpp b/src/kinetics/FalloffFactory.cpp index e2be6510d..e02d304bd 100644 --- a/src/kinetics/FalloffFactory.cpp +++ b/src/kinetics/FalloffFactory.cpp @@ -5,6 +5,7 @@ #include "cantera/kinetics/FalloffFactory.h" #include "cantera/base/ctexceptions.h" +#include "cantera/base/stringUtils.h" #include @@ -350,6 +351,10 @@ public: * a, b, and c of the SRI parameterization */ virtual void init(const vector_fp& c) { + if (c[2] < 0.0) { + throw CanteraError("SRI3::init()", + "m_c parameter is less than zero: " + fp2str(c[2])); + } m_a = c[0]; m_b = c[1]; m_c = c[2]; @@ -459,6 +464,14 @@ public: * a, b, c, d, and e of the SRI parameterization */ virtual void init(const vector_fp& c) { + if (c[2] < 0.0) { + throw CanteraError("SRI5::init()", + "m_c parameter is less than zero: " + fp2str(c[2])); + } + if (c[3] < 0.0) { + throw CanteraError("SRI5::init()", + "m_d parameter is less than zero: " + fp2str(c[3])); + } m_a = c[0]; m_b = c[1]; m_c = c[2]; diff --git a/src/kinetics/importKinetics.cpp b/src/kinetics/importKinetics.cpp index 6cb8c3c38..5d23eb8ce 100644 --- a/src/kinetics/importKinetics.cpp +++ b/src/kinetics/importKinetics.cpp @@ -431,23 +431,8 @@ static void getFalloff(const XML_Node& f, ReactionData& rdata) if (type == "Troe") { if (np == 4) { rdata.falloffType = TROE4_FALLOFF; - if (c[1] < 0.0) { - throw CanteraError("getFalloff()", "Troe4 T3 parameter is less than zero: " + fp2str(c[1])); - } - if (c[2] < 0.0) { - throw CanteraError("getFalloff()", "Troe4 T1 parameter is less than zero: " + fp2str(c[2])); - } - if (c[3] < 0.0) { - throw CanteraError("getFalloff()", "Troe4 T2 parameter is less than zero: " + fp2str(c[3])); - } } else if (np == 3) { rdata.falloffType = TROE3_FALLOFF; - if (c[1] < 0.0) { - throw CanteraError("getFalloff()", "Troe3 T3 parameter is less than zero: " + fp2str(c[1])); - } - if (c[2] < 0.0) { - throw CanteraError("getFalloff()", "Troe3 T1 parameter is less than zero: " + fp2str(c[2])); - } } else { throw CanteraError("getFalloff()", "Troe parameterization is specified by number of pararameters, " + int2str(np) + ", is not equal to 3 or 4");