Fix cargo_container mass for flops based off design missions - #1254
Conversation
| 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' |
There was a problem hiding this comment.
Probably should test this, maybe could piggyback on the existing off design tests, if the cargo container mass recomputes on them.
There was a problem hiding this comment.
I think the cargo container mass is fixed to zero for those tests so this would involve adding a new test I think.
|
@cmbenne3 there is one benchmark test that is failing which is why this was kicked out of merge queue: The following tests failed: 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 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 File "/home/runner/work/Aviary/Aviary/aviary/validation_cases/benchmark_tests/test_bench_off_design.py", line 534, in test_payload_range |
|
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. |
|
Payload Range Test
cmbenne3:issue869
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. |
current main: cmbenne3:issue869 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. |
main cmbenne3:issue869 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. |
Moving the solved 2dof benchmarks over to the benchmark suite so they don't run on the oldest runner.
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.