We have merged a fairly significant systems updated, which overhauls both some of the internal physics as well as greatly expands the systems simulation and detail of the fuel cells and LM ECS.
Summary:
Overhaul Thermal Engine
Overhaul LM cabin/suit loop heat transfer
Improved Model of Hydrogen, Oxygen, and Nitrogen in the liquid phase.
Add Nitrogen pressurization system to fuel cells.
Add fuel cell reactant chambers
Make fuel cell voltage dependent on reactant pressures.
Overhaul Thermal Engine
This is the oldest part of this update, it started a a simple update of our thermal engine code, intended to improve code readability and structure. Scope-creep happened and here we are 18 months later.
The main points are:
A quick note on thermal Polars. The plot below shows the types of Polars that SPSDK/NASSP now supports. Previously we only supported the “directional” type, but the addition of the other three will allow us to more realistically simulate external and internal thermal objects. The magnitude (relative to 1.0) indicated how much Sun (and planet IR and reflected) heat the objects (tank, antenna, thruster etc.) receive or radiate relative to its orientation vector.
Add ASA heat/cooling
@rcflyinghokie has added the ASA stand-by and fast heaters. These operate during TLC before the AGS is powered up to keep the ASA at the correct temperature. Waste heat gets dumped into the glycol and is a contributing factor to the steady-state temperature of the LM during TLC.
Overhaul LM cabin/suit loop heat transfer
The atmosphere portion of the LM ECS is simulated by a large collection of SPSDK tank and pipe objects. The topology of this collection looks something like this:
Changes have been made (mostly small adjustments) to improve the O2 flow around the suit loop by approximately a factor of 2, bringing it significantly closer to the actual mass-flow-rate. This has the effect of drastically improving the ability of the glycol to extract heat from the cabin (which allows us to put a more realistic amount of heat in), and allows us to reduce the partial pressure of CO2 closer to actual values.
The temperature behavior of the LM cabin temp should look something like this: (lower graph)
So if you’re getting drastically different results, that is probably an indication that something isn’t right. I won’t say we have LM temps perfect, but feedback from users is very helpful here.
This update to the LM systems has also necessitated slightly increase the number of sub-steps that SPSDK does internally for each Orbiter time-step. This has been done to improve systems stability. Below a 1 second time-step all internal LM systems should be updated on a constant 50Hz(relative to Orbiter time, not system) update loop.
Improved Model of Hydrogen, Oxygen, and Nitrogen in the liquid phase.
Last September after some discussions with
@indy91 I attempted to add a large H2 tank to our SIVb so that we could realistically simulate propulsive venting. At the time I ran into rather significant roadblocks with the current implementation of our fluid simulation, and as often happens I went down a rather deep rabbit hole in an attempt to fix them. As a result I have ended up a long way from where I started (although we did add propulsive vending last year, just using a different method).
The figure below illustrates the root cause of the issues I was having. Shown in read are the current (now, old) densities of H2, O2, and N2 as a function of temperature. By far the most significant improvement is the removal of the local minima present in both the H2 and O2 existing models. Density increase decrease should now be smooth, continuous, and monotonic with decreasing temperature. The model that was in place before, worked fairly well for conditions like the inside of a CSM cryo tank, but quickly broke down at other temperatures, additionally oxygen was significantly colder (by ~100°F) than it should've been.
The liquid-density update was previously the subject the subject of several prior (closed without merging) PRs. This update adds an improved model of the density-temperature relationship and bulk modulus for H2, N2, and O2 based on
curve-fitting NIST data, and is critical to accurate CSM cryo-tank behavior. Temperatures should much more closely match AOH plots and mission documentation. Tank heater duty cycles and pressure decay rates have also been improved as a result. The Apollo 7 tank stratification tests should produce results that are significantly more well aligned with the mission documentation.
This curve-fit is still not a 100% accurate simulation of real-works substances, but they are representative of real-world data and are within a few degrees/psi over a wide range of temperatures and pressures, and give plausible simulation results. Further improvements to the fluid simulation are probably best accomplished by the replacement of this system with something like Cantera (but I will leave that to people with more ambition and time).
Because of how this changes the compressability of O2, it should be noted that it will now take much longer (which is correct), to fill the surge tank and re-press package from empty.
Add Nitrogen pressurization system to fuel cells
A long-term goal of mine has been a more complete simulation of the fuel cells. Some of the work being merged now, goes back as far as fall of 2020, at least as far as lessons learned on what is possible to simulate.
The Apollo CSM fuel cells are surrounded by a Nitrogen atmosphere that maintains pressure on the cell stack, as well as serving as a pressure reference for the H2 and O2 regulators. This nitrogen system (shown below in green) is now [mostly] simulated.
Those of you familiar with our
CSM Telemetry Client will be happy to know that telemetry words for the Nitrogen pressure have been added to the telemetry data and can be viewed on the EPS page in HBR, (Along with proper FC reactant pressures, see next section).
Add fuel cell reactant chambers & Make fuel cell voltage dependant on reactant pressures.
Previous iterations of our fuel cells have not included any internal volume for the reactant space. This means that fuel cell flow-rate is always equal to the instantaneous demand for reactant of the cell. A much more realistic approach has now been modeled where each cell has a respective H2 and O2 "Tank" that serves as reactant chamber. The H2 and O2 regulators feed reactants into the chamber, and the fuel cell consumes them. Thus results in a significant improvement in the realism of the reactant flow behaviour and make the cells much more dynamic. A great illustration of this can be seen by closing the reactant valves and watching how the cells behave.
Final notes and cautions.
As with all major updates we can never guarantee that anything is 100% bug free, although we take great pains to ensure it is. This update has been extensively tested but it always possible there is an edge case that we missed.
If you are currently flying a mission, as always it is highly recommended that you wait until you finish the mission before you do any updates to NASSP. If you would really like to update your mission we do have a python script that can update your scenarios for you (and as always I am happy to do this for you if you PM me, make a post, or ask on discord.)
Enjoy!