Skip to main content

A Python port of the NIST REGEN3.3 cryogenic regenerator model.

Project description

pyregen

pyregen is a Python-based port of NIST REGEN3.3 cryogenic regenerator model.

It evaluates the fluid dynamics and heat transfer of oscillating helium flow through porous media at cryogenic temperatures. By replacing Fortran structures with a Object-Oriented Python architecture, pyregen acts as a fast, flexible engine.

Installation

pip install pyregen

Quick Start

pyregen is designed to act as a state-machine engine. You initialize the regenerator with your physical parameters, and then drive it forward in a loop.

from pyregen import Regenerator

my_regen = Regenerator(
    gas_temp_cold=80.0,           # Cold end temperature (K)
    gas_temp_hot=300.0,           # Hot end temperature (K)
    herz=60.0,                    # Operating frequency (Hz)
    hydra_diam=50e-6,             # Hydraulic diameter (m)
    mass_flux_cold=0.01,          # Mass flux at cold end (kg/s)
    mass_flux_hot=0.01,           # Mass flux at hot end (kg/s)
    mass_phase=30.0,              # Phase shift (degrees)
    material='stainless steel',   # Matrix material
    porosity=0.68,                # Matrix porosity
    pres_initial=2.5e6,           # Average pressure (Pa)
    rg_area=0.002,                # Cross-sectional area (m^2)
    rg_length=0.05,               # Regenerator length (m)
    geometry='screens',           # Matrix geometry
    num_points_x=21,              # Number of spatial nodes
    num_steps_cyc=80              # Number of time steps per cycle
)

target_cycles = 10
total_steps = target_cycles * my_regen.num_steps_cyc

print(f"Starting Engine: Running {total_steps} steps...")

for step in range(total_steps):
    
    current_data = my_regen.advance()
    
    if (step + 1) % my_regen.num_steps_cyc == 0:
        print(f"Cycle {current_data['Cycle']:.1f} completed.")

full_history = my_regen.results()
final_gas_temp = full_history['Gas_Temperature'][-1, -1]
print(f"\nFinal Gas Temp at the cold boundary: {final_gas_temp:.2f} K")

my_regen.save_to_csv("my_simulation_run.csv")

Supported Materials & Geometries

Materials:

  • stainless steel (or ss)
  • lead (or pb)
  • er3-ni (or er3ni)
  • (More materials can be easily added via the material_properties function)

Geometries:

  • parallel plates (or 1)
  • tubes (or 2)
  • screens (or 4)

License

This project is licensed under the MIT License.

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

pyregen-0.1.0.tar.gz (12.2 kB view details)

Uploaded Source

Built Distribution

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

pyregen-0.1.0-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file pyregen-0.1.0.tar.gz.

File metadata

  • Download URL: pyregen-0.1.0.tar.gz
  • Upload date:
  • Size: 12.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for pyregen-0.1.0.tar.gz
Algorithm Hash digest
SHA256 df866e700a3fd53fa39170ef4b3a42877be673870465079c0461abfbc82e9e8d
MD5 945b0382a5554bece93b503da3e3f771
BLAKE2b-256 0dc7a3cb442d1cbd824858253304340534c413269045caff83a2984930b1c42c

See more details on using hashes here.

File details

Details for the file pyregen-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pyregen-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for pyregen-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 33e3b485fc206192de141b13cbadd90f60fa82c8e3fd6b07c8c79c5ffb81dec1
MD5 72ea42799864743b895bbdb1db2a15bc
BLAKE2b-256 a96be10742d5bc3b0fb14e9031e83c63afbd39b4bff657695b17fdf6dfff0307

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