Skip to content

polykin.properties.pvt¤

B_mixture ¤

B_mixture(
    T: float,
    Tc: FloatVector,
    Pc: FloatVector,
    Zc: FloatVector,
    w: FloatVector,
) -> FloatSquareMatrix

Calculate the matrix of interaction virial coefficients using the mixing rules of Prausnitz.

\[\begin{aligned} B_{ij} &= B(T,T_{cij},P_{cij},\omega_{ij}) \\ v_{cij} &= \frac{(v_{ci}^{1/3}+v_{cj}^{1/3})^3}{8} \\ k_{ij} &= 1 -\frac{\sqrt{v_{ci}v_{cj}}}{v_{cij}} \\ T_{cij} &= \sqrt{T_{ci}T_{cj}}(1-k_{ij}) \\ Z_{cij} &= \frac{Z_{ci}+Z_{cj}}{2} \\ \omega_{ij} &= \frac{\omega_{i}+\omega_{j}}{2} \\ P_{cij} &= \frac{Z_{cij} R T_{cij}}{v_{cij}} \end{aligned}\]

The calculation of the individual coefficients is handled by B_pure.

References

  • RC Reid, JM Prausniz, and BE Poling. The properties of gases & liquids 4th edition, 1986, p. 80.
PARAMETER DESCRIPTION
T

Temperature [K].

TYPE: float

Tc

Critical temperatures of all components [K].

TYPE: FloatVector(N)

Pc

Critical pressures of all components [Pa].

TYPE: FloatVector(N)

Zc

Critical compressibility factors of all components.

TYPE: FloatVector(N)

w

Acentric factors of all components.

TYPE: FloatVector(N)

RETURNS DESCRIPTION
FloatSquareMatrix(N, N)

Matrix of interaction virial coefficients \(B_{ij}\) [m³/mol].

Source code in src/polykin/properties/pvt/virial.py
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
def B_mixture(
    T: float,
    Tc: FloatVector,
    Pc: FloatVector,
    Zc: FloatVector,
    w: FloatVector,
) -> FloatSquareMatrix:
    r"""Calculate the matrix of interaction virial coefficients using the
    mixing rules of Prausnitz.

    \begin{aligned}
        B_{ij} &= B(T,T_{cij},P_{cij},\omega_{ij}) \\
        v_{cij} &= \frac{(v_{ci}^{1/3}+v_{cj}^{1/3})^3}{8} \\
        k_{ij} &= 1 -\frac{\sqrt{v_{ci}v_{cj}}}{v_{cij}} \\
        T_{cij} &= \sqrt{T_{ci}T_{cj}}(1-k_{ij}) \\
        Z_{cij} &= \frac{Z_{ci}+Z_{cj}}{2} \\
        \omega_{ij} &= \frac{\omega_{i}+\omega_{j}}{2} \\
        P_{cij} &= \frac{Z_{cij} R T_{cij}}{v_{cij}}
    \end{aligned}

    The calculation of the individual coefficients is handled by
    [`B_pure`](B_pure.md).

    **References**

    *   RC Reid, JM Prausniz, and BE Poling. The properties of gases & liquids
        4th edition, 1986, p. 80.

    Parameters
    ----------
    T : float
        Temperature [K].
    Tc : FloatVector (N)
        Critical temperatures of all components [K].
    Pc : FloatVector (N)
        Critical pressures of all components [Pa].
    Zc : FloatVector (N)
        Critical compressibility factors of all components.
    w : FloatVector (N)
        Acentric factors of all components.

    Returns
    -------
    FloatSquareMatrix (N,N)
        Matrix of interaction virial coefficients $B_{ij}$ [m³/mol].
    """
    vc = Zc * R * Tc / Pc
    N = Tc.size
    B = np.empty((N, N), dtype=np.float64)
    for i in range(N):
        for j in range(i, N):
            if i == j:
                B[i, j] = B_pure(T, Tc[i], Pc[i], w[i])
            else:
                vcm = (vc[i] ** (1 / 3) + vc[j] ** (1 / 3)) ** 3 / 8
                km = 1 - sqrt(vc[i] * vc[j]) / vcm
                Tcm = sqrt(Tc[i] * Tc[j]) * (1 - km)
                Zcm = (Zc[i] + Zc[j]) / 2
                wm = (w[i] + w[j]) / 2
                Pcm = Zcm * R * Tcm / vcm
                B[i, j] = B_pure(T, Tcm, Pcm, wm)
                B[j, i] = B[i, j]
    return B