diff --git a/Cantera/src/thermo/ThermoFactory.cpp b/Cantera/src/thermo/ThermoFactory.cpp index 5cc165beb..c1e33c528 100644 --- a/Cantera/src/thermo/ThermoFactory.cpp +++ b/Cantera/src/thermo/ThermoFactory.cpp @@ -218,6 +218,26 @@ namespace Cantera { return th; } + // Translate the eosType id into a string + /* + * Returns a string representation of the eosType id for a phase. + * @param ieos eosType id of the phase. This is unique for the phase + * @param length maximum length of the return string. Defaults to 100 + * + * @return returns a string representation. + */ + std::string eosTypeString(int ieos, int length) + { + std::string ss = "UnknownPhaseType"; + // bool found = false; + for (int n = 0; n < ntypes; n++) { + if (_itypes[n] == ieos) { + ss = _types[n]; + //found = true; + } + } + return ss; + } /* diff --git a/Cantera/src/thermo/ThermoFactory.h b/Cantera/src/thermo/ThermoFactory.h index b9a034086..01ec78d12 100644 --- a/Cantera/src/thermo/ThermoFactory.h +++ b/Cantera/src/thermo/ThermoFactory.h @@ -143,6 +143,16 @@ namespace Cantera { return f->newThermoPhase(model); } + //! Translate the eosType id into a string + /*! + * Returns a string representation of the eosType id for a phase. + * @param ieos eosType id of the phase. This is unique for the phase + * @param length maximum length of the return string. Defaults to 100 + * + * @return returns a string representation. + */ + std::string eosTypeString(int ieos, int length = 100); + /*! * This routine first looks up the