def _D2O_Viscosity(rho, T):
    """Equation for the Viscosity of heavy water

    Parameters
    ----------
    rho : float
        Density, [kg/m³]
    T : float
        Temperature, [K]

    Returns
    -------
    μ : float
        Viscosity, [Pa·s]

    Examples
    --------
    >>> _D2O_Viscosity(998, 298.15)
    0.0008897351001498108
    >>> _D2O_Viscosity(600, 873.15)
    7.743019522728247e-05

    References
    ----------
    IAPWS, Revised Release on Viscosity and Thermal Conductivity of Heavy
    Water Substance, http://www.iapws.org/relguide/TransD2O-2007.pdf
    """
    Tr = T/643.847
    rhor = rho/358.0

    no = [1.0, 0.940695, 0.578377, -0.202044]
    fi0 = Tr**0.5/sum([n/Tr**i for i, n in enumerate(no)])

    Li = [0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 0, 1, 2, 5, 0, 1, 2, 3, 0, 1, 3,
          5, 0, 1, 5, 3]
    Lj = [0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4,
          4, 5, 5, 5, 6]
    Lij = [0.4864192, -0.2448372, -0.8702035, 0.8716056, -1.051126,
           0.3458395, 0.3509007, 1.315436, 1.297752, 1.353448, -0.2847572,
           -1.037026, -1.287846, -0.02148229, 0.07013759, 0.4660127,
           0.2292075, -0.4857462, 0.01641220, -0.02884911, 0.1607171,
           -.009603846, -.01163815, -.008239587, 0.004559914, -0.003886659]

    arr = [lij*(1./Tr-1)**i*(rhor-1)**j for i, j, lij in zip(Li, Lj, Lij)]
    fi1 = exp(rhor*sum(arr))

    return 55.2651e-6*fi0*fi1
def _D2O_Viscosity ( rho , T ) : Tr = T / 643.847 rhor = rho / 358.0 no = [ 1.0 , 0.940695 , 0.578377 , - 0.202044 ] fi0 = Tr ** 0.5 / sum ( [ n / Tr ** i for i , n in enumerate ( no ) ] ) Li = [ 0 , 1 , 2 , 3 , 4 , 5 , 0 , 1 , 2 , 3 , 0 , 1 , 2 , 5 , 0 , 1 , 2 , 3 , 0 , 1 , 3 , 5 , 0 , 1 , 5 , 3 ] Lj = [ 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 2 , 2 , 2 , 2 , 3 , 3 , 3 , 3 , 4 , 4 , 4 , 4 , 5 , 5 , 5 , 6 ] Lij = [ 0.4864192 , - 0.2448372 , - 0.8702035 , 0.8716056 , - 1.051126 , 0.3458395 , 0.3509007 , 1.315436 , 1.297752 , 1.353448 , - 0.2847572 , - 1.037026 , - 1.287846 , - 0.02148229 , 0.07013759 , 0.4660127 , 0.2292075 , - 0.4857462 , 0.01641220 , - 0.02884911 , 0.1607171 , - .009603846 , - .01163815 , - .008239587 , 0.004559914 , - 0.003886659 ] arr = [ lij * ( 1. / Tr - 1 ) ** i * ( rhor - 1 ) ** j for i , j , lij in zip ( Li , Lj , Lij ) ] fi1 = exp ( rhor * sum ( arr ) ) return 55.2651e-6 * fi0 * fi1
Equation for the Viscosity of heavy water

    Parameters
    ----------
    rho : float
        Density, [kg/m³]
    T : float
        Temperature, [K]

    Returns
    -------
    μ : float
        Viscosity, [Pa·s]

    Examples
    --------
    >>> _D2O_Viscosity(998, 298.15)
    0.0008897351001498108
    >>> _D2O_Viscosity(600, 873.15)
    7.743019522728247e-05

    References
    ----------
    IAPWS, Revised Release on Viscosity and Thermal Conductivity of Heavy
    Water Substance, http://www.iapws.org/relguide/TransD2O-2007.pdf