Exemple #1
0
    def calculate(self, T, P, zs, ws, method):
        r'''Method to calculate surface tension of a liquid mixture at
        temperature `T`, pressure `P`, mole fractions `zs` and weight fractions
        `ws` with a given method.

        This method has no exception handling; see :obj:`mixture_property <thermo.utils.MixtureProperty.mixture_property>`
        for that.

        Parameters
        ----------
        T : float
            Temperature at which to calculate the property, [K]
        P : float
            Pressure at which to calculate the property, [Pa]
        zs : list[float]
            Mole fractions of all species in the mixture, [-]
        ws : list[float]
            Weight fractions of all species in the mixture, [-]
        method : str
            Name of the method to use

        Returns
        -------
        sigma : float
            Surface tension of the liquid at given conditions, [N/m]
        '''
        if method == LINEAR:
            sigmas = [i(T) for i in self.SurfaceTensions]
            return mixing_simple(zs, sigmas)
        elif method == DIGUILIOTEJA:
            return Diguilio_Teja(T=T,
                                 xs=zs,
                                 sigmas_Tb=self.sigmas_Tb,
                                 Tbs=self.Tbs,
                                 Tcs=self.Tcs)
        elif method == WINTERFELDSCRIVENDAVIS:
            sigmas = [i(T) for i in self.SurfaceTensions]
            if self._correct_pressure_pure:
                rhoms = []
                for obj in self.VolumeLiquids:
                    rho = obj.TP_dependent_property(T, P)
                    #                    if rho is None:
                    #                        rho = obj.T_dependent_property(T)
                    rhoms.append(1.0 / rho)
            else:
                rhoms = [
                    1. / i.T_dependent_property(T) for i in self.VolumeLiquids
                ]
            return Winterfeld_Scriven_Davis(zs, sigmas, rhoms)
        else:
            raise Exception('Method not valid')
def test_Lorentz_Bray_Clarke():
    # Made up example
    T = 300.0
    P = 1e6
    zs = [.4, .3, .3]
    MWs = [16.04246, 30.06904, 44.09562]
    Tcs = [190.564, 305.32, 369.83]
    Pcs = [4599000.0, 4872000.0, 4248000.0]
    Vcs = [9.86e-05, 0.0001455, 0.0002]
    Vm = 0.002302491921416089

    mu = Lorentz_Bray_Clarke(T, P, Vm, zs, MWs, Tcs, Pcs, Vcs)
    assert_close(mu, 9.925488946486405e-06, rtol=1e-6)

    #  2,000 psig and 160°F.
    zs = [0.875, 0.083, 0.021, 0.006, 0.008, 0.003, 0.002, 0.001, 0.001]
    MWs = [16.04, 30.07, 44.09, 58.12, 58.12, 72.15, 72.15, 86.17, 114.00]
    Pcs = [
        667.8 * psi, 707.8 * psi, 616.3 * psi, 529.1 * psi, 550.7 * psi,
        490.4 * psi, 488.6 * psi, 436.9 * psi, 360.6 * psi
    ]
    Tcs = [
        R2K(343.0),
        R2K(549.8),
        R2K(665.7),
        R2K(734.7),
        R2K(765.3),
        R2K(828.8),
        R2K(845.4),
        R2K(913.4),
        R2K(1023.9)
    ]
    Vcs = [
        1.590 * foot**3 / lb, 2.370 * foot**3 / lb, 3.250 * foot**3 / lb,
        4.208 * foot**3 / lb, 4.080 * foot**3 / lb, 4.899 * foot**3 / lb,
        4.870 * foot**3 / lb, 5.929 * foot**3 / lb, 7.882 * foot**3 / lb
    ]
    P = atm + 2000 * psi
    T = F2K(160.0)

    MW = mixing_simple(zs, MWs)
    rho_mass = 6.74 * lb / foot**3
    rhom = rho_mass / MW
    Vm = 1.0 / rhom

    mu = Lorentz_Bray_Clarke(T, P, Vm, zs, MWs, Tcs, Pcs, Vcs)
    assert_close(mu, 1.636032602394696e-05)
Exemple #3
0
def Amgat(xs, Vms):
    r'''Calculate mixture liquid density using the Amgat mixing rule.
    Highly inacurate, but easy to use. Assumes idea liquids with
    no excess volume. Average molecular weight should be used with it to obtain
    density.

    .. math::
        V_{mix} = \sum_i x_i V_i

    or in terms of density:

    .. math::

        \rho_{mix} = \sum\frac{x_i}{\rho_i}

    Parameters
    ----------
    xs : array
        Mole fractions of each component, []
    Vms : array
        Molar volumes of each fluids at conditions [m^3/mol]

    Returns
    -------
    Vm : float
        Mixture liquid volume [m^3/mol]

    Notes
    -----
    Units are that of the given volumes.
    It has been suggested to use this equation with weight fractions,
    but the results have been less accurate.

    Examples
    --------
    >>> Amgat([0.5, 0.5], [4.057e-05, 5.861e-05])
    4.9590000000000005e-05
    '''
    return mixing_simple(xs, Vms)