CoolProp-OOP
An object-oriented wrapper for CoolProp thermodynamic properties. This library provides an intuitive, Pythonic interface to CoolProp's functionality for both humid air and pure fluid property calculations.
Features
- Object-oriented interface to CoolProp's functionality
- Property validation to prevent physically impossible states
- All thermodynamic properties are directly settable - enthalpy, entropy, and any other property can be used as a constraint
- Automatic caching of calculated properties for better performance
- Support for both Humid Air (
StateHA) and Pure Fluids (StateProps) - Comprehensive state validation with helpful error messages
- Fully Pythonic API with property-based getters and setters
CoolProp-OOP provides an intuitive, object-oriented interface to CoolProp's thermodynamic property calculations for both humid air and pure fluids. It simplifies property access and calculations through two main classes: StateHA for humid air properties and StateProps for pure fluid properties.
Installation
pip install coolprop-oop
Features
- Easy-to-use object-oriented interface
- Simple property constraint management
- Support for both humid air and pure fluid calculations
- Consistent SI unit system
- Compatible with CoolProp 6.7.0
Usage
Humid Air Properties
from coolprop_oop import StateHA
# Create a state for humid air at 25°C, 1 atm, 60% RH
state = StateHA('T', 298.15, 'P', 101325, 'R', 0.6)
# Access properties using property codes
humidity_ratio = state.get('W')
wet_bulb = state.get('B') - 273.15 # Convert to Celsius
enthalpy = state.get('H')
# Get multiple properties in one call
temp, pressure, rel_humidity = state.get('T', 'P', 'R')
# View current constraint values
constraints = state.constraints()
print(constraints) # {'T': 298.15, 'P': 101325, 'R': 0.6}
# Update a constraint
state.reset('T', 303.15) # Change temperature to 30°C
# Replace a constraint with a different property
state.replace('R', 'W', 0.015) # Replace RH with humidity ratio
Pure Fluid Properties
from coolprop_oop import StateProps
# Create a state for water at 100°C, 1 atm
water = StateProps('T', 373.15, 'P', 101325, 'water')
# Access properties using property codes
density = water.get('D')
enthalpy = water.get('H')
entropy = water.get('S')
# Get multiple properties in one call
temp, pressure = water.get('T', 'P')
# View current constraint values
constraints = water.constraints()
print(constraints) # {'T': 373.15, 'P': 101325, 'fluid': 'water'}
# Update a constraint
water.reset('T', 393.15) # Change temperature to 120°C
# Replace a constraint with a different property
water.replace('P', 'D', 900.0) # Replace pressure with density
Property Codes (CoolProp 6.7.0)
Humid Air Properties (StateHA)
'T': Temperature [K]'P': Pressure [Pa]'W': Humidity ratio [kg/kg dry air]'R': Relative humidity [0-1]'D': Dew point temperature [K]'B': Wet bulb temperature [K]'V': Specific volume [m³/kg dry air]'H': Specific enthalpy [J/kg dry air]'S': Specific entropy [J/kg dry air/K]'C': Specific heat capacity [J/kg dry air/K]
Pure Fluid Properties (StateProps)
'T': Temperature [K]'P': Pressure [Pa]'D': Density [kg/m³]'H': Specific enthalpy [J/kg]'S': Specific entropy [J/kg-K]'Q': Vapor quality [-]'C': Specific heat capacity at constant pressure [J/kg-K]'O': Specific heat capacity at constant volume [J/kg-K]'U': Specific internal energy [J/kg]
License
MIT
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Metadata
Release files for coolprop-oop 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| coolprop_oop-2.0.0.tar.gz | 12.6 kB | Without provenance | Details for coolprop_oop-2.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| coolprop_oop-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for coolprop_oop-2.0.0-py3-none-any.whl |
Total release size: 23.7 kB
Release files / coolprop_oop-2.0.0.tar.gz
| Download URL | coolprop_oop-2.0.0.tar.gz |
|---|---|
| Size | 12.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e7d9cd8915f9470cd68cd98d386b996db230124ca60c2298792af766ccfb12cb
|
|
BLAKE2b-256 checksum How to use checksums |
b71014d822aad27f8d9ab9fd5509b2ffe5a4f8f4362e6d29d361c82351c1064a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|
Release files / coolprop_oop-2.0.0-py3-none-any.whl
| Download URL | coolprop_oop-2.0.0-py3-none-any.whl |
|---|---|
| Size | 11.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6106f7700dbe85b1361c68405e4bd76b8f1ffa5f3efb33cb2ab75af4425acba3
|
|
BLAKE2b-256 checksum How to use checksums |
93553ac46c3fd61c70677350addb8c7d5ad03b4dada20dd9c07dad46067d29a7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|
Security for coolprop-oop 2.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.