Skip to content

Fuel Variable Accounting - Issue 1012#1027

Merged
jkirk5 merged 37 commits intoOpenMDAO:mainfrom
ehariton:issue_1012v2
Mar 25, 2026
Merged

Fuel Variable Accounting - Issue 1012#1027
jkirk5 merged 37 commits intoOpenMDAO:mainfrom
ehariton:issue_1012v2

Conversation

@ehariton
Copy link
Contributor

@ehariton ehariton commented Mar 16, 2026

Summary

This PR includes a revamp and simplification of fuel mass variables to prevent users from incorrectly selecting variables that don't actually represent mission fuel burn. This included fixes to GASP to Aviary file conversion. As well as an additional doc page on how fuel is summed up. Also fixed some reports that were showing incorrect fuel burn values when takeoff was enabled.

Details

Name and Reference Changes

Renamed for clarity
Mission.fuel.FUEL_MARGIN -> Mission.Fuel.VOLUME_MARGIN this is a fuel margin and has little to do with fuel mass
Aircraft.Design.RESERVE_FUEL_FRACTION -> Aircraft.Design.RESERVE_FUEL_MARGIN we are tracking this as a % now

Removed from aviary variable hierarchy because they were internal variables in GASP and did not need to be set by the user:
Mission.Summary.FUEL_MASS
Mission.Summary.FUEL_MASS_REQUIRED

Updated OAS builder tests to refer to Aircraft.Fuel.WING_FUEL_CAPACITY rather than Mission.Summary.FUEL_MASS which was the mass of ALL fuel for the mission including in the fuselage and aux tanks!!

The initial mass used to calculate Mission.Summary.FUEL_BURNED is now always Mission.Summary.GROSS_MASS whereas before it was sometimes this and sometimes the first point in the first dymos phase.

Calculations Updates

Changed the way Mission.Summary.TOTAL_FUEL_MASS is calculated to remove incorrect addition of Mission.fuel.FUEL_MARGIN.

Updates to GASP to Aviary conversion factors

INGASP.FVOL_MRG -> Mission.Fuel.VOLUME_MARGIN
Depending on the value for FRESF:
INGASP.FRESF -> Aircraft.Design.RESERVE_FUEL_ADDITIONAL
INGASP.FRESF -> Aircraft.Design.RESERVE_FUEL_MARGIN

Test updates

A number of FRESF values were listed as small numbers (0.15 to 0.22) and were being converted to RESERVE_FUEL_ADDITIONAL in lbm. However, with the updates to VOLUME_MARGIN, this caused some BWB missions to stop converging so we modified the source .dat and .csv files for those examples to FRESF = -.1 which kept the gross mass of the concept the same as the test values.

reserve_fuel_margin_mass calculation was updated to not use Mission.Landing.TOUCHDOWN_MASS since that is only calculated if Landing=True. This was swapped with the typical way of calculating fuel-burn by taking final mass - initial miss.

A number of tests had ridiculously small tolerances (1e-9) that were being violated. These were relaxed to 1e-8.

The multi-mission test needed a few more iterations to converge with the change in Mission.Summary.FUEL_BURNED calculations so I bumped the iterations from 75 to 150.

Report updates

The reports for mass summation from pre-mission located in mass_builder.py were changed to display Mission.Summary.GROSS_MASS rather than design gross mass. This was important because all the values in that section were mission specific aircraft details.

Fuel reports in reports.py were updated to properly include fuel burned in takeoff, which was not correctly being added when include_takeoff=True. This was done by referencing mission:summary:fuel_burned directly instead of trying to calculate initial mass - final mass again.

Related Issues

Backwards incompatibilities

None

New Dependencies

None

ehariton added 18 commits March 16, 2026 16:03
…esents extra wing tank volume, not the fuel in the aircraft. Removed FUEL_MASS_REQUIRED and FUEL_MASS from variable_meta_data and as they were internal variables to GASP fuel tank sizing and were not needed by any other processes. They are now local variables in fuel.py fuel_mass_reqired and fuel_mass. Removed VOLUME_MARGIN for calculation of Mission.Summary.TOTAL_FUEL_MASS, the latter is now only made up of FUEL_BURNED + RESERVE_FUEL. Changed name of RESERVE_FUEL_FRACTION to RESERVE_FUEL_MARGIN and changed it from fraction to percentage. Changes across the rest of the repo are not yet complete.
…l.FUEL_MASS and Aircraft.Fuel.FUEL_MASS_REQUIRED. These varaibles have been removed from the variable hirearchy already and are no longer accessible for asserts.`
… reserves. Attempted to leave it as 22.22 but this was importing as 22.220000000000002 so switchied it to 22.2
…em is using CS derivatives meaning we cant also check the results using CS derivatives, we have to use a different method
@ehariton ehariton marked this pull request as ready for review March 17, 2026 13:45
)
if RESERVE_FUEL_FRACTION != 0:
if reserve_fuel_margin != 0:
# Originally tried to reference Mission.Summary.FUEL_BURNED for fuel burn but in some tests this led to errors
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which tests, and what error? I'm guessing that happens because 95% of tests don't run a mission, so FUEL_BURNED simply never gets calculated

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this was more of a note to myself that when I tried to use Mission.Summary.FUEL_BURNED instead of (initial_mass - final_mass), some tests broke. I'm hoping I can revise how the fuel-burn is calculated in my follow-on PR.

outputs.set_val(Mission.Summary.USEFUL_LOAD, 5100, 'lbm')
outputs.set_val(Aircraft.Design.TOTAL_WETTED_AREA, 7956.515738, 'ft**2')
outputs.set_val(Mission.Summary.ZERO_FUEL_MASS, 103442.0, 'lbm')
outputs.set_val(Mission.Summary.FUEL_MASS, 26292.0, 'lbm')
Copy link
Contributor

@jkirk5 jkirk5 Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be changed to FUEL_BURNED? This prevents us from checking the mission fuel in tests

Copy link
Contributor Author

@ehariton ehariton Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mission.Summary.FUEL_MASS is no longer calculated by aviary. It's one of those masses that we removed because it was just internal to a GASP calculation. Now that's it's an internal variable we could potentially check it by reaching into that subsystem and examining it's local assignment. But again, this is just meant to size the fuel tanks and fuel systems and never represented the actual fuel going onto the system.

@jkirk5 jkirk5 added this pull request to the merge queue Mar 25, 2026
Merged via the queue into OpenMDAO:main with commit ef15d2d Mar 25, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Too many identical (?) fuel variables

4 participants