def visw(t, p, ps):
    """Viscosity of liquid water as a function of temperature (deg C) and
    pressure and saturation pressure (Pa)."""
    EX = 247.8 / (t + 133.15)
    PHI = 1.0467 * (t - 31.85)
    AM = 1.0 + PHI * (p - ps) * 1.0e-11
    return 1.0e-7 * AM * 241.4 * 10.0 ** EX