From ef929fcd2a1253db9896958cfda67ae9cf1f4f4a Mon Sep 17 00:00:00 2001 From: Ian Bell Date: Sun, 28 Jun 2015 12:31:09 -0600 Subject: [PATCH] Fix cp0 for tabular backends; closes #696 --- include/AbstractState.h | 2 ++ src/Backends/Tabular/TabularBackends.h | 1 + 2 files changed, 3 insertions(+) diff --git a/include/AbstractState.h b/include/AbstractState.h index e196a9b2..3f15bcf9 100644 --- a/include/AbstractState.h +++ b/include/AbstractState.h @@ -372,6 +372,8 @@ public: */ static AbstractState * factory(const std::string &backend, const std::vector &fluid_names); + /// Set the internal variable T without a flash call (expert use only!) + void set_T(CoolPropDbl T){ _T = T; } /// Get a string representation of the backend virtual std::string backend_name(void) = 0; // The derived classes must implement this function to define whether they use mole fractions (true) or mass fractions (false) diff --git a/src/Backends/Tabular/TabularBackends.h b/src/Backends/Tabular/TabularBackends.h index 6002b2fe..1dc08b16 100644 --- a/src/Backends/Tabular/TabularBackends.h +++ b/src/Backends/Tabular/TabularBackends.h @@ -703,6 +703,7 @@ class TabularBackend : public AbstractState return _Q*yV + (1-_Q)*yL; } CoolPropDbl calc_cpmolar_idealgas(void){ + this->AS->set_T(_T); return this->AS->cp0molar(); }