CoolProp  6.6.0
An open-source fluid property and humid air property database
UNIFAC.h
Go to the documentation of this file.
1 #ifndef UNIFAC_H_
2 #define UNIFAC_H_
3 
4 #include <map>
5 
6 #include "UNIFACLibrary.h"
7 #include "CachedElement.h"
8 #include "Exceptions.h"
9 
12 {
13  std::map<std::size_t, double> X, theta, lnGamma;
15 };
16 
17 namespace UNIFAC {
19 {
20  private:
23 
25 
26  std::size_t N;
27 
28  double m_T;
29  double T_r;
30 
31  std::map<std::pair<std::size_t, std::size_t>, double> Psi_;
32 
33  std::map<std::size_t, double> m_Xg,
34  m_thetag,
35  m_lnGammag,
36  m_Q;
37 
39  std::map<std::pair<int, int>, UNIFACLibrary::InteractionParameters> interaction;
40 
42  std::map<std::size_t, std::size_t> m_sgi_to_mgi;
43 
45  std::set<std::size_t> unique_groups;
46 
47  std::vector<double> mole_fractions;
48 
49  std::vector<UNIFACLibrary::Component> components;
50 
51  std::vector<ComponentData> pure_data;
52 
53  public:
54  UNIFACMixture(const UNIFACLibrary::UNIFACParameterLibrary& library, const double T_r) : library(library), T_r(T_r){};
55 
63  void set_interaction_parameter(const std::size_t mgi1, const std::size_t mgi2, const std::string& parameter, const double value);
65  double get_interaction_parameter(const std::size_t mgi1, const std::size_t mgi2, const std::string& parameter);
66 
68  void set_mole_fractions(const std::vector<double>& z);
69 
71  const std::vector<double>& get_mole_fractions() {
72  return mole_fractions;
73  }
74 
76  void set_temperature(const double T);
77 
79  double get_temperature() const {
80  return m_T;
81  }
82 
83  double Psi(std::size_t sgi1, std::size_t sgi2) const;
84 
85  double theta_pure(std::size_t i, std::size_t sgi) const;
86 
87  void activity_coefficients(double tau, const std::vector<double>& z, std::vector<double>& gamma);
88 
89  double ln_gamma_R(const double tau, std::size_t i, std::size_t itau);
90 
91  std::size_t group_count(std::size_t i, std::size_t sgi) const;
92 
94  void add_component(const UNIFACLibrary::Component& comp);
95 
96  void set_components(const std::string& identifier_type, std::vector<std::string> identifiers);
97 
98  const std::vector<UNIFACLibrary::Component>& get_components() {
99  return components;
100  };
101 
102  void set_pure_data();
103 
105  void set_Q_k(const size_t sgi, const double value);
106 
108  double get_Q_k(const size_t sgi) const;
109 };
110 
111 } /* namespace UNIFAC */
112 
113 #endif