You are browsing as a guest. Sign up (or log in) to start making projects!

Connor

@Connor

Joined June 1st, 2026

  • 7Devlogs
  • 1Projects
  • 0Ships
  • 0Votes
Open comments for this post

6h 9m 56s logged

Devlog #7

Unfortunately, it was not that easy to finish CCEC.

The problem

I was getting consistently inaccurate results with H2-O2 reactions, overestimating the combustion temperature by hundreds of degrees. Troubleshooting a problem like this is very difficult because its almost impossible to figure out where exactly in the algorithm it all went wrong with just console logs. It was only really H2-O2 and H2-F2 reactions that were off; CH4-O2 and Aerozine-NTO reactions were mostly unaffected.

Fix #1

When I added the ability to specify the temperatures of each reactant, I forgot to consider the fact that the NASA-9 polynomials I was using only worked for temperature ranging from 1000-6000K. That means that when I try to use 90K oxygen as reactant, the enthalpy (kind of like the total energy) is completely off. This was a pretty easy fix because I just had to use a different part of the dataset for low-temperature reactants. While this improved numbers by a little bit, it didn’t fix the hydrogen problem.

Shot-in-the-dark #2

This attempt involved poking around at many different numbers while trying not to break anything. This is what took most of the hours recorded for this devlog. This did not fix the problem.

The solution

During the last devlog, I tried optimizing the program by cutting out any chemicals under a certain value every iteration of the chemistry solver. This was a terrible mistake. It improved the numbers for CH4-O2 by a little bit and made the solver considerably faster, so I didn’t think too much of it. However, as it turns out, this is what caused hydrogen combustion to overshoot temperature. After removing this evil line of code, everything worked perfectly fine again and I was getting great numbers!

Optimization

While 3 seconds on my laptop for solving CH4-O2 combustion is plenty good, 30 seconds for solving a much more complex Aerozine-NTO combustion is unacceptable. This meant I had to optimize my algorithm even more. The main way I did this was reducing the number of iterations for my binary search, since each iteration ran MinimizeGibbsEnergy which is what I’ve been working towards developing since day 1 and is the main bottleneck since it takes so long. Now I can get Aerozine-NTO results in around 7 seconds.

The future

Now I can hopefully finally start working on the engine fluid flow calculations, which shouldn’t take too long since I have them in Desmos already. However, I think in order to get the best results I have to solve the chemistry 3 times in total to get the data I need for the rocket engine. One for the combustion chamber, throat, and nozzle mouth respectively. This is quite unfortunate and means I may have to optimize CCEC even further.

TL;DR

Took forever to find a problem, also did some optimization

(Finally figured out how to use markdown. Thank you Hackclub for giving the preview option for devlogs)

0
0
10
Open comments for this post

1h 4m 20s logged

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!

0
0
14
Open comments for this post

2h 38m logged

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!

1
0
15
Open comments for this post

3h 40m 12s logged

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.

0
0
12
Open comments for this post

4h 3m 25s logged

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.

0
0
9
Open comments for this post

2h 45m 44s logged

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.

0
0
9
Open comments for this post

3h 13m 46s logged

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.

1
0
16

Followers

Loading…