Skip to main content

pystormflow

A Python interface to Stormflow, a CFD solver specialized for actuator line simulations of lifting surfaces with the Stormbird library.

Requirements

⚠️ Rust Toolchain Required

This package is distributed as source only and must be compiled during installation. You must have the Rust toolchain installed before installing this package.

Install Rust: Visit https://rust-lang.org/

Stormflow can run parts of the solver on the GPU through wgpu, which requires up-to-date graphics drivers with support for Vulkan, Metal or DirectX 12.

Installation

Once Rust is installed, install pystormflow with pip:

pip install pystormflow

Or install from source:

git clone https://github.com/NTNU-IMT/stormbird.git
cd stormbird/interfaces/pystormflow
pip install .

Use Cases

  • Running actuator line simulations with Stormflow through Python scripting
  • Post-processing of flow fields and sectional forces directly in Python

Implementation Details

The interface is made using PyO3. A simulation is set up from a JSON string, which can be created using Python's built-in json module for dictionaries, or using the stormbird_setup helper package. See the Stormflow README for a description of the solver and its settings.

from pystormflow import Simulation

with open("setup.json") as f:
    simulation = Simulation(f.read())

simulation.do_steps_until_end_time(end_time=10.0, courant_number=0.5)

simulation.export_fields_as_vtk("fields.vtk", binary=True)
result = simulation.get_stormbird_simulation_result()

Development

For a test build using cargo:

cargo build

To build a distributable source package:

maturin sdist

Publishing to PyPI (maintainer cheat-sheet)

This section is a reminder for the main developer. Only the package owner has upload rights to PyPI.

The package is published as a source distribution only (no pre-built wheels), so users compile it locally with their own Rust toolchain. Do not upload wheels from maturin build.

  1. Bump version in Cargo.toml (the Python version is read from there) and update CHANGELOG.md.
  2. Remove old build artifacts and build the source distribution:
    rm -rf target/wheels
    maturin sdist
    
  3. Optionally check that the sdist installs: pip install target/wheels/pystormflow-*.tar.gz
  4. Upload with an API token from PyPI (username __token__, password = the token):
    pip install twine
    twine upload target/wheels/pystormflow-*.tar.gz
    

Metadata

Release files for pystormflow 0.2.1

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

Source distribution (sdist)

Source distribution for pystormflow 0.2.1
File Size Uploaded Provenance
pystormflow-0.2.1.tar.gz 31.5 kB Without provenance Details

Release files / pystormflow-0.2.1.tar.gz

Download URL pystormflow-0.2.1.tar.gz
Size 31.5 kB
Tags Source
SHA-256 checksum
How to use checksums
3d8428c880386ebe39f47986df3eddfc06733cfa9cfb78b2f5d5bcf6775ea67d
BLAKE2b-256 checksum
How to use checksums
70184c036774088ad837b0ff10a541b98e0ed8c0b9fb3d42520e01492252a86d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for pystormflow 0.2.1

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.

Release history Release notifications | RSS feed

This release

0.2.1 This release

1 release file No provenance

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