Skip to main content

Analytical solver for multistage ducted axial fans.

Project description

axialfans

Fast analytical solver for multistage axial turbomachinery

PyPI version License: MIT

Generalized solver for arbitrary sequences of rotating and stationary axial stages (rotors, stators, counter-rotating fans) using Newton-Raphson iteration on coupled thermodynamic equations. Designed for preliminary turbomachinery design and rapid parameter exploration.

Key Features:

  • Fast: 333 solves/second enables real-time Monte Carlo (10,000 samples in ~30s)
  • 🎯 Validated: 6% accuracy vs NASA experimental data (Rotor 37, Report 729)
  • 🔧 General: Rotors, stators, counter-rotation, variable area in unified framework
  • 📊 Production-ready: Type hints, error handling, comprehensive documentation

Installation

pip install axialfans

Requirements: Python 3.9+, NumPy


Quick Start

from axialfans.fan_solver import MultistageFanSolver

# Single stage fan
solver = MultistageFanSolver(
    N=1,                # Number of stages
    direction=[1],      # Rotation: +1=CCW, -1=CW
    sigma=0.9,          # Slip factor
    omega=1800,         # Angular velocity [rad/s]
    beta=45,            # Blade angle [degrees]
    rp=0.25,            # Tip radius [m]
    rm=0.18,            # Hub radius [m]
    eta=0.85,           # Efficiency
    R=287,              # Gas constant [J/kg-K]
    cp=1005,            # Specific heat [J/kg-K]
    gamma=1.4           # Heat capacity ratio
)

# Solve from inlet conditions
solver.solve(
    T0=288,         # Temperature [K]
    vax0=50,        # Axial velocity [m/s]
    P0=101325,      # Pressure [Pa]
    rho0=1.225      # Density [kg/m³]
)

# Results
print(f"Pressure ratio: {solver.P[1]/solver.P[0]:.2f}")
print(f"Exit velocity: {solver.vax[1]:.1f} m/s")

Examples

See the examples/ directory for detailed usage:

Example Description
01_single_rotor.py Basic single-stage fan
02_rotor_stator.py Fan with straightening vanes (NASA 729 config)
03_counter_rotating.py Swirl cancellation with opposite-spinning rotors
04_variable_area.py Converging/diverging ducts
05_multi_spool.py LP + stator + HP compressor configuration
06_monte_carlo_uq.py Uncertainty quantification (1000 samples)

Key Concepts

Indexing Convention

State arrays indexed 0 → N:

  • solver.T[0] = inlet temperature
  • solver.T[n] = temperature exiting stage n

Direction Array

Specifies rotation sense:

  • direction=[1] = counter-clockwise rotation
  • direction=[-1] = clockwise rotation / mirror frame
  • direction=[1, -1] = rotor + stator pair

Stage Types

Configure via parameters:

  • Rotor: omega > 0, any direction
  • Stator: omega = 0, set opposite direction from previous
  • Counter-rotating: Adjacent stages with opposite direction values

Variable Area

Different radii per stage:

rp=[0.30, 0.25, 0.20]  # Decreasing tip radius
rm=[0.20, 0.18, 0.15]  # Decreasing hub radius

Area decrease → velocity increase, pressure ratio decrease


Performance

  • Single solve: ~3 ms
  • 1,000 solves: ~3 seconds
  • 10,000 solves: ~30 seconds
  • 4-5 orders of magnitude faster than RANS CFD

Enables real-time design space exploration and Monte Carlo uncertainty quantification.


Validation

Validated against NASA experimental data:

Test Case Configuration Error
Rotor 37 High-speed single rotor (Re ~ 10⁶) 6.2% on pressure ratio
NASA 729 Low-speed rotor-stator (Re ~ 10⁵) Correctly identifies inviscid breakdown

Uncertainty quantification with 10,000 Monte Carlo samples shows 99.8% convergence rate. See notebooks/rotor37_validation.ipynb for detailed analysis.


Documentation

Full API documentation available in code docstrings. Quick reference:

MultistageFanSolver(
    N,              # Number of stages
    direction,      # Rotation sense: +1 (CCW) or -1 (CW)
    sigma,          # Slip factor (0.85-0.95 typical)
    omega,          # Angular velocity [rad/s] (unsigned, use 0 for stators)
    beta,           # Blade angle [degrees] (unsigned)
    rp, rm,         # Tip and hub radius [m]
    eta,            # Efficiency (0-1)
    R, cp, gamma    # Gas properties
)

All parameters accept scalars (same for all stages) or arrays (per-stage values).


Citation

If you use this software in your research, please cite:

@software{wang2026axialfans,
  title={axialfans: Fast Analytical Solver for Multistage Axial Turbomachinery},
  author={Wang, Sean},
  year={2026},
  url={https://github.com/sean-h-wang/axialfans},
  version={1.0.0}
}

Associated paper:

@article{wang2026analytical,
  title={Analytical Solver for Multistage Axial Turbomachinery with Variable Area and Counter-Rotation},
  author={Wang, Sean},
  journal={AIAA Journal},
  year={2026},
  note={submitted}
}

License

MIT License - see LICENSE file for details.


Contributing

Issues and pull requests welcome! Please see CONTRIBUTING.md for guidelines.

For bug reports, include:

  • Python version
  • NumPy version
  • Minimal reproducible example
  • Error message / unexpected behavior

Author

Sean H. Wang

Developed as part of hypersonic propulsion research.

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

axialfans-1.0.2.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

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

axialfans-1.0.2-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file axialfans-1.0.2.tar.gz.

File metadata

  • Download URL: axialfans-1.0.2.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for axialfans-1.0.2.tar.gz
Algorithm Hash digest
SHA256 eb9071e088880afb4256cfd7bd5ff080f48d2939822900530b8d4ae99d4a2bcf
MD5 e3765a4fc03654f401ae503405eca029
BLAKE2b-256 683d5682a8d18c86d2e979b98817b3e936b677e830d0734334eedbaeea5aa12d

See more details on using hashes here.

File details

Details for the file axialfans-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: axialfans-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for axialfans-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0fbda5eb982620e03c98b4648cd4f48305776028b47c66524ec5daa6398f4548
MD5 0f89f8b6c33ef128b80bd0ec6b10a498
BLAKE2b-256 3f35c681be90c3af9f60ac9165169f7179187718aab5f447990164bbe437e580

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