GMX-TCAF(1)

โœจ gmx-tcaf โ€” calculate viscosities of liquids โœจ

okay bestie, welcome to the GROMACS corner of the manual ๐Ÿ’– this one lives in the gmx-tcaf(1) page and it is literally about figuring out how thick and syrupy your liquid is. let's get into it ๐Ÿซถ


๐ŸŒธ NAME ๐ŸŒธ

gmx-tcaf โ€” Calculate viscosities of liquids


๐ŸŽ€ SYNOPSIS ๐ŸŽ€

gmx tcaf [-f [<.trr/.cpt/...>]] [-s [<.tpr/.gro/...>]] [-n [<.ndx>]]
         [-ot [<.xvg>]] [-oa [<.xvg>]] [-o [<.xvg>]] [-of [<.xvg>]]
         [-oc [<.xvg>]] [-ov [<.xvg>]] [-b <time>] [-e <time>]
         [-dt <time>] [-[no]w] [-xvg <enum>] [-[no]mol] [-[no]k34]
         [-wt <real>] [-acflen <int>] [-[no]normalize] [-P <enum>]
         [-fitfn <enum>] [-beginfit <real>] [-endfit <real>]

๐Ÿ’… DESCRIPTION ๐Ÿ’…

so gmx tcaf computes tranverse current autocorrelations (yes that's how it's spelled in the source, we're keeping it fr fr ๐Ÿ™ˆ). what are those for? estimating the shear viscosity, eta. for the full lore see: Palmer, Phys. Rev. E 49 (1994) pp 359-366. ๐Ÿ“š

k so here's how the k-vectors shake out, and bestie this part is very specific:

  • (1,0,0) and (2,0,0), each also in the y- and z-direction
  • (1,1,0) and (1,-1,0), each also in the 2 other planes (heads up, these vectors are not independent)
  • (1,1,1) and the 3 other box diagonals (also not independent)

for every single k-vector it uses the sine and cosine, combined with the velocity in 2 perpendicular directions. do the math and you get a total of 16*2*2=64 transverse currents. ๐Ÿงฎ one autocorrelation is calculated fitted for each k-vector, which gives 16 TCAFs. each of these TCAFs gets fitted to:

f(t) = exp(-v)(cosh(Wv) + 1/W sinh(Wv)), v = -t/(2 tau), W = sqrt(1 - 4 tau eta/rho k^2)

which hands you 16 values of tau and eta. the fit weights decay exponentially with time constant w (that's the one you set with -wt) as exp(-t/w), and the TCAF plus its fit are calculated up to time 5*w. then those eta values should be fitted to 1 - a eta(k) k^2, and from that you can estimate the shear viscosity at k=0. iconic behavior honestly ๐Ÿ‘‘

if the box is cubic, you can use the option -oc, which averages the TCAFs over all k-vectors with the same length. this results in more accurate TCAFs. both the cubic TCAFs and fits are written to -oc. the cubic eta estimates are also written to -ov. ๐Ÿฆ‹

with option -mol, the transverse current is determined of molecules instead of atoms. in this case, the index group should consist of molecule numbers instead of atom numbers. don't mix those up bestie ๐Ÿ˜ญ

the k-dependent viscosities in the -ov file should be fitted to:

eta(k) = eta_0 (1 - a k^2)

to obtain the viscosity at infinite wavelength. infinite. wavelength. slay. โœจ

Note: make sure you write coordinates and velocities often enough. the initial, non-exponential, part of the autocorrelation function is very important for obtaining a good fit. like, do not skip this. the fit will be giving nothing if you skimp on frames ๐Ÿ’€

๐ŸŒˆ OPTIONS ๐ŸŒˆ

๐Ÿ“ Options to specify input files

  • -f [<.trr/.cpt/...>] (traj.trr) โ€” Full precision trajectory: trr cpt tng h5md
  • -s [<.tpr/.gro/...>] (topol.tpr) (Optional) โ€” Structure+mass(db): tpr gro g96 pdb brk ent
  • -n [<.ndx>] (index.ndx) (Optional) โ€” Index file

๐Ÿงš Options to specify output files

  • -ot [<.xvg>] (transcur.xvg) (Optional) โ€” xvgr/xmgr file
  • -oa [<.xvg>] (tcaf_all.xvg) โ€” xvgr/xmgr file
  • -o [<.xvg>] (tcaf.xvg) โ€” xvgr/xmgr file
  • -of [<.xvg>] (tcaf_fit.xvg) โ€” xvgr/xmgr file
  • -oc [<.xvg>] (tcaf_cub.xvg) (Optional) โ€” xvgr/xmgr file
  • -ov [<.xvg>] (visc_k.xvg) โ€” xvgr/xmgr file

๐Ÿ’œ Other options

  • -b <time> (0) โ€” Time of first frame to read from trajectory (default unit ps)
  • -e <time> (0) โ€” Time of last frame to read from trajectory (default unit ps)
  • -dt <time> (0) โ€” Only use frame when t MOD dt = first time (default unit ps)
  • -[no]w (no) โ€” View output .xvg, .xpm, .eps and .pdb files
  • -xvg <enum> (xmgrace) โ€” xvg plot formatting: xmgrace, xmgr, none
  • -[no]mol (no) โ€” Calculate TCAF of molecules
  • -[no]k34 (no) โ€” Also use k=(3,0,0) and k=(4,0,0)
  • -wt <real> (5) โ€” Exponential decay time for the TCAF fit weights
  • -acflen <int> (-1) โ€” Length of the ACF, default is half the number of frames
  • -[no]normalize (yes) โ€” Normalize ACF
  • -P <enum> (0) โ€” Order of Legendre polynomial for ACF (0 indicates none): 0, 1, 2, 3
  • -fitfn <enum> (none) โ€” Fit function: none, exp, aexp, exp_exp, exp5, exp7, exp9
  • -beginfit <real> (0) โ€” Time where to begin the exponential fit of the correlation function
  • -endfit <real> (-1) โ€” Time where to end the exponential fit of the correlation function, -1 is until the end

๐Ÿฆ‹ SEE ALSO ๐Ÿฆ‹

More information about GROMACS is available at <http://www.gromacs.org/>.


2026, GROMACS development team


and that's the whole page bestie, no cap ๐Ÿซถ this was GROMACS version 2026.4, dated Oct 02, 2026, and it's the GMX-TCAF(1) manual page. go get those viscosity numbers, you're the main character of this simulation ๐Ÿ’–โœจ๐ŸŽ€

๐Ÿ“ฆ where this page comes from