CoolProp  6.6.0
An open-source fluid property and humid air property database
PCSAFTLibrary.h
Go to the documentation of this file.
1 
2 
3 #ifndef PCSAFT_LIBRARY_H
4 #define PCSAFT_LIBRARY_H
5 
6 #include <vector>
7 #include <string>
8 #include "PCSAFTFluid.h"
9 #include "CoolPropTools.h"
10 #include "rapidjson_include.h"
11 
12 namespace CoolProp {
13 
14 std::string get_mixture_binary_pair_pcsaft(const std::string& CAS1, const std::string& CAS2, const std::string& key);
15 void set_mixture_binary_pair_pcsaft(const std::string& CAS1, const std::string& CAS2, const std::string& key, const double value);
16 
17 namespace PCSAFTLibrary {
18 
20 {
21  private:
22  std::map<std::size_t, PCSAFTFluid> fluid_map;
23  std::map<std::string, std::size_t> string_to_index_map;
24  bool empty; // Is empty
26  std::map<std::vector<std::string>, std::vector<Dictionary>> m_binary_pair_map;
27 
28  void load_from_JSON(rapidjson::Document& doc);
29  void load_from_string(const std::string& str);
30 
31  public:
33 
34  bool is_empty() {
35  return empty;
36  };
37 
38  int add_many(rapidjson::Value& listing);
39 
40  PCSAFTFluid& get(const std::string& key);
41  PCSAFTFluid& get(std::size_t key);
42 
43  std::map<std::vector<std::string>, std::vector<Dictionary>>& binary_pair_map() {
44  return m_binary_pair_map;
45  };
46 
47  std::string get_binary_interaction_pcsaft(const std::string& CAS1, const std::string& CAS2, const std::string& key);
48  void set_binary_interaction_pcsaft(const std::string& CAS1, const std::string& CAS2, const std::string& key, const double value);
49 };
50 
54 void add_fluids_as_JSON(const std::string& JSON);
55 
57 std::string get_pcsaft_fluids_schema();
58 
59 PCSAFTLibraryClass& get_library(void);
60 } // namespace PCSAFTLibrary
61 } /* namespace CoolProp */
62 
63 #endif