faunus
electrolyte.h
1 #pragma once
2 
3 #include <optional>
4 #include <vector>
5 #include <nlohmann/json.hpp>
6 
7 namespace Faunus {
8 
9 using json = nlohmann::json;
10 
18 {
19  private:
20  double ionic_strength;
21  double molarity;
22  std::vector<int> valencies;
23 
24  public:
25  Electrolyte(double molarity, const std::vector<int>& valencies);
26  Electrolyte(double debye_length,
27  double bjerrum_length);
28  [[nodiscard]] double ionicStrength() const;
29  [[nodiscard]] double
30  debyeLength(double bjerrum_length) const;
31  [[nodiscard]] double getMolarity() const;
32  [[nodiscard]] const std::vector<int>&
33  getValencies() const;
34 };
35 
36 void to_json(json& j, const Electrolyte& electrolyte);
37 std::optional<Electrolyte> makeElectrolyte(const json& j);
38 
39 } // namespace Faunus
nlohmann::json json
JSON object.
Definition: json_support.h:10
const std::vector< int > & getValencies() const
Charges of each participating ion in the salt.
double debyeLength(double bjerrum_length) const
Debye screening length in Angstrom.
std::optional< Electrolyte > makeElectrolyte(const json &j)
Create ionic salt object from json.
Stores information about salts for calculation of Debye screening length etc.
Definition: electrolyte.h:17
double getMolarity() const
Input salt molarity (mol/l)
Cell list class templates.
Definition: actions.cpp:11
double ionicStrength() const
Molar ionic strength (mol/l)