Example #1
0
def RI(CASRN, method=None):
    r'''This function handles the retrieval of a chemical's refractive
    index. Lookup is based on CASRNs. Will automatically select a data source
    to use if no method is provided; returns None if the data is not available.

    Function has data for approximately 4500 chemicals.

    Parameters
    ----------
    CASRN : str
        CASRN [-]

    Returns
    -------
    RI : float
        Refractive Index on the Na D line, [-]
    T : float or None
        Temperature at which refractive index reading was made; None if not
        available, [K]

    Other Parameters
    ----------------
    method : string, optional
        A string for the method name to use, as defined by constants in
        RI_methods

    Notes
    -----
    Only one source is available in this function. It is:

        * 'CRC', a compillation of Organic RI data in [1]_.

    Examples
    --------
    >>> RI(CASRN='64-17-5')
    (1.3611, 293.15)
    >>> RI("60-35-5")
    (1.4278, None)

    References
    ----------
    .. [1] Haynes, W.M., Thomas J. Bruno, and David R. Lide. CRC Handbook of
       Chemistry and Physics, 95E. Boca Raton, FL: CRC press, 2014.

    '''
    if not _RI_data_loaded: _load_RI_data()
    key = ('RI', 'RIT')
    if method:
        value = retrieve_from_df_dict(RI_sources, CASRN, key, method)
    else:
        value = retrieve_any_from_df_dict(RI_sources, CASRN, key)
    if value is None:
        value = (None, None)
    else:
        if isnan(value[1]):
            value = (value[0], None)
        else:
            value = tuple(value)
    return value
def Tb(CASRN, method=None):
    r'''This function handles the retrieval of a chemical's boiling
    point. Lookup is based on CASRNs. Will automatically select a data
    source to use if no method is provided; returns None if the data is not
    available.

    Preferred sources are 'CRC Physical Constants, organic' for organic
    chemicals, and 'CRC Physical Constants, inorganic' for inorganic
    chemicals. Function has data for approximately 13000 chemicals.

    Parameters
    ----------
    CASRN : str
        CASRN [-]

    Returns
    -------
    Tb : float
        Boiling temperature, [K]

    Other Parameters
    ----------------
    method : string, optional
        A string for the method name to use, as defined in the variable,
        `Tb_all_methods`.

    Notes
    -----
    A total of three methods are available for this function. They are:

        * 'CRC_ORG', a compillation of data on organics
          as published in [1]_.
        * 'CRC_INORG', a compillation of data on
          inorganic as published in [1]_.
        * 'YAWS', a large compillation of data from a
          variety of sources; no data points are sourced in the work of [2]_.

    Examples
    --------
    >>> Tb('7732-18-5')
    373.124

    See Also
    --------
    Tb_methods

    References
    ----------
    .. [1] Haynes, W.M., Thomas J. Bruno, and David R. Lide. CRC Handbook of
       Chemistry and Physics, 95E. Boca Raton, FL: CRC press, 2014.
    .. [2] Yaws, Carl L. Thermophysical Properties of Chemicals and
       Hydrocarbons, Second Edition. Amsterdam Boston: Gulf Professional
       Publishing, 2014.
    '''
    if not _phase_change_const_loaded: _load_phase_change_constants()
    if method:
        return retrieve_from_df_dict(Tb_sources, CASRN, 'Tb', method)
    else:
        return retrieve_any_from_df_dict(Tb_sources, CASRN, 'Tb')
Example #3
0
def Tt(CASRN, get_methods=False, method=None):
    r'''This function handles the retrieval of a chemical's triple temperature.
    Lookup is based on CASRNs. Will automatically select a data source to use
    if no method is provided; returns None if the data is not available.

    Returns data from [1]_, or a chemical's melting point if available.

    Parameters
    ----------
    CASRN : str
        CASRN [-]

    Returns
    -------
    Tt : float
        Triple point temperature, [K].

    Other Parameters
    ----------------
    method : string, optional
        A string for the method name to use, as defined in the variable,
        `Tt_all_methods`.

    Notes
    -----
    Median difference between melting points and triple points is 0.02 K.
    Accordingly, this should be more than good enough for engineering
    applications.

    Temperatures are on the ITS-68 scale.

    Examples
    --------
    Ammonia

    >>> Tt('7664-41-7')
    195.48

    See Also
    --------
    Tt

    References
    ----------
    .. [1] Staveley, L. A. K., L. Q. Lobo, and J. C. G. Calado. "Triple-Points
       of Low Melting Substances and Their Use in Cryogenic Work." Cryogenics
       21, no. 3 (March 1981): 131-144. doi:10.1016/0011-2275(81)90264-2.
    '''
    if not _triple_data_loaded: _load_triple_data()
    if method:
        if method == MELTING:
            return Tm(CASRN)
        else:
            return retrieve_from_df_dict(Tt_sources, CASRN, 'Tt68', method)
    else:
        Tt = retrieve_any_from_df_dict(Tt_sources, CASRN, 'Tt68')
        if Tt: return Tt
        return Tm(CASRN)
