Generalize the injector to a keyed collection of injector elements - #500
Merged
felipebogaertsm merged 1 commit intoAug 23, 2026
Merged
Conversation
felipebogaertsm
force-pushed
the
494-keyed-injector-elements
branch
from
August 6, 2026 19:18
cd06064 to
4735c60
Compare
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.
felipebogaertsm
force-pushed
the
494-keyed-injector-elements
branch
from
August 17, 2026 00:44
4735c60 to
40d4a3e
Compare
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 #494. Stacked on #499.
BipropellantInjectorduplicated 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.InjectorElementholds a discharge coefficient, a flow area and aMassFlowModel, and ownsget_mass_flow(*, inlet, chamber_pressure). It is a pure function of its own inlet, and returns no flow once the chamber has caught up with it — the guard the simulation loop used to carry.Injectorholds one element per line name and exposesget_mass_flows(*, inlet_states, chamber_pressure), so the propellant count is free: one element for a monoliquid or an oxidizer-only hybrid feed, three for a triliquid.BipropellantInjectoris gone;BiliquidEngineThrustChamber.injectoris now anInjector.