Metadata-Version: 2.1
Name: turbodash-core
Version: 0.7.0
Summary: Interactive Dash app for turbomachinery stage preliminary design
Home-page: https://github.com/turbo-sim/turbodash
License: MIT
Author: Roberto Agromayor
Requires-Python: >=3.11,<3.14
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Provides-Extra: mesh
Requires-Dist: dash (>=3.2.0,<4.0.0)
Requires-Dist: dash-bootstrap-components (>=2.0.4,<3.0.0)
Requires-Dist: gunicorn (>=22.0.0,<23.0.0)
Requires-Dist: jaxprop (>=0.5.2,<0.6.0)
Requires-Dist: matplotlib (>=3.10.6,<4.0.0)
Requires-Dist: numpy (>=2.3.0,<3.0.0)
Requires-Dist: plotly (>=5.23.0,<6.0.0)
Requires-Dist: python-docx (>=1.2.0,<2.0.0)
Requires-Dist: scipy (>=1.16.1,<2.0.0)
Requires-Dist: turbo_moc (==1.2.0) ; extra == "mesh"
Requires-Dist: xlwings (==0.34.0)
Project-URL: Documentation, https://github.com/turbo-sim/turbodash
Project-URL: Repository, https://github.com/turbo-sim/turbodash
Description-Content-Type: text/markdown

# Turbodash

`turbodash` is an interactive Dash application for the meanline design of turbine stages.

- 🔗 **App**: [turbodash.onrender](https://turbodash.onrender.com/)
- 📦**PyPI**: [pypi.org/project/turbodash-core](https://pypi.org/project/turbodash-core/)


## Key features
- Supports axial and radial turbine stages.
- Visualization of the meridional channel and blade-to-blade view
- Visualization of total-to-static and total-to-total efficiencies.  
- Adjustable stator/rotor geometry, reaction degree, loss coefficients, and blade velocity ratio. 
- Lightweight, dependency-minimal design based on Plotly Dash.
- Automatic synchronization between sliders and numeric inputs.
- Support import/export of configuration files.
- Experimental app with three tabs: meanline calculation, turbine geometry, and mesh generation/inspection.
- Optional TurboMoC integration in the experimental app for cylindrical axial blade models (STL), periodic 3D passage meshes (Gmsh/CGNS), and VTK geometry/mesh visualization with cell-quality inspection.
- Documentation describing the derivation of governing equations.  

## 🛠️ Installation

**From PyPI:**

Install the latest stable release directly from PyPI:
```bash
pip install turbodash-core
```

**From source (Poetry):**

To get the latest development version, clone the repository and install it using [Poetry](https://python-poetry.org/):
```bash
git clone https://github.com/turbo-sim/turbodash.git
cd turbodash
poetry install
```

**Enable experimental 3D geometry and meshing:**

For development with the companion repository, install it in the same Python
environment as Turbodash. From the `turbodash` directory:

```bash
python -m pip install -e .
python -m pip install -e ../method_of_characteristics
```

Alternatively, `poetry install -E mesh` installs the published TurboMoC 1.2.0
recorded in `poetry.lock`. With pip, use `python -m pip install -e ".[mesh]"`;
for the published Turbodash package, use `python -m pip install "turbodash-core[mesh]"`.
The stable meanline app does not require this optional dependency.
See [the integration assessment and mesh workflow](docs/turbomoc_meshing.md)
for assumptions, outputs, and the Python API.

## 🚀 Run the app locally

The stable turbine meanline app keeps its existing Python launcher:
```bash
python -c "import turbodash; turbodash.launch_app_turbine()"
```

The equivalent console command is `turbodash`. With Poetry, prefix either
command with `poetry run`, for example:
```bash
poetry run python -c "import turbodash; turbodash.launch_app_turbine()"
```

This will start a local server and open the dashboard in your web browser.

To launch the experimental app with the Meanline, Turbine geometry and Mesh
tabs, use its separate command:

```bash
turbodash-experimental
```

After updating an existing checkout, rerun `poetry install` or
`python -m pip install -e .` to register the new console command.

Or use the Python launcher, which also opens your browser:

```bash
python -c "import turbodash; turbodash.launch_app_experimental()"
```

The stable app lives in `turbodash/apps/turbine.py`; the experimental workspace
lives in `turbodash/apps/turbine_experimental.py` so it can be refined independently
before becoming the default. The original single-stage app is also available
with `turbodash-stage` or `turbodash.launch_app_stage()`.

Render and the Procfile continue to launch the stable turbine app. To host the
experimental app separately, install the `mesh` extra and use
`gunicorn turbodash.apps.turbine_experimental:server`.

## Application examples and package organization

[Four YAML-driven app runners](demos/apps/README.md) are available under
`demos/apps/`. Each app has its own runner and startup case. The
[applications guide](turbodash/apps/README.md) explains the stable, experimental,
original stage and dimensionless efficiency applications.

Calculations live in `turbodash/core/`, blade geometry in `geometry/`, plotting
in `visualization/`, report generation in `reporting/`, and external-format
adapters in `io/`. Production loss models remain in `turbodash/loss_models/`.
Import implementations from these packages directly. The former flat module
paths and root module aliases have been removed. Root scientific functions and
Python app launchers remain available. See the [refactor evaluation and migration map](REFACTOR_EVALUATION.md).

## Documentation

The turbine apps use continuous blade counts for meanline losses and efficiency,
and separate integer geometry for physical visualization, meshing and export.
Axial and radial rows take true-chord solidity (`solidity_chord = chord / pitch`)
as their spacing input. Existing Zweifel inputs remain supported for archived
cases; the apps convert them at the loaded design point.
The [loss audit](<loss_model_analysis/loss_model_audit/readme.md>) separates individual
loss-function diagnostics from full stage/turbine loss and efficiency sweeps.
All analyses and turbine solvers use the production models in
`turbodash/loss_models/`, selected by `benner`, `kacker_okapuu`, `moustapha`,
or `isentropic` (zero losses). The shared KO components include the bounded
shock, finite high-Reynolds correction and physical-turning loading formulation.
The stage reports compare isentropic, constant-loss, Kacker–Okapuu and Benner predictions using
the same continuous geometry, true-chord solidity and Benner half-height cap.
Each section includes the scripts and inputs needed to regenerate its figures,
using the existing model functions in this repository.

The [Arianna reproduction prompt](<loss_model_analysis/arianna_comparison/prompt.md>)
describes how to reproduce the original analyses and distinguish historical
whole-model changes from a controlled comparison of loss correlations.

The theoretical derivation of the governing equations, efficiency definitions, and validation against analytical special cases are available in the stable app's Documentation tab and the experimental app's expandable Documentation section in the Meanline tab.

## License
This project is released under the MIT License.

