[Thermo] Check to make sure parameterizations are of the correct type
This commit is contained in:
parent
1cb688150e
commit
473827a8a6
3 changed files with 18 additions and 1 deletions
|
|
@ -133,7 +133,12 @@ public:
|
|||
*/
|
||||
virtual void install(const std::string& name, size_t index, int type, const doublereal* c,
|
||||
doublereal minTemp_, doublereal maxTemp_, doublereal refPressure_) {
|
||||
|
||||
if (type != SIMPLE) {
|
||||
throw CanteraError("SimpleThermo::install",
|
||||
"Incompatible thermo parameterization: Got " +
|
||||
int2str(type) + " but " + int2str(SIMPLE) +
|
||||
" was expected.");
|
||||
}
|
||||
m_logt0.push_back(log(c[0]));
|
||||
m_t0.push_back(c[0]);
|
||||
m_h0_R.push_back(c[1]/GasConstant);
|
||||
|
|
|
|||
|
|
@ -59,6 +59,12 @@ void NasaThermo::install(const std::string& name, size_t index, int type,
|
|||
doublereal min_temp, doublereal max_temp,
|
||||
doublereal ref_pressure)
|
||||
{
|
||||
if (type != NASA) {
|
||||
throw CanteraError("NasaThermo::install",
|
||||
"Incompatible thermo parameterization: Got " +
|
||||
int2str(type) + " but " + int2str(NASA) +
|
||||
" was expected.");
|
||||
}
|
||||
m_name[index] = name;
|
||||
int imid = int(c[0]); // midpoint temp converted to integer
|
||||
int igrp = m_index[imid]; // has this value been seen before?
|
||||
|
|
|
|||
|
|
@ -148,6 +148,12 @@ public:
|
|||
const doublereal* c,
|
||||
doublereal minTemp, doublereal maxTemp,
|
||||
doublereal refPressure) {
|
||||
if (type != SHOMATE) {
|
||||
throw CanteraError("ShomateThermo::install",
|
||||
"Incompatible thermo parameterization: Got " +
|
||||
int2str(type) + " but " + int2str(SHOMATE) +
|
||||
" was expected.");
|
||||
}
|
||||
int imid = int(c[0]); // midpoint temp converted to integer
|
||||
int igrp = m_index[imid]; // has this value been seen before?
|
||||
if (igrp == 0) { // if not, prepare new group
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue