Back Home...

My work on OpenBurn

OpenBurn on GitHub


Beginnings

OpenBurn was my attempt to create an free and open-source version of BurnSim, a solid rocket motor simulation and design program primarily serving the amateur rocketry community.
I had used BurnSim extensively in the past to design solid rocket motors - but I has many grievances with it, mainly in the usability and aesthetics of the program.
In some ways the secondary motivating goal was that of community: I envisioned a future where anyone could inspect the code, add features, and fix bugs, engaging the entire community. Finally, as a poor (read: cheap) student I didn't want to pay for a BurnSim licence...
(Author's Note: As of 2021, BurnSim is now free for students to use)

At the time I started the project (around mid 2017), the only other large codebase I had worked on was Momentum Mod, written in good-ol-C++98. Naturally I chose to write OpenBurn in C++, utilizing the Qt framework.

The Qt framework is exceptional, with best-in-class documentation, great support for all major desktop platforms, and feature-full widgets and extensions.
However, the choice to write the application in C++ ended up biting me as the application grew in scope. C++ is quite a difficult language to use correctly, and as a young developer I was keen to use the coolest and newest features as fast as I could. This meant that the code grew outwardly like a spaghetti monster, each new module written in a slightly different (read: "more modern and therefore more better") style, and most of it not written very well.


Learning...

Despite the slow progress, this project was enormously instructive, being one of the first major pieces of code I ever wrote from scratch. Just about every mistake you can make with C++, I did. I learned about CMake, compiler tools, "modern" C++11/14 (and the then-burgeoning C++17), MVC architecture, OO design patterns, and on.
Looking back I have absolutely no idea how I even got started, given how little I knew at the beginning. I recall painfully mucking about until something worked, then reading documentation and books for hours afterwards to try to understand how to do it better.
This approach really doesn't work for everyone, but for me the experience was transformative. To this day when young developers ask for advice I will always recommend "just diving in". The worst thing to do is to never start, the second worst is giving up.

The other big accomplishment from this time was learning to read and digest technical research papers. When first starting I really had absolutely no idea how one would go about modeling a solid rocket motor burning. Reading Rocket Propulsion Elements by Sutton was a good first step. However the basic "steady state" model was not enough, and soon I wanted to model non-deal nozzle flow behavior, erosive burning, startup transients, and more. Digging into and reading all the papers I could find on this topic (many from the mid-1960s) was again one of the best teachers I could ask for.


Release

Eventually my labor of love paid off, and I "released" verion 0.1 of OpenBurn in late 2017 to a small group of friends in the amateur rocketry community. The "MVP" release allowed for simulation of the solid-state burn phase of a solid rocket motor with arbitrary propellants. I was proud of the graphics I had created to animate the simulated motor "burning", and even added features commonly requested by users of BurnSim, such as calculating the mass flux (the amount of mass flow per unit area) at any point in the thrust chamber.


OpenBurn simulation screenshot

Endings

After "release", I began working on adding new requested features such as more grain types. However, at this point the bad architecture began to really catch up with me. It was monumentally difficult to add new grain types as it required overloading countless classes for drawing the grain and simulating the grain. I was also having a hard time finding closed-form simulation equations for common propellant grain types such as a fin-o-cyl. At this point I even went as far as reverse engineering BurnSim to understand the algorithms Greg had used to simulate complex grain shapes, but to no ultimate avail.

Earlier on this page, I said:

The second worst thing you can do is give up.

This was the hardest lesson of all to learn. Sometimes, you just don't have it in you anymore. As I began to take school more seriously I didn't have a lot of time left for rocketry, and my enthusiasm to keep hacking on this code began to wane. I'm still very proud of all the things I learned and accomplished in the ~6 months I spent working on OpenBurn, but I don't regret focusing on other things.

Epilogue

One of the biggest goals of this project was ultimately to make amateur rocketry more accessible, and to foster an open-source, collaborative attitude. These goals, and more, were achieved when Andrew Reilley released openMotor - a program with the same goals and philosophy as OpenBurn, but generally better in (almost ;) every way.

I did spend a few weeks hacking on Andrew's code and added a few small features such as the non-ideal nozzle simulation mentioned above. In the end, the amateur rocketry community now has a free, open-source, hackable simulation tool to play around with. Isn't that what I wanted?