Skip to content

Commit

Permalink
Fix reducing state access for REFPROP; closes #487
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
  • Loading branch information
ibell committed Feb 23, 2015
1 parent 7361d71 commit aff594b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions include/AbstractState.h
Expand Up @@ -239,14 +239,14 @@ class AbstractState {
virtual long double calc_T_reducing(void){throw NotImplementedError("calc_T_reducing is not implemented for this backend");};
/// Using this backend, get the critical point pressure in Pa
virtual long double calc_p_critical(void){throw NotImplementedError("calc_p_critical is not implemented for this backend");};
/// Using this backend, get the reducing point pressure in Pa
virtual long double calc_p_reducing(void){throw NotImplementedError("calc_p_reducing is not implemented for this backend");};
/// Using this backend, get the critical point molar density in mol/m^3
virtual long double calc_rhomolar_critical(void){throw NotImplementedError("calc_rhomolar_critical is not implemented for this backend");};
/// Using this backend, get the reducing point molar density in mol/m^3
virtual long double calc_rhomolar_reducing(void){throw NotImplementedError("calc_rhomolar_reducing is not implemented for this backend");};

/// Using this backend, construct the phase envelope, the variable type describes the type of phase envelope to be built.
virtual void calc_phase_envelope(const std::string &type){throw NotImplementedError("calc_phase_envelope is not implemented for this backend");};

///
virtual long double calc_rhomass(void){return _rhomolar*molar_mass();}
virtual long double calc_hmass(void){return hmolar()/molar_mass();}
Expand Down Expand Up @@ -274,7 +274,7 @@ class AbstractState {
/// Using this backend, unspecify the phase
virtual void calc_unspecify_phase(void){throw NotImplementedError("This backend does not implement calc_unspecify_phase function");};
/// Using this backend get a vector of fluid names
virtual std::vector<std::string> calc_fluid_names(void){throw NotImplementedError("This backend does not implement fluid_names function");};
virtual std::vector<std::string> calc_fluid_names(void){throw NotImplementedError("This backend does not implement calc_fluid_names function");};
/// Using this backend, calculate a phase given by the state string
/// @param state A string that describes the state desired, one of "hs_anchor", "critical"/"crit", "reducing"
virtual const CoolProp::SimpleState & calc_state(const std::string &state){throw NotImplementedError("calc_state is not implemented for this backend");};
Expand Down
6 changes: 3 additions & 3 deletions src/AbstractState.cpp
Expand Up @@ -184,11 +184,11 @@ double AbstractState::trivial_keyed_output(int key)
case iP_triple:
return this->p_triple();
case iT_reducing:
return get_reducing_state().T;
return calc_T_reducing();
case irhomolar_reducing:
return get_reducing_state().rhomolar;
return calc_rhomolar_reducing();
case iP_reducing:
return get_reducing_state().p;
return calc_p_reducing();
case iP_critical:
return this->p_critical();
case iT_critical:
Expand Down
1 change: 1 addition & 0 deletions src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.h
Expand Up @@ -240,6 +240,7 @@ class HelmholtzEOSMixtureBackend : public AbstractState {

long double calc_T_reducing(void){return get_reducing_state().T;};
long double calc_rhomolar_reducing(void){return get_reducing_state().rhomolar;};
long double calc_p_reducing(void){return get_reducing_state().p;};

std::string calc_name(void);
std::vector<std::string> calc_fluid_names(void);
Expand Down

0 comments on commit aff594b

Please sign in to comment.