relentless.simulate.Dilute#

class relentless.simulate.Dilute(initializer, operations=None)#

Simulation of a dilute system.

A dilute “simulation” is performed under the assumption that the radial distribution function \(g_{ij}(r)\) can be determined exactly from the pair potential \(u_{ij}(r)\):

\[g_{ij}(r) = e^{-\beta u_{ij}(r)}\]

The virial equation of state is used to calculate the pressure. The second virial coefficient (B) is computed as:

\[B = \sum_i \sum_j x_i x_j B_{ij}\]

where \(x_i = N_i/N\) is the mole fraction of component i (\(N = \sum_i N_i\)) and

\[B_{ij} = -\frac{1}{2} \int {\rm d}\mathbf{r} [e^{-\beta u_{ij}(|\mathbf{r}|)} - 1]\]

Using the number density and second virial coefficient, the pressure is:

\[P = k_B T (\rho + B\rho^2)\]

This approximation is only reasonable for low-density systems, but it can still quite be useful for debugging a script without needing to run a costly simulation. It can also be helpful for finding an initial guess for design variables before switching to a full simulation.

Methods

run(potentials, directory)

Run the simulation operations.

Attributes

initializer

Initialization operation.

operations

The operations to be performed during a simulation run.

property initializer#

Initialization operation.

Type:

InitializationOperation

property operations#

The operations to be performed during a simulation run.

Type:

list

run(potentials, directory)#

Run the simulation operations.

A new simulation instance is created to perform the run. It is intended to be destroyed at the end of the run to prevent memory leaks.

Parameters:
  • potentials (Potentials) – The interaction potentials.

  • directory (str or Directory) – Directory for output.

Returns:

The simulation instance after the operations are performed.

Return type:

SimulationInstance