Skip to content
Chiyami1213Public

About

Interactive 3D rocket propulsion simulator: liquid, hybrid, solid and electric. Python, PySide6, PyVista, NASA CEA.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

107 Commits

Folders and files

Repository files navigation

PropSim

Interactive 3D rocket propulsion simulator for Windows: liquid, hybrid, solid, electric and nuclear thermal propulsion in one desktop application, with live parameter studies, time-domain simulations, synchronized 3D views and publication-style plots.

Features

  • Live mode: physics recomputes in under 50 ms while you drag a slider; plots, 3D scene and readouts follow.

  • Run mode: longer simulations run in a separate process with progress and Cancel, then play back with a scrubber synchronized to the plots, the 3D scene and the readouts. Saved runs can be overlaid for comparison.

  • Modules

    • Common: NASA CEA thermochemistry (eight propellant pairs, equilibrium or frozen) and nozzle performance.
    • Liquid: injector and chamber sizing, regenerative cooling (Bartz), feed-network transients (water hammer, valve timing), pump-fed cycles (gas generator, expander, staged combustion), chugging and L* stability.
    • Hybrid: regression laws, port and grain, core flow fields, fuel and oxidizer, instability and scaling, 0-D and quasi-1D burns, N₂O self-pressurized blowdown.
    • Solid: grain designer (BATES segments, star, wagon wheel, finocyl, moon burner, C-slot, D-grain, X-core, end burner and custom sections), burn rate and K_n with pressure-band laws (KNSB and KNDX from Nakka), 3D level-set burnback, internal ballistics with erosive burning, nozzle losses, throat erosion, Isp and a .eng thrust-curve export (validated against the Kappa-SB static test), and a quasi-steady CP motor (end-face burning, three throat-erosion treatments, parameter sweeps, SI or US customary units).
    • Electric: mission and power trades (Stuhlinger), electrothermal thrusters, gridded ion and Hall thrusters, ion-optics particle simulation, Hall discharge, low-thrust Edelbaum spiral with power degradation.
    • Nuclear: nuclear thermal rocket performance against LOX / LH₂, one-group reactor criticality with reflectors, fuel-element thermal hydraulics (chopped-cosine power, peak fuel temperature, channel pressure drop), hot bleed, cold bleed and expander cycles with real hydrogen, xenon and samarium poisoning over burn and restart histories, and six-group reactor kinetics with fuel, moderator and hydrogen-density feedback (startup with temperature control, reactivity steps, scram with decay heat, Bode stability).
    • Vehicle: staging and atmosphere budget, and a 2-D point-mass ascent over a spherical Earth (U.S. Standard Atmosphere 1976, drag curves or your own table, wind, up to three stages, pitch kick and level-off guidance, perigee cutoff) that can fly thrust curves sent from the hybrid, solid and liquid models.
  • Component library (propsim/data/library): sourced fluid and propellant data, a catalog of 19 liquid-engine component types, reference engines and cycles, every value with its source and quality (published, derived, estimated), plus documented gaps and source conflicts. Read with propsim.data; checked by python tools/check_library.py. The vehicle model uses it for stage engine presets.

  • All math in LaTeX: plot labels, tables, readouts and hover help; every plot has a grid.

  • Color themes: Graphite, Ocean, Forest, Plum and Light, chosen in View > Color Theme (F10) and remembered between sessions. The picker shows each theme's palette and falls back to the theme names alone when the window is too narrow for the palettes.

  • Panels and tutorial: every panel has a drag grip (top left) and a close button (top right); View > Panels and F12 bring them back. Help > Tutorial (F1) is a guided tour you step through with the left and right arrow keys, and it is offered on the first launch.

  • Preferences and shortcuts: Edit > Preferences (F9) sets the color theme, the 3D legend and colorbar, and the quit confirmation, and lets you rebind every menu command. F11 toggles full screen, F2 saves a screenshot of the window to the data folder (screenshots), and double-clicking a slider restores its default. The 3D view has a Legend button (bottom right) that names its solid-color blocks. A loading screen shows while PropSim starts.

  • Export: reports (HTML, PDF, or LaTeX tables with figures) and the exports below, PNG figures, CSV, MATLAB .mat, HDF5, and runnable code:

    • Python script (.py): rebuilds the model with your parameters through the propsim package and redraws every plot with Matplotlib.
    • MATLAB script (.m + _data.mat): every plot redrawn natively (grid, LaTeX labels); set rerun = true to recompute from MATLAB through Python.

Models

Common

  • Thermochemistry & nozzle (Live): propellant pair, O/F, P_c and area ratio give CEA performance and the nozzle.

Liquid

  • Liquid engine designer (Design menu): build any engine cycle from components, solve it, explore trades; the injector and regenerative jacket are components of it.
  • Feed network transient (Run): feed-network transient (valve timing, line dynamics).
  • Pump-fed cycles (Run): pump-fed cycles (gas generator, expander, staged combustion).
  • Chugging & L stability* (Run): chugging and L* stability.

Hybrid

  • Nozzle thrust coefficient (Live): nozzle area ratio gives the C_F curve, Mach and pressure distributions, and a 3D bell nozzle.
  • Regression laws (Live): regression-law explorer.
  • Hybrid motor designer (Design menu, editor window): port and multiport grain, custom ports with inhibitors, grain stacks; 3D grain with a side-view cutaway.
  • Core flow fields (Live): core flow fields (Taylor-Culick and bidirectional-vortex mantle).
  • Fuel & oxidizer (Live): fuel and oxidizer properties.
  • Instability & scaling (Live): ILFI instability and similarity scaling.
  • 0-D burn (Run): 0-D burn (HTPB/GOX power law) with 3D grain cutaway playback.
  • Quasi-1D burn (Run): quasi-1D burn: axial port evolution, throttling, throat erosion.
  • N₂O blowdown (Run): N2O self-pressurized tank blowdown feeding the hybrid motor.

Solid

  • Solid motor designer (Design menu, editor window): grain sections (BATES, star, wagon wheel, finocyl, moon burner, C-slot, D-grain, X-core, end burner and more) with burnback tables, segments and burning ends, 3D grain with a side-view cutaway, Open in Main Window.
  • 3D burnback (Run): 3-D level-set burnback.
  • Internal ballistics (Run): internal ballistics.
  • CP motor (quasi-steady) (Run): quasi-steady cylindrical-perforated motor marched in web: end-face burning, three throat-erosion treatments and parameter sweeps.
  • CP motor (US units) (Run): the same CP motor with inputs and plots in US customary units (in, psi, lbf, lbm).

Electric

  • Mission & power trades (Live): mission and power trades.
  • Electrothermal thrusters (Live): electrothermal thrusters.
  • Gridded ion thruster (Live): gridded ion thruster.
  • Hall thruster (Live): Hall thruster.
  • Ion optics (Run): ion-optics beamlet particle simulation.
  • Hall discharge (Run): 1-D Hall discharge.
  • Low-thrust spiral (Run): low-thrust Edelbaum spiral with solar-array degradation.

Nuclear

  • NTR performance (Live): chamber temperature, pressure and area ratio give I_sp, flow, reactor power and core size, compared with a LOX / LH₂ engine (CEA) and on stage payload fraction.
  • Reactor criticality (Live): one-group bare or reflected sphere, cylinder or slab: k_eff, critical size and mass, reflector savings and the flux shape.
  • Fuel element thermal hydraulics (Live): equivalent fuel cell with a chopped-cosine power shape: propellant, wall and peak fuel temperatures, Dittus–Boelter film coefficient and channel pressure drop.
  • NTR engine cycles (Live): hot bleed, cold bleed and expander energy balances with CoolProp hydrogen: bleed fraction, delivered I_sp, pump outlet pressure and the T–s diagram.
  • Xenon & samarium (Live): iodine-xenon and promethium-samarium chains over a burn, coast and restart, with the poison reactivity against the drum excess.
  • Reactor kinetics & startup (Run): six-group point kinetics with fuel, moderator and propellant-density feedback: startup under outlet temperature control, reactivity steps and a scram with decay heat; closed-loop Bode plot.

Vehicle

  • Vehicle & staging (Live): staging budget (ideal velocity, mass, thrust-to-weight), atmosphere, drag and wind, with a stack sketch.
  • Point-mass ascent (Run): 2-D point-mass ascent over a spherical Earth with staging, wind, drag and imported thrust profiles.

Toy

  • Spring-mass (Run): damped spring-mass, a proof of the Run pipeline (not a propulsion model).

Planned and not yet implemented: ILFI stability (Run).

System requirements

Minimum Recommended
Operating system Windows 10 64-bit (version 1809) or Windows 11 Windows 11 64-bit
Processor 64-bit x86 (x86-64), 2 cores 4 or more cores
Memory 4 GB RAM 8 GB RAM or more (large 3D runs)
Graphics OpenGL 3.2 or newer, up-to-date driver Recent integrated or discrete GPU
Disk space 1.5 GB free (about 0.85 GB installed)
Display 1366 × 768 1920 × 1080 or larger

The installed application needs no Python and works fully offline. Windows on ARM (x64 emulation) is not tested. Running from source needs Python 3.11 or newer.

Installation

Windows installer: v1.0.0 is not released yet. Build the installer yourself with python tools/build_installer.py (see Building the Windows package below); once released, PropSim-<version>-Setup.exe will be on the Releases page. It installs for your account (or for all users), adds Start-menu shortcuts for PropSim and this help page, and can be removed from Windows Apps & features.

From source:

pip install -e .
python run.py

Optional extras: pip install -e ".[cea]" queries NASA CEA directly through RocketCEA (otherwise the bundled CEA tables are used); pip install -e ".[rao]" enables Rao optimum-bell angles from the Huzel & Huang chart via pygasflow (GPL-3.0, not bundled; without it the bell contour uses labelled placeholder angles).

Getting started

The user guide covers the window, workflows, exports, the data folder and shortcuts.

  1. Pick a model in the Modules tree: (Live) models update as you move the sliders, (Run) models start with Run (Ctrl+R).
  2. Hover over a parameter to see its meaning and dimensions.
  3. Use the 3D toolbar for cutaway, color field, color bar and snapshots; the plot tabs below show the results.
  4. Export from the bottom-right buttons or File > Export Code. Help > Online Help opens this page.

Where your data is stored

Saved runs, cases, exports and automatic backups are kept in %APPDATA%\PropSim by default: runs\, cases\, exports\, backups\ (previous versions of overwritten cases and your last session). Choose another location with File > Data Folder, which can also copy existing runs and cases there. File > Restore Last Session reopens the model and parameters from your previous session.

Validation

The test suite (python -m pytest, headless: set QT_QPA_PLATFORM=offscreen) currently reports 236 passed, 1 expected failure (xfail). By group: tests/reference 25 (the MathKit reference script, mathkit_check.py, reports 24 PASS), tests/core 10, tests/validation 118, tests/ui 83 (Live under 50 ms, text and plot standards, process worker, window layout, code export).

  • Reference values: the validation tests reproduce the worked-example values of the project's MathKit document (Sections 2, 3 and 5; Bartz heat-transfer values for the liquid module, ideal thrust coefficient, hybrid, solid and electric-propulsion examples).
  • Thermochemistry: LOX/HTPB performance against Chiaverini Table 1, the bundled tables against direct NASA CEA for all pairs, and frozen versus equilibrium ordering. One test is a documented expected failure: CEA's built-in HTPB is 1.7 % low in c* and 1.2 % low in I_sp against Table 1 (a different HTPB formula), so the 1 % target is not met.
  • Analytic and conservation checks: Prandtl-Meyer and divergence loss for the nozzle, the Joukowsky water-hammer limit and polytropic blowdown for the feed network, pump-turbine power balance for the cycles, chamber mass balance, level-set convergence for the solid grain, and the Hall discharge mass balance.
  • Not validated here: the Hall breathing mode (not reproduced) and ion-optics focusing (checked for trend only).

