5.6. exec/immersedIons – Brownian ions in a fluctuating fluid
- Purpose
Simulates charged (or neutral) Brownian particles immersed in a fluctuating Stokes fluid, with electrostatics, short-range interactions, walls and external fields. Typical uses are ionic conductivity, electro-osmosis, diffusion and structure factors of electrolytes.
- Libraries and build
src_particles,src_hydro,src_gmres,src_electrostatic,src_geometry,src_immersed-boundary(base kernels),src_analysis,src_rng,src_common; built withUSE_PARTICLES = TRUE,USE_FFT = TRUE,DIM = 3.- Algorithm
Each time step:
computes short-range (Lennard-Jones) forces and the P3M short-range correction (when
sr_tog != 0ores_tog = 3);spreads charges to the grid and solves the Poisson equation (
es_tog= 1 or 3), or computes pairwise Coulomb forces (es_tog = 2);spreads particle forces to the fluid with the chosen kernel;
solves the fluctuating Stokes equations (
fluid_tog = 1);moves the ions with the interpolated fluid velocity plus their dry Brownian motion (
move_tog);accumulates statistics, distributions, structure factors and output.
- Wet and dry diffusion
The kernel width sets each ion’s hydrodynamic (“wet”) radius: about 0.91, 1.255 and 1.481 grid spacings for
pkernel_fluid= 3, 4 and 6. For exponential-of-semicircle kernels (eskernel_fluid), the radius is tabulated inwetRad_wN.datfiles. The total diffusion coefficient comes from Stokes–Einstein ifdiameter > 0, and fromdiffotherwise. The remainder after subtracting the wet part is applied as dry diffusion.all_dry = 1makes all diffusion dry and requiresfluid_tog = 0.- Key parameters
Parameter
Meaning
fluid_tog0 no fluid, 1 Stokes (2, low Mach, is not supported).
es_tog0 off, 1 Poisson, 2 pairwise Coulomb (serial only), 3 P3M.
move_togTotal particle move: 0 off, 1 single step, 2 midpoint.
dry_move_togDry particle move: 0 off, 1 on, 2 on without the dry stochastic drift correction.
sr_tog,eepsilon,sigma,rmin,rmaxShort-range Lennard-Jones interactions between particles (
*_wallvariants for walls).wall_mobDry mobility correction near walls: 0 none, 1 infinite plane, 2 alternative model.
pkernel_fluid,pkernel_es,eskernel_fluid,eskernel_betaKernels for fluid coupling and charge spreading.
qval,permittivity,imagesCharges, permittivity, and the number of periodic images for pairwise Coulomb interactions.
eamp,efreq,ephaseAmplitude, frequency and phase of an external electric field.
bc_es_lo/hi,potential_lo/hiPotential boundary conditions: -1 periodic, 1 Dirichlet, 2 Neumann.
particle_count,particle_n0,particle_neffNumber or number density of ions per species.
particle_placement1 reads
x y z pinnedfor each particle fromparticles.dat; any other value places particles randomly.msd_int,msd_len,radialdist_int,cartdist_intMean-square displacement and pair-distribution diagnostics.
- Example inputs
inputs_templatedocuments every option.regression_inputs/contains conductivity, electro-osmosis and boundary-condition tests.paper_inputs/andpaper_inputs_2/reproduce published results; the README maps them to their cases.inputs_gpuis set up for GPU runs.- Output
Fluid plotfiles
plt*(andstagx/y/z*), particle and charge plotfilescplt*,eplt*andparplt*, and structure factorsplt_SF_chargeandplt_SF_vel. Particle diagnostics are written as text files, e.g.msdEst_<i>,radialDistribution*,cartesianDistribution*,currentEstandbulkFlowEst.plot_ascii = 1adds ASCII copies of mean fields.