From 4f83438ec7b288ec8eb6659710133a0b144d281a Mon Sep 17 00:00:00 2001 From: dmiron Date: Sun, 11 Aug 2019 19:27:43 +0200 Subject: [PATCH] fixed bug for species wthout T interval given for cp_ft method --- ThermoFun/Substances/EmpiricalCpIntegration.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/ThermoFun/Substances/EmpiricalCpIntegration.cpp b/ThermoFun/Substances/EmpiricalCpIntegration.cpp index 405f6c57..ad1d01c1 100644 --- a/ThermoFun/Substances/EmpiricalCpIntegration.cpp +++ b/ThermoFun/Substances/EmpiricalCpIntegration.cpp @@ -44,13 +44,17 @@ auto thermoPropertiesEmpCpIntegration(Reaktoro_::Temperature TK, Reaktoro_::Pres // } // get Cp interval -> this has to go!!!! - for (unsigned i=0; i TK)) - { - k = i; - break; - } + if (thermo_parameters.temperature_intervals[i].size() > 0) { + if ((thermo_parameters.temperature_intervals[i][0] <= TK) && (thermo_parameters.temperature_intervals[i][1] > TK)) + { + k = i; + break; + } } + else { + k = 0; + } } if (k<0)