Skip to content

SacredSqueegee/Propellant_Grain_Designer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

94 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MAE-440 Final Project Code

Solid Rocket Motor Design & Analysis Toolkit

Overview

This project is designed for simulation and analysis of solid propellant grains. It performs detailed model-based calculations for propellant burn, motor chamber pressure, thrust characteristics, and the resulting flight trajectory of a rocket. The software is organized around propellant characterization, burn geometry, motor optimization, and vehicle ascent performance. While the program does account for all of the previously mentioned items, it is primarily meant to design propellant count and geometry characteristics.

Key features include:

  • Grain design and burn simulation
  • Pressure and thrust analysis per time step
  • Trajectory calculation for powered/coast phases (accounts for 2-stage rocket and changing time of ignition of upper stage)
  • Data display and graphing utilities
  • Optimization tools for design parameters (Almost not usable, implements brute force approach)

Features

  • Flexible propellant grain and case geometry modeling
  • Stepwise simulation and analysis of chamber pressure, burn rate, thrust, and impulse
  • Rocket trajectory simulation including drag, Mach, and flight altitude/velocity
  • Batch optimization of design variables to target max altitude or other constraints
  • Data tabulation and terminal color-coded summary output
  • Modular graphing for rapid visualization

Code Structure

Module Purpose
Propellant.py Model solid propellant grain, burn area, web thickness and time stepping
TrajectoryFunctions.py Calculates vehicle flight trajectory given burn and environmental data
DataDisplay.py PrettyTables display utilities for all analysis results, with terminal color feedback
Graph.py General-purpose line graphing/plotting utilities (matplotlib)
Terminal.py Terminal color formatting and screen control tools
Optimizer.py Brute-force optimizer for multistage/parameter sweep design tasks
machFinder.py Supersonic/subsonic Mach number solvers for nozzle calculations
PropellantTest.py Unit and integration tests for propellant performance simulation
GraphTest.py Unit and integration tests for all graphing/visualization features
requirements.txt List of required Python dependencies and versions

Getting Started

Prerequisites

  • Python 3.10+
  • Install dependencies with: pip intstall -r requirements.txt

Directory Layout

Place the code modules in a single project directory structure. Ensure that submodules such as libraries and dataStructures (if referenced) are available as dependencies.

Usage Example

A common workflow:

  1. Define propellant and motor geometry parameters in data.py.
  2. Simulate a single motor burn profile with PropellantTest.py for pressure, thrust, impulse, and web recession output.
  3. Simulate a trajectory using TrajectoryFunctions.py for ascent analysis.
  4. Use Optimizer.py to perform batch sweeps for parameters like bore diameter, grain length, nozzle expansion ratio, etc., aiming for the desired apogee or constraint set.
  5. Visualize results with Graph.py and tabular outputs with DataDisplay.py.

Extending and Customizing

  • The toolkit is modular: add more physical models (e.g., new drag formulas, wind models) in separate files and link them in the workflow.
  • Plug in new propellant chemistries or grain geometries by modifying or subclassing Propellant.py.
  • Adjust tabulation and color criteria within DataDisplay.py as needed for different projects.
  • The optimizer supports brute-force sweeps; swap in global/local search or bounded strategies for faster results in future work.

Development and Testing

  • Use the included test scripts (PropellantTest.py, GraphTest.py) to validate model and UI updates.
  • Integration with external or real test data can be achieved by building appropriate I/O wrappers and data pipelines.

Dependencies

Key libraries (see requirements.txt):

  • numpy
  • matplotlib
  • prettytable

References

good matplotlib reference: https://www.geeksforgeeks.org/plot-mathematical-expressions-in-python-using-matplotlib/

About

Code repository for the final project for MAE-440

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages