Fix stack overflow (and bug) with TTSE and mass-based units; closes #843

This commit is contained in:
Ian Bell
2015-10-23 11:27:53 +02:00
parent 0b5d988cc1
commit 64ed6d659a

View File

@@ -136,7 +136,7 @@ void CoolProp::TTSEBackend::update(CoolProp::input_pairs input_pair, double val1
}
case DmassP_INPUTS:{
// Call again, but this time with molar units; D: [kg/m^3] / [kg/mol] -> [mol/m^3]
update(DmassP_INPUTS, val1 / AS->molar_mass(), val2); return;
update(DmolarP_INPUTS, val1 / AS->molar_mass(), val2); return;
}
case PUmass_INPUTS:{
// Call again, but this time with molar units; U: [J/kg] * [kg/mol] -> [J/mol]
@@ -174,11 +174,11 @@ void CoolProp::TTSEBackend::update(CoolProp::input_pairs input_pair, double val1
}
case DmassT_INPUTS:{
// Call again, but this time with molar units; D: [kg/m^3] / [kg/mol] -> [mol/m^3]
update(DmassP_INPUTS, val1 / AS->molar_mass(), val2); return;
update(DmolarT_INPUTS, val1 / AS->molar_mass(), val2); return;
}
case SmassT_INPUTS:{
// Call again, but this time with molar units; S: [J/kg/K] * [kg/mol] -> [J/mol/K]
update(PSmolar_INPUTS, val1*AS->molar_mass(),val2); return;
update(SmolarT_INPUTS, val1*AS->molar_mass(), val2); return;
}
case SmolarT_INPUTS:
case DmolarT_INPUTS:{