Skip to main content

A Python library for heat transfer and thermodynamics calculations, derived from EES

Project description

EESLib

EESLib is a Python library for heat transfer and thermodynamics calculations, derived from Engineering Equation Solver (EES) functions. It is designed for educational use in the ME564 Heat Transfer course at the University of Wisconsin-Madison.

Features

EESLib provides implementations for various engineering calculations including:

Fluid Properties

  • Thermodynamic properties (enthalpy, entropy, density, etc.) using CoolProp
  • Functions for common fluids with temperature, pressure, and quality inputs
  • NOTE: The CoolProp fluid property implementation approach differs from the fluid properties in EES! Do not expect perfect correspondence between properties obtained using either method. CoolProp is generally less robust and slower than the native EES implementation.

Heat Transfer Functions

  • Internal Flow: Nusselt number and friction factor calculations for pipe and duct flow (laminar, turbulent, transitional)
  • External Flow: Heat transfer and friction for flow over plates, cylinders, and other geometries
  • Heat Exchangers: NTU and LMTD calculations for various flow configurations
  • Fin Efficiency: Efficiency calculations for fins with various profiles and tip boundary conditions
  • Radiation: Blackbody radiation, view factors, and radiative heat transfer functions. Note that a catalog of view factors with number ID assignments is provided in a PDF distributed in the source code folder.

Utilities

  • Unit conversions
  • Lookup tables for various properties
  • Talbot inversion for Laplace transforms
  • Result printing and PDF generation utilities

Installation

Prerequisites

  • Python 3.11 or higher
  • Packages listed in requirements.txt

Install from PyPi

Quick Setup

Open a command window with the same privileges used to install Python.

conda activate me564 
pip install eeslib

Full Setup

  1. Download miniconda executable from (https://www.anaconda.com/download/success#miniconda)
  2. Run installer:
    • Choose "Just for me" option
    • Check 'yes' for Add Miniconda3 to PATH, and 'yes' for registering as the default Python
  3. Download code resources from Canvas: Files/Lectures/examples_<version#>.zip. This folder contains a number of examples that we’ll use in both lecture and homework codes.
  4. Create the me564 environment in conda. In the command window, type:
    conda create -n me564 python=3.<latest>
    
  5. Open command window (shell). Navigate your command window to the folder you downloaded. For example, type:
    cd C:/path/to/my/folder/examples
    
  6. Activate your conda environment. In the command window, type:
    conda activate me564
    
  7. Install the EESLib package from PyPi
    pip install eeslib
    
  8. Automatic PDF reports are created from EESLib using LaTeX. This requires two tools to be installed on your computer that generate the reports.

Install from source

Use this option if you are going to make local changes to the EESLib package source code.

git clone https://github.com/uw-esolab/eeslib.git
cd eeslib
pip install -e .

Usage

Import the library modules as needed:

from eeslib import fluid_properties as fp
from eeslib import internal_flow as iflow
from eeslib import functions as fn

# Get water properties at 100°C and 1 atm
rho = fp.density('Water', T=373.15, P=101325)
print(f"Density: {rho} kg/m³")

# Calculate Nusselt number for pipe flow
Nu, f = iflow.pipeflow_nd(Re=10000, Pr=7, LoverD=50, relRough=0.001)
print(f"Nusselt number: {Nu}, Friction factor: {f}")

# Convert units
temp_c = fn.converttemp('F', 'C', 212)
print(f"212°F = {temp_c}°C")

Modules

Module Description
fluid_properties.py Thermodynamic property calculations
internal_flow.py Heat transfer in pipes and ducts
external_flow.py External convection heat transfer
heat_exchangers.py Heat exchanger analysis
fin_efficiency.py Extended surface heat transfer
radiation.py Radiative heat transfer and view factors
functions.py Utility functions, unit conversions
lookup_data.py Interpolation and lookup tables
talbot_inversion.py Numerical Laplace transform inversion

License

Portions of this code are derived from Engineering Equation Solver (EES) under license restrictions and is intended for educational use at the University of Wisconsin-Madison.

Contributing

This library is maintained for educational purposes. Please contact the instructor for contributions or modifications.

Testing

EESLib includes a comprehensive test suite to ensure functionality and catch regressions.

Running Tests

Install test dependencies:

pip install -e ".[dev]"

Run all tests:

python run_tests.py

Run specific test file:

python run_tests.py tests/test_fluid_properties.py

Run with coverage:

pip install pytest-cov
python -m pytest --cov=eeslib --cov-report=html

Test Coverage

The test suite covers:

  • Fluid Properties: Thermodynamic property calculations using CoolProp
  • Unit Conversions: Temperature, length, mass, energy, and other unit conversions
  • Internal Flow: Heat transfer and friction factor calculations for pipe flow
  • Heat Exchangers: LMTD correction factors and NTU calculations

References

  • Engineering Equation Solver (EES)
  • CoolProp library for fluid properties
  • Heat Transfer by Nellis & Klein, 2007

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eeslib-0.0.1.tar.gz (67.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eeslib-0.0.1-py3-none-any.whl (63.1 kB view details)

Uploaded Python 3

File details

Details for the file eeslib-0.0.1.tar.gz.

File metadata

  • Download URL: eeslib-0.0.1.tar.gz
  • Upload date:
  • Size: 67.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for eeslib-0.0.1.tar.gz
Algorithm Hash digest
SHA256 fa41fc4aa960cef5a40ecb9cbc74c2bd1657b310125825970b72c6c287cc0cf9
MD5 e6eb02b6d9ae74d38a2d37bed0e43d35
BLAKE2b-256 c7c6f22f3f56163b92e2d4ff63e1a5b042089eaef52e848ef332b627dfaa1b82

See more details on using hashes here.

File details

Details for the file eeslib-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: eeslib-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 63.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for eeslib-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 183c2f0cafa926488e258658eda75d7889bd30f5f779542230e931bd31969762
MD5 a76a1826150ee692ae71ebdbb85f5bba
BLAKE2b-256 5395e2a864b571e7fe60398980cf9645ae7f0bae12bb58249f612a9a22b3dbdf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page