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

From a real-fluid supersonic nozzle to a meshed 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.

Stator blade derived from the nozzle wall and a supersonic vortex rotor blade

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

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 and Fluent 2D automation.

The package refactor describes the current module layout and import changes. 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.2.2

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.2.2
File Size Uploaded Provenance Actions
turbo_moc-1.2.2.tar.gz 613.9 kB Without provenance Details for turbo_moc-1.2.2.tar.gz

Built distribution (wheel)

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

Total release size: 1.2 MB

Release files / turbo_moc-1.2.2.tar.gz

Download URL turbo_moc-1.2.2.tar.gz
Size 613.9 kB
Tags Source
SHA-256 checksum
How to use checksums
74d6fa07045af212d63b031c11b0a41abb38a7b0c5cf5a140bc1f2031944a925
BLAKE2b-256 checksum
How to use checksums
03b84338eef4c4016bb9a524425d9c0aa3d4a93a1e103d297d37fc279daf84bd
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.2.2-py3-none-any.whl

Download URL turbo_moc-1.2.2-py3-none-any.whl
Size 594.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c37aaca820cc96542377776bcf274f610910fd3f991756345cde9a27b3fe6d28
BLAKE2b-256 checksum
How to use checksums
6d254351407603ff2687b092b022c5182a3fc06d35100f7d47154f3c036b7ba7
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.2.2

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