Explain how feed systems are modeled, and rename the theory section to explanations - #505
Merged
felipebogaertsm merged 10 commits intoAug 23, 2026
Conversation
A feed system that identifies its propellants by the attribute names fuel_tank and oxidizer_tank leaves no room for a third propellant, a single propellant, or an oxidizer-only hybrid feed. Add a PropellantLine holding the line name, its role and its Tank, plus a LineState holding the fluid mass and internal energy the integrator carries for that line. The role is a ComponentRole, whose ADDITIVE member covers a triliquid diluent or a coolant line. Nothing consumes these yet.
… one call The feed system took a fuel tank and an oxidizer tank and exposed one pressure hook per side, each taking every other side's fluid mass and internal energy. That signature grows with the square of the propellant count, and a third line was not expressible at all. The system now holds a mapping of PropellantLine keyed by name, and get_fuel_tank_pressure, get_oxidizer_tank_pressure, get_fuel_inlet_state and get_oxidizer_inlet_state give way to get_inlet_pressures and get_inlet_states, which take the state of every line and return the result for every line. A cycle couples its lines physically, as the stacked-tank piston ties the fuel pressure to the oxidizer ullage pressure, so solving them together matches the physics and drops the cross-argument passing. StackedTankPressureFedFeedSystem stacks any number of lines below the pressurizing one, and from_oxidizer_and_fuel keeps the two-line call sites readable.
BipropellantInjector duplicated its discharge coefficient, flow area, mass flow model and mass flow method once per side, so a third propellant line meant a third copy, and a single-line monoliquid or hybrid injector could not be expressed. Now that the injector is fed an inlet fluid state, an element is a pure function of its own inlet. InjectorElement holds a discharge coefficient, a flow area and a mass flow model, and Injector holds one element per line name with a get_mass_flows that takes the inlet state of every line and the chamber pressure. An element returns no flow once the chamber has caught up with its inlet, which is where the guard the simulation loop carried now lives.
BiliquidEngineState kept a separate attribute per side for fluid mass, internal energy, mass flow rate, tank pressure and tank temperature, and computed the mixture ratio as one oxidizer-over-fuel division. BiliquidSimulationResult and the tank profile plot hardcoded the same two series. Each of these is now a mapping keyed by line name, the internal energy drains in a loop over the lines, and the mixture ratio is the total oxidizer flow over the total fuel flow taken by line role, which leaves no ratio for a monoliquid and leaves room for a hybrid grain to contribute to the fuel total. plot_bipropellant_tank_profiles gives way to plot_tank_profiles, which draws a trace per line. The run_timestep skeleton stays aligned with SolidMotorState.
An oxidizer-only hybrid feed and a monoliquid feed are both the one-line case of the feed system contract, but no cycle exercised that case. SingleLinePressureFedFeedSystem delivers one line the tank pressurizes itself, less what the feedline takes, with from_oxidizer_tank for the hybrid case. Tests cover the inlet state, the blowdown as the tank drains, the empty tank, and one line feeding one injector element through the simulation helper.
…o explanations The docs covered feed systems only as API reference, with nothing explaining how a propellant line, a cycle and the injector face fit together, or why the inlet states are solved in one call. Add an explanation page covering the propellant line, the injector face as the seam, the two pressure-fed cycles and their pressure chains, the orifice models, and what the integrator carries per line. Rename the theory section to explanations, along with docs/theory/ and docs/assets/theory/.
An oxidizer-only hybrid feed and a monoliquid feed are both the one-line case of the feed system contract, but no cycle exercised that case. SingleLinePressureFedFeedSystem delivers one line the tank pressurizes itself, less what the feedline takes, with from_oxidizer_tank for the hybrid case. Tests cover the inlet state, the blowdown as the tank drains, the empty tank, and one line feeding one injector element through the simulation helper.
felipebogaertsm
force-pushed
the
496-single-line-pressure-fed
branch
from
August 17, 2026 00:44
977ce49 to
0eabaac
Compare
State the three fields as a list, say what the line name keys, and cover how the lines are used across the feed system, the injector and the recorded series.
Base automatically changed from
496-single-line-pressure-fed
to
495-state-results-plots-per-line
August 23, 2026 00:09
felipebogaertsm
merged commit Aug 23, 2026
126e789
into
495-state-results-plots-per-line
14 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #504. Stacked on #502.
The docs covered feed systems only as API reference; nothing explained how a propellant line, a cycle and the injector face fit together, or why the inlet states are solved in one call.
docs/explanations/feed_systems.md: the propellant line and its role, the injector face as the seam, why every line is solved in one call, the pressure chain for both pressure-fed cycles, the SPI and HEM orifice models, the mixture ratio by role, and the tank energy balance.docs/theory/becomesdocs/explanations/,docs/assets/theory/becomesdocs/assets/explanations/, and the nav section "Rocket Theory" becomes "Explanations".mkdocs build --strictis clean, so every cross-reference resolves.