Skip to content

Commit

Permalink
Merge pull request OpenMDAO#518 from xjjiang/wetted_area_gasp_again
Browse files Browse the repository at this point in the history
Override wetted area gasp_based
  • Loading branch information
jkirk5 authored Sep 11, 2024
2 parents ed93aed + a752d79 commit 814f8dd
Show file tree
Hide file tree
Showing 26 changed files with 289 additions and 523 deletions.
13 changes: 5 additions & 8 deletions aviary/models/N3CC/N3CC_generic_low_speed_polars_FLOPSinp.csv
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ aircraft:fuselage:max_width,12.3,ft
aircraft:fuselage:military_cargo_floor,False,unitless
aircraft:fuselage:num_fuselages,1,unitless
aircraft:fuselage:passenger_compartment_length,97.5,ft
aircraft:fuselage:wetted_area,4235.082096,lbm
aircraft:fuselage:wetted_area_scaler,1.0,unitless
aircraft:fuselage:wetted_area,4235.082096,ft**2
aircraft:horizontal_tail:area,349.522730527158,ft**2
aircraft:horizontal_tail:aspect_ratio,5.22699386503068,unitless
aircraft:horizontal_tail:laminar_flow_lower,0,unitless
Expand All @@ -80,8 +79,7 @@ aircraft:horizontal_tail:sweep,30.5853213018973,deg
aircraft:horizontal_tail:taper_ratio,0.2734375,unitless
aircraft:horizontal_tail:thickness_to_chord,0.115,unitless
aircraft:horizontal_tail:vertical_tail_fraction,0,unitless
aircraft:horizontal_tail:wetted_area,576.571192,lbm
aircraft:horizontal_tail:wetted_area_scaler,1.0,unitless
aircraft:horizontal_tail:wetted_area,576.571192,ft**2
aircraft:hydraulics:mass_scaler,0.95543,unitless
aircraft:hydraulics:system_pressure,5000,psi
aircraft:instruments:mass_scaler,1.66955,unitless
Expand All @@ -95,7 +93,7 @@ aircraft:nacelle:avg_diameter,7.2,ft
aircraft:nacelle:avg_length,35,ft
aircraft:nacelle:laminar_flow_lower,0,unitless
aircraft:nacelle:laminar_flow_upper,0,unitless
aircraft:nacelle:wetted_area_scaler,244.468282,unitless
aircraft:nacelle:wetted_area,244.468282,ft**2
aircraft:paint:mass_per_unit_area,0,lbm/ft**2
aircraft:propulsion:engine_oil_mass_scaler,1,unitless
aircraft:propulsion:misc_mass_scaler,0,unitless
Expand All @@ -108,7 +106,7 @@ aircraft:vertical_tail:num_tails,1,unitless
aircraft:vertical_tail:sweep,39.735053245438,deg
aircraft:vertical_tail:taper_ratio,0.25,unitless
aircraft:vertical_tail:thickness_to_chord,0.1,unitless
aircraft:vertical_tail:wetted_area_scaler,445.645658,unitless
aircraft:vertical_tail:wetted_area,445.645658,ft**2
aircraft:wing:aeroelastic_tailoring_factor,0.33333,unitless
aircraft:wing:airfoil_technology,1.6,unitless
aircraft:wing:area,1220,1,0,0,0,0,ft**2
Expand Down Expand Up @@ -144,8 +142,7 @@ aircraft:wing:thickness_to_chord_dist,0.14233,0.12233,0.1108,0.1058,unitless
aircraft:wing:thickness_to_chord_reference,0.116565,unitless
aircraft:wing:ultimate_load_factor,3.75,unitless
aircraft:wing:var_sweep_mass_penalty,0,unitless
aircraft:wing:wetted_area,2210.280228,lbm
aircraft:wing:wetted_area_scaler,1.0,unitless
aircraft:wing:wetted_area,2210.280228,ft**2
mission:constraints:max_mach,0.785,unitless
mission:design:gross_mass,1,lbm
mission:design:lift_coefficient,-1,unitless
Expand Down
2 changes: 1 addition & 1 deletion aviary/models/large_single_aisle_1/V3_bug_fixed_IO.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
Aircraft.Fuselage.TAIL_FINENESS, 3, units="unitless"
)
V3_bug_fixed_options.set_val(
Aircraft.Fuselage.WETTED_AREA_FACTOR, 4000, units="unitless"
Aircraft.Fuselage.WETTED_AREA, 4000, units="ft**2"
)
V3_bug_fixed_options.set_val(
Aircraft.VerticalTail.MOMENT_RATIO, 2.362, units="unitless"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ aircraft:fuselage:pressure_differential,7.5,psi
aircraft:fuselage:seat_pitch,29,inch
aircraft:fuselage:seat_width,20.2,inch
aircraft:fuselage:tail_fineness,3,unitless
aircraft:fuselage:wetted_area_factor,4000,unitless
aircraft:fuselage:wetted_area,4000,ft**2
aircraft:horizontal_tail:area,0,ft**2
aircraft:horizontal_tail:aspect_ratio,4.75,unitless
aircraft:horizontal_tail:form_factor,1.25,unitless
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ aircraft:fuselage:pressure_differential,7.5,psi
aircraft:fuselage:seat_pitch,31,inch
aircraft:fuselage:seat_width,24,inch
aircraft:fuselage:tail_fineness,3.368,unitless
aircraft:fuselage:wetted_area_factor,1,unitless
aircraft:fuselage:wetted_area_scaler,1,unitless
aircraft:horizontal_tail:area,0,ft**2
aircraft:horizontal_tail:aspect_ratio,4.26,unitless
aircraft:horizontal_tail:form_factor,1.55,unitless
Expand Down
2 changes: 1 addition & 1 deletion aviary/models/test_aircraft/aircraft_for_bench_FwGm.csv
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ aircraft:fuselage:pressure_differential,7.5,psi
aircraft:fuselage:seat_pitch,29,inch
aircraft:fuselage:seat_width,20.2,inch
aircraft:fuselage:tail_fineness,3,unitless
aircraft:fuselage:wetted_area_factor,4000,unitless
aircraft:fuselage:wetted_area,4000,ft**2
aircraft:horizontal_tail:area,355.0,ft**2
aircraft:horizontal_tail:aspect_ratio,6.0,unitless
aircraft:horizontal_tail:form_factor,1.25,unitless
Expand Down
3 changes: 0 additions & 3 deletions aviary/models/test_aircraft/aircraft_for_bench_GwFm.csv
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,9 @@ aircraft:fuselage:passenger_compartment_length,85.5,ft
aircraft:fuselage:pilot_compartment_length,9.5,ft
aircraft:fuselage:planform_area,1578.24,ft**2
aircraft:fuselage:pressure_differential,7.5,psi
aircraft:fuselage:provide_surface_area,True,unitless
aircraft:fuselage:seat_pitch,29,inch
aircraft:fuselage:seat_width,20.2,inch
aircraft:fuselage:tail_fineness,3,unitless
aircraft:fuselage:wetted_area_factor,4000,unitless
aircraft:fuselage:wetted_area_scaler,1.0,unitless
aircraft:fuselage:wetted_area,4158.62,ft**2
aircraft:horizontal_tail:area,355.0,ft**2
aircraft:horizontal_tail:aspect_ratio,4.75,unitless
Expand Down
2 changes: 1 addition & 1 deletion aviary/models/test_aircraft/aircraft_for_bench_GwGm.csv
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ aircraft:fuselage:pressure_differential,7.5,psi
aircraft:fuselage:seat_pitch,29,inch
aircraft:fuselage:seat_width,20.2,inch
aircraft:fuselage:tail_fineness,3,unitless
aircraft:fuselage:wetted_area_factor,4000,unitless
aircraft:fuselage:wetted_area,4000,ft**2
aircraft:horizontal_tail:area,0,ft**2
aircraft:horizontal_tail:aspect_ratio,4.75,unitless
aircraft:horizontal_tail:form_factor,1.25,unitless
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ aircraft:fuselage:pressure_differential,7.5,psi
aircraft:fuselage:seat_pitch,29,inch
aircraft:fuselage:seat_width,20.2,inch
aircraft:fuselage:tail_fineness,3,unitless
aircraft:fuselage:wetted_area_factor,4000,unitless
aircraft:fuselage:wetted_area,4000,ft**2
aircraft:horizontal_tail:area,0,ft**2
aircraft:horizontal_tail:aspect_ratio,4.75,unitless
aircraft:horizontal_tail:form_factor,1.25,unitless
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ aircraft:fuselage:pressure_differential,7.5,psi
aircraft:fuselage:seat_pitch,44.2,inch
aircraft:fuselage:seat_width,20.2,inch
aircraft:fuselage:tail_fineness,1.18,unitless
aircraft:fuselage:wetted_area_factor,1,unitless
aircraft:fuselage:wetted_area_scaler,1,unitless
aircraft:horizontal_tail:area,0,ft**2
aircraft:horizontal_tail:aspect_ratio,4.025,unitless
aircraft:horizontal_tail:form_factor,1.7,unitless
Expand Down
94 changes: 33 additions & 61 deletions aviary/subsystems/geometry/gasp_based/fuselage.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,8 @@ def setup(self):
self.add_input("cabin_len", val=0, units="ft", desc="LC: length of cabin")
add_aviary_input(self, Aircraft.Fuselage.TAIL_FINENESS, val=3)
self.add_input("cabin_height", val=0, units="ft", desc="HC: height of cabin")
if self.options['aviary_options'].get_val(Aircraft.Fuselage.PROVIDE_SURFACE_AREA, units='unitless'):
add_aviary_input(self, Aircraft.Fuselage.WETTED_AREA_FACTOR,
val=4000, units="unitless")
else:
add_aviary_input(self, Aircraft.Fuselage.WETTED_AREA_FACTOR,
val=1, units="unitless")
add_aviary_input(self, Aircraft.Fuselage.WETTED_AREA_SCALER,
val=1, units="unitless")

add_aviary_output(self, Aircraft.Fuselage.LENGTH, val=0)
add_aviary_output(self, Aircraft.Fuselage.WETTED_AREA, val=0)
Expand All @@ -136,9 +132,11 @@ def setup(self):
"cabin_height",
],
)

self.declare_partials(
Aircraft.Fuselage.WETTED_AREA,
[
Aircraft.Fuselage.WETTED_AREA_SCALER,
"cabin_height",
Aircraft.Fuselage.NOSE_FINENESS,
"nose_height",
Expand All @@ -148,24 +146,6 @@ def setup(self):
],
)

if self.options['aviary_options'].get_val(Aircraft.Fuselage.PROVIDE_SURFACE_AREA, units='unitless'):
self.declare_partials(Aircraft.Fuselage.WETTED_AREA,
Aircraft.Fuselage.WETTED_AREA_FACTOR)

else:
self.declare_partials(
Aircraft.Fuselage.WETTED_AREA,
[
Aircraft.Fuselage.WETTED_AREA_FACTOR,
"cabin_height",
Aircraft.Fuselage.NOSE_FINENESS,
"nose_height",
Aircraft.Fuselage.PILOT_COMPARTMENT_LENGTH,
"cabin_len",
Aircraft.Fuselage.TAIL_FINENESS,
],
)

self.declare_partials(
Aircraft.TailBoom.LENGTH,
[
Expand All @@ -182,7 +162,7 @@ def compute(self, inputs, outputs):
LoverD_nose = inputs[Aircraft.Fuselage.NOSE_FINENESS]
LoverD_tail = inputs[Aircraft.Fuselage.TAIL_FINENESS]
cockpit_len = inputs[Aircraft.Fuselage.PILOT_COMPARTMENT_LENGTH]
fus_SA_factor = inputs[Aircraft.Fuselage.WETTED_AREA_FACTOR]
fus_SA_scaler = inputs[Aircraft.Fuselage.WETTED_AREA_SCALER]
nose_height = inputs["nose_height"]
cabin_len = inputs["cabin_len"]
cabin_height = inputs["cabin_height"]
Expand All @@ -200,11 +180,7 @@ def compute(self, inputs, outputs):
+ 2.1 * LoverD_tail * cabin_height
)

if self.options["aviary_options"].get_val(Aircraft.Fuselage.PROVIDE_SURFACE_AREA, units='unitless'):
fus_SA = fus_SA_factor

else:
fus_SA = fus_SA * fus_SA_factor
fus_SA = fus_SA * fus_SA_scaler

cabin_len_tailboom = fus_len

Expand All @@ -217,7 +193,7 @@ def compute_partials(self, inputs, J):
LoverD_tail = inputs[Aircraft.Fuselage.TAIL_FINENESS]
nose_height = inputs["nose_height"]
cabin_height = inputs["cabin_height"]
fus_SA_factor = inputs[Aircraft.Fuselage.WETTED_AREA_FACTOR]
fus_SA_scaler = inputs[Aircraft.Fuselage.WETTED_AREA_SCALER]
cockpit_len = inputs[Aircraft.Fuselage.PILOT_COMPARTMENT_LENGTH]
cabin_len = inputs["cabin_len"]

Expand All @@ -228,36 +204,32 @@ def compute_partials(self, inputs, J):
J[Aircraft.Fuselage.LENGTH, Aircraft.Fuselage.TAIL_FINENESS] = cabin_height
J[Aircraft.Fuselage.LENGTH, "cabin_height"] = LoverD_tail

if self.options["aviary_options"].get_val(Aircraft.Fuselage.PROVIDE_SURFACE_AREA, units='unitless'):
J[Aircraft.Fuselage.WETTED_AREA, Aircraft.Fuselage.WETTED_AREA_FACTOR] = 1

else:
J[Aircraft.Fuselage.WETTED_AREA, "cabin_height"] = fus_SA_factor * (
2.5 * (LoverD_nose * nose_height + cockpit_len)
+ 3.14 * cabin_len
+ 2.1 * LoverD_tail * cabin_height
+ cabin_height * 2.1 * LoverD_tail
)
J[Aircraft.Fuselage.WETTED_AREA, Aircraft.Fuselage.NOSE_FINENESS] = (
fus_SA_factor * cabin_height * 2.5 * nose_height
)
J[Aircraft.Fuselage.WETTED_AREA, "nose_height"] = (
fus_SA_factor * cabin_height * 2.5 * LoverD_nose
)
J[Aircraft.Fuselage.WETTED_AREA, Aircraft.Fuselage.PILOT_COMPARTMENT_LENGTH] = (
fus_SA_factor * cabin_height * 2.5
)
J[Aircraft.Fuselage.WETTED_AREA, "cabin_len"] = (
fus_SA_factor * 3.14 * cabin_height
)
J[Aircraft.Fuselage.WETTED_AREA, Aircraft.Fuselage.TAIL_FINENESS] = (
fus_SA_factor * 2.1 * cabin_height**2
)
J[Aircraft.Fuselage.WETTED_AREA, Aircraft.Fuselage.WETTED_AREA_FACTOR] = cabin_height * (
2.5 * (LoverD_nose * nose_height + cockpit_len)
+ 3.14 * cabin_len
+ 2.1 * LoverD_tail * cabin_height
)
J[Aircraft.Fuselage.WETTED_AREA, "cabin_height"] = fus_SA_scaler * (
2.5 * (LoverD_nose * nose_height + cockpit_len)
+ 3.14 * cabin_len
+ 2.1 * LoverD_tail * cabin_height
+ cabin_height * 2.1 * LoverD_tail
)
J[Aircraft.Fuselage.WETTED_AREA, Aircraft.Fuselage.NOSE_FINENESS] = (
fus_SA_scaler * cabin_height * 2.5 * nose_height
)
J[Aircraft.Fuselage.WETTED_AREA, "nose_height"] = (
fus_SA_scaler * cabin_height * 2.5 * LoverD_nose
)
J[Aircraft.Fuselage.WETTED_AREA, Aircraft.Fuselage.PILOT_COMPARTMENT_LENGTH] = (
fus_SA_scaler * cabin_height * 2.5
)
J[Aircraft.Fuselage.WETTED_AREA, "cabin_len"] = (
fus_SA_scaler * 3.14 * cabin_height
)
J[Aircraft.Fuselage.WETTED_AREA, Aircraft.Fuselage.TAIL_FINENESS] = (
fus_SA_scaler * 2.1 * cabin_height**2
)
J[Aircraft.Fuselage.WETTED_AREA, Aircraft.Fuselage.WETTED_AREA_SCALER] = cabin_height * (
2.5 * (LoverD_nose * nose_height + cockpit_len)
+ 3.14 * cabin_len
+ 2.1 * LoverD_tail * cabin_height
)

J[Aircraft.TailBoom.LENGTH, Aircraft.Fuselage.NOSE_FINENESS] = nose_height
J[Aircraft.TailBoom.LENGTH, "nose_height"] = LoverD_nose
Expand Down
Loading

0 comments on commit 814f8dd

Please sign in to comment.