Example #4
0
def S0g(CASRN, method=None):
    r'''This function handles the retrieval of a chemical's absolute
    entropy at a reference temperature of 298.15 K and pressure of 1 bar,
    in the ideal gas state.

    Lookup is based on CASRNs. Will automatically select a data
    source to use if no method is provided; returns None if the data is not
    available.

    Parameters
    ----------
    CASRN : str
        CASRN [-]

    Returns
    -------
    S0g : float
        Ideal gas standard absolute entropy of compound, [J/mol/K]
        
    Other Parameters
    ----------------
    method : string, optional
        A string for the method name to use, as defined in the variable,
        `S0g_all_methods`
        
    Notes
    -----
    Function has data for approximately 5400 chemicals. Sources are:

        * 'CRC', from the CRC handbook (520 values)
        * 'YAWS', a large compillation of values, mostly estimated (4890 values)

    Examples
    --------
    >>> S0g('67-56-1')
    239.9
    >>> S0g('67-56-1', method='YAWS')
    239.88
    
    See Also
    --------
    S0g_methods

    References
    ----------
    .. [1] Haynes, W.M., Thomas J. Bruno, and David R. Lide. CRC Handbook of
       Chemistry and Physics. [Boca Raton, FL]: CRC press, 2014.
    .. [2] Yaws, Carl L. Thermophysical Properties of Chemicals and
       Hydrocarbons, Second Edition. Amsterdam Boston: Gulf Professional
       Publishing, 2014.
    '''
    if not _reaction_data_loaded: _load_reaction_data()
    if method:
        return retrieve_from_df_dict(S0g_sources, CASRN, 'S0g', method)
    else:
        return retrieve_any_from_df_dict(S0g_sources, CASRN, 'S0g')
Example #5
0
def Pt(CASRN, get_methods=False, method=None):
    r'''This function handles the retrieval of a chemical's triple pressure.
    Lookup is based on CASRNs. Will automatically select a data source to use
    if no method is provided; returns None if the data is not available.

    Returns data from [1]_ only.

    This function doe snot implement it but it is also possible to calculate
    the vapor pressure at the triple temperature from a vapor pressure
    correlation, if data is available; note most Antoine-type correlations do
    not extrapolate well to this low of a pressure.

    Parameters
    ----------
    CASRN : str
        CASRN [-]

    Returns
    -------
    Pt : float
        Triple point pressure, [Pa]
    methods : list, only returned if get_methods == True
        List of methods which can be used to obtain Pt with the
        given inputs

    Other Parameters
    ----------------
    method : string, optional
        A string for the method name to use, as defined in the variable,
        `Pt_all_methods`.

    Notes
    -----

    Examples
    --------
    Ammonia

    >>> Pt('7664-41-7')
    6079.5

    See Also
    --------
    Pt_methods

    References
    ----------
    .. [1] Staveley, L. A. K., L. Q. Lobo, and J. C. G. Calado. "Triple-Points
       of Low Melting Substances and Their Use in Cryogenic Work." Cryogenics
       21, no. 3 (March 1981): 131-144. doi:10.1016/0011-2275(81)90264-2.
    '''
    if not _triple_data_loaded: _load_triple_data()
    if method:
        return retrieve_from_df_dict(Pt_sources, CASRN, 'Pt', method)
    else:
        return retrieve_any_from_df_dict(Pt_sources, CASRN, 'Pt')
Example #6
0
def T_autoignition(CASRN, method=None):
    r'''
    This function handles the retrieval or calculation of a chemical's
    autoifnition temperature. Lookup is based on CASRNs. No predictive methods
    are currently implemented. Will automatically select a data source to use
    if no Method is provided; returns None if the data is not available.
    
    Parameters
    ----------
    CASRN : str
        CASRN [-]
    
    Returns
    -------
    Tautoignition : float
        Autoignition point of the chemical, [K].
    
    Other Parameters
    ----------------
    method : string, optional
        A string for the method name to use, as defined in the variable,
        `T_autoignition_all_methods`.
    
    Examples
    --------
    >>> T_autoignition(CASRN='71-43-2')
    771.15
    
    Notes
    -----
    Preferred source is 'IEC 60079-20-1 (2010)' [1]_, with the secondary source
    'NFPA 497 (2008)' [2]_ having very similar data.
    
    See Also
    --------
    T_autoignition_methods
    
    References
    ----------
    .. [1] IEC. “IEC 60079-20-1:2010 Explosive atmospheres - Part 20-1:
       Material characteristics for gas and vapour classification - Test
       methods and data.” https://webstore.iec.ch/publication/635. See also
       https://law.resource.org/pub/in/bis/S05/is.iec.60079.20.1.2010.pdf
    .. [2] National Fire Protection Association. NFPA 497: Recommended
       Practice for the Classification of Flammable Liquids, Gases, or Vapors
       and of Hazardous. NFPA, 2008.
    '''
    if not _safety_data_loaded: _load_safety_data()
    if method:
        return retrieve_from_df_dict(Tautoignition_sources, CASRN,
                                     'T_autoignition', method)
    else:
        return retrieve_any_from_df_dict(Tautoignition_sources, CASRN,
                                         'T_autoignition')
