Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
c3f7938
added a comment
xjjiang Jun 9, 2026
d192f00
replaced excrescences_drag by Aircraft.Design.EXCRESCENCE_DRAG_FACTOR…
xjjiang Jun 9, 2026
2ce4519
minor fix
xjjiang Jun 9, 2026
777dcb3
convert Aircraft.Design.PERCENT_EXCRESCENCE_DRAG from option to varia…
xjjiang Jun 11, 2026
9edf6f8
minor update
xjjiang Jun 11, 2026
083ddca
promote Aircraft.Design.PERCENT_EXCRESCENCE_DRAG in ComputedAeroGroup
xjjiang Jun 11, 2026
58753b8
added Aircraft.Design.PERCENT_EXCRESCENCE_DRAG to test datasets
xjjiang Jun 11, 2026
5aed495
added aircraft:design:percent_excrescence_drag to csv files
xjjiang Jun 11, 2026
40e7b87
minor update
xjjiang Jun 11, 2026
9c8dcd6
update test json file
xjjiang Jun 11, 2026
351f2f7
testing
xjjiang Jun 11, 2026
4208a0c
added Aircraft.Design.PERCENT_EXCRESCENCE_DRAG to COMPUTED_CORE_INPUTS
xjjiang Jun 11, 2026
43396e6
add unit test
xjjiang Jun 11, 2026
d51b572
Merge branch 'OpenMDAO:main' into FLOPS_excrescence
xjjiang Jun 11, 2026
622cacc
preprocess Aircraft.Design.PERCENT_EXCRESCENCE_DRAG for FLOPS and GAS…
xjjiang Jun 15, 2026
39e6457
added Settings.AERODYNAMICS_METHOD to FLOPS based bench test data
xjjiang Jun 15, 2026
a38f548
added EDET-only excrescence drag percent default
jkirk5 Jun 15, 2026
36f01fd
Merge branch 'FLOPS_excrescence' of https://github.com/xjjiang/om-Avi…
jkirk5 Jun 15, 2026
133c7e4
minor update to preprocessor logic tree
jkirk5 Jun 15, 2026
45e2e49
Moved GASP excrescence drag default to the gasp_defaults file (was in…
jkirk5 Jun 16, 2026
d46d5f9
Merge branch 'OpenMDAO:main' into FLOPS_excrescence
xjjiang Jun 16, 2026
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
6 changes: 6 additions & 0 deletions aviary/interface/test/sizing_results_for_test.json
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,12 @@
"unitless",
"<class 'int'>"
],
[
"aircraft:design:percent_excrescence_drag",
0.06,
"unitless",
"<class 'float'>"
],
[
"mission:gross_mass",
175400.0,
Expand Down
4 changes: 4 additions & 0 deletions aviary/mission/test/test_mission_fuel_burn.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,7 @@ def test_taxi_in_fuel_burned(self):

assert_near_equal(fuel_burned, 13234.43186723, tol)
assert_near_equal(block_fuel, 13334.43186723, tol)


if __name__ == '__main__':
unittest.main()
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ aircraft:wing:zero_lift_angle,0,deg
aircraft:design:cruise_altitude,41000,ft
aircraft:design:gross_mass,150000,lbm
aircraft:design:mach,0.8,unitless
aircraft:design:percent_excrescence_drag,0.075,unitless
aircraft:design:range,3500,NM
mission:landing:airport_altitude,0,ft
mission:landing:braking_delay,1,s
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ aircraft:wing:zero_lift_angle,-1.2,deg
aircraft:design:cruise_altitude,37500,ft
aircraft:design:gross_mass,175400,lbm
aircraft:design:mach,0.8,unitless
aircraft:design:percent_excrescence_drag,0.075,unitless
aircraft:design:range,3675,NM
mission:landing:airport_altitude,0,ft
mission:landing:braking_delay,1,s
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ aircraft:furnishings:mass, 0, lbm
aircraft:design:cruise_altitude, 21000, ft
aircraft:design:gross_mass, 155000, lbm
aircraft:design:mach, 0.475, unitless
aircraft:design:percent_excrescence_drag,0.075,unitless
aircraft:design:range, 2020, NM

# Takeoff and Landing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ aircraft:wing:zero_lift_angle,-1.2,deg
aircraft:design:cruise_altitude,37000,ft
aircraft:design:gross_mass,124780,lbm
aircraft:design:mach,0.78,unitless
aircraft:design:percent_excrescence_drag,0.075,unitless
aircraft:design:range,3480,NM
mission:landing:airport_altitude,0,ft
mission:landing:braking_delay,1,s
Expand Down
2 changes: 2 additions & 0 deletions aviary/subsystems/aerodynamics/aerodynamics_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,7 @@ def report(self, prob, reports_folder, **kwargs):
# Mission.GROSS_MASS,
Aircraft.Design.LIFT_COEFFICIENT,
Aircraft.Design.MACH,
Aircraft.Design.PERCENT_EXCRESCENCE_DRAG,
]

