pyPRISM.closure.PercusYevick module

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

Bases: pyPRISM.closure.PercusYevick.PercusYevick

Alias of PercusYevick

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

Bases: pyPRISM.closure.AtomicClosure.AtomicClosure

Percus Yevick closure evaluated in terms of a change of variables

Mathematial Definition

\[c_{\alpha,\beta}(r) = (\exp(-U_{\alpha,\beta}(r)) - 1.0) (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 Percus-Yevick (PY) is derived by expanding the exponential of the direct correlation function, \(c_{\alpha,\beta}(r)\), in powers of density shift from a reference state. See Reference [1] for a full derivation.

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.

This closure has been shown to be accurate for systems with hard cores (strongly repulsive at short distances) and when the potential is short ranged.

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.
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