# GURU — `guru-viscosity` Manual (EN)

**Purpose.** Estimate dynamic and kinematic viscosity. Currently implemented method: Stokes–Einstein (SE) variant using the first RDF peak radius and the self‑diffusion coefficient.

---

## Formula (SE variant)

The relation used is

```
D * eta = k_B * T / (2 π d)
```

where `eta` is dynamic viscosity [Pa·s], `D` is the self‑diffusion coefficient [m²/s], `T` is temperature [K], and `d` is chosen as the radius of the first peak of the radial distribution function `g(r)` [m]. The kinematic viscosity is `nu = eta / rho` [m²/s] when density `rho` is available (kg/m³).

---

## Synopsis

```bash
guru-viscosity --method se \
  --msd diffusion.tsv --rdf-stats rdf_stats.tsv --thermo thermo.tsv \
  [--rdf-curve all] [--rho RHO_g_cc] \
  [-o viscosity.tsv] [--print]
```

**Inputs**
- `--msd` — TSV from `guru-msd --diff-out` (reads `D_m2_per_s`).
- `--rdf-stats` — TSV from `guru-rdf --stats-out` (reads `r_peak_A`); `--rdf-curve` selects a curve (default `all`).
- `--thermo` — TSV from `guru-thermo --out` to read `T_mean` (and `density_g_cm3` when present). If density is missing, pass `--rho` in g/cm³.

**Outputs**
- TSV columns: `method  T[K]  D[m2/s]  r_peak_A  eta_Pa_s  nu_m2_s  rho_kg_m3`.
- Console prints the same values when `--print` is given (or when `-o` is omitted).

---

## Example

```bash
guru-msd -x XDATCAR -o OUTCAR --diff-out diffusion.tsv
guru-rdf -x XDATCAR --stats-out rdf_stats.tsv
guru-thermo -i OUTCAR --out thermo.tsv

guru-viscosity --method se \
  --msd diffusion.tsv --rdf-stats rdf_stats.tsv --thermo thermo.tsv \
  -o viscosity.tsv --print
```

---

## Notes
- Units: `r_peak_A` is converted to meters; `D` must be in m²/s; `eta` is Pa·s; `nu` is m²/s.
- If `density_g_cm3` is unavailable in thermo TSV, provide `--rho` to compute kinematic viscosity.
- Future methods: Green–Kubo, transverse current ACF.

