pytherm.eos.psrk module

class pytherm.eos.psrk.PSRK(system: dict[str, float], cr_params, ms_params, activity_model: ActivityModel, omegas=None)[source]

Bases: EOS

Class for solving the Predictive Soave-Redlich-Kwong equation

Methods

get_a(system, T, b, ai, ge[, A])

Calculate a parameter for SRK using modified Huron-Vidal mixing rule

get_ai(alphas)

Calculate a_i coefficient for each component in system

get_alphas(T)

Calculate alpha coefficients using Mathias-Copeman equation

get_b(system)

Calculate b parameter for SQR equation using linear mixing rule

get_bi()

Calculate b_i coefficient for each component in system.

get_cubic_coef(system, T, P)

Return coefficient in cubic form of SQR V^3 + a1 * V^2 + a2*V + a3 =0

get_f(system, P, V, T)

Calculate fugacity coefficients for given P, V, T

get_ge(system, T)

_summary_

get_p(system, T, V)

Calculate p using PSRK equation

get_roots(system, P, T)

Solving PSRK equation for P and T

get_system

get_a(system: dict[str, float], T: float, b: float, ai: dict[str, float], ge: float, A=-0.64663) float[source]

Calculate a parameter for SRK using modified Huron-Vidal mixing rule

Parameters:
  • system (dict[str, float]) – Dictionary with component concentrations

  • T (float) – Temperature, [K]

  • b (float) – b parameter for SRK

  • ai (dict[str, float]) – a_i parameters dictionary for SRK

  • ge (float) – Excess Gibbs free energy

  • A (float, optional) – MHV constant, by default -0.64663

Returns:

a parameter for SRK

Return type:

float

get_ai(alphas: dict[str, float]) dict[str, float][source]

Calculate a_i coefficient for each component in system

Parameters:

alphas (dict[str, float]) – Mathias-Copeman alpha coefficients

Returns:

a_i coefficient for each component in system

Return type:

dict[str, float]

get_alphas(T: float) dict[str, float][source]

Calculate alpha coefficients using Mathias-Copeman equation

Parameters:

T (float) – Temperature, [K]

Returns:

alpha coefficients

Return type:

dict[str, float]

get_b(system: dict[str, float]) float[source]

Calculate b parameter for SQR equation using linear mixing rule

Parameters:

system (dict[str, float]) – Dictionary with component concentrations

Returns:

b parameter for SQR equation

Return type:

float

get_bi() dict[str, float][source]

Calculate b_i coefficient for each component in system. Calculated only once during the initialization of the object.

Returns:

b_i coefficient for each component in system

Return type:

dict[str, float]

get_cubic_coef(system: dict[str, float], T: float, P: float) tuple[source]

Return coefficient in cubic form of SQR V^3 + a1 * V^2 + a2*V + a3 =0

Parameters:
  • system (dict[str, float]) – Dictionary with component concentrations

  • T (float) – Temperature, [K]

  • P (float) – Pressure, [Pa]

Returns:

(a1, a2, a3)

Return type:

tuple

get_f(system: dict[str, float], P: float, V: float, T: float) dict[str, float][source]

Calculate fugacity coefficients for given P, V, T

Parameters:
  • system (dict[str, float]) – Dictionary with component concentrations

  • P (float) – Pressure, [Pa]

  • V (float) – Molar volume, [m^3/mol]

  • T (float) – Temperature, [K]

Returns:

Dictionary with fugacity coefficients for all components

Return type:

dict[str, float]

get_ge(system: dict[str, float], T: float) float[source]

_summary_

Parameters:
  • system (dict[str, float]) – Dictionary with component concentrations

  • T (float) – Temperature, [K]

Returns:

Excess Gibbs free energy

Return type:

float

get_p(system: dict[str, float], T: float, V: float) float[source]

Calculate p using PSRK equation

Parameters:
  • system (dict[str, float]) – Dictionary with component concentrations

  • T (float) – Temperature, [K]

  • V (float) – Molar volume, [m^3/mol]

Returns:

Pressure, [Pa]

Return type:

float

get_roots(system: dict[str, float], P: float, T: float) tuple[source]

Solving PSRK equation for P and T

Parameters:
  • system (dict[str, float]) – Dictionary with component concentrations

  • P (float) – Pressure, [Pa]

  • T (float) – Temperature, [K]

Returns:

One or two roots

Return type:

tuple

get_system()[source]