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 = 408¶
- PD = 236¶
- PH = 237¶
- PLOTS = {'HS': 408, 'PD': 236, 'PH': 237, 'PS': 238, 'PT': 219, 'TD': 226, 'TS': 228}¶
- PLOTS_INV = {219: 'PT', 226: 'TD', 228: 'TS', 236: 'PD', 237: 'PH', 238: 'PS', 408: 'HS'}¶
- PS = 238¶
- PT = 219¶
- PU = 242¶
- TD = 226¶
- TS = 228¶
- property critical_state¶
- property state¶
- property x_index¶
- property y_index¶
- class CoolProp.Plots.Common.BaseDimension(add_SI=0.0, mul_SI=1.0, off_SI=0.0, label='', symbol='', unit='')¶
Bases:
BaseQuantity
A dimension is a class that extends the BaseQuantity and adds a label, a symbol and a unit label
- property label¶
- property symbol¶
- property unit¶
- class CoolProp.Plots.Common.BasePlot(fluid_ref, graph_type, unit_system='KSI', tp_limits='DEF', **kwargs)¶
Bases:
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 = {19: {'color': 'Darkred', 'lw': 0.25}, 20: {'color': 'DarkCyan', 'lw': 0.25}, 21: {'color': 'black', 'lw': 0.25}, 36: {'color': 'DarkBlue', 'lw': 0.25}, 37: {'color': 'DarkGreen', 'lw': 0.25}, 38: {'color': 'DarkOrange', 'lw': 0.25}}¶
- LO_FACTOR = 1.01¶
- PROPERTIES = {19: 'temperature', 20: 'pressure', 36: 'density', 37: 'specific enthalpy', 38: 'specific entropy', 42: 'specific internal energy'}¶
- TP_LIMITS = {'ACHP': [173.15, 493.15, 25000.0, 2.25], 'DEF': [1.01, 2.25, 1.01, 2.25], 'NONE': [None, None, None, None], 'ORC': [273.15, 673.15, 25000.0, 2.25]}¶
- UNIT_SYSTEMS = {'EUR': <CoolProp.Plots.Common.EURunits object>, 'KSI': <CoolProp.Plots.Common.KSIunits object>, 'SI': <CoolProp.Plots.Common.SIunits object>}¶
- property axis¶
- property 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.
- property limits¶
Returns [Tmin,Tmax,pmin,pmax] as value or factors
- property 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()¶
- property 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)
- property add_SI¶
- from_SI(value)¶
- property mul_SI¶
- property off_SI¶
- to_SI(value)¶
- class CoolProp.Plots.Common.IsoLine(i_index, x_index, y_index, value=0.0, state=None)¶
Bases:
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 = {19: {219: None, 226: None, 228: None, 236: False, 237: True, 238: False, 408: False}, 20: {219: None, 226: False, 228: False, 236: None, 237: None, 238: None, 408: False}, 21: {219: False, 226: True, 228: True, 236: True, 237: True, 238: True, 408: True}, 36: {219: False, 226: None, 228: True, 236: None, 237: True, 238: True, 408: False}, 37: {219: False, 226: False, 228: False, 236: True, 237: None, 238: True, 408: None}, 38: {219: True, 226: False, 228: None, 236: True, 237: True, 238: None, 408: None}}¶
- 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.
- property i_index¶
- sanitize_data()¶
Fill the series via interpolation
- property value¶
- property x¶
- property y¶
- class CoolProp.Plots.Common.PropertyDict¶
Bases:
object
A collection of dimensions for all the required quantities
- property D¶
- property H¶
- property P¶
- property Q¶
- property S¶
- property T¶
- property U¶
- property dimensions¶
- class CoolProp.Plots.Common.SIunits¶
Bases:
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) –
- Return type: