Expand description
§Electrostatic Interactions and Electrolyte Solutions
This library provides support for working with electrostatic interactions in e.g. molecular systems. This includes:
- Background dielectric medium with or without implicit salt.
- Handling of electrolyte solutions with salt of arbitrary valency and ionic strength.
- Calculation of pairwise interactions between ions and point multipoles using (truncated) potentials.
- Ewald summation
§Interactions between Multipoles
Please see the pairwise module.
§Electrolyte Solutions
This provides support for calculating properties of electrolyte solutions such as the Debye length, ionic strength, and Bjerrum length. It also has a module for empirical models of relative permittivity as a function of temperature.
§Examples
The is a Medium of neat water at 298.15 K where the temperature-dependent
dielectric constant is found by the permittivity::WATER model:
use coulomb::*;
let medium = Medium::neat_water(298.15);
assert_relative_eq!(medium.permittivity(), 78.35565171480539);
assert!(medium.ionic_strength().is_none());
assert!(medium.debye_length().is_none());We can also add Salt of arbitrary valency and concentration which
leads to a non-zero ionic strength and Debye length,
let medium = Medium::salt_water(298.15, Salt::CalciumChloride, 0.1);
assert_relative_eq!(medium.ionic_strength().unwrap(), 0.3);
assert_relative_eq!(medium.debye_length().unwrap(), 5.548902662386284);The pairwise module can be used to calculate the interaction energy (and forces, field) between
point multipoles in the medium. Here’s a simple example for the energy between two point
charges:
use coulomb::{Medium, TO_CHEMISTRY_UNIT};
use coulomb::pairwise::{Plain, MultipoleEnergy};
let (z1, z2, r) = (1.0, -1.0, 7.0); // unit-less charge numbers, separation in angstrom
let medium = Medium::neat_water(298.15); // pure water
let plain = Plain::without_cutoff(); // generic coulomb interaction scheme
let energy = plain.ion_ion_energy(z1, z2, r) * TO_CHEMISTRY_UNIT / medium.permittivity();
assert_relative_eq!(energy, -2.533055636224861); // in kJ/molRe-exports§
pub use reciprocal::EwaldPolicy;pub use reciprocal::EwaldReciprocal;
Modules§
- pairwise
- Pairwise Electrostatic Interactions.
- permittivity
- Relative permittivity models
- reciprocal
- Reciprocal-space Ewald summation for Coulomb and Yukawa potentials.
- units
- Re-exported units from the
uomcrate.
Structs§
- Medium
- Implicit solvent medium such as water or a salt solution
Enums§
Constants§
- AVOGADRO_
CONSTANT - Avogadro constant, Nₐ (mol⁻¹). CODATA 2018.
- BJERRUM_
LEN_ VACUUM_ 298K - Bjerrum length in vacuum at 298.15 K, e²/4πε₀kT (Å).
- BOLTZMANN_
CONSTANT - Boltzmann constant, k (J/K). CODATA 2018.
- ELEMENTARY_
CHARGE - Elementary charge, e (C). CODATA 2018.
- MOLAR_
GAS_ CONSTANT - Molar gas constant, R (J/(mol·K)). CODATA 2018.
- TO_
CHEMISTRY_ UNIT - Electrostatic prefactor, e²/4πε₀ × 10⁷ × NA [Å × kJ / mol].
- VACUUM_
ELECTRIC_ PERMITTIVITY - Vacuum electric permittivity, ε₀ (F/m). CODATA 2018.
Traits§
- Cutoff
- Defines a spherical cut-off distance
- Debye
Length - Trait for objects where a Debye length can be calculated
- Ionic
Strength - Trait for objects that has an ionic strength
- Temperature
- Trait for objects with a temperature
Functions§
- bjerrum_
length - Calculates the Bjerrum length, λ𝐵 = e²/4πε𝑘𝑇 commonly used in electrostatics (ångström).
- debye_
length - Calculates the Debye length in angstrom, λ𝐷 = 1/√(8π·λ𝐵·𝐼·𝑁𝐴·𝑉), where 𝐼 is the ionic strength in molar units (mol/l).