mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-04-23 03:00:17 -04:00
Implement calling a flash routine with guess values provided at the low-level (PQ only for now)
This commit is contained in:
@@ -17,6 +17,16 @@
|
||||
|
||||
namespace CoolProp {
|
||||
|
||||
class GuessesStructure{
|
||||
public:
|
||||
CoolPropDbl T, p, rhomolar, hmolar, smolar;
|
||||
CoolPropDbl rhomolar_liq, rhomolar_vap;
|
||||
std::vector<CoolPropDbl> x,
|
||||
y;
|
||||
GuessesStructure() : T(_HUGE), p(_HUGE), rhomolar(_HUGE), hmolar(_HUGE), smolar(_HUGE),
|
||||
rhomolar_liq(_HUGE), rhomolar_vap(_HUGE), x(), y(){};
|
||||
};
|
||||
|
||||
//! The mother of all state classes
|
||||
/*!
|
||||
This class provides the basic properties based on interrelations of the
|
||||
@@ -353,7 +363,13 @@ public:
|
||||
virtual bool using_mass_fractions(void) = 0;
|
||||
virtual bool using_volu_fractions(void) = 0;
|
||||
|
||||
/// Update the state using two state variables
|
||||
virtual void update(CoolProp::input_pairs input_pair, double Value1, double Value2) = 0;
|
||||
|
||||
/// Update the state using two state variables and providing guess values
|
||||
/// Some or all of the guesses will be used
|
||||
virtual void update_with_guesses(CoolProp::input_pairs input_pair, double Value1, double Value2, const GuessesStructure &guesses){throw NotImplementedError("update_with_guesses is not implemented for this backend");};
|
||||
|
||||
virtual void set_mole_fractions(const std::vector<CoolPropDbl> &mole_fractions) = 0;
|
||||
virtual void set_mass_fractions(const std::vector<CoolPropDbl> &mass_fractions) = 0;
|
||||
virtual void set_volu_fractions(const std::vector<CoolPropDbl> &mass_fractions){throw NotImplementedError("Volume composition has not been implemented.");}
|
||||
|
||||
@@ -385,7 +385,7 @@
|
||||
Dictionary(){};
|
||||
bool is_empty(void) const {return numbers.empty() && strings.empty() && double_vectors.empty() && string_vectors.empty();}
|
||||
void add_string(const std::string &s1, const std::string &s2){ strings.insert(std::pair<std::string, std::string>(s1, s2));}
|
||||
void add_number(const std::string &s1, double d){ numbers.insert(std::pair<std::string, double>(s1, d));}
|
||||
void add_number(const std::string &s1, double d){ numbers.erase(s1); numbers.insert(std::pair<std::string, double>(s1, d));}
|
||||
void add_double_vector(const std::string &s1, const std::vector<double> &d){ double_vectors.insert(std::pair<std::string, std::vector<double> >(s1, d));}
|
||||
void add_string_vector(const std::string &s1, const std::vector<std::string> &d){ string_vectors.insert(std::pair<std::string, std::vector<std::string> >(s1, d));}
|
||||
std::string get_string(const std::string &s) const
|
||||
|
||||
Reference in New Issue
Block a user