Example #7
0
def Hfl(CASRN, method=None):
    r'''This function handles the retrieval of a chemical's liquid standard
    phase heat of formation. The lookup is based on CASRNs. Will automatically
    select a data source to use if no method is provided; returns None if 
    the data is not available.

    Parameters
    ----------
    CASRN : str
        CASRN [-]

    Returns
    -------
    Hfl : float
        Liquid standard-state heat of formation, [J/mol]

    Other Parameters
    ----------------
    method : string, optional
        A string for the method name to use, as defined in the variable,
        `Hfl_all_methods`.

    Notes
    -----
    Sources are:

        * 'ATCT_L', the Active Thermochemical Tables version 1.112.
        * 'CRC', from the CRC handbook (1360 values)

    Examples
    --------
    >>> Hfl('67-56-1')
    -238400.0
    
    See Also
    --------
    Hfl_methods

    References
    ----------
    .. [1] Ruscic, Branko, Reinhardt E. Pinzon, Gregor von Laszewski, Deepti
       Kodeboyina, Alexander Burcat, David Leahy, David Montoy, and Albert F.
       Wagner. "Active Thermochemical Tables: Thermochemistry for the 21st
       Century." Journal of Physics: Conference Series 16, no. 1
       (January 1, 2005): 561. doi:10.1088/1742-6596/16/1/078.
    .. [2] Haynes, W.M., Thomas J. Bruno, and David R. Lide. CRC Handbook of
       Chemistry and Physics. [Boca Raton, FL]: CRC press, 2014.
    '''
    if not _reaction_data_loaded: _load_reaction_data()
    if method:
        return retrieve_from_df_dict(Hfl_sources, CASRN, 'Hfl', method)
    else:
        return retrieve_any_from_df_dict(Hfl_sources, CASRN, 'Hfl')
Example #8
0
def Hfus(CASRN, method=None):
    r'''This function handles the retrieval of a chemical's heat of fusion.
    Lookup is based on CASRNs. Will automatically select a data
    source to use if no method is provided; returns None if the data is not
    available.

    The Preferred source is 'CRC'. Function has data for approximately 1100
    chemicals.

    Parameters
    ----------
    CASRN : str
        CASRN [-]

    Returns
    -------
    Hfus : float
        Molar enthalpy of fusion at normal melting point, [J/mol]

    Other Parameters
    ----------------
    method : string, optional
        A string for the method name to use, as defined by the variable,
        `Hfus_all_methods`.

    Notes
    -----
    A total of one method is available for this function. They are:

    * 'CRC', a compillation of data on organics and inorganics as published
      in [1]_.


    Examples
    --------
    >>> Hfus('7732-18-5')
    6010.0

    See Also
    --------
    Hfus_methods

    References
    ----------
    .. [1] Haynes, W.M., Thomas J. Bruno, and David R. Lide. CRC Handbook of
       Chemistry and Physics, 95E. Boca Raton, FL: CRC press, 2014.
    '''
    if not _phase_change_const_loaded: _load_phase_change_constants()
    if method:
        return retrieve_from_df_dict(Hfus_sources, CASRN, 'Hfus', method)
    else:
        return retrieve_any_from_df_dict(Hfus_sources, CASRN, 'Hfus')
Example #9
0
def S0l(CASRN, method=None):
    r'''This function handles the retrieval of a chemical's absolute
    entropy at a reference temperature of 298.15 K and pressure of 1 bar,
    in the liquid state.

    Lookup is based on CASRNs. Will automatically select a data
    source to use if no method is provided; returns None if the data is not
    available.

    Parameters
    ----------
    CASRN : str
        CASRN [-]

    Returns
    -------
    S0l : float
        Ideal gas standard absolute entropy of compound, [J/mol/K]

    Other Parameters
    ----------------
    method : string, optional
        A string for the method name to use, as defined in the variable,
        `S0l_all_methods`.

    Notes
    -----
    Sources are:
        
        * 'CRC', from the CRC handbook

    Examples
    --------
    >>> S0l('7439-97-6') # Mercury
    75.9

    See Also
    --------
    S0l_methods

    References
    ----------
    .. [1] Haynes, W.M., Thomas J. Bruno, and David R. Lide. CRC Handbook of
       Chemistry and Physics. [Boca Raton, FL]: CRC press, 2014.
    '''
    if not _reaction_data_loaded: _load_reaction_data()
    if method:
        return retrieve_from_df_dict(S0l_sources, CASRN, 'S0l', method)
    else:
        return retrieve_any_from_df_dict(S0l_sources, CASRN, 'S0l')
Example #10
0
def Hfs(CASRN, method=None):
    r'''This function handles the retrieval of a chemical's solid/crystaline 
    standard phase heat of formation. The lookup is based on CASRNs. Will 
    automatically select a data source to use if no method is provided; returns 
    None if the data is not available.

    Parameters
    ----------
    CASRN : str
        CASRN [-]

    Returns
    -------
    Hfs : float
        Solid standard-state heat of formation, [J/mol]

    Other Parameters
    ----------------
    method : string, optional
        A string for the method name to use, as defined by constants in
        Hfs_methods

    Notes
    -----
    Sources are:

        * 'CRC', from the CRC handbook (1360 values)

    Examples
    --------
    >>> Hfs('101-81-5') # Diphenylmethane
    71500.0

    See Also
    --------
    Hfs_methods

    References
    ----------
    .. [1] Ruscic, Branko, Reinhardt E. Pinzon, Gregor von Laszewski, Deepti
       Kodeboyina, Alexander Burcat, David Leahy, David Montoy, and Albert F.
       Wagner. "Active Thermochemical Tables: Thermochemistry for the 21st
       Century." Journal of Physics: Conference Series 16, no. 1
       (January 1, 2005): 561. doi:10.1088/1742-6596/16/1/078.
    '''
    if not _reaction_data_loaded: _load_reaction_data()
    if method:
        return retrieve_from_df_dict(Hfs_sources, CASRN, 'Hfs', method)
    else:
        return retrieve_any_from_df_dict(Hfs_sources, CASRN, 'Hfs')