How it was built

I developed PropSim with Claude in VS Code, working from a written specification and the MathKit reference values. All physics lives in the pure-Python propsim/core/ package, which has no Qt dependency, so it is tested on its own (tests/core, tests/validation); the Run models are drivers in propsim/sims/, and propsim/modules/ and propsim/ui/ only connect them to the plots and the 3D view. Each model's parameters are declared once with the schema in propsim/core/schema.py, which also drives the sliders, hover help and validation.

Model notes and limitations

  • Combustion properties come from NASA CEA tables (about 0.14 % from direct CEA over the tabulated range).
  • Without pygasflow, Rao bell angles are placeholders and labelled as such.
  • The Hall discharge model has fixed field and electron-temperature profiles: the discharge settles and the breathing mode is not reproduced; the breathing frequency is given by the Fife (predator-prey) estimate.
  • Ion optics uses a fixed emission plane (no plasma-meniscus solve) and flags runs near the perveance limit that do not converge; read the focusing curve as a trend.
  • The solid internal-ballistics 3D view uses an equivalent circular port.

Building the Windows package

pip install pyinstaller
python tools/build_exe.py          # dist/PropSim/PropSim.exe
python tools/build_installer.py    # dist/installer/PropSim-<version>-Setup.exe (needs Inno Setup 6)

License and credits

PropSim's own code is released under the MIT License. Third-party notes are in NOTICE.

  • Thermochemistry: the shipped tables (propsim/core/thermo/data/cea_tables.npz) are numbers computed with NASA's Chemical Equilibrium with Applications (Gordon and McBride, NASA RP-1311) through RocketCEA. Neither program is distributed with PropSim.
  • Optional extras are installed separately and keep their own licenses: rocketcea (GPL-3.0) and pygasflow (GPL-3.0). PropSim does not import them unless you install them.
  • Qt for Python (PySide6) is used under the LGPL-3.0; the Windows build ships the Qt libraries as separate files.
  • The remaining runtime libraries (NumPy, SciPy, Matplotlib, PyVista and VTK, pyqtgraph, pydantic, h5py, CoolProp, scikit-image, Numba) are permissively licensed; see NOTICE for each.

Help and feedback

Questions and bug reports: GitHub Issues.

Gallery

