Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion aviary/core/aviary_problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -1488,7 +1488,7 @@ def run_off_design_mission(
):
num_pax = sum(filter(None, [num_economy, num_business, num_first_class]))

# only FLOPS cares about seat class or specific cargo categories
# only FLOPS cares about seat class, specific cargo categories and cargo containers
if mass_method == LegacyCode.FLOPS:
if num_first_class is not None:
inputs.set_val(Aircraft.CrewPayload.NUM_FIRST_CLASS, num_first_class)
Expand All @@ -1501,6 +1501,15 @@ def run_off_design_mission(
inputs.set_val(Aircraft.CrewPayload.WING_CARGO, wing_cargo, 'lbm')
if misc_cargo is not None:
inputs.set_val(Aircraft.CrewPayload.MISC_CARGO, misc_cargo, 'lbm')
# fix cargo_container_mass so it doesn't change for off_design
cargo_container_mass = self.get_val(
Aircraft.CrewPayload.CARGO_CONTAINER_MASS, units='lbm'
)[0]
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.

)
else:
warnings.warn(
'Off-design functionality is in beta for GASP-mass based aircraft. Please manually '
Expand Down
Loading