Example #11
0
def logP(CASRN, method=None):
    r'''This function handles the retrieval of a chemical's octanol-water
    partition coefficient. Lookup is based on CASRNs. Will automatically
    select a data source to use if no method is provided; returns None if the
    data is not available.

    Parameters
    ----------
    CASRN : str
        CASRN [-]

    Returns
    -------
    logP : float
        Octanol-water partition coefficient, [-]

    Other Parameters
    ----------------
    method : string, optional
        The method name to use. Accepted methods are 'SYRRES', or 'CRC',
        All valid values are also held in the list logP_methods.

    Notes
    -----
    Although matimatically this could be expressed with a logarithm in any
    base, reported values are published using a  base 10 logarithm.

    .. math::
        \log_{10} P_{ oct/wat} = \log_{10}\left(\frac{\left[{solute}
        \right]_{ octanol}^{un-ionized}}{\left[{solute}
        \right]_{ water}^{ un-ionized}}\right)

    Examples
    --------
    >>> logP('67-56-1')
    -0.74

    References
    ----------
    .. [1] Syrres. 2006. KOWWIN Data, SrcKowData2.zip.
       http://esc.syrres.com/interkow/Download/SrcKowData2.zip
    .. [2] Haynes, W.M., Thomas J. Bruno, and David R. Lide. CRC Handbook of
       Chemistry and Physics, 95E. Boca Raton, FL: CRC press, 2014.
    '''
    if not _logP_data_loaded: _load_logP_data()
    if method:
        return retrieve_from_df_dict(logP_sources, CASRN, 'logP', method)
    else:
        return retrieve_any_from_df_dict(logP_sources, CASRN, 'logP')
Example #12
0
def S0s(CASRN, method=None):
    r'''This function handles the retrieval of a chemical's absolute
    entropy at a reference temperature of 298.15 K and pressure of 1 bar,
    in the solid state. Lookup is based on CASRNs. Will automatically select a 
    data source to use if no method is provided; returns None if the data is not
    available.

    Parameters
    ----------
    CASRN : str
        CASRN [-]

    Returns
    -------
    S0s : float
        Ideal gas standard absolute entropy of compound, [J/mol/K]

    Other Parameters
    ----------------
    method : string, optional
        A string for the method name to use, as defined by constants in
        `S0s_all_methods`.

    Notes
    -----
    Sources are:

        * 'CRC', from the CRC handbook (1360 values)

    Examples
    --------
    >>> S0s('7439-93-2') # Lithium
    29.1
    
    See Also
    --------
    S0s_methods

    '''
    if not _reaction_data_loaded: _load_reaction_data()
    if method:
        return retrieve_from_df_dict(S0s_sources, CASRN, 'S0s', method)
    else:
        return retrieve_any_from_df_dict(S0s_sources, CASRN, 'S0s')
Example #13
0
def Hfg(CASRN, method=None):
    r'''This function handles the retrieval of a chemical's gas heat of
    formation. Lookup is based on CASRNs. Will automatically select a data
    source to use if no method is provided; returns None if the data is not
    available.
    
    Parameters
    ----------
    CASRN : str
        CASRN [-]

    Returns
    -------
    Hfg : float
        Ideal gas phase heat of formation, [J/mol]

    Other Parameters
    ----------------
    method : string, optional
        A string for the method name to use, as defined by constants in
        Hfg_methods

    Notes
    -----
    Function has data for approximately 8700 chemicals. Sources are:

        * 'ATCT_G', the Active Thermochemical Tables version 1.112 (600 values)
        * 'TRC', from a 1994 compilation (1750 values)
        * 'CRC', from the CRC handbook (1360 values)
        * 'YAWS', a large compillation of values, mostly estimated (5000 values)

    'TRC' data may have come from computational procedures, for example petane
    is off by 30%.

    Examples
    --------
    >>> Hfg('67-56-1')
    -200700.0
    >>> Hfg('67-56-1', method='YAWS')
    -200900.0
    >>> Hfg('67-56-1', method='CRC')
    -201000.0
    >>> Hfg('67-56-1', method='TRC')
    -190100.0

    See Also
    --------
    Hfg_methods

    References
    ----------
    .. [1] Ruscic, Branko, Reinhardt E. Pinzon, Gregor von Laszewski, Deepti
       Kodeboyina, Alexander Burcat, David Leahy, David Montoy, and Albert F.
       Wagner. "Active Thermochemical Tables: Thermochemistry for the 21st
       Century." Journal of Physics: Conference Series 16, no. 1
       (January 1, 2005): 561. doi:10.1088/1742-6596/16/1/078.
    .. [2] Frenkelʹ, M. L, Texas Engineering Experiment Station, and
       Thermodynamics Research Center. Thermodynamics of Organic Compounds in
       the Gas State. College Station, Tex.: Thermodynamics Research Center,
       1994.
    .. [3] Haynes, W.M., Thomas J. Bruno, and David R. Lide. CRC Handbook of
       Chemistry and Physics. [Boca Raton, FL]: CRC press, 2014.
    .. [4] Yaws, Carl L. Thermophysical Properties of Chemicals and
       Hydrocarbons, Second Edition. Amsterdam Boston: Gulf Professional
       Publishing, 2014.
    '''
    if not _reaction_data_loaded: _load_reaction_data()
    if method:
        return retrieve_from_df_dict(Hfg_sources, CASRN, 'Hfg', method)
    else:
        return retrieve_any_from_df_dict(Hfg_sources, CASRN, 'Hfg')
