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¶
- class lib.thermo.Thermo(**kwargs)[source]¶
Bases:
objectClass with common functionality for special thermo model, children class are iapws, coolprop, refprop
- Attributes:
calculableCheck 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
Return list with calculated properties availables in tuple format with name, key, unit
List properties only availables for global stream, not defined by phase
Extract keys from properties available
Extract name from properties available
List properties availables for single phase
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¶
- kwargs = {}¶
- property calculable¶
Check input parameter to define calculation posibility
- 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 propertiesGlobal()[source]¶
List properties only availables for global stream, not defined by phase
- _fillCorriente(corriente)[source]¶
Procedure to populate the corriente with the global advanced properties corriente: instance of corriente to populate
- class lib.thermo.ThermoWater(**kwargs)[source]¶
Bases:
ThermoCustom specified thermo instance to add special properties for water
Methods
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
- class lib.thermo.ThermoAdvanced(**kwargs)[source]¶
Bases:
ThermoCustom specified thermo instance to add special properties for advanced model as coolprop, refprop and meos
Methods
Return list with calculated properties availables in tuple format with name, key, unit
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
- class lib.thermo.ThermoRefProp(**kwargs)[source]¶
Bases:
ThermoAdvancedCustom specified thermo instance to add special properties for advanced model as coolprop, refprop and meos
Methods
Return list with calculated properties availables in tuple format with name, key, unit
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