def _debye_parameter_volume(temperature='25 degC'):
    '''
    Return the constant A_V, the Debye-Huckel limiting slope for apparent
    molar volume.
    
    Parameters
    ----------
    temperature : str Quantity, optional
                  String representing the temperature of the solution. Defaults to '25 degC' if not specified.
    
    Notes
    -----
    Takes the value 1.8305 cm ** 3 * kg ** 0.5 /  mol ** 1.5 at 25 C.
    This constant is calculated according to: [#]_

     .. math:: A_V = -2 A_{\\phi} R T [ {3 \\over \\epsilon} {{\\partial \\epsilon \\over \\partial p} \
     } - {{1 \\over \\rho}{\\partial \\rho \\over \\partial p} }]
     
    NOTE: at this time, the term in brackets (containing the partial derivatives) is approximate.
    These approximations give the correct value of the slope at 25 degC and 
    produce estimates with less than 10% error between 0 and 60 degC.
     
    The derivative of epsilon with respect to pressure is assumed constant (for atmospheric pressure)
    at -0.01275 1/MPa. Note that the negative sign does not make sense in light
    of real data, but is required to give the correct result.
     
    The second term is equivalent to the inverse of the bulk modulus of water, which
    is taken to be 2.2 GPa. [#]_
    
    References
    ----------
    .. [#] Archer, Donald G. and Wang, Peiming. "The Dielectric Constant of Water \
    and Debye-Huckel Limiting Law Slopes." /J. Phys. Chem. Ref. Data/ 19(2), 1990.
        
    .. [#] http://hyperphysics.phy-astr.gsu.edu/hbase/permot3.html
    
    Examples
    --------
    TODO
  
    
    See Also
    --------
    _debye_parameter_osmotic
    
    '''
    
    # TODO - add partial derivatives to calculation
    epsilon = h2o.water_dielectric_constant(unit(temperature))
    dedp = unit('-0.01275 1/MPa')
    result = -2 * _debye_parameter_osmotic(temperature) * unit.R * unit(temperature) * \
    (3 / epsilon * dedp - 1/unit('2.2 GPa'))
    #result = unit('1.898 cm ** 3 * kg ** 0.5 /  mol ** 1.5')
    
    if unit(temperature) != unit('25 degC'):
        logger.warning('Debye-Huckel limiting slope for volume is approximate when T is not equal to 25 degC')
    
    logger.info('Computed Debye-Huckel Limiting Slope for volume A^V = %s at %s' % (result,temperature))
    
    return result.to('cm ** 3 * kg ** 0.5 /  mol ** 1.5')
def _debye_parameter_B(temperature='25 degC'):
    '''
    Return the constant B used in the extended Debye-Huckel equation
    
    Parameters
    ----------
    temperature : str Quantity, optional
                  String representing the temperature of the solution. Defaults to '25 degC' if not specified.
    
    Notes
    -----
    The parameter B is equal to: [#]_

    .. math:: B = ( {8 \\pi N_A e^2 \\over 1000 \\epsilon k T} ) ^ {1 \\over 2}
    
    .. [#] Bockris and Reddy. /Modern Electrochemistry/, vol 1. Plenum/Rosetta, 1977, p.210.    
    
    Examples
    --------
    >>> _debye_parameter_B() #doctest: +ELLIPSIS
    0.3291...
    
    '''
    # TODO - fix this and resolve units
    param_B = ( 8 * math.pi * unit.avogadro_number * unit.elementary_charge ** 2 
    / (h2o.water_density(unit(temperature)) * unit.epsilon_0 * h2o.water_dielectric_constant(unit(temperature)) * unit.boltzmann_constant * unit(temperature)) )** 0.5
    return param_B.to_base_units()
def _debye_parameter_activity(temperature="25 degC"):
    """
    Return the constant A for use in the Debye-Huckel limiting law (base 10)
    
    Parameters
    ----------
    temperature : str Quantity, optional
                  String representing the temperature of the solution. Defaults to '25 degC' if not specified.
    
    Returns
    -------
    Quantity          The parameter A for use in the Debye-Huckel limiting law (base e)
    
    Notes
    -----
     
    The parameter A is equal to: [#]_
     
    ..  math::    
        A^{\\gamma} = {e^3 ( 2 \\pi N_A {\\rho})^{0.5} \\over (4 \\pi \\epsilon_o \\epsilon_r k T)^{1.5}}
    
    Note that this equation returns the parameter value that can be used to calculate
    the natural logarithm of the activity coefficient. For base 10, divide the
    value returned by 2.303. The value is often given in base 10 terms (0.509 at
    25 degC) in older textbooks.
    
    References
    ----------
    .. [#] Archer, Donald G. and Wang, Peiming. "The Dielectric Constant of Water \
    and Debye-Huckel Limiting Law Slopes." /J. Phys. Chem. Ref. Data/ 19(2), 1990.
        
    Examples
    --------
    >>> _debye_parameter_activity() #doctest: +ELLIPSIS
    1.17499...
    
    See Also
    --------
    _debye_parameter_osmotic
    
    """

    debyeparam = (
        unit.elementary_charge ** 3
        * (2 * math.pi * unit.avogadro_number * h2o.water_density(unit(temperature))) ** 0.5
        / (
            4
            * math.pi
            * unit.epsilon_0
            * h2o.water_dielectric_constant(unit(temperature))
            * unit.boltzmann_constant
            * unit(temperature)
        )
        ** 1.5
    )

    logger.info("Computed Debye-Huckel Limiting Law Constant A^{\\gamma} = %s at %s" % (debyeparam, temperature))
    return debyeparam.to("kg ** 0.5 / mol ** 0.5")
Beispiel #4
0
def _debye_parameter_activity(temperature="25 degC"):
    """
    Return the constant A for use in the Debye-Huckel limiting law (base 10)

    Parameters
    ----------
    temperature : str Quantity, optional
                  String representing the temperature of the solution. Defaults to '25 degC' if not specified.

    Returns
    -------
    Quantity          The parameter A for use in the Debye-Huckel limiting law (base e)

    Notes
    -----

    The parameter A is equal to: [#]_

    ..  math::
        A^{\\gamma} = {e^3 ( 2 \\pi N_A {\\rho})^{0.5} \\over (4 \\pi \\epsilon_o \\epsilon_r k T)^{1.5}}

    Note that this equation returns the parameter value that can be used to calculate
    the natural logarithm of the activity coefficient. For base 10, divide the
    value returned by 2.303. The value is often given in base 10 terms (0.509 at
    25 degC) in older textbooks.

    References
    ----------
    .. [#] Archer, Donald G. and Wang, Peiming. "The Dielectric Constant of Water \
    and Debye-Huckel Limiting Law Slopes." /J. Phys. Chem. Ref. Data/ 19(2), 1990.

    Examples
    --------
    >>> _debye_parameter_activity() #doctest: +ELLIPSIS
    1.17499...

    See Also
    --------
    _debye_parameter_osmotic

    """

    debyeparam = (unit.elementary_charge**3 *
                  (2 * math.pi * unit.avogadro_constant *
                   h2o.water_density(unit(temperature)))**0.5 /
                  (4 * math.pi * unit.epsilon_0 *
                   h2o.water_dielectric_constant(unit(temperature)) *
                   unit.boltzmann_constant * unit(temperature))**1.5)

    logger.info(
        "Computed Debye-Huckel Limiting Law Constant A^{\\gamma} = %s at %s" %
        (debyeparam, temperature))
    return debyeparam.to("kg ** 0.5 / mol ** 0.5")