Skip to main content
TurboMoC logo with the Atlantic nozzle icon and Dynamic wordmark

From a real-fluid supersonic nozzle to a meshed and simulated turbine stage, in one Python package.

Python package for the design of supersonic nozzles and turbomachinery blades using the method of characteristics. Its current design app designs stator and vortex rotor profiles for linear cascades and axial/radial machines, then generates section and volume meshes with quality reports and CGNS export. The Python library and preserved preceding app also provide sizing, CAD and stage-assembly tools.

📦 PyPI package: https://pypi.org/project/turbo_moc/

📚 Documentation: https://turbo-sim.github.io/TurboMoC/

🎓 Tutorials: https://turbo-sim.github.io/TurboMoC/examples/index.html

Axial stage, swept 3D passage mesh and radial stage generated with TurboMoC

Features

Nozzle design with the method of characteristics

  • Conventional and minimum-length nozzles for single-phase and two-phase (HEM) flows.
  • Real-fluid properties through jaxprop/CoolProp, including wet inlets (vapor quality) and expansions crossing the saturation dome.
  • Smooth sonic transition, kernel and reflex regions, with axis and wall property distributions.

Characteristics mesh of a two-phase Cyclopentane nozzle and its expansion in the T-s diagram

Blade design

  • Stator: the nozzle wall becomes a B-spline blade with prescribed inlet/outlet metal angles, trailing-edge radius and throat, editable control point by control point.
  • Rotor: supersonic vortex blades (Goldman's method, generalized to real gases), impulse or reacting, optionally coupled to the stator exit state (including the stator loss), with elliptic leading and trailing edges. A constant-passage circular-arc impulse blade is available as a baseline.
  • Supersonic rotor inlet: unique incidence angle (Starken's method for a general equation of state) with the leading-edge bow-shock stand-off (Moeckel), and the Kantrowitz starting check of the passage on the real-fluid relative isentrope.
  • Boundary-layer correction: stator and rotor walls are offset by the displacement thickness of a turbulent flat-plate layer computed from the inviscid design.

Stator blade derived from the nozzle wall and a supersonic vortex rotor passage with its MoC transition arcs

Sizing, CAD and stages in the preserved workflow

  • Size the stator for a mass flow and blade count; the rotor shares its annulus.
  • Axial rows wrap onto the annulus between hub and shroud; radial rows use an angle-preserving log-spiral map, with the blade count and outer radius chosen so that the radial passage is exactly the one designed in 2D.
  • Assemble stator and rotor rows into a stage and export STEP/STL solids.

Meshing for CFD

  • The canonical pipeline generates a periodic 2D reference mesh with Gmsh, inflation layers and controlled core grading, then deforms and sweeps its shared connectivity into hexahedral/prismatic volumes.
  • General meridional mapping serves axial/radial stators. Linear cascades use physical section coordinates and translational extrusion, with both true 2D export and an optional one-element-span volume.
  • Geometry and meshing are separate actions; reference/volume validity, periodicity, quality and CGNS connectivity are audited before publication.
  • The preserved legacy workflow retains structured O-H topology, sizing from target $y^+$, stator/rotor axial/radial meshes and original guarded cell repairs. Those capabilities remain available under turbo_moc.legacy; they are not silently activated in the canonical pipeline.

Unstructured 2D passage mesh and the inflation layers at the trailing edge

Stage CFD with Ansys Fluent

  • turbo_moc.fluent.stage sets up a stator–rotor stage from the design (mixing plane, barotropic two-phase material built with the companion barotropy package, SST $k$–$\omega$) and writes a Markdown/HTML/PDF report that compares the solution with the MoC design: efficiencies, work, inflow angles, blade Mach numbers and passage fields.
  • Three-dimensional stages from two-dimensional sections: sections blended along the span, optional rotor tip clearance and an exhaust diffuser on the hub and/or shroud.

Automatic differentiation (optional)

  • turbo_moc.jax_rotor is a JAX copy of the vortex rotor and its starting check, for exact gradients of the blade geometry and starting margin with respect to the design inputs. The app and the rest of the package use NumPy and do not import it; a test keeps the two implementations identical.

Interactive app and workflows

  • The current Dash app has Geometry generation and Mesh generation workspaces, ordered row settings, shared machine views, selected-row section/report views and a live terminal for local background jobs.
  • The preceding Nozzle/Stator/Rotor/Cascade app remains runnable through its established entry point. Its diagnostics, reference tools, control-point editing, sizing, CAD and rotor capabilities are preserved.
  • Thin scripted workflows and editable cases live under examples/: Gmsh 2D, Gmsh 3D, Fluent 2D automation and Fluent 3D stage.

The app development checklist records retained capabilities and remaining integration work. The teaching guide derives the coordinate mapping, mesh deformation, connectivity and CGNS export.

Installation instructions

TurboMoC requires Python 3.12 or 3.13. The control-point editor uses the installed nurbspy>=1.7.1,<2.0 package from PyPI.

Install from PyPI

To install TurboMoC from PyPI into an existing Poetry project, use:

poetry add "turbo_moc[cad]"

The cad extra installs CadQuery for STEP/STL export. Gmsh and the app's 3D viewer are installed by default.

Include the fluent extra to install optional PyFluent support alongside CAD:

poetry add "turbo_moc[cad,fluent]"

Use "turbo_moc[fluent]" if you only need the Fluent extra. Poetry records the selected extras in your project's dependencies and installs them from PyPI.

Install from source

With Poetry, clone the repository and install the package with CAD support:

git clone https://github.com/turbo-sim/TurboMoC.git
cd TurboMoC
poetry install --extras cad

For CAD and Fluent support in the source checkout, use:

poetry install --extras "cad fluent"

The fluent extra installs the Python interface; Fluent must be installed and licensed separately. See the Fluent workflow README for the companion barotropy installation and example configuration.

The commands below use poetry run to run tools in the Poetry environment. Use poetry install without extras if you do not need CAD or Fluent support.

Quick start

Save the following as quick_start.py and run it with:

poetry run python quick_start.py

It designs a CO₂ expansion nozzle, prints the convergence status and exit Mach number, and displays the characteristics mesh with Matplotlib.

The conditions are representative of a transcritical CO₂ heat pump: the nozzle expands CO₂ from a gas-cooler outlet at 35 °C and 1.2 times the critical pressure (about 88.5 bar) to the saturation pressure at an evaporation temperature of 5 °C (about 39.7 bar).

import jaxprop as jxp
import matplotlib.pyplot as plt
from turbo_moc import design_nozzle, mpl

fluid = jxp.Fluid("CO2")
inlet_pressure = 1.2 * fluid.critical_point.p  # Pa
inlet_temperature = 273.15 + 35.0  # K; gas-cooler outlet at 35 °C
evaporation_temperature = 273.15 + 5.0  # K (5 °C)
back_pressure = fluid.get_state(jxp.QT_INPUTS, 0, evaporation_temperature).p

result = design_nozzle(
    fluid_name="CO2",
    P0=inlet_pressure,
    T0=inlet_temperature,  # K
    p_back=back_pressure,  # Pa; saturation pressure at 5 °C
    solver="conventional",
)

print(f"Converged: {result['converged']}")
print(f"Exit Mach number: {result['exit_M']:.4f}")

fig, ax = mpl.plot_characteristics_mesh(result, mirror=True)
plt.show()

See the worked examples for nozzle, stator, and rotor design, including plots and coordinate exports.

Interactive app

Launch the app:

poetry run turbo_moc-app

Open the local URL printed in the terminal (port 8052 by default). Example app YAML files are available in examples/apps/cases/.

Follow the illustrated app user guide for the stator–rotor workflow, mesh inspection, quality reports, and project export.

Development and citation

TurboMoC is co-developed by Roberto Agromayor and Andrea Cioffi.

Citation metadata is provided in CITATION.cff. For version-specific reproducibility, also record the release or commit used.

Metadata

Release files for turbo_moc 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for turbo_moc 1.3.0
File Size Uploaded Provenance Actions
turbo_moc-1.3.0.tar.gz 643.7 kB Without provenance Details for turbo_moc-1.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for turbo_moc 1.3.0
File Interpreter ABI Platform Actions
turbo_moc-1.3.0-py3-none-any.whl Python 3 none any Details for turbo_moc-1.3.0-py3-none-any.whl

Total release size: 1.3 MB

Release files / turbo_moc-1.3.0.tar.gz

Download URL turbo_moc-1.3.0.tar.gz
Size 643.7 kB
Tags Source
SHA-256 checksum
How to use checksums
bd04f9d8a823ae16c77a18e9a69f18094b59219c787dce36d3778054344c14c3
BLAKE2b-256 checksum
How to use checksums
eba2f273e7b95ab6f49a8f43412050c49f9cde273db1139365eac1db234a4781
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.2 CPython/3.12.16 Linux/7.0.0-1019-azure

Release files / turbo_moc-1.3.0-py3-none-any.whl

Download URL turbo_moc-1.3.0-py3-none-any.whl
Size 625.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f8d1f52f648daa45958485f65055dcc7dc458b5da2824497914ce7a4574c4856
BLAKE2b-256 checksum
How to use checksums
273daaf32be8b32c2d66ec1dfca684475b5a1fdc1f1b1c45853428a2239a79b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.2 CPython/3.12.16 Linux/7.0.0-1019-azure

Security for turbo_moc 1.3.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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page