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
- 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
- __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)
- get_CpoR()
Default method to calculate the dimensionless heat capacity at constant pressure.
- Returns:
CpoR – Returns 0
- Return type:
- get_Cv(units, **kwargs)
Calculate the heat capacity (constant V)
- get_CvoR()
Default method to calculate the dimensionless heat capacity at constant volume.
- Returns:
CvoR – Returns 0
- Return type:
- get_F(units, T=298.15, **kwargs)
Calculate the Helmholtz energy
- get_FoRT(x=0.0, T=298.15)
Calculates the excess Helmholtz energy
- get_G(units, T=298.15, **kwargs)
Calculate the Gibbs energy
- get_GoRT(x=0.0, T=298.15)
Calculates the excess Gibbs energy
- get_H(units, T=298.15, **kwargs)
Calculate the enthalpy
- get_HoRT(x=0.0, T=298.15)
Calculates the excess enthalpy
- get_S(units, **kwargs)
Calculate the entropy
- get_SoR()
Default method to calculate the dimensionless entropy.
- Returns:
SoR – Returns 0
- Return type:
- get_U(units, T=298.15, **kwargs)
Calculate the internal energy
- get_UoRT(x=0.0, T=298.15)
Calculates the excess internal energy
- get_q()
Default method to calculate the partition coefficient.
- Returns:
q – Returns 1
- Return type:
- 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
- Parameters:
i (float) – Index to remove from
self.intervals
andself.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:
- Returns:
lat_inter_str – Lateral interaction in CTI format
- Return type:
- to_dict()
Represents object as dictionary with JSON-accepted datatypes
- Returns:
obj_dict
- Return type:
- to_omkm_yaml(energy_unit='kcal', quantity_unit='mol', units=None)
Writes the object in Cantera’s YAML format.
- Parameters:
- Returns:
yaml_dict – Dictionary compatible with Cantera’s YAML format
- Return type: