Call signature:
DerivTerms(OutputName, T, rho, Fluid) --> float
where Fluid is a string with a valid CoolProp fluid name, and T and rho are the temperature in K and density in kg/m 3 . The value OutputName is one of the strings in the table below:
OutputName | Description |
---|---|
dpdT | Derivative of pressure with respect to temperature at constant density [kPa/K] |
dpdrho | Derivative of pressure with respect to density at constant temperature [kPa/(kg/m3)] |
Z | Compressibility factor [-] |
dZ_dDelta | Derivative of Z with respect to reduced density [-] |
dZ_dTau | Derivative of Z with respect to inverse reduced temperature [-] |
VB | Second virial coefficient [m3/kg] |
dBdT | Derivative of second virial coefficient with respect to temperature [m3/kg/K] |
VC | Third virial coefficient [m6/kg2] |
dCdT | Derivative of third virial coefficient with respect to temperature [m6/kg2/K] |
phir | Residual non-dimensionalized Helmholtz energy [-] |
dphir_dTau | Partial of residual non-dimensionalized Helmholtz energy with respect to inverse reduced temperature [-] |
d2phir_dTau2 | Second partial of residual non-dimensionalized Helmholtz energy with respect to inverse reduced temperature [-] |
dphir_dDelta | Partial of residual non-dimensionalized Helmholtz energy with respect to reduced density [-] |
d2phir_dDelta2 | Second partial of residual non-dimensionalized Helmholtz energy with respect to reduced density [-] |
d2phir_dDelta_dTau | First cross-partial of residual non-dimensionalized Helmholtz energy [-] |
d3phir_dDelta2_dTau | Second cross-partial of residual non-dimensionalized Helmholtz energy [-] |
phi0 | Ideal-gas non-dimensionalized Helmholtz energy [-] |
dphi0_dTau | Partial of ideal-gas non-dimensionalized Helmholtz energy with respect to inverse reduced temperature [-] |
d2phi0_dTau2 | Second partial of ideal-gas non-dimensionalized Helmholtz energy with respect to inverse reduced temperature [-] |
dphi0_dDelta | Partial of ideal-gas non-dimensionalized Helmholtz energy with respect to reduced density [-] |
d2phi0_dDelta2 | Second partial of ideal-gas non-dimensionalized Helmholtz energy with respect to reduced density [-] |
IsothermalCompressibility | Isothermal compressibility [1/kPa] |
Make the DerivTerms function handle different kinds of unit sets. Use kSI or SI to identify your desired unit system. Both input and output values have to be from the same unit set.
Convert temperature in degrees Fahrenheit to Kelvin
Return a list of strings of all fluid names
Returns: | FluidsList – All the fluids that are included in CoolProp |
---|---|
Return type: | list of strings of fluid names |
Notes
Here is an example:
In [0]: from CoolProp.CoolProp import FluidsList
In [1]: FluidsList()
This is a more computationally efficient version of the Props() function as it uses integer keys for the input and output codes as well as the fluid index for the fluid. It can only be used with CoolProp fluids. An example of how it should be used:
# These should be run once in the header of your file
from CoolProp.CoolProp import IProps, get_Fluid_index
from CoolProp import param_constants
iPropane = get_Fluid_index('Propane')
# This should be run using the cached values - much faster !
IProps(param_constants.iP,param_constants.iT,0.8*Tc,param_constants.iQ,1,iPropane)
The reason that this function is significantly faster than Props is that it skips all the string comparisons which slows down the Props function quite a lot. At the C++ level, IProps doesn’t use any strings and operates on integers and floating point values
Check if a fluid is of a given type
Valid types are:
Convert temperature in Kelvin to degrees Fahrenheit
Given a set of temperature and pressure, returns one of the following strings
Phase diagram:
| |
| | Supercritical
| |
p | Liquid (b)------------
| /
| /
| / Gas
| /
| (a)
| /
|------------------------
T
a: triple point
b: critical point
a-b: Saturation line
Call Type #1:
Props(Fluid,PropName) --> float
Where Fluid is a string with a valid CoolProp fluid name, and PropName is one of the following strings:
Tcrit | Critical temperature [K] |
Treduce | Reducing temperature [K] |
pcrit | Critical pressure [kPa] |
rhocrit | Critical density [kg/m3] |
rhoreduce | Reducing density [kg/m3] |
molemass | Molecular mass [kg/kmol] |
Ttriple | Triple-point temperature [K] |
Tmin | Minimum temperature [K] |
ptriple | Triple-point pressure [kPa] |
accentric | Accentric factor [-] |
GWP100 | Global Warming Potential 100 yr |
ODP | Ozone Depletion Potential |
This type of call is used to get fluid-specific parameters that are not dependent on the state
Call Type #2:
Alternatively, Props can be called in the form:
Props(OutputName,InputName1,InputProp1,InputName2,InputProp2,Fluid) --> float
where Fluid is a string with a valid CoolProp fluid name. The value OutputName is either a single-character or a string alias. This list shows the possible values
OutputName | Description |
---|---|
Q | Quality [-] |
T | Temperature [K] |
P | Pressure [kPa] |
D | Density [kg/m3] |
C0 | Ideal-gas specific heat at constant pressure [kJ/kg/K] |
C | Specific heat at constant pressure [kJ/kg/K] |
O | Specific heat at constant volume [kJ/kg/K] |
U | Internal energy [kJ/kg] |
H | Enthalpy [kJ/kg] |
S | Entropy [kJ/kg/K] |
A | Speed of sound [m/s] |
G | Gibbs function [kJ/kg] |
V | Dynamic viscosity [Pa-s] |
L | Thermal conductivity [kW/m/K] |
I or SurfaceTension | Surface Tension [N/m] |
w or accentric | Accentric Factor [-] |
The following sets of input values are valid (order doesn’t matter):
InputName1 | InputName2 |
---|---|
T | P |
T | D |
P | D |
T | Q |
P | Q |
H | P |
S | P |
S | H |
T | S |
Python Only : InputProp1 and InputProp2 can be lists or numpy arrays. If both are iterables, they must be the same size.
If InputName1 is T and OutputName is I or SurfaceTension, the second input is neglected since surface tension is only a function of temperature
Just like Props(), but this function ALWAYS takes in and returns SI units (K, kg, J/kg, Pa, N/m, etc.)
Call Type #1:
Props(Fluid,PropName) --> float
Where Fluid is a string with a valid CoolProp fluid name, and PropName is one of the following strings:
Tcrit | Critical temperature [K] |
Treduce | Reducing temperature [K] |
pcrit | Critical pressure [Pa] |
rhocrit | Critical density [kg/m3] |
rhoreduce | Reducing density [kg/m3] |
molemass | Molecular mass [kg/kmol] |
Ttriple | Triple-point temperature [K] |
Tmin | Minimum temperature [K] |
ptriple | Triple-point pressure [Pa] |
accentric | Accentric factor [-] |
GWP100 | Global Warming Potential 100 yr |
ODP | Ozone Depletion Potential |
This type of call is used to get fluid-specific parameters that are not dependent on the state
Call Type #2:
Alternatively, Props can be called in the form:
Props(OutputName,InputName1,InputProp1,InputName2,InputProp2,Fluid) --> float
where Fluid is a string with a valid CoolProp fluid name. The value OutputName is either a single-character or a string alias. This list shows the possible values
OutputName | Description |
---|---|
Q | Quality [-] |
T | Temperature [K] |
P | Pressure [Pa] |
D | Density [kg/m3] |
C0 | Ideal-gas specific heat at constant pressure [J/kg] |
C | Specific heat at constant pressure [J/kg] |
O | Specific heat at constant volume [J/kg] |
U | Internal energy [J/kg] |
H | Enthalpy [J/kg] |
S | Entropy [J/kg/K] |
A | Speed of sound [m/s] |
G | Gibbs function [J/kg] |
V | Dynamic viscosity [Pa-s] |
L | Thermal conductivity [W/m/K] |
I or SurfaceTension | Surface Tension [N/m] |
w or accentric | Accentric Factor [-] |
The following sets of input values are valid (order doesn’t matter):
InputName1 | InputName2 |
---|---|
T | P |
T | D |
P | D |
T | Q |
P | Q |
H | P |
S | P |
S | H |
Python Only : InputProp1 and InputProp2 can be lists or numpy arrays. If both are iterables, they must be the same size.
If InputName1 is T and OutputName is I or SurfaceTension, the second input is neglected since surface tension is only a function of temperature
Make the Props function handle different kinds of unit sets. Use kSI or SI to identify your desired unit system. Both input and output values have to be from the same unit set.
add_REFPROP_fluid(signatures, args, kwargs, defaults)
Add a REFPROP fluid to CoolProp internal structure
example
add_REFPROP_fluid(“REFPROP-PROPANE”)
The derivative of the saturation enthalpy cair_sat = d(hsat)/dT
Call fromSI(Property, Value, Units) to convert from SI units to a given set of units. At the moment, only kSI is supported. This convenience function is used inside both the PropsU and DerivTermsU functions.
Return the safety code for the fluid from ASHRAE34 if it is in ASHRAE34
Return the BibTeX key for the given fluid.
The possible keys are
BibTeX keys refer to the BibTeX file in the trunk/CoolProp folder
Returns: | empty string if Fluid not in CoolProp, “Bad key” if key is invalid |
---|---|
Return type: | key, string |
Return a string with the CAS number for the given fluid
get_Fluid_index(signatures, args, kwargs, defaults)
Gets the integer index of the given CoolProp fluid (primarily for use in IProps function)
Return the REFPROP compatible name for the fluid (only useful on windows)
Some fluids do not use the REFPROP name. For instance, ammonia is R717, and propane is R290. You can still can still call CoolProp using the name ammonia or R717, but REFPROP requires that you use a limited subset of names. Therefore, this function that returns the REFPROP compatible name. To then use this to call REFPROP, you would do something like:
In [0]: from CoolProp.CoolProp import get_REFPROPname, Props
In [1]: Fluid = 'REFPROP-' + get_REFPROPname('R290')
In [2]: Props('D', 'T', 300, 'P', 300, Fluid)
Get the current range of the single-phase LUT
Returns: | |
---|---|
Return type: | tuple of hmin,hmax,pmin,pmax |
Get the mode of the TTSE table, one of "TTSE" or "BICUBIC"
Return a comma separated string of aliases for the given fluid
Return the current debug level as integer
Returns: | level – If level is 0, no output will be written to screen, if >0, some output will be written to screen. The larger level is, the more verbose the output will be |
---|---|
Return type: | int |
Return the current error string
get_fluid_param_string(signatures, args, kwargs, defaults)
get_global_param_string(signatures, args, kwargs, defaults)
Get the boolean telling you if the given key matches with a fluid constant.
Set the mode of the TTSE table, one of "TTSE" or "BICUBIC"
Set the current debug level as integer in the range [0,10]
Parameters: | level (int) – If level is 0, no output will be written to screen, if >0, some output will be written to screen. The larger level is, the more verbose the output will be |
---|
set_reference_state(signatures, args, kwargs, defaults)
Accepts one of two signatures:
Type #1:
set_reference_state(FluidName,reference_state)
FluidName The name of the fluid param reference_state The reference state to use, one of
IIR | (h=200 kJ/kg, s=1 kJ/kg/K at 0C sat. liq.) |
ASHRAE | (h=0,s=0 @ -40C sat liq) |
NBP | (h=0,s=0 @ 1.0 bar sat liq.) |
Type #2:
set_reference_state(FluidName,T0,rho0,h0,s0)
FluidName The name of the fluid
T0 The temperature at the reference point [K]
rho0 The density at the reference point [kg/m^3]
h0 The enthalpy at the reference point [J/kg]
s0 The entropy at the reference point [J/kg]
Call toSI(Property, Value, Units) to convert from a given set of units to SI units. At the moment, only kSI is supported. This convenience function is used inside both the PropsU and DerivTermsU functions.