direct_coexistence_method_util

Short description

@author: Moritz F P Becker

pyrid.evaluation.direct_coexistence_method_util.calc_phase_diagram(Histograms, cutoff)[source]

Calculates the phase diagram from a given density profile by identifying the dense and the dilute phase.

Parameters
Histogramfloat64[:]

Density profile.

cutofffloat64

Fraction of the maximum density at which to distinguish between dilute and dense phase.

Returns
tuple(float64, float64)

Volume fractions of the dense and the dilute phase.

pyrid.evaluation.direct_coexistence_method_util.calc_profile(path, moltype, box_lengths, axes, cells_axes, section)[source]

Calculates the density profile of a molecule population along a given coordinate axis.

Parameters
pathstring

directory of the hdf5 file.

moltypestring

Molecule type

box_lengthsfloat64[3]

Simulation box lengths

axes0, 1 or 2

Coordinate axis along which to calculate the density profile.

cells_axesint64

Number of cells / bins by which to divide the simulation box along the chosen axis.

sectionint64[2]

Time interval (section) over which the density profile is averaged.

Returns
float64[:]

Density profile / histogram

pyrid.evaluation.direct_coexistence_method_util.center_profile(Histograms0, box_lengths, axes, cells_axes)[source]

Centers the molecule density profile.

Parameters
Histogram0float64[:]

Density profile.

box_lengthsfloat64[3]

Simulation box lengths

axes0, 1 or 2

Coordinate axis corresponding to the density profile (axis along which the profile has been sampled).

cells_axesint64

Number of cells / bins along the chosen axis.

Returns
float64

Value by which to shift the density profile such that it is centered.

pyrid.evaluation.direct_coexistence_method_util.critical_Density(eps_csw, s2, phi_c)[source]

Equation to estimate the critical density / volume fraction. critical_Density() is called by critical_point_fit() for fitting. Based on: Silmore 2017, “Vapour–liquid phase equilibrium and surface tension of fully flexible Lennard–Jones chains”

Parameters
eps_cswfloat64

Interaction energy constant

s2float64

fitting parameter

phi_cfloat64

Volume fraction of the condensed (dense) phase.

Returns
float64

Critical density.

pyrid.evaluation.direct_coexistence_method_util.critical_Temp(eps_csw, d, eps_c, x)[source]

Equation to estimate the critical temperature (inverse interaction strength). critical_Temp() is called by critical_point_fit() for fitting. Based on: Silmore 2017, “Vapour–liquid phase equilibrium and surface tension of fully flexible Lennard–Jones chains”

Parameters
eps_cswfloat64

Interaction energy constant

dfloat64

fitting parameter

eps_cfloat64

Critical interaction energy constant of the highest-valency molecule (interaction energy at the critical point where the two phase regime ends).

Returns
float64

Critical temperature (inverse interaction strength)

pyrid.evaluation.direct_coexistence_method_util.critical_point_fit(pp_strength, dense, dilute)[source]

Estimates the critical temperature (inverse interaction strength) and density / volume fraction from a selection of phase diagram points.

Parameters
pp_strengthfloat64[:]

List of particle-particle interaction strengths.

densefloat64[:]

Volume fractions of the dense phase (condensate) corresponding to particle-particle interaction strengths kept in pp_strength.

dilutefloat64[:]

Volume fractions of the dilute phase corresponding to particle-particle interaction strengths kept in pp_strength.

Returns
tuple(float64, float64)

Estimates for the critical temperature (inverse interaction strength) and the critical density (volume fraction).

pyrid.evaluation.direct_coexistence_method_util.density_hyperbolic_tangent(z, z0, d, dense, dilute)[source]

The hyperbolic tangent function can be used to fit the density profile.

Parameters
zfloat64[:]

Location / Distance values along z-axis.

z0float64

Location shift.

dfloat64

fitting parameter

dense: `float64`

Volume fraction dense phase.

dilutefloat64

Volume fraction dilute phase.

Returns
float64[:]

Fit of the density profile.