lib.thermo module

Module with common thermodynamic utilities:

  • Thermo: Class with common functionality for special thermo model

  • ThermoWater: Thermo subclass with water specific properties, for iapws and freesteam

  • ThermoAdvanced: Thermo subclass with additional properties for advanced model like coolprop, meos

  • ThermoRefProp: Thermo subclass with specific properties availables in refprop

API reference

lib.thermo.translate(context: str, sourceText: str, disambiguation: str = None, n: int = -1) str
class lib.thermo.Thermo(**kwargs)[source]

Bases: object

Class with common functionality for special thermo model, children class are iapws, coolprop, refprop

Attributes:
calculable

Check input parameter to define calculation posibility

Methods

__call__(**kwargs)

Call self as a function.

calculo()

Calculate procedure

cleanOldKwargs(**kwargs)

Convert alternative input parameters

cleanOldValues(**kwargs)

Convert alternative input parameters

derivative(z, x, y, fase)

Calculate generic partial derivative: (δz/δx)y where x, y, z can be: P, T, v, u, h, s, g, a

fillNone(fase)

Fill properties in null phase with a explicative msg

getphase(**kwargs)

Return fluid phase kwarg: phase: direct msg Tc, Pc, T, P, x, region: to calculate by iapws

properties()

Return list with calculated properties availables in tuple format with name, key, unit

propertiesGlobal()

List properties only availables for global stream, not defined by phase

propertiesKey()

Extract keys from properties available

propertiesName()

Extract name from properties available

propertiesPhase()

List properties availables for single phase

propertiesUnit()

Extract units from properties available

readStatefromJSON(fluid)

Read state from JSON and populate instance

writeStatetoJSON(state, fase)

Write current instance state to JSON format to save to file

_bool = False
status = 0
msg = 'Unknown variables'
h = 0
s = 0
u = 0
a = 0
g = 0
__init__(**kwargs)[source]
kwargs = {}
_new(**kw)[source]

Create a new instance

cleanOldValues(**kwargs)[source]

Convert alternative input parameters

cleanOldKwargs(**kwargs)[source]

Convert alternative input parameters

property calculable

Check input parameter to define calculation posibility

calculo()[source]

Calculate procedure

_cp0(cp0)[source]

Set ideal properties to state

derivative(z, x, y, fase)[source]

Calculate generic partial derivative: (δz/δx)y where x, y, z can be: P, T, v, u, h, s, g, a

getphase(**kwargs)[source]

Return fluid phase kwarg:

phase: direct msg Tc, Pc, T, P, x, region: to calculate by iapws

classmethod properties()[source]

Return list with calculated properties availables in tuple format with name, key, unit

classmethod propertiesName()[source]

Extract name from properties available

classmethod propertiesKey()[source]

Extract keys from properties available

classmethod propertiesUnit()[source]

Extract units from properties available

classmethod _dictUnit()[source]
classmethod propertiesGlobal()[source]

List properties only availables for global stream, not defined by phase

classmethod propertiesPhase()[source]

List properties availables for single phase

_fillCorriente(corriente)[source]

Procedure to populate the corriente with the global advanced properties corriente: instance of corriente to populate

_writeGlobalState(corriente, state)[source]

Procedure to populate a state dict with the global advanced properties corriente: instance of corriente to populate state: dict properties

_readGlobalState(corriente, state)[source]
fillNone(fase)[source]

Fill properties in null phase with a explicative msg

writeStatetoJSON(state, fase)[source]

Write current instance state to JSON format to save to file

readStatefromJSON(fluid)[source]

Read state from JSON and populate instance

class lib.thermo.ThermoWater(**kwargs)[source]

Bases: Thermo

Custom specified thermo instance to add special properties for water

Methods

properties()

Return list with calculated properties availables in tuple format with name, key, unit

readStatefromJSON(fluid)

Read state from JSON and populate instance

writeStatetoJSON(state, fase)

Write current instance state to JSON format to save to file

classmethod properties()[source]

Return list with calculated properties availables in tuple format with name, key, unit

writeStatetoJSON(state, fase)[source]

Write current instance state to JSON format to save to file

readStatefromJSON(fluid)[source]

Read state from JSON and populate instance

class lib.thermo.ThermoAdvanced(**kwargs)[source]

Bases: Thermo

Custom specified thermo instance to add special properties for advanced model as coolprop, refprop and meos

Methods

properties()

Return list with calculated properties availables in tuple format with name, key, unit

propertiesGlobal()

List properties only availables for global stream, not defined by phase

readStatefromJSON(fluid)

Read state from JSON and populate instance

writeStatetoJSON(state, fase)

Write current instance state to JSON format to save to file

classmethod properties()[source]

Return list with calculated properties availables in tuple format with name, key, unit

classmethod propertiesGlobal()[source]

List properties only availables for global stream, not defined by phase

writeStatetoJSON(state, fase)[source]

Write current instance state to JSON format to save to file

readStatefromJSON(fluid)[source]

Read state from JSON and populate instance

class lib.thermo.ThermoRefProp(**kwargs)[source]

Bases: ThermoAdvanced

Custom specified thermo instance to add special properties for advanced model as coolprop, refprop and meos

Methods

properties()

Return list with calculated properties availables in tuple format with name, key, unit

propertiesGlobal()

List properties only availables for global stream, not defined by phase

readStatefromJSON(fluid)

Read state from JSON and populate instance

writeStatetoJSON(state, fase)

Write current instance state to JSON format to save to file

classmethod properties()[source]

Return list with calculated properties availables in tuple format with name, key, unit

classmethod propertiesGlobal()[source]

List properties only availables for global stream, not defined by phase

writeStatetoJSON(state, fase)[source]

Write current instance state to JSON format to save to file

readStatefromJSON(fluid)[source]

Read state from JSON and populate instance