pmutt.empirical.nasa.SingleNasa9

class pmutt.empirical.nasa.SingleNasa9(T_low, T_high, a)

Bases: EmpiricalBase

Stores the NASA9 polynomial for a defined interval. Inherits from EmpiricalBase

T_low

Lower temperature bound (in K)

Type:

float

T_high

High temperature bound (in K)

Type:

float

a

NASA9 polynomial to use between T_low and T_high

Type:

(9,) numpy.ndarray

__init__(T_low, T_high, a)

Methods

__init__(T_low, T_high, a)

compare_CpoR([T])

Compares the dimensionless heat capacity of the statistical model and the empirical model

compare_GoRT([T])

Compares the dimensionless Gibbs energy of the statistical model and the empirical model

compare_HoRT([T])

Compares the dimensionless enthalpy of the statistical model and the empirical model

compare_SoR([T])

Compares the dimensionless entropy of the statistical model and the empirical model

from_dict(json_obj)

Recreate an object from the JSON representation.

get_Cp(units, **kwargs)

Calculate the heat capacity (constant P)

get_CpoR(T)

Calculate the dimensionless heat capacity

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(**kwargs)

Calculates the dimensionless Helmholtz energy

get_G(units[, T])

Calculate the Gibbs energy

get_GoRT(**kwargs)

Calculates the dimensionless Gibbs free energy

get_H(units[, T])

Calculate the enthalpy

get_HoRT(T)

Calculate the dimensionless enthalpy

get_S(units, **kwargs)

Calculate the entropy

get_SoR(T)

Calculate the dimensionless heat capacity

get_U(units[, T])

Calculate the internal energy

get_UoRT()

Default method to calculate the dimensionless internal energy.

get_q()

Default method to calculate the partition coefficient.

plot_empirical([T_low, T_high, Cp_units, ...])

Plots the thermodynamic profiles between T_low and T_high using empirical relationship

plot_statmech([T_low, T_high, Cp_units, ...])

Plots the thermodynamic profiles between T_low and T_high using empirical relationship

plot_statmech_and_empirical([T_low, T_high, ...])

Plots the thermodynamic profiles between T_low and T_high using empirical relationship

to_cti([line_indent])

Writes the object in Cantera's CTI format.

to_dict()

Represents object as dictionary with JSON-accepted datatypes

compare_CpoR(T=None)

Compares the dimensionless heat capacity of the statistical model and the empirical model

Parameters:

T ((N,) numpy.ndarray or float, optional) – Temperatures (in K) to calculate CpoR. If None, generates a list of temperatures between self.T_low and self.T_high

Returns:

  • T ((N,) numpy.ndarray or float) – Temperatures in K

  • CpoR_model ((N,) numpy.ndarray or float) – Dimensionless heat capacity of original model

  • CpoR_empirical (((N,) numpy.ndarray or float) – Dimensionless heat capacity of empirical model

compare_GoRT(T=None)

Compares the dimensionless Gibbs energy of the statistical model and the empirical model

Parameters:

T ((N,) numpy.ndarray or float, optional) – Temperatures (in K) to calculate CpoR. If None, generates a list of temperatures between self.T_low and self.T_high

Returns:

  • T ((N,) numpy.ndarray or float) – Temperatures in K

  • CpoR_model ((N,) numpy.ndarray or float) – Dimensionless heat capacity of original model

  • CpoR_empirical ((N,) numpy.ndarray or float) – Dimensionless heat capacity of empirical model

compare_HoRT(T=None)

Compares the dimensionless enthalpy of the statistical model and the empirical model

Parameters:

T ((N,) numpy.ndarray or float, optional) – Temperatures (in K) to calculate CpoR. If None, generates a list of temperatures between self.T_low and self.T_high

Returns:

  • T ((N,) numpy.ndarray or float) – Temperatures in K

  • CpoR_model ((N,) numpy.ndarray or float) – Dimensionless heat capacity of original model

  • CpoR_empirical (((N,) numpy.ndarray or float) – Dimensionless heat capacity of empirical model

compare_SoR(T=None)

Compares the dimensionless entropy of the statistical model and the empirical model

Parameters:

T ((N,) numpy.ndarray or float, optional) – Temperatures (in K) to calculate CpoR. If None, generates a list of temperatures between self.T_low and self.T_high

Returns:

  • T ((N,) numpy.ndarray or float) – Temperatures in K

  • CpoR_model ((N,) numpy.ndarray or float) – Dimensionless heat capacity of original model

  • CpoR_empirical (((N,) numpy.ndarray or float) – Dimensionless heat capacity of empirical model

classmethod from_dict(json_obj)

Recreate an object from the JSON representation.

Parameters:

json_obj (dict) – JSON representation

Returns:

Nasa

Return type:

Nasa 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(T)

Calculate the dimensionless heat capacity

Parameters:

T (float or (N,) numpy.ndarray) – Temperature(s) in K

Returns:

CpoR – Dimensionless heat capacity

Return type:

float or (N,) numpy.ndarray

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(**kwargs)

Calculates the dimensionless Helmholtz energy

Parameters:

kwargs (keyword arguments) – Parameters needed by get_UoRT and get_SoR

Returns:

FoRT – Dimensionless 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(**kwargs)

Calculates the dimensionless Gibbs free energy

Parameters:

kwargs (keyword arguments) – Parameters needed by get_HoRT and get_SoR

Returns:

GoRT – Dimensionless Gibbs free 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(T)

Calculate the dimensionless enthalpy

Parameters:

T (float or (N,) numpy.ndarray) – Temperature(s) in K

Returns:

HoRT – Dimensionless enthalpy

Return type:

float or (N,) numpy.ndarray

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(T)

Calculate the dimensionless heat capacity

Parameters:

T (float or (N,) numpy.ndarray) – Temperature(s) in K

Returns:

CpoR – Dimensionless heat capacity

Return type:

float or (N,) numpy.ndarray

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()

Default method to calculate the dimensionless internal energy.

Returns:

UoRT – Returns 0

Return type:

float

get_q()

Default method to calculate the partition coefficient.

Returns:

q – Returns 1

Return type:

float

plot_empirical(T_low=None, T_high=None, Cp_units=None, H_units=None, S_units=None, G_units=None)

Plots the thermodynamic profiles between T_low and T_high using empirical relationship

Parameters:
  • T_low (float) – Lower temperature in K. If not specified, T_low attribute used.

  • T_high (float) – Upper temperature in K. If not specified, T_high attribute used.

  • Cp_units (str) – Units to plot heat capacity. See R() for accepted units. If not specified, dimensionless units used.

  • H_units (str) – Units to plot enthalpy. See R() for accepted units but omit the ‘/K’ (e.g. J/mol). If not specified, dimensionless units used.

  • S_units (str) – Units to plot entropy. See R() for accepted units. If not specified, dimensionless units used.

  • G_units (str) – Units to plot Gibbs free energy. See R() for accepted units but omit the ‘/K’ (e.g. J/mol). If not specified, dimensionless units used.

Returns:

plot_statmech(T_low=None, T_high=None, Cp_units=None, H_units=None, S_units=None, G_units=None, use_references=True)

Plots the thermodynamic profiles between T_low and T_high using empirical relationship

Parameters:
  • T_low (float) – Lower temperature in K. If not specified, T_low attribute used

  • T_high (float) – Upper temperature in K. If not specified, T_high attribute used

  • Cp_units (str) – Units to plot heat capacity. See R() for accepted units. If not specified, dimensionless units used.

  • H_units (str) – Units to plot enthalpy. See R() for accepted units but omit the ‘/K’ (e.g. J/mol). If not specified, dimensionless units used.

  • S_units (str) – Units to plot entropy. See R() for accepted units. If not specified, dimensionless units used.

  • G_units (str) – Units to plot Gibbs free energy. See R() for accepted units but omit the ‘/K’ (e.g. J/mol). If not specified, dimensionless units used.

Returns:

plot_statmech_and_empirical(T_low=None, T_high=None, Cp_units=None, H_units=None, S_units=None, G_units=None, use_references=True)

Plots the thermodynamic profiles between T_low and T_high using empirical relationship

Parameters:
  • T_low (float) – Lower temperature in K. If not specified, T_low attribute used

  • T_high (float) – Upper temperature in K. If not specified, T_high attribute used

  • Cp_units (str) – Units to plot heat capacity. See R() for accepted units. If not specified, dimensionless units used.

  • H_units (str) – Units to plot enthalpy. See R() for accepted units but omit the ‘/K’ (e.g. J/mol). If not specified, dimensionless units used.

  • S_units (str) – Units to plot entropy. See R() for accepted units. If not specified, dimensionless units used.

  • G_units (str) – Units to plot Gibbs free energy. See R() for accepted units but omit the ‘/K’ (e.g. J/mol). If not specified, dimensionless units used.

Returns:

to_cti(line_indent=False)

Writes the object in Cantera’s CTI format.

Parameters:

line_indent (bool, optional) – If True, the first line is indented by 16 spaces. Default is False

Returns:

CTI_str – Object represented as a CTI string.

Return type:

str

to_dict()

Represents object as dictionary with JSON-accepted datatypes

Returns:

obj_dict

Return type:

dict