Setup

Setup that is specific only to Jupyter notebooks


In [1]:
from pathlib import Path
import sys

notebook_directory_parent = Path.cwd().resolve().parent
if str(notebook_directory_parent) not in sys.path:
    sys.path.append(str(notebook_directory_parent))

Setup to use Python libraries/modules

cf. www.coolprop.org/coolprop/examples.html


In [3]:
# Import the things you need
from CoolProp.CoolProp import PropsSI

import CoolProp

Examples from CoolProp's Examples

cf. www.coolprop.org/coolprop/examples.html


In [4]:
# Print some information on the currently used version of coolprop
print(CoolProp.__version__, CoolProp.__gitrevision__)


6.3.1dev dac671a3dc18c0be26cfe3a0a037c011f61eaf7d

In [5]:
# Density of carbon dioxide at 100 bar and 25 C
PropsSI('D', 'T', 298.15, 'P', 100e5, 'CO2')


Out[5]:
817.6273812375758

In [6]:
# Saturated vapor enthalpy [J/kg] of R134a at 25 C
PropsSI('H', 'T', 298.15, 'Q', 1, 'R134a')


Out[6]:
412333.95323186804
  • T is the output property returned
  • 2nd, 4th parameters are specified input pair of properties that determine state point where output property will be calculated
  • output property and input pair properties are text strings
  • 3rd, 5th parameters are values of input pair
  • 6th and last parameter is fluid for which output property will be calculated

In [7]:
# Saturation temperature of Water at 1 atm in K
PropsSI('T', 'P', 101325, 'Q', 0, 'Water')


Out[7]:
373.1242958476844

Nitrogen


In [8]:
PropsSI('T', 'P', 101325, 'Q', 0, 'N2')


Out[8]:
77.35499390959467

In [9]:
PropsSI('T', 'P', 101325, 'Q', 0, 'Nitrogen')


Out[9]:
77.35499390959467

In [ ]: