pmutt.mixture.cov.PiecewiseCovEffect

class pmutt.mixture.cov.PiecewiseCovEffect(name_i, name_j, intervals, slopes, name=None)

Bases: _ModelBase

Models enthalpic contribution to coverage effect between two species using piecewise linear functions

name_i

Name of specie’s properties affected by coverage of specie_j

Type:

str

name_j

Name of specie affecting the properties of specie_i

Type:

str

intervals

Intervals (in ML) to change slopes. The first element of the list should be 0 and the list should be sorted in ascending order to correctly specify a piecewise function with mole fraction domain [0, 1]

Type:

list (length N) of float

slopes

Slopes (in kcal/mol) to use between the intervals

Type:

list (length N) of float

name

Name to assign. Default is None

Type:

str, optional

__init__(name_i, name_j, intervals, slopes, name=None)

Methods

__init__(name_i, name_j, intervals, slopes)

from_dict(json_obj)

Recreate an object from the JSON representation.

get_Cp(units, **kwargs)

Calculate the heat capacity (constant P)

get_CpoR()

Default method to calculate the dimensionless heat capacity at constant pressure.

get_Cv(units, **kwargs)

Calculate the heat capacity (constant V)

get_CvoR()

Default method to calculate the dimensionless heat capacity at constant volume.

get_F(units[, T])

Calculate the Helmholtz energy

get_FoRT([x, T])

Calculates the excess Helmholtz energy

get_G(units[, T])

Calculate the Gibbs energy

get_GoRT([x, T])

Calculates the excess Gibbs energy

get_H(units[, T])

Calculate the enthalpy

get_HoRT([x, T])

Calculates the excess enthalpy

get_S(units, **kwargs)

Calculate the entropy

get_SoR()

Default method to calculate the dimensionless entropy.

get_U(units[, T])

Calculate the internal energy

get_UoRT([x, T])

Calculates the excess internal energy

get_q()

Default method to calculate the partition coefficient.

insert(interval, slope)

Inserts the a new interval and slope for the piecewise function

pop(i)

Removes the interval and slope specified by an index

to_cti([energy_unit, quantity_unit, units])

Writes the lateral interaction in CTI format

to_dict()

Represents object as dictionary with JSON-accepted datatypes

to_omkm_yaml([energy_unit, quantity_unit, units])

Writes the object in Cantera's YAML format.

classmethod from_dict(json_obj)

Recreate an object from the JSON representation.

Parameters:

json_obj (dict) – JSON representation

Returns:

EmpiricalBase

Return type:

EmpiricalBase object

get_Cp(units, **kwargs)

Calculate the heat capacity (constant P)

Parameters:
  • units (str) – Units as string. See R() for accepted units.

  • kwargs (keyword arguments) – Parameters needed by get_CpoR

Returns:

Cp – Heat capacity (constant P) in appropriate units

Return type:

float

get_CpoR()

Default method to calculate the dimensionless heat capacity at constant pressure.

Returns:

CpoR – Returns 0

Return type:

float

get_Cv(units, **kwargs)

Calculate the heat capacity (constant V)

Parameters:
  • units (str) – Units as string. See R() for accepted units.

  • kwargs (keyword arguments) – Parameters needed by get_CvoR

Returns:

Cv – Heat capacity (constant V) in appropriate units

Return type:

float

get_CvoR()

Default method to calculate the dimensionless heat capacity at constant volume.

Returns:

CvoR – Returns 0

Return type:

float

get_F(units, T=298.15, **kwargs)

Calculate the Helmholtz energy

Parameters:
  • units (str) – Units as string. See R() for accepted units but omit the ‘/K’ (e.g. J/mol).

  • T (float, optional) – Temperature in K. Default is 298.15 K

  • kwargs (keyword arguments) – Parameters needed by get_FoRT

Returns:

F – Hemholtz energy in appropriate units

Return type:

float

get_FoRT(x=0.0, T=298.15)

Calculates the excess Helmholtz energy

Parameters:
  • x (float, optional) – Coverage (in ML) of species j. Default is 0

  • T (float, optional) – Temperature in K. Default is 298.15 K

Returns:

FoRT – Dimensionless excess Helmholtz energy

Return type:

float

get_G(units, T=298.15, **kwargs)

Calculate the Gibbs energy

Parameters:
  • units (str) – Units as string. See R() for accepted units but omit the ‘/K’ (e.g. J/mol).

  • T (float, optional) – Temperature in K. Default is 298.15 K

  • kwargs (keyword arguments) – Parameters needed by get_GoRT

Returns:

G – Gibbs energy in appropriate units

Return type:

float

get_GoRT(x=0.0, T=298.15)

Calculates the excess Gibbs energy

Parameters:
  • x (float, optional) – Coverage (in ML) of species j. Default is 0

  • T (float, optional) – Temperature in K. Default is 298.15 K

Returns:

GoRT – Dimensionless excess Gibbs energy

Return type:

float

get_H(units, T=298.15, **kwargs)

Calculate the enthalpy

Parameters:
  • units (str) – Units as string. See R() for accepted units but omit the ‘/K’ (e.g. J/mol).

  • T (float, optional) – Temperature in K. Default is 298.15 K

  • kwargs (keyword arguments) – Parameters needed by get_HoRT

Returns:

H – Enthalpy in appropriate units

Return type:

float

get_HoRT(x=0.0, T=298.15)

Calculates the excess enthalpy

Parameters:
  • x (float, optional) – Coverage (in ML) of species j. Default is 0

  • T (float, optional) – Temperature in K. Default is 298.15 K

Returns:

HoRT – Dimensionless excess enthalpy

Return type:

float

get_S(units, **kwargs)

Calculate the entropy

Parameters:
  • units (str) – Units as string. See R() for accepted units.

  • kwargs (keyword arguments) – Parameters needed by get_SoR

Returns:

S – Entropy in appropriate units

Return type:

float

get_SoR()

Default method to calculate the dimensionless entropy.

Returns:

SoR – Returns 0

Return type:

float

get_U(units, T=298.15, **kwargs)

Calculate the internal energy

Parameters:
  • units (str) – Units as string. See R() for accepted units but omit the ‘/K’ (e.g. J/mol).

  • T (float, optional) – Temperature in K. Default is 298.15 K

  • kwargs (keyword arguments) – Parameters needed by get_UoRT

Returns:

U – Internal energy in appropriate units

Return type:

float

get_UoRT(x=0.0, T=298.15)

Calculates the excess internal energy

Parameters:
  • x (float, optional) – Coverage (in ML) of species j. Default is 0

  • T (float, optional) – Temperature in K. Default is 298.15 K

Returns:

UoRT – Dimensionless internal energy

Return type:

float

get_q()

Default method to calculate the partition coefficient.

Returns:

q – Returns 1

Return type:

float

insert(interval, slope)

Inserts the a new interval and slope for the piecewise function

Parameters:
  • interval (float) – Interval to insert. It will automatically be inserted in the intervals list in the position so that piecewise function remains continuous

  • slope (float) – Slope to insert. Inserted into the same position as interval

pop(i)

Removes the interval and slope specified by an index

Parameters:

i (float) – Index to remove from self.intervals and self.slopes. Value cannot be 0 since removing this index would not allow mole fractions to span from 0 to 1

Raises:

ValueError – Raised when i = 0

to_cti(energy_unit='kcal', quantity_unit='mol', units=None)

Writes the lateral interaction in CTI format

Parameters:
  • energy_unit (str, optional) – Energy unit for slopes. Default is ‘kcal’

  • quantity_unit (str, optional) – Quantity unit for slopes. Default is ‘mol’

  • units (Units object) – If specified, energy_unit and quantity_unit are overwritten. Default is None.

Returns:

lat_inter_str – Lateral interaction in CTI format

Return type:

str

to_dict()

Represents object as dictionary with JSON-accepted datatypes

Returns:

obj_dict

Return type:

dict

to_omkm_yaml(energy_unit='kcal', quantity_unit='mol', units=None)

Writes the object in Cantera’s YAML format.

Parameters:
  • energy_unit (str, optional) – Energy unit for slopes. Default is ‘kcal’

  • quantity_unit (str, optional) – Quantity unit for slopes. Default is ‘mol’

  • units (Units object) – If specified, energy_unit is overwritten. Default is None.

Returns:

yaml_dict – Dictionary compatible with Cantera’s YAML format

Return type:

dict