fugacity_test_2

despasito.thermodynamics.calc.fugacity_test_2

fugacity_test_2(P, T, xi, rho, Eos, step_size=0.001, n0=1, **kwargs)[source]

A consistency test where np.sum( xi * d(ln φ)/dn1) = 0 at constant temperature and pressure.

Parameters:
  • P (float) – [Pa] Pressure of the system

  • T (float) – [K] Temperature of the system

  • xi (numpy.ndarray) – Liquid mole fraction of each component, sum(xi) should equal 1.0

  • rho (float) – [mol/\(m^3\)] Molar density

  • Eos (obj) – An instance of the defined EOS class to be used in thermodynamic computations.

  • step_size (float, Optional, default=1e-3) – Step size in central difference method be aware that changing the step_size can change the inherent error in the derivative.

  • n0 (float, Optional, default=1.0) – Assumed number of moles in derivative, be aware that changing the step_size can change the inherent error in the derivative. For this example, n0 should be three orders of magnitude larger than the step_size to minimize error.

Returns:

Residual – Thermodynamically consistency residual, should be zero.

Return type:

float