[Equil] Add vcs_VolPhase::eos_name; deprecate string16_EOSType
This commit is contained in:
parent
5bf57795fc
commit
eda9fc8f23
4 changed files with 32 additions and 6 deletions
|
|
@ -492,6 +492,9 @@ public:
|
|||
//! Return the number of species in the phase
|
||||
size_t nSpecies() const;
|
||||
|
||||
//! Return the name corresponding to the equation of state
|
||||
std::string eos_name() const;
|
||||
|
||||
private:
|
||||
//! Evaluate the activity coefficients at the current conditions
|
||||
/*!
|
||||
|
|
@ -846,6 +849,7 @@ private:
|
|||
/*!
|
||||
* @param EOSType : integer value of the equation of state
|
||||
* @return a string representing the EOS. The string is no more than 16 characters.
|
||||
* @deprecated Use vcs_VolPhase::eos_name instead. To be removed after Cantera 2.3.
|
||||
*/
|
||||
std::string string16_EOSType(int EOSType);
|
||||
|
||||
|
|
|
|||
|
|
@ -970,10 +970,9 @@ int vcs_Cantera_to_vprob(MultiPhase* mphase, VCS_PROB* vprob)
|
|||
|
||||
for (size_t iphase = 0; iphase < vprob->NPhase; iphase++) {
|
||||
vcs_VolPhase* VolPhase = vprob->VPhaseList[iphase];
|
||||
std::string sEOS = string16_EOSType(VolPhase->m_eqnState);
|
||||
plogf("%16s %5d %5d %8d %16s %8d %16e ", VolPhase->PhaseName.c_str(),
|
||||
VolPhase->VP_ID_, VolPhase->m_singleSpecies,
|
||||
VolPhase->m_gasPhase, sEOS.c_str(),
|
||||
VolPhase->m_gasPhase, VolPhase->eos_name(),
|
||||
VolPhase->nSpecies(), VolPhase->totalMolesInert());
|
||||
plogf("%16e\n", VolPhase->totalMoles());
|
||||
}
|
||||
|
|
@ -1079,10 +1078,9 @@ int vcs_Cantera_update_vprob(MultiPhase* mphase, VCS_PROB* vprob)
|
|||
|
||||
for (size_t iphase = 0; iphase < vprob->NPhase; iphase++) {
|
||||
vcs_VolPhase* VolPhase = vprob->VPhaseList[iphase];
|
||||
std::string sEOS = string16_EOSType(VolPhase->m_eqnState);
|
||||
plogf("%16s %5d %5d %8d %16s %8d %16e ", VolPhase->PhaseName.c_str(),
|
||||
VolPhase->VP_ID_, VolPhase->m_singleSpecies,
|
||||
VolPhase->m_gasPhase, sEOS.c_str(),
|
||||
VolPhase->m_gasPhase, VolPhase->eos_name(),
|
||||
VolPhase->nSpecies(), VolPhase->totalMolesInert());
|
||||
plogf("%16e\n", VolPhase->totalMoles());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -819,6 +819,8 @@ void vcs_VolPhase::setMolesCurrent(int stateCalc)
|
|||
|
||||
std::string string16_EOSType(int EOSType)
|
||||
{
|
||||
warn_deprecated("string16_EOSType", "Use vcs_VolPhase::eos_name instead."
|
||||
" To be removed after Cantera 2.3.");
|
||||
char st[32];
|
||||
st[16] = '\0';
|
||||
switch (EOSType) {
|
||||
|
|
@ -1127,4 +1129,27 @@ size_t vcs_VolPhase::nSpecies() const
|
|||
return m_numSpecies;
|
||||
}
|
||||
|
||||
std::string vcs_VolPhase::eos_name() const
|
||||
{
|
||||
switch (m_eqnState) {
|
||||
case VCS_EOS_CONSTANT:
|
||||
return "Constant";
|
||||
case VCS_EOS_IDEAL_GAS:
|
||||
return "Ideal Gas";
|
||||
case VCS_EOS_STOICH_SUB:
|
||||
return "Stoich Sub";
|
||||
case VCS_EOS_IDEAL_SOLN:
|
||||
return "Ideal Soln";
|
||||
case VCS_EOS_DEBEYE_HUCKEL:
|
||||
return "Debeye Huckel";
|
||||
case VCS_EOS_REDLICK_KWONG:
|
||||
return "Redlick_Kwong";
|
||||
case VCS_EOS_REGULAR_SOLN:
|
||||
return "Regular Soln";
|
||||
default:
|
||||
return fmt::format("UnkType: {:7d}", m_eqnState);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -212,10 +212,9 @@ void VCS_PROB::prob_report(int print_lvl)
|
|||
|
||||
for (size_t iphase = 0; iphase < NPhase; iphase++) {
|
||||
vcs_VolPhase* Vphase = VPhaseList[iphase];
|
||||
std::string EOS_cstr = string16_EOSType(Vphase->m_eqnState);
|
||||
plogf("%16s %5d %5d %8d ", Vphase->PhaseName,
|
||||
Vphase->VP_ID_, Vphase->m_singleSpecies, Vphase->m_gasPhase);
|
||||
plogf("%16s %8d %16e ", EOS_cstr,
|
||||
plogf("%16s %8d %16e ", Vphase->eos_name(),
|
||||
Vphase->nSpecies(), Vphase->totalMolesInert());
|
||||
if (iest >= 0) {
|
||||
plogf("%16e\n", Vphase->totalMoles());
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue