Skip to content

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 (  at  ). Joung & Cheatham (2008, 2009) parameterized water-model-specific alkali-halide Lennard-Jones models against hydration free energies, crystal lattice energies, and lattice constants, improving hydration-shell geometry and delaying premature aggregation. At the same time, direct thermodynamic solubility studies (Joung & Cheatham 2009; Nezbeda, Moučka & Smith 2016) established that the equilibrium solubility of the Joung–Cheatham SPC/E NaCl model is  , so   solutions are supersaturated (metastable) with respect to the crystal phase, and short nanosecond MD runs probe metastable liquid structure and transport rather than thermodynamic solubility.

This tutorial runs a Joung & Cheatham (2008, 2009) aqueous NaCl concentration sweep in SPC/E water across four molalities ( ,  ,  , and   at   and  ) while exercising six ParticleDynamics v1.2.0 capabilities on the GPU:

  1. Multi-type PairTable with automatic Lorentz–Berthelot mixing and active LJ type compaction: Declaring 4 atom types (:OW, :HW, :Na, :Cl) with per-type vectors forms arithmetic/geometric pair matrices and compacts zero-LJ hydrogens (:HW,  ) out of the GPU pair kernel (4 types -> 3 active LJ types).

  2. Deterministic ClusterPairList (force_accumulation=:fixed64): 8×8 tile Newton-3 traversal in Float32 with 64-bit fixed-point associative slot force accumulation (2⁻³⁰ resolution).

  3. Smooth -continuous ESP (continuity=:c2) + CompactFFT: Prolate-spheroidal Ewald splitting whose real-space force and curvature vanish at   , paired with intramolecular exclusions via Topology(exclusions=...).

  4. Double-float RigidWaterConstraint (settle_mode=:df64): Analytic SETTLE / RATTLE rigid SPC/E water geometry at    (max|Δr| <= 1.49e-7 nm in Float32).

  5. GPU-resident StochasticCellRescaling (DeviceCRescale): Zero-sync NPT density equilibration with molecular virials, rigid water COM volume scaling, and a Float64 shadow box in v1.2.0 (8,626–8,880 steps/s on a single RTX A5000).

  6. Per-species TypeSelection MSDObservable + GSDWriter (write_unwrapped=true): Simultaneous GPU self-diffusion for OW, Na+, and Cl- backed by Float64 unwrapped tracking in v1.2.0, cross-checked against unwrapped GSD trajectories for multi-origin diffusion, partial RDFs, Nernst–Einstein conductivity , and collective Einstein–Helfand conductivity .

Trajectory Visualization ​

Live Fresnel Studio Dashboard (T07): Concentrated 5 m aqueous Joung–Cheatham NaCl brine (3,180 atoms, amber Na⁺, emerald Cl⁻, highlighted first hydration shells) with live ion–oxygen RDFs g(r) and per-species ionic MSDs showing D(Cl⁻) > D(Na⁺) and metastable dispersed ions over the 800 ps NVT window (tutorials/render_movies.py --targets T07).

Studio Fresnel snapshot of 5 m aqueous NaCl brine with hydration shells


Running the Tutorial ​

All scripts live in tutorials/T07_nacl_electrolytes/:

bash
# 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.py

1. Physical Model & Force Field ​

All simulations use standard biomolecular units (,  , , , ), with Boltzmann constant       (    at  ), Coulomb prefactor       , and pressure conversion      .

SPC/E Water + Joung & Cheatham (2008) NaCl Parameters ​

SpeciesMass ()Charge () () ( )Notes
OWRigid SPC/E (  ,  ,   )
HWZero-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    in production without long-range LJ dispersion tail corrections (  + NaCl pairs corresponding to  ; scaled to   at    in 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 cross-term error by   relative to geometric-mean charges at zero runtime cost.

Hydration Shells, Apparent Molar Volume, and Collective Ionic Conductivity ​

  1. 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 hydrated exceeds that of , inverting the bare-size expectation so that   across all concentrations.

  2. 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   .

  3. 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:

julia
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   and samples density for   at   and   with GPU-resident StochasticCellRescaling (  ,    , applied every 10 steps) and CSVR (  ):

julia
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   via set_cell_and_molecules!, zeroes total linear momentum, switches sim.integrator to NVT (barostat=nothing, weak CSVR with   ), synchronizes unwrapped buffers via sync_unwrapped!, and runs   of transport production with aligned 500-step GPU batches logging both GPU 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:

julia
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 ​

Aqueous NaCl Hydration Shells, Ion Pairing, and NPT 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 ( ) () () () () () () (z-score) () ()
Pure SPC/E ()     (, )——
  NaCl ()      (, )  ()
  NaCl ()      (, )  ()
  NaCl ()      (, )  ()

Examining the signed density residuals and apparent molar volume reveals an instructive cancellation of errors rather than uniform sub-percent accuracy:

  • At  , omitting the long-range Lennard-Jones dispersion tail beyond    depresses pure SPC/E density by    (, ; Tutorial T06 shows that DispersionESP restores bulk SPC/E density to  ).

  • Adding Joung–Cheatham NaCl shifts the signed density residual upward from at   to at  , crossing zero to at   and at  . Computing directly exposes why: JC-SPC/E underestimates the apparent molar volume by (  vs.   at  ;   vs.   at  ;   vs.   at  ), producing an overly steep that 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 located automatically inside   (O–O),   (Na–O),   (Cl–O), and   (Na–Cl), with per-state values written to summary_structure.csv:

State () () ()
   ( )—————
   ( )     
   ( )     
   ( )     
Literature Refs. (SPC/E)see metastability note

Hydration reference ranges compile Joung & Cheatham (2008, 2009) (SPC/E MD:   ,  ;   ,   depending on ) and Mancinelli et al. (2007) (neutron diffraction with isotopic substitution:   ,  ;   ,  ).

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.4 literature 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 ​

Aqueous NaCl Species Self-Diffusion, Charge-Current MSD, and Conductivity

State GSD / GPU ( ) GSD / GPU ( ) GSD / GPU ( ) () () () 
   /  —————
   /    /    /     
   /    /    /     
   /    /    /     

_Experimental specific conductivities at   are interpolated at the corresponding molarities ( ) from Chambers, Stokes & Stokes (1956) (_J. Phys. Chem.* 60, 985–986), where aqueous NaCl conductivity rises monotonically toward   near saturation (  /  ). Note that the recorded table values for and were evaluated with the full-step    (a factor relative to  ); analyze.jl now uses the thermodynamic target   .*

Key transport findings and methodological diagnostics:

  1. Diagnosis of the recorded online vs. offline D offset: In the recorded dataset above, online GPU MSDObservable exceeded offline COM-subtracted GSD D in 9 of 10 species–concentration pairs, by up to +8.3% (1 m Na+: 1.003 vs. 0.926) and +7.9% (3 m Cl-: 0.883 vs. 0.818). Although each individual pair falls within ~0.1–1.2σ, the 9/10 sign 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-frame Float32 PME/SETTLE COM drift to inflate the unsubtracted online MSDObservable; and (ii) online single-origin windows were fitted over [10, 45] ps while offline sliding-origin COM-subtracted curves were fitted over [8, 36] ps. Both issues are now fixed in run.jl (per-window zero_com_momentum!) and analyze.jl (aligned [8, 36] ps fitting windows) for fresh runs.

  2. Concentration-dependent dynamical slowing: Increasing salt from   to   slows water self-diffusion by   (   ) and slows both and monotonically by   from   to  . (Because these are finite cubic cells with   , single-particle values include a negative Yeh–Hummer finite-size shift as demonstrated in Tutorial T05; collective is unaffected by the leading self-diffusion shift.)

  3. Mobility hierarchy ( ): diffuses faster than at every concentration (ΔD = +0.302 ± 0.107 at 1 m, +0.168 ± 0.034 at 3 m, +0.097 ± 0.026 × 10⁻⁹ m²/s at 5 m) despite its   larger bare Lennard-Jones , reflecting the tighter electrostricted hydration shell around .

  4. 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 (  /  ). The shortfall 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 ​

  1. 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

  2. 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

  3. 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

  4. 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

  5. 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

  6. 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

  7. 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

  8. M. Bernetti and G. Bussi, "Pressure control using stochastic cell rescaling," J. Chem. Phys. 153(11), 114107 (2020). DOI: 10.1063/5.0020514

  9. 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

ParticleDynamics v1.2.0 · GPU-native molecular dynamics in pure Julia · MIT License