Example #14
0
def LFL(Hc=None, atoms=None, CASRN='', method=None):
    r'''This function handles the retrieval or calculation of a chemical's
    Lower Flammability Limit. Lookup is based on CASRNs. Will automatically 
    select a data source to use if no Method is provided; returns None if the
    data is not available.
    
    Parameters
    ----------
    Hc : float, optional
        Heat of combustion of gas [J/mol].
    atoms : dict, optional
        Dictionary of atoms and atom counts.
    CASRN : str, optional
        CASRN, [-]
    
    Returns
    -------
    LFL : float
        Lower flammability limit of the gas in an atmosphere at STP, [mole fraction].
    
    Other Parameters
    ----------------
    method : string, optional
        A string for the method name to use, as defined in the variable,
        `LFL_all_methods`.
    
    Examples
    --------
    >>> LFL(CASRN='71-43-2')
    0.012
    >>> LFL(Hc=-890590.0, atoms={'C': 1, 'H': 4}, CASRN='74-82-8')
    0.044000000000000004
    
    Notes
    -----
    Preferred source is 'IEC 60079-20-1 (2010)' [1]_, with the secondary source
    'NFPA 497 (2008)' [2]_ having very similar data. If the heat of combustion
    is provided, the estimation method :obj:`Suzuki_LFL` can be used. If the atoms
    of the molecule are available, the method :obj:`Crowl_Louvar_LFL` can be used.
    
    References
    ----------
    .. [1] IEC. “IEC 60079-20-1:2010 Explosive atmospheres - Part 20-1:
       Material characteristics for gas and vapour classification - Test
       methods and data.” https://webstore.iec.ch/publication/635. See also
       https://law.resource.org/pub/in/bis/S05/is.iec.60079.20.1.2010.pdf
    .. [2] National Fire Protection Association. NFPA 497: Recommended
       Practice for the Classification of Flammable Liquids, Gases, or Vapors
       and of Hazardous. NFPA, 2008.
    
    '''
    if not _safety_data_loaded: _load_safety_data()
    if not method:
        LFL = retrieve_any_from_df_dict(LFL_sources, CASRN, 'LFL')
        if not LFL:
            if Hc: LFL = Suzuki_LFL(Hc)
            elif atoms: LFL = Crowl_Louvar_LFL(atoms)
        return LFL
    elif method == SUZUKI:
        return Suzuki_LFL(Hc)
    elif method == CROWLLOUVAR:
        return Crowl_Louvar_LFL(atoms)
    else:
        return retrieve_from_df_dict(LFL_sources, CASRN, 'LFL', method)
Example #15
0
def omega(CASRN, method=None):
    r'''Retrieve a chemical's acentric factor, `omega`.

    Automatically select a method to use if no method is provided;
    returns None if the data is not available.

    .. math::
        \omega \equiv -\log_{10}\left[\lim_{T/T_c=0.7}(P^{sat}/P_c)\right]-1.0

    Examples
    --------
    >>> omega(CASRN='64-17-5')
    0.635

    Parameters
    ----------
    CASRN : str
        CASRN [-]

    Returns
    -------
    omega : float
        Acentric factor of compound

    Other Parameters
    ----------------
    method : string, optional
        The method name to use. Accepted methods are 'PSRK', 'PD', or 'YAWS'.
        All valid values are also held in the variable `omega_all_methods`.

    Notes
    -----
    A total of three sources are available for this function. They are:

        * 'PSRK', a compillation of experimental and estimated data published 
          in the Appendix of [15]_, the fourth revision of the PSRK model.
        * 'PD', an older compillation of
          data published in (Passut & Danner, 1973) [16]_.
        * 'YAWS', a large compillation of data from a
          variety of sources; no data points are sourced in the work of [17]_.

    See Also
    --------
    omega_methods

    References
    ----------
    .. [1] Pitzer, K. S., D. Z. Lippmann, R. F. Curl, C. M. Huggins, and
       D. E. Petersen: The Volumetric and Thermodynamic Properties of Fluids.
       II. Compressibility Factor, Vapor Pressure and Entropy of Vaporization.
       J. Am. Chem. Soc., 77: 3433 (1955).
    .. [2] Horstmann, Sven, Anna Jabłoniec, Jörg Krafczyk, Kai Fischer, and
       Jürgen Gmehling. "PSRK Group Contribution Equation of State:
       Comprehensive Revision and Extension IV, Including Critical Constants
       and Α-Function Parameters for 1000 Components." Fluid Phase Equilibria
       227, no. 2 (January 25, 2005): 157-64. doi:10.1016/j.fluid.2004.11.002.
    .. [3] Passut, Charles A., and Ronald P. Danner. "Acentric Factor. A
       Valuable Correlating Parameter for the Properties of Hydrocarbons."
       Industrial & Engineering Chemistry Process Design and Development 12,
       no. 3 (July 1, 1973): 365-68. doi:10.1021/i260047a026.
    .. [4] Yaws, Carl L. Thermophysical Properties of Chemicals and
       Hydrocarbons, Second Edition. Amsterdam Boston: Gulf Professional
       Publishing, 2014.
    '''
    if method:
        return retrieve_from_df_dict(critical.omega_sources, CASRN, 'omega',
                                     method)
    else:
        return retrieve_any_from_df_dict(critical.omega_sources, CASRN,
                                         'omega')
