pyPRISM.closure.HyperNettedChain module

class pyPRISM.closure.HyperNettedChain.HNC(apply_hard_core=False)[source]

Bases: pyPRISM.closure.HyperNettedChain.HyperNettedChain

Alias of HyperNettedChain

class pyPRISM.closure.HyperNettedChain.HyperNettedChain(apply_hard_core=False)[source]

Bases: pyPRISM.closure.AtomicClosure.AtomicClosure

HyperNettedChain closure

Mathematial Definition

\[c_{\alpha,\beta}(r) = \exp\left(\gamma_{\alpha,\beta}(r)-U_{\alpha,\beta}(r)\right) - 1.0 - \gamma_{\alpha,\beta}(r)\]
\[\gamma_{\alpha,\beta}(r) = h_{\alpha,\beta}(r) - c_{\alpha,\beta}(r)\]

Variables Definitions

  • \(h_{\alpha,\beta}(r)\)
    Total correlation function value at distance \(r\) between sites \(\alpha\) and \(\beta\).
  • \(c_{\alpha,\beta}(r)\)
    Direct correlation function value at distance \(r\) between sites \(\alpha\) and \(\beta\).
  • \(U_{\alpha,\beta}(r)\)
    Interaction potential value at distance \(r\) between sites \(\alpha\) and \(\beta\).

Description

The Hypernetted Chain Closure (HNC) is derived by expanding the direct correlation function, \(c(r)\), in powers of density shift from a reference state. See Reference [1] for a full derivation and discussion of this closure.

The change of variables is necessary in order to use potentials with hard cores in the computational setting. Written in the standard form, this closure diverges with divergent potentials, which makes it impossible to numerically solve.

Compared to the PercusYevick closure, the HNC closure is a more accurate approximation of the full expression for the direct correlation function. Depsite this, it can produce inaccurate, long-range fluctuations that make it difficult to employ in phase-separating systems. The HNC closure performs well for systems where there is a disparity in site diameters and is typically used for the larger site.

References

  1. Hansen, J.P.; McDonald, I.R.; Theory of Simple Liquids; Chapter 4, Section 4; 4th Edition (2013), Elsevier [link]

Example

import pyPRISM

sys = pyPRISM.System(['A','B'])

sys.closure['A','A'] = pyPRISM.closure.PercusYevick()
sys.closure['A','B'] = pyPRISM.closure.PercusYevick()
sys.closure['B','B'] = pyPRISM.closure.HypernettedChain()

# ** finish populating system object **

PRISM = sys.createPRISM()

PRISM.solve()
__init__(apply_hard_core=False)[source]

Contstructor

Parameters:apply_hard_core (bool) – If True, the total correlation function will be assumed to be -1 inside the core (\(r_{i,j}<(d_i + d_j)/2.0\)) and the closure will not be applied in this region. Defaults to True.
calculate(r, gamma)[source]

Calculate direct correlation function based on supplied \(\gamma\)

Parameters:
  • r (np.ndarray) – array of real-space values associated with \(\gamma\)
  • gamma (np.ndarray) – array of \(\gamma\) values used to calculate the direct correlation function