Tutorial T07: Aqueous NaCl Electrolytes (0–5 m)
Scripts: tutorials/T07_nacl_electrolytes/run.jl · tutorials/T07_nacl_electrolytes/analyze.jl · tutorials/T07_nacl_electrolytes/plot.py
Concentrated aqueous electrolytes test both nonbonded force-field balance and multi-species GPU molecular dynamics. Older biomolecular monovalent ion parameters routinely suffered from rapid artificial salt clustering well below the experimental NaCl solubility limit (
This tutorial runs a Joung & Cheatham (2008, 2009) aqueous NaCl concentration sweep in SPC/E water across four molalities (ParticleDynamics v1.2.0 capabilities on the GPU:
Multi-type
PairTablewith automatic Lorentz–Berthelot mixing and active LJ type compaction: Declaring 4 atom types (:OW,:HW,:Na,:Cl) with per-typevectors forms arithmetic/geometric pair matrices and compacts zero-LJ hydrogens ( :HW, ) out of the GPU pair kernel (4 types -> 3 active LJ types).Deterministic
ClusterPairList(force_accumulation=:fixed64): 8×8 tile Newton-3 traversal inFloat32with 64-bit fixed-point associative slot force accumulation (2⁻³⁰resolution).Smooth
-continuous ESP(continuity=:c2) +CompactFFT: Prolate-spheroidal Ewald splitting whose real-space force and curvature vanish at , paired with intramolecular exclusions viaTopology(exclusions=...).Double-float
RigidWaterConstraint(settle_mode=:df64): AnalyticSETTLE/RATTLErigid SPC/E water geometry at (max|Δr| <= 1.49e-7 nminFloat32).GPU-resident
StochasticCellRescaling(DeviceCRescale): Zero-sync NPT density equilibration with molecular virials, rigid water COM volume scaling, and aFloat64shadow box inv1.2.0(8,626–8,880 steps/son a single RTX A5000).Per-species
TypeSelectionMSDObservable+GSDWriter(write_unwrapped=true): Simultaneous GPU self-diffusion forOW,Na+, andCl-backed byFloat64unwrapped tracking inv1.2.0, cross-checked against unwrapped GSD trajectories for multi-origin diffusion, partial RDFs, Nernst–Einstein conductivity, and collective Einstein–Helfand conductivity .
Trajectory Visualization
tutorials/render_movies.py --targets T07).
Running the Tutorial
All scripts live in tutorials/T07_nacl_electrolytes/:
# Quick GPU smoke verification (216 H2O, rc = 0.80 nm)
TUTORIAL_FAST=1 julia --project tutorials/T07_nacl_electrolytes/run.jl
TUTORIAL_FAST=1 julia --project tutorials/T07_nacl_electrolytes/analyze.jl
# Full production validation (1000 H2O, rc = 1.00 nm, 300 ps NPT + 500-800 ps NVT)
julia --project tutorials/T07_nacl_electrolytes/run.jl
julia --project tutorials/T07_nacl_electrolytes/analyze.jl
# Regenerate 300-DPI documentation figures
python3 tutorials/T07_nacl_electrolytes/plot.py1. Physical Model & Force Field
All simulations use standard biomolecular units (
SPC/E Water + Joung & Cheatham (2008) NaCl Parameters
| Species | Mass ( | Charge | Notes | ||
|---|---|---|---|---|---|
OW | Rigid SPC/E ( | ||||
HW | Zero-LJ site (compacted out of GPU pair table) | ||||
Na+ | JC (2008) Table 4: | ||||
Cl- | JC (2008) Table 4: |
Cross-interactions obey Lorentz–Berthelot combining rules for all active pairs (
with all :HW Lennard-Jones interactions zero. Nonbonded short-range interactions and real-space ESP(continuity=:c2) electrostatics use TUTORIAL_FAST=1). Note that if DispersionESP is appended to size-asymmetric Lorentz–Berthelot electrolytes such as NaCl (ParticleDynamics v1.2.0 automatically computes composition-weighted Rank-1 SVD dispersion mesh charges, reducing reciprocal-space
Hydration Shells, Apparent Molar Volume, and Collective Ionic Conductivity
First-shell coordination: From the partial radial distribution function
integrated up to its first minimum , Despite its much smaller bare diameter (
),has a higher surface charge density and pulls water oxygens into a tight, strongly bound first hydration shell ( , across neutron-diffraction and JC-SPC/E studies; Mancinelli et al. 2007; Joung & Cheatham 2008, 2009). Conversely,forms a broader, hydrogen-bonded shell ( , , with the integrated count sensitive to the placement of the shallow first minimum ). Consequently, the effective hydrodynamic radius of hydratedexceeds that of , inverting the bare-size expectation so that across all concentrations.Apparent molar volume
: To separate pure-solvent density offsets (such as LJ truncation at ) from the volumetric accuracy of the ion model, we evaluate the apparent molar volume of dissolved NaCl:where
is the pure-water density of the same force field and cutoff, is the solution density at molality , and .Nernst–Einstein vs. Collective Einstein–Helfand Conductivity: From unwrapped trajectories
in a fixed equilibrium volume , the individual species self-diffusion coefficients define the ideal Nernst–Einstein conductivity (assuming uncorrelated ionic motion):Including all distinct cation–cation, anion–anion, and cation–anion cross-correlations yields the collective Einstein–Helfand conductivity from the total ionic charge-dipole displacement
(invariant to uniform center-of-mass drift by electroneutrality ):The dimensionless inverse Haven ratio (ionicity)
quantifies dynamic ion–ion correlations: for uncorrelated ions, whereas transient ion pairing and oppositely charged ionic atmospheres suppress net charge transport ( ) in concentrated brines.
2. ParticleDynamics Workflow API Walkthrough
Multi-Type PairTable, ClusterPairList(:fixed64), and ESP(continuity=:c2)
Supplying per-type vectors to PairTable constructs the Lorentz–Berthelot interaction matrices automatically; the cluster engine compacts :HW out of the active LJ table (n_act = 3) while retaining its charges for real-space and CompactFFT reciprocal electrostatics:
using ParticleDynamics
pt = PairTable(
type_names = [:OW, :HW, :Na, :Cl],
sigma = [0.316557, 0.0, 0.2159538, 0.4830453],
epsilon = [0.650194, 0.0, 1.4754533, 0.05349244],
cutoff = 1.00,
)
forces = Force[
LennardJones(
pair_table = pt,
pairs = :neighborlist,
neighborlist = ClusterPairList(buffer=0.10, force_accumulation=:fixed64),
vdw_modifier = :none,
),
ESP(
coulomb_prefactor = 138.935458,
real_cutoff = 1.00,
tolerance = 1e-4,
continuity = :c2,
exclusions = :topology, # excludes intramolecular water O-H / H-H pairs
),
]GPU-Resident NPT Equilibration (DeviceCRescale + SETTLE(:df64))
Each concentration equilibrates for StochasticCellRescaling (CSVR (
all_grp = Group(:all, AllSelection())
ow_grp = Group(:ow, TypeSelection(:OW))
na_grp = Group(:na, TypeSelection(:Na))
cl_grp = Group(:cl, TypeSelection(:Cl))
rw_constraint = RigidWaterConstraint(triples; oh=0.10, hh=0.163298, settle_mode=:df64)
baro_npt = StochasticCellRescaling(
pressure = 0.0602214076, # 1 bar in kJ/(mol·nm³)
kT = 2.47895703, # 298.15 K
compressibility = 4.5e-5 / 0.0602214076, # liquid water compressibility
tau = 1.5,
interval = 10,
)
sim = Simulation(
system;
groups = Groups(all_grp, ow_grp, na_grp, cl_grp),
integrator = Integrator(
dt = 0.002,
scheme = VelocityVerlet(),
forces = forces,
methods = [ConstantVolume(all_grp; thermostat=CSVR(kT=2.47895703, tau=0.5))],
constraints = [rw_constraint],
barostat = baro_npt,
),
observables = [thermo, press, msd_ow, msd_na, msd_cl],
precision = Float32,
)Equilibrium-Volume NVT Lock, Per-Species MSDObservable, and Unwrapped GSDWriter
After NPT production, run.jl rigidly rescales the cell to the equilibrium box length set_cell_and_molecules!, zeroes total linear momentum, switches sim.integrator to NVT (barostat=nothing, weak CSVR with sync_unwrapped!, and runs MSDObservable windows (InMemoryWriter) and continuous unwrapped coordinates (GSDWriter(write_unwrapped=true)). In the updated run.jl, zero_com_momentum!(sim) is applied before every NVT window to prevent cumulative lab-frame COM drift across windows without disrupting unwrapped positional continuity:
set_cell_and_molecules!(state(sim), (L_eq, L_eq, L_eq))
zero_com_momentum!(sim)
sim.integrator = Integrator(
dt=0.002, scheme=VelocityVerlet(), forces=forces,
methods=[ConstantVolume(all_grp; thermostat=CSVR(kT=2.47895703, tau=2.0))],
constraints=[rw_constraint], barostat=nothing,
)
prepare!(sim)
# ... settle 20 ps, sync_unwrapped!(state(sim)), then log 16 x 50 ps windows
# calling zero_com_momentum!(sim) before each window:
gsd_writer = GSDWriter(gsd_path; every=500, write_unwrapped=true, write_start=false, mode=:replace)3. Results & Literature Validation
All recorded production results below were executed on an NVIDIA RTX A5000 (Float32, ClusterPairList(:fixed64), ESP(:c2) with CompactFFT meshes (15, 15, 15) / (16, 16, 16), RigidWaterConstraint(:df64) with DeviceCRescale NPT throughput 8,626–8,880 steps/s). Uncertainties are 8-block standard errors of the mean (SEM).
Part A: Hydration Structure, Metastable Dispersion & Solution Density

Solution Density, Apparent Molar Volume , & NPT Thermodynamics (1,000 H₂O, 300 ps NPT at 298.15 K, 1 bar) {#Solution-Density,-Apparent-Molar-Volume-V_\phi,-and-NPT-Thermodynamics-1,000-HO,-300-ps-NPT-at-298.15-K,-1-bar}
| State ( | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Pure SPC/E ( | — | — | |||||||
Examining the signed density residuals and apparent molar volume
At
, omitting the long-range Lennard-Jones dispersion tail beyond depresses pure SPC/E density by (, ; Tutorial T06 shows that DispersionESPrestores bulk SPC/E density to ).Adding Joung–Cheatham NaCl shifts the signed density residual upward from
at toat , crossing zero toat andat . Computingdirectly exposes why: JC-SPC/E underestimates the apparent molar volume by ( vs. at ; vs. at ; vs. at ), producing an overly steepthat partially cancels the omitted water dispersion tail at high salt concentration.
Hydration Shell Geometry & Metastable Ion-Pairing Diagnostic
In analyze.jl, first-shell coordination numbers are integrated up to the smoothed first RDF minimum summary_structure.csv:
| State | ||||||
|---|---|---|---|---|---|---|
| — | — | — | — | — | ||
| Literature Refs. | see metastability note |
Hydration reference ranges compile Joung & Cheatham (2008, 2009) (SPC/E MD:
Key structural observations:
The
peak sits at with , nearly invariant across concentration.The
peak lies at with (sensitive to the shallow first minimum near ; integrated to the same, all three concentrations lie inside the 6.4–7.4literature range).Solubility and metastability caveat at
: At ( ),shows a modest contact ion-pair (CIP) peak near ( ) alongside a stronger solvent-separated ion-pair (SSIP) peak near ( ), with . This does not prove thermodynamic solubility at . Direct chemical-potential and coexistence calculations (Joung & Cheatham 2009; Nezbeda, Moučka & Smith 2016) show that the equilibrium solubility of JC-SPC/E NaCl is , so the state is supersaturated and metastable. Homogeneous crystal nucleation from a-ion-pair brine is a rare activated event requiring much longer trajectories or crystal-seeding / chemical-potential methods; the low over simply confirms that the simulation samples a metastable dispersed liquid state without rapid unphysical clustering.
Part B: Species Self-Diffusion & Collective Ionic Conductivity

| State | |||||||
|---|---|---|---|---|---|---|---|
| — | — | — | — | — | |||
_Experimental specific conductivities analyze.jl now uses the thermodynamic target
Key transport findings and methodological diagnostics:
Diagnosis of the recorded online vs. offline
Doffset: In the recorded dataset above, online GPUMSDObservableexceeded offline COM-subtracted GSDDin 9 of 10 species–concentration pairs, by up to+8.3%(1 m Na+:1.003vs.0.926) and+7.9%(3 m Cl-:0.883vs.0.818). Although each individual pair falls within~0.1–1.2σ, the9/10sign bias is systematic rather than random noise: (i)zero_com_momentum!was previously invoked only once before all 16 consecutive NVT windows, allowing cumulative lab-frameFloat32PME/SETTLE COM drift to inflate the unsubtracted onlineMSDObservable; and (ii) online single-origin windows were fitted over[10, 45] pswhile offline sliding-origin COM-subtracted curves were fitted over[8, 36] ps. Both issues are now fixed inrun.jl(per-windowzero_com_momentum!) andanalyze.jl(aligned[8, 36] psfitting windows) for fresh runs.Concentration-dependent dynamical slowing: Increasing salt from
to slows water self-diffusion by ( ) and slows bothand monotonically by from to . (Because these are finite cubic cells with , single-particlevalues include a negative Yeh–Hummer finite-size shift as demonstrated in Tutorial T05; collective is unaffected by the leading self-diffusion shift.) Mobility hierarchy (
):diffuses faster than at every concentration ( ΔD = +0.302 ± 0.107at1 m,+0.168 ± 0.034at3 m,+0.097 ± 0.026 × 10⁻⁹ m²/sat5 m) despite its larger bare Lennard-Jones, reflecting the tighter electrostricted hydration shell around . Collective ion–ion anticorrelation & comparison with experimental conductivity: At
, collective cross-correlations suppress conductivity below the Nernst–Einstein estimate with inverse Haven ratio ( ,below unity). However, the apparent dip in between ( ) and ( ) isΔσ = -2.38 ± 3.94 S/m(0.60σ), which is not statistically significant and does not establish a conductivity turnover. Experimentally (Chambers, Stokes & Stokes 1956), aqueous NaCl conductivity at increases monotonically across this entire range ( at ) toward near saturation ( / ). Theshortfall of JC-SPC/E at relative to experiment reflects a well-known limitation of nonpolarizable full-charge ( ) ion force fields, which overestimate solution viscosity and ionic friction in concentrated brines.
References
I. S. Joung and T. E. Cheatham III, "Determination of Alkali and Halide Monovalent Ion Parameters for Use in Explicitly Solvated Biomolecular Simulations," J. Phys. Chem. B 112(30), 9020–9041 (2008). DOI: 10.1021/jp8001614
I. S. Joung and T. E. Cheatham III, "Molecular Dynamics Simulations of the Dynamic and Energetic Properties of Alkali and Halide Ions Using Water-Model-Specific Ion Parameters," J. Phys. Chem. B 113(40), 13279–13290 (2009). DOI: 10.1021/jp902584c
I. Nezbeda, F. Moučka, and W. R. Smith, "Recent progress in molecular simulation of aqueous electrolytes: force fields, chemical potentials and solubility," Mol. Phys. 114(11), 1665–1690 (2016). DOI: 10.1080/00268976.2016.1165296
R. Mancinelli, A. Botti, F. Bruni, M. A. Ricci, and A. K. Soper, "Hydration of Sodium, Potassium, and Chloride Ions in Solution and the Concept of Structure Maker/Breaker," J. Phys. Chem. B 111(48), 13570–13577 (2007). DOI: 10.1021/jp075913v
J. F. Chambers, J. M. Stokes, and R. H. Stokes, "Conductances of Concentrated Aqueous Sodium and Potassium Chloride Solutions at 25°," J. Phys. Chem. 60(7), 985–986 (1956). DOI: 10.1021/j150541a040
A. Lo Surdo, E. M. Alzola, and F. J. Millero, "The (p, V, T) properties of concentrated aqueous electrolytes. I. Densities and apparent molar volumes of NaCl, Na₂SO₄, MgCl₂, and MgSO₄ solutions from 0.1 mol·kg⁻¹ to saturation and from 273.15 to 323.15 K," J. Chem. Thermodyn. 14(7), 649–662 (1982). DOI: 10.1016/0021-9614(82)90080-5
H. J. C. Berendsen, J. R. Grigera, and T. P. Straatsma, "The missing term in effective pair potentials," J. Phys. Chem. 91(24), 6269–6271 (1987). DOI: 10.1021/j100308a038
M. Bernetti and G. Bussi, "Pressure control using stochastic cell rescaling," J. Chem. Phys. 153(11), 114107 (2020). DOI: 10.1063/5.0020514
S. Miyamoto and P. A. Kollman, "SETTLE: An analytical version of the SHAKE and RATTLE algorithm for rigid water models," J. Comput. Chem. 13(8), 952–962 (1992). DOI: 10.1002/jcc.540130805