Thermochemistry & nozzle: propellant pair, O/F, P_c and area ratio give CEA performance and the nozzle
Thermochemistry & nozzle (Common, Live)
Feed network transient: feed-network transient (valve timing, line dynamics)
Feed network transient (Liquid, Run)
Pump-fed cycles: pump-fed cycles (gas generator, expander, staged combustion)
Pump-fed cycles (Liquid, Run)
Chugging & L* stability: chugging and L* stability
Chugging & L* stability (Liquid, Run)
Nozzle thrust coefficient: nozzle area ratio gives the C_F curve, Mach and pressure distributions, and a 3D bell nozzle
Nozzle thrust coefficient (Hybrid, Live)
Regression laws: regression-law explorer
Regression laws (Hybrid, Live)
Core flow fields: core flow fields (Taylor-Culick and bidirectional-vortex mantle)
Core flow fields (Hybrid, Live)
Fuel & oxidizer: fuel and oxidizer properties
Fuel & oxidizer (Hybrid, Live)
Instability & scaling: ILFI instability and similarity scaling
Instability & scaling (Hybrid, Live)
0-D burn: 0-D burn (HTPB/GOX power law) with 3D grain cutaway playback
0-D burn (Hybrid, Run)
Quasi-1D burn: quasi-1D burn: axial port evolution, throttling, throat erosion
Quasi-1D burn (Hybrid, Run)
N₂O blowdown: N2O self-pressurized tank blowdown feeding the hybrid motor
N₂O blowdown (Hybrid, Run)
3D burnback: 3-D level-set burnback
3D burnback (Solid, Run)
Internal ballistics: internal ballistics
Internal ballistics (Solid, Run)
CP motor (quasi-steady): quasi-steady cylindrical-perforated motor marched in web: end-face burning, three throat-erosion treatments and parameter sweeps
CP motor (quasi-steady) (Solid, Run)
CP motor (US units): the same CP motor with inputs and plots in US customary units (in, psi, lbf, lbm)
CP motor (US units) (Solid, Run)
Mission & power trades: mission and power trades
Mission & power trades (Electric, Live)
Electrothermal thrusters: electrothermal thrusters
Electrothermal thrusters (Electric, Live)
Gridded ion thruster: gridded ion thruster
Gridded ion thruster (Electric, Live)
Hall thruster: Hall thruster
Hall thruster (Electric, Live)
Ion optics: ion-optics beamlet particle simulation
Ion optics (Electric, Run)
Hall discharge: 1-D Hall discharge
Hall discharge (Electric, Run)
Low-thrust spiral: low-thrust Edelbaum spiral with solar-array degradation
Low-thrust spiral (Electric, Run)
NTR performance: chamber temperature, pressure and area ratio give I_sp, flow, reactor power and core size against a LOX / LH₂ engine
NTR performance (Nuclear, Live)
Reactor criticality: one-group bare or reflected reactor, k_eff, critical size and mass, reflector savings and the flux shape
Reactor criticality (Nuclear, Live)
Fuel element thermal hydraulics: chopped-cosine power shape, propellant, wall and peak fuel temperatures and channel pressure drop
Fuel element thermal hydraulics (Nuclear, Live)
NTR engine cycles: hot bleed, cold bleed and expander energy balances with real hydrogen
NTR engine cycles (Nuclear, Live)
Xenon & samarium: iodine-xenon and promethium-samarium poisoning over a burn, coast and restart
Xenon & samarium (Nuclear, Live)
Reactor kinetics & startup: six-group point kinetics with feedback, startup under temperature control, reactivity steps and scram
Reactor kinetics & startup (Nuclear, Run)
Vehicle & staging: staging budget (ideal velocity, mass, thrust-to-weight), atmosphere, drag and wind, with a stack sketch
Vehicle & staging (Vehicle, Live)
Point-mass ascent: 2-D point-mass ascent over a spherical Earth with staging, wind, drag and imported thrust profiles
Point-mass ascent (Vehicle, Run)
Spring-mass: damped spring-mass, a proof of the Run pipeline (not a propulsion model)
Spring-mass (Toy, Run)
Liquid engine designer: flow-diagram editor for building and solving liquid engine cycles
Liquid engine designer (Editor)
Nuclear thermal designer: performance, reactor criticality, fuel element, engine cycle and poison studies in one window, saved as a design for the nuclear analysis modules
Nuclear thermal designer (Editor)
Electric propulsion designer: mission trades, electrothermal, gridded ion and Hall thruster studies in one window, saved as a design for the electric analysis modules
Electric propulsion designer (Editor)
Solid motor designer: design the port and grain stack, see the whole grain in 3D with a side-view cutaway, and read the burning perimeter, port area and remaining propellant
Solid motor designer (Editor)
Hybrid motor designer: design the port and grain stack, see the whole grain in 3D with a side-view cutaway, and read the burning perimeter, port area and remaining propellant
Hybrid motor designer (Editor)

The guided tutorial highlights the parameters panel and explains it
The guided tutorial (Help > Tutorial): left and right arrow keys move between steps.

About

Interactive 3D rocket propulsion simulator: liquid, hybrid, solid and electric. Python, PySide6, PyVista, NASA CEA.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages