Full Flow
- 6 Devlogs
- 17 Total hours
Design and use your own rocket engines.
Design and use your own rocket engines.
Devlog #6
After finishing the Gibbs minimizer, it was pretty easy to finish CCEC. I just had to find the chemical solution with the smallest change in enthalpy using a binary search. I put together a table for stoichiometric methalox and hydrolox combustion at 97 bar comparing my CCEC and NASA’s CEA.
This is awesome!
Devlog #5
After poking at several functions for several hours, I have managed to reduce the Gibbs minimizer runtime from 40 seconds to around 1 second, which is good enough. Hopefully I can improve this in the future, but the final CCEC build should run in reasonable time.
As you can see, CCEC matches NASA’s CEA results pretty nicely if you pay attention to the most significant chemical species!
Devlog #4
After hours of tracking down stupid mistakes, I’ve finally completed a rough implementation of my Gibbs free energy minimizer. It seems to produce reasonably accurate results, but it definitely needs to be optimized. For the final equilibrium solver, it will probably need to run at least 20 times so 40 seconds for one temperature is utterly ridiculous.
I’m scared of optimization.
Devlog #3
I have implemented the chemical adjustment system. Essentially, you give it a set of chemical amounts and tell it to adjust one of them while conserving the total amount of each element in the system. This ended up being really hard to implement and I had to try many different things to get it to work.
First, I tried using the null space vector to change each value in the element vector, which worked in conserving the element counts but it ended up being almost impossible to ensure every chemical had an amount greater than zero. The math doesn’t care about negative numbers, but you definitely can’t have negative 10 moles of hydrogen. Unfortunately, this approach wasted several hours of my time.
Next, I tried another approach that was a bit dumber but much more successful. It uses a bit of matrix magic to lock one value in place (the one you’re modifying) and change others to keep the element conservation.
The second approach worked great and next update I should be able to implement the Gibbs free energy minimizer, and after that, finally finish my chemical equilibrium solver.
Linear algebra is freaking awesome and magical.
Devlog #2
Now you can easily get the elemental and thermodynamic properties of a chemical species; ended up being a little difficult because the dataset I’m using is formatted really weird.
Github is evil.
Devlog #1
The goal of Full Flow is to have a spaceflight simulator where a user can design an engine and rocket parts from scratch and put them together to create a working spacecraft and fly it.
One of the most challenging aspects of this project - or, at least, the one I have to deal with first - is the engine design. It is also what I consider to be the most important.
Most of my time these past few weeks was spent throwing together a really complicated Desmos graph. Thanks to NASA’s propulsion index, there’s a lot of great info about this stuff.
It would be pretty easy to implement this into code, but the problem is that you need to plug in really specific numbers to get the thermodynamics to make sense. This wouldn’t be a problem if all rocket engines used the same fuel, but they don’t. This means I have to implement a system that takes input chemicals and engine properties in and outputs gas properties and the combustion chamber temperatures.
Starting off this project will be the development of CCEC (Connor’s Chemical Equilibrium for Combustion). As it turns out, this stuff is really complicated and required a ton more research. However, again thanks to NASA, there are tons of data and many papers about this topic.
As it turns out, computers don’t understand chemistry. In order to do the calculations to solve for equilibrium, you need a bunch of data for each chemical species the algorithm can use. What I thought would take me less than an hour ended up taking me more than 3 and counting.
Trying to use a database formatted in FORTRAN for a C# project is a bad idea. Since the format and syntax was different (FORTRAN uses (X)D+(Y) instead of (X)E+(Y) for scientific notation???), I had to create an algorithm to search the database. This was hard. I am a terrible programmer and C# is really weird sometimes when it comes to strings.
After banging my head against a wall for 3 hours, I am finally almost done making the class for chemical species, which was the easy part.
Very long devlog.