Methods in the PC-SAFT class
SurfPack - Latest (beta)
The PC_SAFT
class, found in surfpack/pcsaft.py
, inherits the SAFT
class and implements several
contributions to the Helmholtz energy density, such as association and chain contributions.
Table of contents
- Constructor
- Utility methods
- Internal methods
- Profile property interfaces
- Helmholtz energy contributions
- Weighted densities
- Weight functions
Constructor
Construction method(s).
Table of contents
__init__(self, comps, hs_model=<class 'surfpack.saft_hardsphere.SAFT_WhiteBear'>, parameter_ref='default')
Initialises a PC-SAFT model.
Args:
comps (str) :
Comma separated component identifiers, following thermopack convention.
hs_model (SAFT_HardSphere) :
Model to use for the hard-sphere contribution. Default is SAFT_WhiteBear.
parameter_ref (str) :
Reference for parameter set to use (see ThermoPack).
Utility methods
Methods for computing specific parameters and contributions to the residual Helmholtz energy for PC-SAFT-type equations of state
Table of contents
get_characteristic_lengths(self)
Compute a characteristic length for the system.
Returns:
float :
The sigma-parameter of the first component.
Internal methods
Internal use, mainly documented for maintainers and developers.
Table of contents
__repr__(self)
Generates a unique string for this model, containing information about the parameters and hard-sphere model.
get_caching_id(self)
Get id that identifies this model. See Functional
for more information.
Returns:
str :
Unique id for initialised model.
Profile property interfaces
Compute properties using a given density profile, without iterating the density profile to ensure equilibrium.
Table of contents
reduced_helmholtz_energy_density(self, rho, T, dphidn=False, bulk=False, asarray=False, dphidT=False, dphidrho=False)
Compute the the reduced Helmholtz energy density
Args:
rho (list[Profile] or list[float]) :
Particle density for each species
T (float) :
Temperature [K]
bulk (bool) :
Default False. Set to True if rho
is list[float]
dphidn (bool) :
Compute derivative
dphidT (bool) :
Compute derivative
dphidrho (bool) :
Compute derivative
n_chain (list[Profile], optional) :
Pre-computed weighted densities.
Returns:
Profile or float :
The (reduced) chain helmholtz energy density [-]
Helmholtz energy contributions
Methods for computing various contributions to the Helmholtz energy that are present in all SAFT-based functionals.
Table of contents
association_helmholtz_energy_density(self, rho, T, bulk=False, dphidn=False, dphidT=False, dphidrho=False, n_assoc=None)
Compute the association contribution to the reduced Helmholtz energy density.
Args:
rho (list[Profile] or list[float]) :
Particle density for each species
T (float) :
Temperature [K]
bulk (bool) :
Default False. Set to True if rho
is list[float]
dphidn (bool) :
Compute derivative
dphidT (bool) :
Compute derivative
dphidrho (bool) :
Compute derivative
n_assoc (list[Profile], optional) :
Pre-computed weighted densities.
Returns:
Profile or float :
The (reduced) association helmholtz energy density [-]
chain_helmholtz_energy_density(self, rho, T, dphidrho=False, dphidn=False, dphidT=False, bulk=False, n_chain=None)
Compute the chain contribution to the reduced Helmholtz energy density
Args:
rho (list[Profile] or list[float]) :
Particle density for each species
T (float) :
Temperature [K]
bulk (bool) :
Default False. Set to True if rho
is list[float]
dphidn (bool) :
Compute derivative
dphidT (bool) :
Compute derivative
dphidrho (bool) :
Compute derivative
n_chain (list[Profile], optional) :
Pre-computed weighted densities.
Returns:
Profile or float :
The (reduced) chain helmholtz energy density [-]
Weighted densities
Methods to compute various weighted densities required by the different Helmholtz energy contributions.
Table of contents
get_assoc_weighted_densities(self, rho, T, bulk=False, dndrho=False, dndT=False)
Compute the component weighted densities
Args:
rho (list[Profile]) :
Density profiles [particles / Å^3] indexed as rho_arr[
T (float) :
Temperature [K], used to get radii and weights (in case of temp. dependent radii)
bulk (bool) :
If true, take a list[float] for rho_arr, and return a list[float]
dndrho (bool) :
If true, also return derivative (only for bulk)
dndT (bool) :
If true, also return derivative
Returns:
list[Profile] :
weighted densities [particles / Å^3], indexed as wts[
Optional 2d array (float) :
dndrho, derivatives of weighted densities, indexed as dndrho[
get_chain_weighted_densities(self, rho, T, bulk=False, dndrho=False, dndT=False)
Compute the weighted densities for the chain contribution
Args:
rho (list[Profile]) :
Density profiles [particles / Å^3] indexed as rho_arr[
T (float) :
Temperature [K], used to get radii and weights (in case of temp. dependent radii)
bulk (bool) :
If true, take a list[float] for rho_arr, and return a list[float]
dndrho (bool) :
If true, also return derivative (only for bulk)
dndT (bool) :
If true, also return derivative
Returns:
list[Profile] :
weighted densities [particles / Å^3], indexed as wts[
Optional 2d array (float) :
dndrho, derivatives of weighted densities, indexed as dndrho[
get_weighted_densities(self, rho, T, bulk=False, dndrho=False, dndT=False)
Compute all neccessary weighted densities for this model.
Args:
rho (list[Profile] or list[float]) :
The particle density of each species
T (float) :
Temperature [K]
bulk (bool) :
Default False. Set to True if rho
is list[float]
dndrho (bool) :
Compute derivative (only for bulk=True
)
dndT (bool) :
Compute derivative
Returns:
list[Profile] or list[float] :
Weighted densities
Optional 2d array (float) :
dndrho, derivatives of weighted densities, indexed as dndrho[
Weight functions
Get-methods for various weight functions.
Table of contents
get_association_weights(self, T, dwdT=False)
Get the weight functions for the association weighted densities, indexed as wts[
Args:
T (float) :
Temperature [K]
dwdT (bool) :
Compute derivative
Returns:
list[list[Analytical]] :
The weight functions.
get_chain_weights(self, T, dwdT=False)
Get the weight functions for the chain contribution, indexed as wts[
Args:
T (float) :
Temperature [K]
dwdT (bool) :
Compute derivative instead.
Returns:
list[list[Analytical]] :
The weight functions, shape (3 * ncomps, ncomps)
get_weights(self, T, dwdT=False)
Get all the weights used for weighted densities in a 2D array, indexed as weight[
Args:
T (float) :
Temperature [K], used to get hard sphere diameters
dwdT (bool) :
Compute temperature differentials
Return:
2D array [Analytical] :
Weight functions, indexed as weight[