Skip to content

polykin.thermo.eos¤

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/thermo/eos/virial.py
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
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