Skip to content

Fix cargo_container mass for flops based off design missions - #1254

Merged
Kenneth-T-Moore merged 13 commits into
OpenMDAO:mainfrom
cmbenne3:issue869
Aug 31, 2026
Merged

Kenneth-T-Moore merged 13 commits into
OpenMDAO:mainfrom
cmbenne3:issue869

Conversation

@cmbenne3

@cmbenne3 cmbenne3 commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Quick change to fix cargo_container_mass for off design FLOPS missions.
Aircraft.CrewPayload.CARGO_CONTAINER_MASS is summed into Mission.OPERATING_ITEMS_MASS, which is in turn part of Mission.OPERATING_MASS.
If the cargo load or baggage load (e.g. num passengers) changes between design and off_design then the number of cargo containers will recalculate and change the OPERATING_MASS
It is confusing if this changes between a design and off design mission.
This PR now checks the value from design mission and adds an override for this value in the off_design problem so that it doesn't change.
This is similar to the FLOPS behavior when mywts = 1 is set in a rerun namelist. (it's not identical as FLOPS actually carries the operating empty weight (dowe) across directly (or overwrites with user value) when mywts=1.)

With this change Mission.OPERATING_MASS could now be updated to Aircraft.Design.OPERATING_MASS as I don't think it will ever change between design and off design.

Related Issues

Backwards incompatibilities

None

AI Usage

Disclose any AI usage in this PR, including models used and files affected.

inputs.set_val(Aircraft.CrewPayload.CARGO_CONTAINER_MASS, cargo_container_mass, 'lbm')
if verbosity >= Verbosity.BRIEF:
warnings.warn(
f'Setting CARGO_CONTAINER_MASS for off design mission equal to design mission = {cargo_container_mass} lbm'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Probably should test this, maybe could piggyback on the existing off design tests, if the cargo container mass recomputes on them.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think the cargo container mass is fixed to zero for those tests so this would involve adding a new test I think.

@jkirk5
jkirk5 added this pull request to the merge queue Aug 17, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 17, 2026
@ehariton

Copy link
Copy Markdown
Contributor

@cmbenne3 there is one benchmark test that is failing which is why this was kicked out of merge queue:

The following tests failed:
test_bench_off_design.py:PayloadRangeTest.test_payload_range
test_bench_off_design.py:TestEnergyStateOffDesign.test_off_design_max_range_mission_changed
test_bench_off_design.py:TestEnergyStateOffDesign.test_off_design_min_fuel_mission_changed

File "/home/runner/work/Aviary/Aviary/aviary/validation_cases/benchmark_tests/test_bench_off_design.py", line 206, in test_off_design_min_fuel_mission_changed
assert_near_equal(
File "/home/runner/work/Aviary/Aviary/.openmdao-pixi/.pixi/envs/py311/lib/python3.11/site-packages/openmdao/utils/assert_utils.py", line 733, in assert_near_equal
raise ValueError('actual %s, desired %s, %s error %s, tolerance %s'
ValueError: actual [24216.80682191], desired [24245.7724282], rel error 0.0011946662607701377, tolerance 1e-05

File "/home/runner/work/Aviary/Aviary/aviary/validation_cases/benchmark_tests/test_bench_off_design.py", line 115, in test_off_design_max_range_mission_changed
assert_near_equal(prob_off_design_max_range.get_val(Mission.RANGE), 2377.4, tolerance=1e-3)
File "/home/runner/work/Aviary/Aviary/.openmdao-pixi/.pixi/envs/py311/lib/python3.11/site-packages/openmdao/utils/assert_utils.py", line 733, in assert_near_equal
raise ValueError('actual %s, desired %s, %s error %s, tolerance %s'
ValueError: actual [2406.74846166], desired [2377.4], rel error 0.012344772297906568, tolerance 0.001

File "/home/runner/work/Aviary/Aviary/aviary/validation_cases/benchmark_tests/test_bench_off_design.py", line 534, in test_payload_range
assert_near_equal(
File "/home/runner/work/Aviary/Aviary/.openmdao-pixi/.pixi/envs/py311/lib/python3.11/site-packages/openmdao/utils/assert_utils.py", line 733, in assert_near_equal
raise ValueError('actual %s, desired %s, %s error %s, tolerance %s'
ValueError: actual [38025. 38025. 24529.33078365 0. ], desired [38025. 38025. 24953.7 0. ], rel error 0.007158348138894293, tolerance 0.001

@jkirk5
jkirk5 added this pull request to the merge queue Aug 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 20, 2026
@jkirk5
jkirk5 enabled auto-merge August 24, 2026 21:37
@jkirk5
jkirk5 added this pull request to the merge queue Aug 24, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 24, 2026
@jkirk5
jkirk5 added this pull request to the merge queue Aug 25, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 25, 2026
@jkirk5
jkirk5 added this pull request to the merge queue Aug 27, 2026
@Kenneth-T-Moore

Copy link
Copy Markdown
Member

I just pulled this down on mac, and I get the same 3 failures. Must be SNOPT runs that aren't tested on windows. Will investigate.

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 27, 2026
@cmbenne3

Copy link
Copy Markdown
Contributor Author

Payload Range Test
Current Main:

Name Design max fuel plus payload ferry range Units
Empty Mass 90773.83 90773.83 90773.83 lbm
Operating Items 6043.6 5619.28 4629.54 lbm
Total Crew 915.0 915.0 915.0 lbm
Flight Crew 450.0 450.0 450.0 lbm
Cabin Crew 465.0 465.0 465.0 lbm
Passenger Service 3022.75 3022.75 3022.75 lbm
Cargo Containers 1474.32 1050.0 60.26 lbm
Unusable Fuel 501.3 501.3 501.3 lbm
Oil 130.23 130.23 130.23 lbm
Operating Mass 96817.43 96393.11 95403.37 lbm
Payload 38025.0 24953.65 0 lbm
Passengers and Baggage 38025.0 24300.0 0 lbm
Cargo 0 653.65 0 lbm
Zero Fuel Mass 134842.43 121346.76 95403.37 lbm
Total Fuel 28697.03 42192.7 42192.7 lbm
Mission Fuel 28697.03 42192.7 42192.7 lbm
Reserve Fuel 0 0 0 lbm
Gross Mass 166539.46 166539.46 140596.07 lbm

cmbenne3:issue869

Name Design max fuel plus payload ferry range Units
Empty Mass 90773.83 90773.83 90773.83 lbm
Operating Items 6043.6 6043.6 6043.6 lbm
Total Crew 915.0 915.0 915.0 lbm
Flight Crew 450.0 450.0 450.0 lbm
Cabin Crew 465.0 465.0 465.0 lbm
Passenger Service 3022.75 3022.75 3022.75 lbm
Cargo Containers 1474.32 1474.32 1474.32 lbm
Unusable Fuel 501.3 501.3 501.3 lbm
Oil 130.23 130.23 130.23 lbm
Operating Mass 96817.43 96817.43 96817.43 lbm
Payload 38025.0 24529.33 0 lbm
Passengers and Baggage 38025.0 24300.0 0 lbm
Cargo 0 229.33 0 lbm
Zero Fuel Mass 134842.43 121346.76 96817.43 lbm
Total Fuel 28697.03 42192.7 42192.7 lbm
Mission Fuel 28697.03 42192.7 42192.7 lbm
Reserve Fuel 0 0 0 lbm
Gross Mass 166539.46 166539.46 142010.13 lbm

Since we (correctly) add cargo container mass to the off design cases, the payload must reduce for the max fuel plus payload case since the gross mass and fuel are fixed. The gross mass for the ferry range increases, reducing the range calculated for this case.

@cmbenne3

Copy link
Copy Markdown
Contributor Author

File "/home/runner/work/Aviary/Aviary/aviary/validation_cases/benchmark_tests/test_bench_off_design.py", line 115, in test_off_design_max_range_mission_changed assert_near_equal(prob_off_design_max_range.get_val(Mission.RANGE), 2377.4, tolerance=1e-3) File "/home/runner/work/Aviary/Aviary/.openmdao-pixi/.pixi/envs/py311/lib/python3.11/site-packages/openmdao/utils/assert_utils.py", line 733, in assert_near_equal raise ValueError('actual %s, desired %s, %s error %s, tolerance %s' ValueError: actual [2406.74846166], desired [2377.4], rel error 0.012344772297906568, tolerance 0.001

current main:
CARGO CONTAINERS
DESIGN: [1474.31956451]
OFFDES: [1749.93889393]
OPERATING MASS
DESIGN: [97522.66789489]
OFFDES: [97798.28722432]
FUEL MASS
DESIGN: [32224.90102845]
OFFDES: [28976.71277568]
GROSS MASS
DESIGN: [167772.56892334]
OFFDES: [150000.]

cmbenne3:issue869
CARGO CONTAINERS
DESIGN: [1474.31956451]
OFFDES: [1474.31956451]
OPERATING MASS
DESIGN: [97522.66789489]
OFFDES: [97522.66789489]
FUEL MASS
DESIGN: [32224.90102845]
OFFDES: [29252.33210511]
GROSS MASS
DESIGN: [167772.56892334]
OFFDES: [150000.]

With the cargo containers not updating on the new branch we need to update the range of the mission since the aircraft has more fuel to burn.

@cmbenne3

Copy link
Copy Markdown
Contributor Author

File "/home/runner/work/Aviary/Aviary/aviary/validation_cases/benchmark_tests/test_bench_off_design.py", line 206, in test_off_design_min_fuel_mission_changed assert_near_equal( File "/home/runner/work/Aviary/Aviary/.openmdao-pixi/.pixi/envs/py311/lib/python3.11/site-packages/openmdao/utils/assert_utils.py", line 733, in assert_near_equal raise ValueError('actual %s, desired %s, %s error %s, tolerance %s' ValueError: actual [24216.80682191], desired [24245.7724282], rel error 0.0011946662607701377, tolerance 1e-05

main
CARGO CONTAINERS
DESIGN: [1474.31956451]
OFFDES: [1750.]
OPERATING MASS
DESIGN: [97522.66789489]
OFFDES: [97798.34833039]
FUEL MASS
DESIGN: [32224.90102845]
OFFDES: [24245.76896967]
GROSS MASS
DESIGN: [167772.56892334]
OFFDES: [158294.11730005]

cmbenne3:issue869
CARGO CONTAINERS
DESIGN: [1474.31956451]
OFFDES: [1474.31956451]
OPERATING MASS
DESIGN: [97522.66789489]
OFFDES: [97522.66789489]
FUEL MASS
DESIGN: [32224.90102845]
OFFDES: [24216.8086261]
GROSS MASS
DESIGN: [167772.56892334]
OFFDES: [157989.476521]

With cargo containers not updating the operating mass reduces to match the design mission and as a result the fuel required to fly the mission reduces too.

@Kenneth-T-Moore
Kenneth-T-Moore added this pull request to the merge queue Aug 28, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 28, 2026
Moving the solved 2dof benchmarks over to the benchmark suite so they don't run on the oldest runner.
@Kenneth-T-Moore
Kenneth-T-Moore added this pull request to the merge queue Aug 31, 2026
Merged via the queue into OpenMDAO:main with commit 7023669 Aug 31, 2026
7 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.

Cargo container mass bookeeping

4 participants