COMPUTED_CORE_INPUTS_BWB = [
Expand Down Expand Up @@ -827,6 +828,7 @@ def report(self, prob, reports_folder, **kwargs):
# Mission.GROSS_MASS,
Aircraft.Design.LIFT_COEFFICIENT,
Aircraft.Design.MACH,
Aircraft.Design.PERCENT_EXCRESCENCE_DRAG,
]

HORIZONTAL_TAIL_INPUTS = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ def setup(self):
'laminar_fractions_upper',
'laminar_fractions_lower',
Aircraft.Wing.AREA,
Aircraft.Design.PERCENT_EXCRESCENCE_DRAG,
],
)

Expand Down
33 changes: 19 additions & 14 deletions aviary/subsystems/aerodynamics/flops_based/skin_friction_drag.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,6 @@ def initialize(self):
add_aviary_option(self, Aircraft.VerticalTail.NUM_TAILS)
add_aviary_option(self, Aircraft.Wing.AIRFOIL_TECHNOLOGY)

# TODO: Bring this into the variable hierarchy.
self.options.declare(
'excrescences_drag',
default=0.06,
desc='Drag contribution of excrescences as a percentage.',
)

def setup(self):
nn = self.options['num_nodes']

Expand Down Expand Up @@ -85,6 +78,11 @@ def setup(self):
units=get_units(Aircraft.Wing.LAMINAR_FLOW_LOWER),
desc='Vector of component lower-surface laminar-flow fractions.',
)
add_aviary_input(
self,
Aircraft.Design.PERCENT_EXCRESCENCE_DRAG,
desc='Drag contribution of excrescences as a percentage.',
)

# Aircraft design inputs
add_aviary_input(self, Aircraft.Wing.AREA, units='ft**2')
Expand All @@ -102,7 +100,10 @@ def setup_partials(self):
nc = self.nc
n = nn * nc

self.declare_partials(of='skin_friction_drag_coeff', wrt=[Aircraft.Wing.AREA])
self.declare_partials(
of='skin_friction_drag_coeff',
wrt=[Aircraft.Wing.AREA, Aircraft.Design.PERCENT_EXCRESCENCE_DRAG],
)

rows = np.repeat(np.arange(nn), nc)
cols = np.tile(np.arange(nc), nn)
Expand Down Expand Up @@ -177,14 +178,14 @@ def compute(self, inputs, outputs):

# Add drag for excrescences.

# TODO - Per component not completely implemented in aviary 1.0
# See issue #1184 - Per component not completely implemented in aviary 1.0
# Var mission_skin_friction_drag_corrections_count is a vector over components and is added
# to the drag.
# This may be "dead weight" from FLOPS - D.J.

# An additional six percent of the skin friction drag is added to for excrescences
# An additional percentage of the skin friction drag is added to for excrescences
# (miscellaneous).
CDF *= 1.0 + self.options['excrescences_drag']
CDF *= 1.0 + inputs[Aircraft.Design.PERCENT_EXCRESCENCE_DRAG]

outputs['skin_friction_drag_coeff'] = CDF

Expand Down Expand Up @@ -255,10 +256,10 @@ def compute_partials(self, inputs, partials):
dform_dfine[idx_surf] = dFF1 * (2.0 - airfoil) + dFF2 * (airfoil - 1.0)

den = 1.0 / mission_wing_area
CDF = np.einsum('j,ij,j->i', wetted_area, cf, form_factor) * den
CDF = CDF0 = np.einsum('j,ij,j->i', wetted_area, cf, form_factor) * den

excr = 1.0 + self.options['excrescences_drag']
CDF *= excr
excr = 1.0 + inputs[Aircraft.Design.PERCENT_EXCRESCENCE_DRAG]
CDF = CDF * excr
DCDF_dwet = excr * np.einsum('ij,j->ij', cf, form_factor) * den
DCDF_dcf = excr * wetted_area * form_factor * den
DCDF_dform = excr * np.einsum('j,ij->ij', wetted_area, cf) * den
Expand Down Expand Up @@ -288,6 +289,10 @@ def compute_partials(self, inputs, partials):

partials['skin_friction_drag_coeff', Aircraft.Wing.AREA] = DCDF_dmwa.ravel()

partials['skin_friction_drag_coeff', Aircraft.Design.PERCENT_EXCRESCENCE_DRAG] = (
CDF0.ravel()
)


def _calc_laminar_flow(lam):
return lam * (0.0064164 + lam * (0.48087e-4 - 0.12234e-6 * lam))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -504,4 +504,4 @@ def test_large_single_aisle_2_drag(self):
if __name__ == '__main__':
unittest.main()
# test = MissionDragTest()
# test.test_large_single_aisle_2_drag()
# test.test_basic_large_single_aisle_1()
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

@use_tempdirs
class SkinFrictionDragTest(unittest.TestCase):
def test_derivs(self):
def test_case(self):
nn = 2

fine = np.array([0.13, 0.125, 0.1195, 10.0392, 1.5491, 1.5491])
Expand Down Expand Up @@ -42,7 +42,7 @@ def test_derivs(self):
model.add_subsystem(
'CDf',
SkinFrictionDrag(num_nodes=nn, **options),
promotes_inputs=[Aircraft.Wing.AREA],
promotes_inputs=[Aircraft.Wing.AREA, Aircraft.Design.PERCENT_EXCRESCENCE_DRAG],
promotes_outputs=['skin_friction_drag_coeff'],
)

Expand All @@ -55,6 +55,8 @@ def test_derivs(self):
prob.set_val('CDf.laminar_fractions_upper', lam_up)
prob.set_val('CDf.laminar_fractions_lower', lam_low)
prob.set_val(Aircraft.Wing.AREA, 198.0)
# this must be hardcoded because the FLOPS EDET default is normally applied by the preprocessor
prob.set_val(Aircraft.Design.PERCENT_EXCRESCENCE_DRAG, 0.06)

prob.run_model()

Expand All @@ -65,7 +67,7 @@ def test_derivs(self):

assert_near_equal(prob.get_val('skin_friction_drag_coeff'), [14.91229, 15.01284], 1e-6)

def test_derivs_multiengine(self):
def test_case_multiengine(self):
nn = 2

fine = np.array([0.13, 0.125, 0.1195, 10.0392, 1.5491, 1.5491, 1.125, 1.125, 1.125, 1.125])
Expand Down Expand Up @@ -125,7 +127,7 @@ def test_derivs_multiengine(self):
model.add_subsystem(
'CDf',
SkinFrictionDrag(num_nodes=nn, **options),
promotes_inputs=[Aircraft.Wing.AREA],
promotes_inputs=[Aircraft.Wing.AREA, Aircraft.Design.PERCENT_EXCRESCENCE_DRAG],
promotes_outputs=['skin_friction_drag_coeff'],
)

Expand All @@ -138,6 +140,8 @@ def test_derivs_multiengine(self):
prob.set_val('CDf.laminar_fractions_upper', lam_up)
prob.set_val('CDf.laminar_fractions_lower', lam_low)
prob.set_val(Aircraft.Wing.AREA, 198.0)
# this must be hardcoded because the FLOPS EDET default is normally applied by the preprocessor
prob.set_val(Aircraft.Design.PERCENT_EXCRESCENCE_DRAG, 0.06)

prob.run_model()

Expand Down
2 changes: 1 addition & 1 deletion aviary/subsystems/mass/mass_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def report(self, prob, reports_folder, **kwargs):

# OTHER STRUCTURES (NOT IN GROUP) #
val, units = find_variable_in_problem(Aircraft.Nacelle.MASS, prob, self.meta_data)
f.write(f'|Nacelles|{np.dot(val, num_engines)[0]}||\n')
f.write(f'|Nacelles|{np.dot(val, num_engines)}||\n')
for i, engine in enumerate(engine_models):
if isinstance(val, (np.ndarray, list, tuple)):
val = val[i]
Expand Down
1 change: 1 addition & 0 deletions aviary/utils/legacy_code_data/gasp_defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@
'INGASP.YWFOLD': (0.0, 'ft'),
'INGASP.UM': (0.02, 'unitless'),
'INGASP.MUB': (0.4, 'unitless'),
'INGASP.PCT_EXCR': (0.075, 'unitless'),
}
)

