Skip to main content

absorptionlib

This package contains thermophysical property functions for the following aqueous solutions used in absorption systems:

  • NaOH-water
  • LiBr-water
  • LiCl-water
  • CaCl2-water

If you use this package, please cite:

Höffner et al. 2025 — Potentials of absorption thermal energy storage systems in seasonal application

DOI: https://doi.org/10.18462/iir.tptpr2025.1130

Installation and Usage

pip install absorptionlib
# Import
from absorptionlib import NaOH, LiBr, LiCl, CaCl2

# Example Usage
p = 100000  # [Pa]
x = 0.4     # [kg NaOH / kg solution]
t_sat = NaOH.saturation_temperature(x, p)
print(round(t_sat, 2))

Output

129.75

Units

All functions use the same units throughout the package:

Symbol Meaning Unit
x Salt mass fraction kg salt / kg solution
T Temperature °C
p Pressure Pa

Warnings and errors

Each function checks its inputs against the validity range of the underlying correlation:

  • Inputs outside the validated range emit an OutOfRangeWarning (the value is still computed and returned).
  • State points below the crystallization line emit a CrystallizationWarning.
  • Physically invalid inputs raise a ValueError.

Every property function accepts prevent_errors=True, which suppresses all warnings and returns float('nan') instead of raising a ValueError — useful inside optimizers and root finders:

NaOH.enthalpy(0.4, 80, prevent_errors=True)

Warnings can also be controlled globally:

import absorptionlib
absorptionlib.disable_warnings()   # silence all package warnings
absorptionlib.enable_warnings()    # restore them

# or with the standard library, e.g. turn warnings into exceptions:
import warnings
warnings.filterwarnings("error", category=absorptionlib.CrystallizationWarning)

Quick documentation

Each submodule has its own "in-line" documentation, which can be called with the documentation() function. Each property function has a docstring, which can be printed with the explain() function.

# How to get quick documentation on the modules
NaOH.documentation()  # or LiBr, LiCl, CaCl2

# How to get quick documentation for functions
NaOH.explain("enthalpy")    # prints docstring of NaOH.enthalpy
LiCl.explain("pTDiagram")   # prints docstring of LiCl.pTDiagram

Available Property Functions

Function Name Description NaOH LiBr LiCl CaCl2
saturation_temperature Boiling point temperature of the solution [°C] x x x x
saturation_pressure Equilibrium (vapor) pressure of the solution [Pa] x x x x
saturation_concentration Saturation concentration at given pressure and temperature [kg/kg] x x x x
enthalpy Specific enthalpy of the solution [kJ/kg] x x x x
differential_enthalpy_AD Differential enthalpy of dilution [kJ/kg H2O] x x
density Density of the solution [kg/m³] x x x x
specific_heat_capacity Specific heat capacity of the solution [kJ/(kg K)] x x x
dynamic_viscosity Dynamic viscosity of the solution [Pa s] x x x
thermal_conductivity Thermal conductivity of the solution [W/(m K)] x
diffusion_coefficient Self diffusion coefficient of the solution [m²/s] x x
solubility_temperature Crystallization temperature at given concentration [°C] x x x x
hxDiagram Plots the enthalpy-concentration diagram x x x x
pTDiagram Plots the pressure-temperature diagram x x x x
crystallization_curve Plots (or returns) the crystallization curve x x x x

Diagrams

You can construct diagrams (pT-diagram, hx-diagram, crystallization curve) with the package. For example:

NaOH.pTDiagram()

pT-Diagram

Note: The plots can be styled with the usual matplotlib syntax. If the plot should be editable, use NaOH.pTDiagram(editablePlot=True). To reproduce the same-looking plot, set up matplotlib using:

import matplotlib.pyplot as plt
plt.rcParams['font.family'] = 'Georgia'
plt.rcParams['mathtext.fontset'] = 'custom'
plt.rcParams['mathtext.rm'] = 'Georgia'
plt.rcParams['mathtext.it'] = 'Georgia:italic'

Metadata

Release files for absorptionlib 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for absorptionlib 1.1.0
File Size Uploaded
absorptionlib-1.1.0.tar.gz 32.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for absorptionlib 1.1.0
File Interpreter ABI Platform
absorptionlib-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 70.2 kB

Release files / absorptionlib-1.1.0.tar.gz

Download URL absorptionlib-1.1.0.tar.gz
Size 32.3 kB
Tags Source
SHA-256 checksum
How to use checksums
096e3feb9eae76d90602cd25ff0a2df7b378b94cb48b7dc1dd384538437bd293
BLAKE2b-256 checksum
How to use checksums
afd7c92a4c64201e25247a479bf9070e0c835542be25c0aa1adc69531ab060ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / absorptionlib-1.1.0-py3-none-any.whl

Download URL absorptionlib-1.1.0-py3-none-any.whl
Size 37.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b8c78656735f1a55577aa498e8bf61d08e297ab46ad3a4f6ce4355f449395471
BLAKE2b-256 checksum
How to use checksums
9d112982f7c16e2dc9d62a7ed47922c9e5887f1f78a6f2f220402f49fdce58bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.14

2 release files

1.0.13

2 release files

1.0.12

2 release files

1.0.11

2 release files

1.0.10

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page