CoolProp.Plots.Common module

class CoolProp.Plots.Common.Base2DObject(x_type, y_type, state=None, small=None)

Bases: object

A container for shared settings and constants for the isolines and the property plots.

HS = 386
PD = 234
PH = 235
PLOTS = {'PS': 236, 'PT': 219, 'HS': 386, 'TS': 226, 'PD': 234, 'TD': 224, 'PH': 235}
PLOTS_INV = {224: 'TD', 386: 'HS', 234: 'PD', 235: 'PH', 236: 'PS', 226: 'TS', 219: 'PT'}
PS = 236
PT = 219
PU = 240
TD = 224
TS = 226
critical_state
state
x_index
y_index
class CoolProp.Plots.Common.BaseDimension(add_SI=0.0, mul_SI=1.0, off_SI=0.0, label='', symbol='', unit='')

Bases: CoolProp.Plots.Common.BaseQuantity

A dimension is a class that extends the BaseQuantity and adds a label, a symbol and a unit label

label
symbol
unit
class CoolProp.Plots.Common.BasePlot(fluid_ref, graph_type, unit_system='KSI', tp_limits='DEF', **kwargs)

Bases: CoolProp.Plots.Common.Base2DObject

The base class for all plots. It can be instantiated itself, but provides many general facilities to be used in the different plots.

HI_FACTOR = 2.25
ID_FACTOR = 10.0
LINE_PROPS = {34: {'color': 'DarkBlue', 'lw': 0.25}, 35: {'color': 'DarkGreen', 'lw': 0.25}, 36: {'color': 'DarkOrange', 'lw': 0.25}, 19: {'color': 'Darkred', 'lw': 0.25}, 20: {'color': 'DarkCyan', 'lw': 0.25}, 21: {'color': 'black', 'lw': 0.25}}
LO_FACTOR = 1.01
PROPERTIES = {34: 'density', 35: 'specific enthalpy', 36: 'specific entropy', 40: 'specific internal energy', 19: 'temperature', 20: 'pressure'}
TP_LIMITS = {'NONE': [None, None, None, None], 'ACHP': [173.15, 493.15, 25000.0, 2.25], 'ORC': [273.15, 673.15, 25000.0, 2.25], 'DEF': [1.01, 2.25, 1.01, 2.25]}
UNIT_SYSTEMS = {'SI': <CoolProp.Plots.Common.SIunits object at 0x10d736e10>, 'KSI': <CoolProp.Plots.Common.KSIunits object at 0x10d736f90>, 'EUR': <CoolProp.Plots.Common.EURunits object at 0x10d89fd50>}
axis
figure
static generate_ranges(itype, imin, imax, num)

Generate a range for a certain property

get_Tp_limits()

Get the limits for the graphs in temperature and pressure, based on the active units: [Tmin, Tmax, pmin, pmax]

get_axis_limits(x_index=None, y_index=None)

Returns the previously set limits or generates them and converts the default values to the selected unit system. Returns a list containing [xmin, xmax, ymin, ymax]

static get_x_y_dydx(xv, yv, x)

Get x and y coordinates and the linear interpolation derivative

grid(b=None, **kwargs)
inline_label(xv, yv, x=None, y=None)

This will give the coordinates and rotation required to align a label with a line on a plot in axis units.

limits

Returns [Tmin,Tmax,pmin,pmax] as value or factors

props
savefig(*args, **kwargs)
set_Tp_limits(limits)

Set the limits for the graphs in temperature and pressure, based on the active units: [Tmin, Tmax, pmin, pmax]

set_axis_limits(limits)

Set the limits of the internal axis object based on the active units, takes [xmin, xmax, ymin, ymax]

show()
system
title(title)
xlabel(xlabel)
ylabel(ylabel)
class CoolProp.Plots.Common.BaseQuantity(add_SI=0.0, mul_SI=1.0, off_SI=0.0)

Bases: object

A very basic property that can convert an input to and from a given unit system, note that the conversion from SI units starts with a multiplication. If you need to remove an offset, use the off_SI property. Examples with temperature: celsius = BaseQuantity(add_SI=-273.15) fahrenheit = BaseQuantity(add_SI=32.0, mul_SI=1.8, off_SI=-273.15) Examples with pressure: bar = BaseQuantity(mul_SI=1e-5) psi = BaseQuantity(mul_SI=0.000145037738)

add_SI
from_SI(value)
mul_SI
off_SI
to_SI(value)
class CoolProp.Plots.Common.EURunits

Bases: CoolProp.Plots.Common.KSIunits

class CoolProp.Plots.Common.IsoLine(i_index, x_index, y_index, value=0.0, state=None)

Bases: CoolProp.Plots.Common.Base2DObject

An object that holds the functions to calculate a line of a constant property in the dimensions of a property plot. This class only uses SI units.

VALID_REQ = 0.05
XY_SWITCH = {34: {224: None, 226: True, 234: None, 235: True, 236: True, 386: False, 219: False}, 35: {224: False, 226: False, 234: True, 235: None, 236: True, 386: None, 219: False}, 36: {224: False, 226: None, 234: True, 235: True, 236: None, 386: None, 219: True}, 19: {224: None, 226: None, 234: False, 235: True, 236: False, 386: False, 219: None}, 20: {224: False, 226: False, 234: None, 235: None, 236: None, 386: False, 219: None}, 21: {224: True, 226: True, 234: True, 235: True, 236: True, 386: True, 219: False}}
calc_range(xvals=None, yvals=None)
calc_sat_range(Trange=None, Prange=None, num=200)
get_update_pair()

Processes the values for the isoproperty and the graph dimensions to figure which should be used as inputs to the state update. Returns a tuple with the indices for the update call and the property constant. For an isobar in a Ts-diagram it returns the default order and the correct constant for the update pair: get_update_pair(CoolProp.iP,CoolProp.iSmass,CoolProp.iT) -> (0,1,2,CoolProp.PSmass_INPUTS) other values require switching and swapping.

i_index
sanitize_data()

Fill the series via interpolation

value
x
y
class CoolProp.Plots.Common.KSIunits

Bases: CoolProp.Plots.Common.SIunits

class CoolProp.Plots.Common.PropertyDict

Bases: object

A collection of dimensions for all the required quantities

D
H
P
Q
S
T
U
dimensions
class CoolProp.Plots.Common.SIunits

Bases: CoolProp.Plots.Common.PropertyDict

CoolProp.Plots.Common.get_critical_point(state)
CoolProp.Plots.Common.interpolate_values_1d(x, y, x_points=None, kind='linear')
CoolProp.Plots.Common.is_string(in_obj)
CoolProp.Plots.Common.process_fluid_state(fluid_ref, fractions='mole')

Check input for state object or fluid string

Parameters:
  • fluid_ref (str, CoolProp.AbstractState) –
  • fractions (str, switch to set mass, volu or mole fractions) –
Returns:

Return type:

CoolProp.AbstractState