Expand Down
14 changes: 14 additions & 0 deletions aviary/utils/preprocessors.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ def preprocess_options(
verbosity = meta_data[Settings.VERBOSITY]['default_value']
aviary_options.set_val(Settings.VERBOSITY, verbosity)

if Settings.AERODYNAMICS_METHOD in aviary_options:
aero_method = aviary_options.get_val(Settings.AERODYNAMICS_METHOD)
else:
raise UserWarning(
'AERODYNAMICS_METHOD not specified. Cannot preprocess fuel aerodynamic inputs.'
)

preprocess_crewpayload(aviary_options, meta_data, verbosity)
preprocess_fuel_capacities(aviary_options, verbosity)

Expand Down Expand Up @@ -82,6 +89,13 @@ def preprocess_options(
f'Aircraft.Wing.THICKNESS_TO_CHORD ({tc}).'
)

if Aircraft.Design.PERCENT_EXCRESCENCE_DRAG not in aviary_options:
# In FLOPS, excrescence drag percentage is not able to be set via the input file
# Therefore, it appears to have been hardcoded into the method
# Here we set the default value to that fixed value
if aviary_options.get_val(Settings.AERODYNAMICS_METHOD) is LegacyCode.FLOPS:
aviary_options.set_val(Aircraft.Design.PERCENT_EXCRESCENCE_DRAG, 0.06)


def preprocess_crewpayload(aviary_options: AviaryValues, meta_data=CoreMetaData, verbosity=None):
"""
Expand Down
1 change: 1 addition & 0 deletions aviary/utils/test/data/converter_test_BWB_GASP.csv
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ aircraft:design:lift_dependent_drag_coeff_factor,0.85,unitless
aircraft:design:mach,0.8,unitless
aircraft:design:max_structural_speed,402.5,mi/h
aircraft:design:part25_structural_category,3.0,unitless
aircraft:design:percent_excrescence_drag,0.075,unitless
aircraft:design:range,3500.0,NM
aircraft:design:static_margin,0.05,unitless
aircraft:design:structural_mass_increment,0.0,lbm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ aircraft:design:landing_to_takeoff_mass_ratio,0.9423,unitless
aircraft:design:mach,0.8,unitless
aircraft:design:max_structural_speed,440.0,mi/h
aircraft:design:part25_structural_category,3.0,unitless
aircraft:design:percent_excrescence_drag,0.075,unitless
aircraft:design:range,3500.0,NM
aircraft:design:static_margin,0.05,unitless
aircraft:design:structural_mass_increment,0.0,lbm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ aircraft:design:landing_to_takeoff_mass_ratio,0.9423,unitless
aircraft:design:mach,0.8,unitless
aircraft:design:max_structural_speed,402.5,mi/h
aircraft:design:part25_structural_category,3.0,unitless
aircraft:design:percent_excrescence_drag,0.075,unitless
aircraft:design:range,3675.0,NM
aircraft:design:static_margin,0.03,unitless
aircraft:design:structural_mass_increment,0.0,lbm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ aircraft:design:landing_to_takeoff_mass_ratio,0.9423,unitless
aircraft:design:mach,0.78,unitless
aircraft:design:max_structural_speed,402.5,mi/h
aircraft:design:part25_structural_category,3.0,unitless
aircraft:design:percent_excrescence_drag,0.075,unitless
aircraft:design:range,3480.0,NM
aircraft:design:static_margin,0.05,unitless
aircraft:design:structural_mass_increment,0.0,lbm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@
# ---------------------------
inputs.set_val(Settings.EQUATIONS_OF_MOTION, EquationsOfMotion.ENERGY_STATE)
inputs.set_val(Settings.MASS_METHOD, LegacyCode.FLOPS)
inputs.set_val(Settings.AERODYNAMICS_METHOD, LegacyCode.FLOPS)

# ---------------------------
# OUTPUTS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@
# ---------------------------
inputs.set_val(Settings.EQUATIONS_OF_MOTION, EquationsOfMotion.ENERGY_STATE)
inputs.set_val(Settings.MASS_METHOD, LegacyCode.FLOPS)
inputs.set_val(Settings.AERODYNAMICS_METHOD, LegacyCode.FLOPS)

# ---------------------------
# OUTPUTS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@
# ---------------------------
inputs.set_val(Settings.EQUATIONS_OF_MOTION, EquationsOfMotion.ENERGY_STATE)
inputs.set_val(Settings.MASS_METHOD, LegacyCode.FLOPS)
inputs.set_val(Settings.AERODYNAMICS_METHOD, LegacyCode.FLOPS)

# ---------------------------
# OUTPUTS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ aircraft:wing:zero_lift_angle,-1.2,deg
aircraft:design:cruise_altitude,37500,ft
aircraft:design:gross_mass,175400,lbm
aircraft:design:mach,0.8,unitless
aircraft:design:percent_excrescence_drag,0.075,unitless
aircraft:design:range,3675,NM
mission:landing:airport_altitude,0,ft
mission:landing:braking_delay,1,s
Expand Down
Loading