Skip to content

Conversation

@xjjiang
Copy link
Contributor

@xjjiang xjjiang commented Dec 25, 2025

Summary

This PR updates utility application fortran_to_aviary to include the features needed for FLOPS based BWB aircraft dataset.

Related Issues

  • Resolves #

Backwards incompatibilities

None

New Dependencies

None

xjjiang and others added 30 commits December 24, 2025 18:51
Merge branch 'BWB_FLOPS_premission' into BWB_FLOPS_F2A
@xjjiang xjjiang changed the title [Draft] BWB FLOPS Fortran_to_Aviary BWB FLOPS Fortran_to_Aviary Jan 13, 2026
@xjjiang xjjiang marked this pull request as ready for review January 13, 2026 18:26
input_values: NamedValues = vehicle_data['input_values']

# if reference + scaled thrust both provided, set scale factor
# if reference + scaled thrust both provided, set scale factor -- Is this comment still true?
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can remove this whole comment - this is handled by code in engine_deck.py:

Image

input_values.set_val(Aircraft.Fuselage.SIMPLE_LAYOUT, [True], 'unitless')
else:
input_values.set_val(Aircraft.Fuselage.SIMPLE_LAYOUT, [False], 'unitless')
elif design_type[0] == 3:
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should add a catch all 'else' for design_type. FLOPS has options 0,1,2,3.
If a user attempts to convert a FLOPS deck with 1 or 2 set then maybe Aviary should Error to make the user aware that we can't convert those ones yet?


design_type, design_units = input_values.get_item(Aircraft.Design.TYPE)
if design_type[0] == 0:
input_values.set_val(Aircraft.Design.TYPE, ['transport'], design_units)
Copy link
Contributor

Choose a reason for hiding this comment

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

should we use the enum here rather than a string?

input_values.set_val(Aircraft.Wing.INPUT_STATION_DIST, input_station_dist)
n_dist = len(input_station_dist)
chord_per_semispan_dist = input_values.get_val(Aircraft.Wing.CHORD_PER_SEMISPAN_DIST)
chord_per_semispan_dist = [-1.0] + chord_per_semispan_dist[0 : n_dist - 1]
Copy link
Contributor

Choose a reason for hiding this comment

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

just checking that -1 is the correct value, not 0? Perhaps we can add a comment to this block of code explaining the translation of FLOPS -> Aviary detailed wing definition.
I assume this code is implementing this behaviour?

Image


if Aircraft.Engine.SCALED_SLS_THRUST in input_values:
# not sure why THRUST=70000,1,0,0,0,0, just grab the first entry
# does it apply to transporters?
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes - this applies to all FLOPS files, depending on whether the FLOPS user wanted to use the FLOPS optimization functionality.

Image

I think we should move this so it is not only for BWB aircraft. We need to be able to handle the case where there is only one value, or if there is an array.

wing_tc = input_values.get_val(Aircraft.Wing.THICKNESS_TO_CHORD, 'unitless')[0]
input_values.set_val(Aircraft.Fuselage.HEIGHT_TO_WIDTH_RATIO, [wing_tc], 'unitless')

if not Aircraft.Fuel.WING_FUEL_FRACTION in input_values:
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we only need to do this conversion if WING_FUEL_FRACTION does appear in input_values?
Otherwise we can just use the default value? Perhaps we need to set a default value...?

else:
# If detail wing is not provided, initialize it to [0, 0.5, 1]
input_values.set_val(Aircraft.BWB.DETAILED_WING_PROVIDED, [False])
input_values.set_val(Aircraft.Wing.INPUT_STATION_DIST, [0.0, 0.5, 1.0])
Copy link
Contributor

Choose a reason for hiding this comment

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

perhaps add a comment to the user if this is the case?

aircraft:crew_and_payload:baggage_mass_per_passenger,35.0,lbm
aircraft:crew_and_payload:design:num_business_class,20,unitless
aircraft:crew_and_payload:design:num_first_class,16,unitless
aircraft:crew_and_payload:design:num_passengers,154,unitless
Copy link
Contributor

Choose a reason for hiding this comment

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

see comments in fortran_to_aviary, but I don't believe we need to total up the passengers on conversion, that should be handled by preprocessors I think...!

aircraft:engine:geopotential_alt,False,unitless
aircraft:engine:ignore_negative_thrust,False,unitless
aircraft:engine:mass_scaler,1.15,unitless
aircraft:engine:num_engines,2,unitless
Copy link
Contributor

Choose a reason for hiding this comment

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

As for passenger totals I think this should be handled by preprocessors?

mission:design:thrust_takeoff_per_eng,0.25,lbf
mission:landing:initial_velocity,140,ft/s
mission:landing:lift_coefficient_max,3.0,unitless
#mission:landing:lift_coefficient_max,3.0,unitless
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this commented out?

mission:design:thrust_takeoff_per_eng,0.25,lbf
mission:landing:initial_velocity,140,ft/s
mission:landing:lift_coefficient_max,3.0,unitless
#mission:landing:lift_coefficient_max,3.0,unitless
Copy link
Contributor

Choose a reason for hiding this comment

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

Check if this is supposed to be commented out

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.

2 participants