Catalog PyPI
PACKAGE EXPLORERView in registry

absorptionlib

PyPI

Thermophysical properties of salt solutions (NaOH, LiBr, LiCl, CaCl2) for absorption systems

Versions collected1
Direct dependencies4From release 1.1.0
Last observed20 Oct, 17:38 UTC

README

Version 1.1.0 documentation

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:

SymbolMeaningUnit
xSalt mass fractionkg salt / kg solution
TTemperature°C
pPressurePa

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 NameDescriptionNaOHLiBrLiClCaCl2
saturation_temperatureBoiling point temperature of the solution [°C]xxxx
saturation_pressureEquilibrium (vapor) pressure of the solution [Pa]xxxx
saturation_concentrationSaturation concentration at given pressure and temperature [kg/kg]xxxx
enthalpySpecific enthalpy of the solution [kJ/kg]xxxx
differential_enthalpy_ADDifferential enthalpy of dilution [kJ/kg H2O]xx
densityDensity of the solution [kg/m³]xxxx
specific_heat_capacitySpecific heat capacity of the solution [kJ/(kg K)]xxx
dynamic_viscosityDynamic viscosity of the solution [Pa s]xxx
thermal_conductivityThermal conductivity of the solution [W/(m K)]x
diffusion_coefficientSelf diffusion coefficient of the solution [m²/s]xx
solubility_temperatureCrystallization temperature at given concentration [°C]xxxx
hxDiagramPlots the enthalpy-concentration diagramxxxx
pTDiagramPlots the pressure-temperature diagramxxxx
crystallization_curvePlots (or returns) the crystallization curvexxxx

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'

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
1.1.09 Oct 20264

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 17:38 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:b8d9422ce38cf5ee5c2c4bb86aa16611115770f6a683eb607f6cdc0043c39fa4