Example #16
0
def dipole_moment(CASRN, method=None):
    r'''This function handles the retrieval of a chemical's dipole moment.
    Lookup is based on CASRNs. Will automatically select a data source to use
    if no method is provided; returns None if the data is not available.

    Preferred source is 'CCCBDB'. Considerable variation in reported data has
    found.

    Parameters
    ----------
    CASRN : str
        CASRN [-]

    Returns
    -------
    dipole : float
        Dipole moment, [debye]

    Other Parameters
    ----------------
    method : string, optional
        The method name to use. Accepted methods are 'CCCBDB', 'MULLER', or
        'POLING'. All valid values are also held in the list `dipole_all_methods`.

    Notes
    -----
    A total of three sources are available for this function. They are:

        * 'CCCBDB', a series of critically evaluated data for compounds in
          [1]_, intended for use in predictive modeling.
        * 'MULLER', a collection of data in a
          group-contribution scheme in [2]_.
        * 'POLING', in the appendix in [3].

    This function returns dipole moment in units of Debye. This is actually
    a non-SI unit; to convert to SI, multiply by 3.33564095198e-30 and its
    units will be in ampere*second^2 or equivalently and more commonly given,
    coulomb*second. The constant is the result of 1E-21/c, where c is the
    speed of light.

    Examples
    --------
    >>> dipole_moment(CASRN='64-17-5')
    1.44

    See Also
    --------
    dipole_moment_methods

    References
    ----------
    .. [1] NIST Computational Chemistry Comparison and Benchmark Database
       NIST Standard Reference Database Number 101 Release 17b, September 2015,
       Editor: Russell D. Johnson III http://cccbdb.nist.gov/
    .. [2] Muller, Karsten, Liudmila Mokrushina, and Wolfgang Arlt. "Second-
       Order Group Contribution Method for the Determination of the Dipole
       Moment." Journal of Chemical & Engineering Data 57, no. 4 (April 12,
       2012): 1231-36. doi:10.1021/je2013395.
    .. [3] Poling, Bruce E. The Properties of Gases and Liquids. 5th edition.
       New York: McGraw-Hill Professional, 2000.
    '''
    if not _dipole_data_loaded: _load_dipole_data()
    if method:
        return retrieve_from_df_dict(dipole_sources, CASRN, 'Dipole', method)
    else:
        return retrieve_any_from_df_dict(dipole_sources, CASRN, 'Dipole')
Example #17
0
def Stockmayer(CASRN='',
               Tm=None,
               Tb=None,
               Tc=None,
               Zc=None,
               omega=None,
               method=None):
    r'''This function handles the retrieval or calculation a chemical's
    Stockmayer parameter. Values are available from one source with lookup
    based on CASRNs, or can be estimated from 7 CSP methods.
    Will automatically select a data source to use if no method is provided;
    returns None if the data is not available.

    Preferred sources are 'Magalhães, Lito, Da Silva, and Silva (2013)' for
    common chemicals which had valies listed in that source, and the CSP method
    `Tee, Gotoh, and Stewart CSP with Tc, omega (1966)` for chemicals which
    don't.

    Examples
    --------
    >>> Stockmayer(CASRN='64-17-5')
    1291.41

    Parameters
    ----------
    CASRN : str, optional
        CASRN [-]
    Tm : float, optional
        Melting temperature of compound [K]
    Tb : float, optional
        Boiling temperature of compound [K]
    Tc : float, optional
        Critical temperature of compound, [K]
    Zc : float, optional
        Critical compressibility of compound, [-]
    omega : float, optional
        Acentric factor of compound, [-]

    Returns
    -------
    epsilon_k : float
        Lennard-Jones depth of potential-energy minimum over k, [K]

    Other Parameters
    ----------------
    method : string, optional
        A string for the method name to use, as defined by constants in
        Stockmayer_all_methods

    Notes
    -----
    These values are somewhat rough, as they attempt to pigeonhole a chemical
    into L-J behavior.

    The tabulated data is from [2]_, for 322 chemicals.

    References
    ----------
    .. [1] Bird, R. Byron, Warren E. Stewart, and Edwin N. Lightfoot.
       Transport Phenomena, Revised 2nd Edition. New York:
       John Wiley & Sons, Inc., 2006
    .. [2] Magalhães, Ana L., Patrícia F. Lito, Francisco A. Da Silva, and
       Carlos M. Silva. "Simple and Accurate Correlations for Diffusion
       Coefficients of Solutes in Liquids and Supercritical Fluids over Wide
       Ranges of Temperature and Density." The Journal of Supercritical Fluids
       76 (April 2013): 94-114. doi:10.1016/j.supflu.2013.02.002.
    '''
    if not _LJ_data_loaded: _load_LJ_data()
    if method is not None:
        if method == FLYNN:
            return epsilon_Flynn(Tc)
        elif method == BSLC:
            return epsilon_Bird_Stewart_Lightfoot_critical(Tc)
        elif method == BSLB:
            return epsilon_Bird_Stewart_Lightfoot_boiling(Tb)
        elif method == BSLM:
            return epsilon_Bird_Stewart_Lightfoot_melting(Tm)
        elif method == STIELTHODOS:
            return epsilon_Stiel_Thodos(Tc, Zc)
        elif method == TEEGOTOSTEWARD1:
            return epsilon_Tee_Gotoh_Steward_1(Tc)
        elif method == TEEGOTOSTEWARD2:
            return epsilon_Tee_Gotoh_Steward_2(Tc, omega)
        else:
            return retrieve_from_df_dict(LJ_sources, CASRN, 'epsilon', method)
    else:
        epsilon = retrieve_any_from_df_dict(LJ_sources, CASRN, 'epsilon')
        if epsilon is not None: return epsilon
        if Tc:
            if omega: return epsilon_Tee_Gotoh_Steward_2(Tc, omega)
            if Zc: return epsilon_Stiel_Thodos(Tc, Zc)
            return epsilon_Flynn(Tc)
        if Tb: return epsilon_Bird_Stewart_Lightfoot_boiling(Tb)
        if Tm: return epsilon_Bird_Stewart_Lightfoot_melting(Tm)
Example #18
0
def Tm(CASRN, method=None):
    r'''This function handles the retrieval of a chemical's melting
    point. Lookup is based on CASRNs. Will automatically select a data
    source to use if no method is provided; returns None if the data is not
    available.

    Preferred sources are 'Open Notebook Melting Points', with backup sources
    'CRC Physical Constants, organic' for organic chemicals, and
    'CRC Physical Constants, inorganic' for inorganic chemicals. Function has
    data for approximately 14000 chemicals.

    Parameters
    ----------
    CASRN : str
        CASRN [-]

    Returns
    -------
    Tm : float
        Melting temperature, [K]

    Other Parameters
    ----------------
    method : string, optional
        A string for the method name to use, as defined by the vairable
        `Tm_all_methods`.

    Notes
    -----
    A total of three sources are available for this function. They are:

        * 'OPEN_NTBKM, a compillation of data on organics
          as published in [1]_ as Open Notebook Melting Points; Averaged 
          (median) values were used when
          multiple points were available. For more information on this
          invaluable and excellent collection, see
          http://onswebservices.wikispaces.com/meltingpoint.
        * 'CRC_ORG', a compillation of data on organics
          as published in [2]_.
        * 'CRC_INORG', a compillation of data on
          inorganic as published in [2]_.

    Examples
    --------
    >>> Tm(CASRN='7732-18-5')
    273.15

    See Also
    --------
    Tm_methods

    References
    ----------
    .. [1] Bradley, Jean-Claude, Antony Williams, and Andrew Lang.
       "Jean-Claude Bradley Open Melting Point Dataset", May 20, 2014.
       https://figshare.com/articles/Jean_Claude_Bradley_Open_Melting_Point_Datset/1031637.
    .. [2] Haynes, W.M., Thomas J. Bruno, and David R. Lide. CRC Handbook of
       Chemistry and Physics, 95E. Boca Raton, FL: CRC press, 2014.
    '''
    if not _phase_change_const_loaded: _load_phase_change_constants()
    elif method:
        return retrieve_from_df_dict(Tm_sources, CASRN, 'Tm', method)
    else:
        return retrieve_any_from_df_dict(Tm_sources, CASRN, 'Tm')
Example #19
0
def molecular_diameter(CASRN=None,
                       Tc=None,
                       Pc=None,
                       Vc=None,
                       Zc=None,
                       omega=None,
                       Vm=None,
                       Vb=None,
                       method=None):
    r'''This function handles the retrieval or calculation a chemical's
    L-J molecular diameter. Values are available from one source with lookup
    based on CASRNs, or can be estimated from 9 CSP methods.
    Will automatically select a data source to use if no method is provided;
    returns None if the data is not available.

    Preferred sources are 'Magalhães, Lito, Da Silva, and Silva (2013)' for
    common chemicals which had valies listed in that source, and the CSP method
    `Tee, Gotoh, and Stewart CSP with Tc, Pc, omega (1966)` for chemicals which
    don't.

    Examples
    --------
    >>> molecular_diameter(CASRN='64-17-5')
    4.23738

    Parameters
    ----------
    CASRN : str, optional
        CASRN [-]
    Tc : float, optional
        Critical temperature, [K]
    Pc : float, optional
        Critical pressure, [Pa]
    Vc : float, optional
        Critical volume, [m^3/mol]
    Zc : float, optional
        Critical compressibility, [-]
    omega : float, optional
        Acentric factor of compound, [-]
    Vm : float, optional
        Molar volume of liquid at the melting point of the fluid [K]
    Vb : float, optional
        Molar volume of liquid at the boiling point of the fluid [K]

    Returns
    -------
    sigma : float
        Lennard-Jones molecular diameter, [Angstrom]

    Other Parameters
    ----------------
    method : string, optional
        A string for the method name to use, as defined by constants in
        molecular_diameter_all_methods

    Notes
    -----
    These values are somewhat rough, as they attempt to pigeonhole a chemical
    into L-J behavior.

    The tabulated data is from [2]_, for 322 chemicals.

    References
    ----------
    .. [1] Bird, R. Byron, Warren E. Stewart, and Edwin N. Lightfoot.
       Transport Phenomena, Revised 2nd Edition. New York:
       John Wiley & Sons, Inc., 2006
    .. [2] Magalhães, Ana L., Patrícia F. Lito, Francisco A. Da Silva, and
       Carlos M. Silva. "Simple and Accurate Correlations for Diffusion
       Coefficients of Solutes in Liquids and Supercritical Fluids over Wide
       Ranges of Temperature and Density." The Journal of Supercritical Fluids
       76 (April 2013): 94-114. doi:10.1016/j.supflu.2013.02.002.
    '''
    if not _LJ_data_loaded: _load_LJ_data()
    if method is not None:
        if method == FLYNN:
            return sigma_Flynn(Vc)
        elif method == BSLC1:
            return sigma_Bird_Stewart_Lightfoot_critical_1(Vc)
        elif method == BSLC2:
            return sigma_Bird_Stewart_Lightfoot_critical_2(Tc, Pc)
        elif method == TEEGOTOSTEWARD3:
            return sigma_Tee_Gotoh_Steward_1(Tc, Pc)
        elif method == SILVALIUMACEDO:
            return sigma_Silva_Liu_Macedo(Tc, Pc)
        elif method == BSLB:
            return sigma_Bird_Stewart_Lightfoot_boiling(Vb)
        elif method == BSLM:
            return sigma_Bird_Stewart_Lightfoot_melting(Vm)
        elif method == STIELTHODOSMD:
            return sigma_Stiel_Thodos(Vc, Zc)
        elif method == TEEGOTOSTEWARD4:
            return sigma_Tee_Gotoh_Steward_2(Tc, Pc, omega)
        else:
            return retrieve_from_df_dict(LJ_sources, CASRN, 'sigma', method)
    else:
        epsilon = retrieve_any_from_df_dict(LJ_sources, CASRN, 'sigma')
        if epsilon is not None: return epsilon
        if Tc:
            if Pc:
                if omega: return sigma_Tee_Gotoh_Steward_2(Tc, Pc, omega)
                return sigma_Silva_Liu_Macedo(Tc, Pc)
        if Vc:
            if Zc: return sigma_Stiel_Thodos(Vc, Zc)
            return sigma_Flynn(Vc)
        if Vb: return sigma_Bird_Stewart_Lightfoot_boiling(Vb)
        if Vm: return sigma_Bird_Stewart_Lightfoot_melting(Vm)
Example #20
0
def T_flash(CASRN, method=None):
    r'''
    This function handles the retrieval or calculation of a chemical's
    flash point. Lookup is based on CASRNs. No predictive methods are currently
    implemented. Will automatically select a data source to use if no method
    is provided; returns None if the data is not available.
    
    Examples
    --------
    >>> T_flash(CASRN='64-17-5')
    285.15
    
    Parameters
    ----------
    CASRN : str
        CASRN [-]
    
    Returns
    -------
    T_flash : float
        Flash point of the chemical, [K]
    
    Other Parameters
    ----------------
    method : string, optional
        A string for the method name to use, as defined in the variable,
        `T_flash_all_methods`,
    
    Notes
    -----
    Preferred source is 'IEC 60079-20-1 (2010)' [1]_, with the secondary source
    'NFPA 497 (2008)' [2]_ having very similar data. A third source 
    'Serat DIPPR (2017)' [3]_ provides third hand experimental but evaluated 
    data from the DIPPR database, version unspecified, for 870 compounds.
    
    The predicted values from the DIPPR databank are also available in the
    supporting material in [3]_, but are not included.
    
    See Also
    --------
    T_flash_methods
    
    References
    ----------
    .. [1] IEC. "IEC 60079-20-1:2010 Explosive atmospheres - Part 20-1:
       Material characteristics for gas and vapour classification - Test
       methods and data." https://webstore.iec.ch/publication/635. See also
       https://law.resource.org/pub/in/bis/S05/is.iec.60079.20.1.2010.pdf
    .. [2] National Fire Protection Association. NFPA 497: Recommended
       Practice for the Classification of Flammable Liquids, Gases, or Vapors
       and of Hazardous. NFPA, 2008.
    .. [3] Serat, Fatima Zohra, Ali Mustapha Benkouider, Ahmed Yahiaoui, and 
       Farid Bagui. "Nonlinear Group Contribution Model for the Prediction of 
       Flash Points Using Normal Boiling Points." Fluid Phase Equilibria 449 
       (October 15, 2017): 52-59. doi:10.1016/j.fluid.2017.06.008.
    
    '''
    if not _safety_data_loaded: _load_safety_data()
    if method:
        return retrieve_from_df_dict(Tflash_sources, CASRN, 'T_flash', method)
    else:
        return retrieve_any_from_df_dict(Tflash_sources, CASRN, 'T_flash')