Releases: SvetLuna-Lab/Sympy-nozzle-gasdynamics-lab
Initial SymPy Nozzle Gasdynamics Lab
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 fixedgamma(e.g. 1.4 for air).
- isentropic temperature ratio
#### Numeric wrapper
src/symgas/numerics.py:IsentropicNozzleNumericclass that turns SymPy expressions into NumPy functions;dimensional_profiles(...):- given a Mach profile
M(x)and stagnation conditionsT0,p0(and optionalrho0),
returns dimensional profilesT(x),p(x),rho(x),A(x)/A*.
- given a Mach profile
#### 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 forgamma = 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.
- prescribed Mach distribution from subsonic inlet
#### 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.
- checks isentropic ratios at
-
tests/test_numerics.py:- verifies that for
M = 0dimensional profiles tend toT0,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 atM = 1and is > 1 for both
subsonic and supersonic points.
- verifies that for
-
CHANGELOG.md– initial changelog entry forv0.1.0. -
pyproject.toml– minimal packaging config (symgaspackage, 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.