Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Releases: SvetLuna-Lab/Sympy-nozzle-gasdynamics-lab

Initial SymPy Nozzle Gasdynamics Lab

19 Nov 14:24
e79e2b5

Choose a tag to compare

Overview

First public release of the SymPy Nozzle Gasdynamics Lab
a small symbolic/numeric playground for quasi-1D isentropic nozzle flow.

This version is intended as a compact teaching and exploration tool for:

  • students learning compressible flow;
  • engineers who want quick SymPy-based isentropic relations;
  • researchers who like to prototype ideas in symbolic form
    before going to full CFD.

The project sits between a textbook, a lab notebook, and a Python library.


Added

#### Symbolic core

  • src/symgas/symbolic_nozzle.py:
    • isentropic temperature ratio T/T0(M),
    • pressure ratio p/p0(M),
    • density ratio rho/rho0(M),
    • area–Mach relation A/A*(M),
    • helper expressions_for_gamma(...) for a fixed gamma (e.g. 1.4 for air).

#### Numeric wrapper

  • src/symgas/numerics.py:
    • IsentropicNozzleNumeric class that turns SymPy expressions into NumPy functions;
    • dimensional_profiles(...):
      • given a Mach profile M(x) and stagnation conditions T0, p0 (and optional rho0),
        returns dimensional profiles T(x), p(x), rho(x), A(x)/A*.

#### Plots

  • src/symgas/plots.py:
    • plot_mach_profile(...) – Mach vs station;
    • plot_pressure_temperature_profiles(...) – pressure and temperature on the same axis.

#### Notebooks

  • notebooks/01_symbolic_derivations.ipynb
    Step-by-step symbolic derivations for gamma = 1.4:
    T/T0(M), p/p0(M), rho/rho0(M), A/A*(M).

  • notebooks/02_nozzle_profiles.ipynb
    Example 1D nozzle profile:

    • prescribed Mach distribution from subsonic inlet
      through a sonic throat to a supersonic exit;
    • computed dimensional T(x), p(x) and plots.

#### Documentation

  • docs/Overview_EN.md – conceptual English overview
    (nozzle as organ and as a collider-like channel).
  • docs/Overview_RU.md – Russian counterpart with the same idea.
  • Updated README.md:
    • project structure,
    • installation instructions,
    • symbolic and numeric usage examples,
    • brief roadmap.

#### Tests and tooling

  • tests/test_symbolic_nozzle.py:

    • checks isentropic ratios at M → 0,
    • verifies A/A*(M=1) ≈ 1,
    • validates expressions_for_gamma(...) against direct formulas.
  • tests/test_numerics.py:

    • verifies that for M = 0 dimensional profiles tend to T0, p0, rho0;
    • checks monotonic pressure decrease for an increasing Mach sequence
      M = [0.2, 0.5, 1.0, 2.0];
    • confirms that A/A* has a minimum at M = 1 and is > 1 for both
      subsonic and supersonic points.
  • CHANGELOG.md – initial changelog entry for v0.1.0.

  • pyproject.toml – minimal packaging config (symgas package, src-layout).

  • requirements.txt, requirements-dev.txt, pytest.ini, .gitignore.


### Usage

Basic workflow:

# install dependencies
pip install -r requirements.txt

# optional: editable install of the symgas package
pip install -e .

# run tests
pip install -r requirements-dev.txt
pytest

For exploration, open the notebooks:

notebooks/01_symbolic_derivations.ipynb

notebooks/02_nozzle_profiles.ipynb

### Notes and roadmap

This is a prototype lab, not a full nozzle design tool.

Planned directions for future versions:

helpers for subsonic/supersonic branches of A/A*(M);

simple nozzle geometries x → A(x) and corresponding Mach distributions;

basic loss models (non-ideal expansion, friction);

more detailed teaching notebooks for students and self-study.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.