In descending order of importance:
-
MDAO class structure
-
Basic setup
-
Fix trajectory calculator and unrealistic optimization outputs -- caused by lack of a drag model
-
Implement an atmospheric model
-
Implement a drag model
-
-
Refine the propulsion class/component to include subgroups within the propulsion assembly
-
Aerodynamics componentNecessary for apogee calculator -
Figure out a reasonable class structure for rocket form factor parameters (diameter etc.)
-
Implement an MDAO
Problemclass that abstracts optimization problems
-
-
Implement proper mass calculations to replace the rudimentary structural coefficient model
-
Figure out the correct chemistry of CEA reactants, specifically reactant temperatures and enthalpies of formation
-
Move optimization options and inputs from
solver.pyto JSON files ininputs/ -
Fix RocketCEA's garbage folders (see note)
-
Move to a JSON5 parsing library to allow for C++-style comments in inputs files
This program aims to implement highly general multi-dimensional multi-disciplinary optimization for the whole rocket assembly
Programs must be written for people to read, and only incidentally for machines to execute
-- Harold Abelson
This program aims for generality, and general programs must be understandable to be reusable. Code clarity and readability is top priority
The hope of organizing the code into MDAO class structure is that each layer of assembly may be understood from its inputs and outputs, with one central, clearly defined function mapping between the two
bears_rocket_solver
├── solver.py # Central calculation script
├── inputs # Solver configuration JSON files
│ └── ...
├── modules
│ ├── BEARS_Atmo # Atmospheric model package
│ │ ├── atmo.py
│ │ └── ...
│ ├── BEARS_Chem # CEA propellant chemistry module
│ │ ├── chem.py
│ │ └── ...
│ └── BEARS_Rocket # MDAO class structure module
│ ├── comp_cea.py # - Propulsion component
│ ├── comp_mass.py # - Mass profile component
│ ├── comp_traj.py # - Trajectory component
│ ├── group_rocket.py # - Rocket assembly group
│ └── ...
├── figures # Figure outputs
│ └── ...
└ ...
BEARS_Chem: CEA parser module. Contains functions to read the reactant
data from input JSONs and parse it into a CEA object to be passed to the
propulsion subsystem
BEARS_Atmo: Currently uses the
isacalc
package for calculating the ISA model parameters from the altitude
BEARS_Rocket: Classes for the OpenMDAO rocket assembly
structure. Each file defines one component class, and each file is prefixed with
the MDAO component type it defines: group_, comp_, etc
MDAO organizes the assembly components into a hierarchical tree-like
class structure.
At the root of the model tree is a Problem definition, which contains a
Group of interconnected Components or other Groups.
The current dataflow structure of our model looks as follows:
Each input variable (coming out of _auto_ivc) can be either fixed or optimized
for. More than one variable can be optimized at once. In the current solver.py
script, one can switch between minimizing the propellant mass, or additionally
calculating the optimal oxidizer-to-fuel ratio with CEA
Model components in detail:
| Component | OpenMDAO Class | Inputs | Outputs | Comments |
|---|---|---|---|---|
| RocketGroup | Group | - | - | The top-level rocket assembly group. This is where the inputs and outputs of individual subsystems are connected together |
| TrajectoryComponent | ExplicitComponent | thrustispinitial_massdry_massdiameter |
apogee |
The trajectory calculator component, including simple drag calculations using the atmospheric model. In the future, this component may also contain the encoding of the flight plan for >1D trajectories |
| MassComponent | ExplicitComponent | payload_masspropellant_massstructural_coefficient |
initial_massdry_mass |
Mass profile of the rocket. Preliminary and will probably be superseded by better calculation methods |
| ChemComponent | ExplicitComponent | chamber_pressuremixture_ratioexpansion_ratio |
cstarispthrust |
Propulsion chemistry subsystem using the CEA solver. This is to be broken up into further subassemblies: nozzle, fuel stack, tank(, injector?) |
This structure is in very early development and is subject to drastic change. This table will evolve as sub-assemblies are refined
The following Python packages are required:
openmdao
rocketcea
isacalc
# Structure visualization
pydot
graphvizTo initialize a Python virtual environment and install the required packages:
python -m venv env
# for Bash shells; use appropriate activation method on your system
source env/bin/activate
# should automatically pull required dependencies
pip install .(You may need to install graphviz on your system, I haven't tested if it works
with plain Python)
solver.py is the main entry point:
source env/bin/activate
./solver.py # or python3 solver.py on Windows
Note: When the program is run, RocketCEA will create some runtime
directories like solver_out in the project directory and RocketCEA in your
home directory. TODO figure out how to instruct RocketCEA to put those in
an appropriate manageable location
OpenMDAO (Muldi-Disciplinary Analysis and Optimization) is the multidisciplinary optimizer that ties the whole solver program together. OpenMDAO works by organizing large calculations into groups and subsystems with corresponding Python classes
CEA is NASA's isentropic chemistry solver written primarily in Fortran. We use CEA Python wrappers in this program for computing the propulsion chemistry
We use RocketCEA instead of the plain CEA Python interface used in a previous version of the program because this new package is designed specifically for rocketry development and is somewhat more convenient
CEA doesn't understand the full chemistry of polymer reactants, and polymers are modelled with a pseudo-species of fixed polymer chain length
ABS properties used in some of the scripts can be found in this table: PubChem ABS table
ISACALC - A very simple Python calculator for the ISA atmospheric model. May be superseded by an in-house ISA calculator in the future
Possible alternatives:
