Remove requirement that engines compute max thrust and other values #946
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.
Summary
Maximum thrust at a given flight condition is required to compute excess specific power for mission. Previously, EngineModels were required to output max thrust, which is a large overhead for users and difficult to clearly communicate through documentation and the API.
The propulsion subsystem was upgraded to check if an EngineModel provides max values (via a new flag,
self.compute_max_values, defaulted to False), and if not creates a duplicate copy of the mission components that are fed a throttle & hybrid throttle of 1 instead. No outputs are promoted from this duplicate engine to avoid promotion/connection issues. Thrust outputted by the duplicate engine is directly connected to the engine mux component's max thrust input.Cleaned up some pieces of propulsion code including formatting, bugfixes, TODO's, etc. as I found them and was able to resolve on the spot.
Disclosure: Generative AI was used to draft coding approaches to handle the parallel engine groups, I ended up not using its suggestions but I did keep a few minor fixes it tried. Code in
propulsion_mission.py: lines 6 and 49 (plus indenting the lines I already wrote immediately following that line) were added by AI. The Cursor IDE was used, which does not disclose which LLM models it uses.Related Issues
Backwards incompatibilities
EngineModels that already compute max thrust can continue to do so as long as they add the
compute_max_valuesflag asTruein their models. If they don't, their component will get duplicated, which theoretically shouldn't break anything but will be very inefficient.New Dependencies
None