Skip to content

Commit

Permalink
rename Aircraft.Wing.MOUNTING_TYPE to Aircraft.Wing.MOUNT_LOCATION be…
Browse files Browse the repository at this point in the history
…cause it is wing location on fuselage between 0 and 1.
  • Loading branch information
xjjiang committed Jan 13, 2025
1 parent 394fb52 commit 0b55d98
Show file tree
Hide file tree
Showing 19 changed files with 34 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ aircraft:wing:max_slat_deflection_landing,10,deg
aircraft:wing:max_slat_deflection_takeoff,10,deg
aircraft:wing:max_thickness_location,0.4,unitless
aircraft:wing:min_pressure_location,0.3,unitless
aircraft:wing:mounting_type,0,unitless
aircraft:wing:mount_location,0,unitless
aircraft:wing:num_flap_segments,2,unitless
aircraft:wing:optimum_flap_deflection,55,deg
aircraft:wing:optimum_slat_deflection,20,deg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ aircraft:wing:max_slat_deflection_landing, 0, deg
aircraft:wing:max_slat_deflection_takeoff, 0, deg
aircraft:wing:max_thickness_location, 0.35, unitless
aircraft:wing:min_pressure_location, 0.3, unitless
aircraft:wing:mounting_type, 1, unitless
aircraft:wing:mount_location, 1, unitless
aircraft:wing:num_flap_segments, 2, unitless
aircraft:wing:optimum_flap_deflection, 55, deg
aircraft:wing:optimum_slat_deflection, 45, deg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ aircraft:wing:max_slat_deflection_landing,10,deg
aircraft:wing:max_slat_deflection_takeoff,10,deg
aircraft:wing:max_thickness_location,0.35,unitless
aircraft:wing:min_pressure_location,0.3,unitless
aircraft:wing:mounting_type,0,unitless
aircraft:wing:mount_location,0,unitless
aircraft:wing:num_flap_segments,2,unitless
aircraft:wing:optimum_flap_deflection,20,deg
aircraft:wing:optimum_slat_deflection,20,deg
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 @@ -126,7 +126,7 @@ aircraft:wing:max_slat_deflection_landing,10,deg
aircraft:wing:max_slat_deflection_takeoff,10,deg
aircraft:wing:max_thickness_location,0.4,unitless
aircraft:wing:min_pressure_location,0.3,unitless
aircraft:wing:mounting_type,0,unitless
aircraft:wing:mount_location,0,unitless
aircraft:wing:num_flap_segments,2,unitless
aircraft:wing:optimum_flap_deflection,55,deg
aircraft:wing:optimum_slat_deflection,20,deg
Expand Down
2 changes: 1 addition & 1 deletion aviary/models/test_aircraft/aircraft_for_bench_GwFm.csv
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ aircraft:wing:max_camber_at_70_semispan,0.0,unitless
aircraft:wing:max_thickness_location,0.4,unitless
aircraft:wing:min_pressure_location,0.3,unitless
aircraft:wing:misc_mass_scaler,1.0,unitless
aircraft:wing:mounting_type,0,unitless
aircraft:wing:mount_location,0,unitless
aircraft:wing:num_integration_stations,50,unitless
aircraft:wing:shear_control_mass_scaler,1.0,unitless
aircraft:wing:span_efficiency_reduction,False,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 @@ -125,7 +125,7 @@ aircraft:wing:max_slat_deflection_landing,10,deg
aircraft:wing:max_slat_deflection_takeoff,10,deg
aircraft:wing:max_thickness_location,0.4,unitless
aircraft:wing:min_pressure_location,0.3,unitless
aircraft:wing:mounting_type,0,unitless
aircraft:wing:mount_location,0,unitless
aircraft:wing:num_flap_segments,2,unitless
aircraft:wing:optimum_flap_deflection,55,deg
aircraft:wing:optimum_slat_deflection,20,deg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ aircraft:wing:max_slat_deflection_landing,10,deg
aircraft:wing:max_slat_deflection_takeoff,10,deg
aircraft:wing:max_thickness_location,0.4,unitless
aircraft:wing:min_pressure_location,0.3,unitless
aircraft:wing:mounting_type,0,unitless
aircraft:wing:mount_location,0,unitless
aircraft:wing:num_flap_segments,2,unitless
aircraft:wing:optimum_flap_deflection,55,deg
aircraft:wing:optimum_slat_deflection,20,deg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ aircraft:wing:max_slat_deflection_landing,10,deg
aircraft:wing:max_slat_deflection_takeoff,10,deg
aircraft:wing:max_thickness_location,0.35,unitless
aircraft:wing:min_pressure_location,0.3,unitless
aircraft:wing:mounting_type,1,unitless
aircraft:wing:mount_location,1,unitless
aircraft:wing:num_flap_segments,2,unitless
aircraft:wing:optimum_flap_deflection,55,deg
aircraft:wing:optimum_slat_deflection,20,deg
Expand Down
2 changes: 1 addition & 1 deletion aviary/subsystems/aerodynamics/aerodynamics_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ def report(self, prob, reports_folder, **kwargs):
Aircraft.Wing.FUSELAGE_INTERFERENCE_FACTOR,
Aircraft.Wing.MAX_THICKNESS_LOCATION,
Aircraft.Wing.MIN_PRESSURE_LOCATION,
Aircraft.Wing.MOUNTING_TYPE,
Aircraft.Wing.MOUNT_LOCATION,
Aircraft.Wing.SPAN,
Aircraft.Wing.SWEEP,
Aircraft.Wing.TAPER_RATIO,
Expand Down
4 changes: 2 additions & 2 deletions aviary/subsystems/aerodynamics/gasp_based/gaspaero.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def setup(self):

add_aviary_input(self, Aircraft.Wing.THICKNESS_TO_CHORD_ROOT, val=0.15)

add_aviary_input(self, Aircraft.Wing.MOUNTING_TYPE, val=0.0)
add_aviary_input(self, Aircraft.Wing.MOUNT_LOCATION, val=0.0)

add_aviary_input(self, Aircraft.HorizontalTail.VERTICAL_TAIL_FRACTION, val=0.0)

Expand Down Expand Up @@ -202,7 +202,7 @@ def setup_partials(self):
Aircraft.HorizontalTail.VERTICAL_TAIL_FRACTION,
Aircraft.VerticalTail.SPAN,
Aircraft.Fuselage.AVG_DIAMETER,
Aircraft.Wing.MOUNTING_TYPE,
Aircraft.Wing.MOUNT_LOCATION,
Aircraft.Wing.THICKNESS_TO_CHORD_ROOT,
Aircraft.Wing.AREA,
Aircraft.Wing.SPAN,
Expand Down
4 changes: 2 additions & 2 deletions aviary/subsystems/aerodynamics/gasp_based/interference.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class CommonVariables(om.ExplicitComponent):

def setup(self):
self.add_input('CROOT')
add_aviary_input(self, Aircraft.Wing.MOUNTING_TYPE)
add_aviary_input(self, Aircraft.Wing.MOUNT_LOCATION)
add_aviary_input(self, Aircraft.Wing.THICKNESS_TO_CHORD_ROOT)
add_aviary_input(self, Aircraft.Fuselage.AVG_DIAMETER)

Expand All @@ -65,7 +65,7 @@ def compute(self, inputs, outputs):
outputs['wtofd'] = TCR*CROOT/SWF # wing_thickness_over_fuselage_diameter

def setup_partials(self):
self.declare_partials('ZW_RF', [Aircraft.Wing.MOUNTING_TYPE], val=2)
self.declare_partials('ZW_RF', [Aircraft.Wing.MOUNT_LOCATION], val=2)
self.declare_partials(
'wtofd', [
Aircraft.Wing.THICKNESS_TO_CHORD_ROOT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def _init_geom(prob):
prob.set_val(Aircraft.Wing.AVERAGE_CHORD, setup_data["cbarw"])
prob.set_val(Aircraft.Wing.TAPER_RATIO, setup_data["slm"])
prob.set_val(Aircraft.Wing.THICKNESS_TO_CHORD_ROOT, setup_data["tcr"])
prob.set_val(Aircraft.Wing.MOUNTING_TYPE, setup_data["hwing"])
prob.set_val(Aircraft.Wing.MOUNT_LOCATION, setup_data["hwing"])
prob.set_val(Aircraft.HorizontalTail.VERTICAL_TAIL_FRACTION, setup_data["sah"])
prob.set_val(Aircraft.HorizontalTail.SPAN, setup_data["bht"])
prob.set_val(Aircraft.VerticalTail.SPAN, setup_data["bvt"])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def test_common_vars(self):
prob.setup(force_alloc_complex=True)

prob.set_val('CROOT', 12)
prob.set_val(Aircraft.Wing.MOUNTING_TYPE, .1)
prob.set_val(Aircraft.Wing.MOUNT_LOCATION, .1)
prob.set_val(Aircraft.Wing.THICKNESS_TO_CHORD_ROOT, .12)
prob.set_val(Aircraft.Fuselage.AVG_DIAMETER, 10)

Expand Down Expand Up @@ -121,7 +121,7 @@ def test_complete_group(self):
prob.set_val(Aircraft.Wing.AREA, 1400)
prob.set_val(Aircraft.Wing.SPAN, 118)
prob.set_val(Aircraft.Wing.TAPER_RATIO, .9)
prob.set_val(Aircraft.Wing.MOUNTING_TYPE, .1)
prob.set_val(Aircraft.Wing.MOUNT_LOCATION, .1)
prob.set_val(Aircraft.Wing.THICKNESS_TO_CHORD_ROOT, .12)
prob.set_val(Aircraft.Wing.THICKNESS_TO_CHORD_TIP, .1)
prob.set_val(Aircraft.Fuselage.AVG_DIAMETER, 12)
Expand Down
6 changes: 3 additions & 3 deletions aviary/subsystems/mass/gasp_based/fixed.py
Original file line number Diff line number Diff line change
Expand Up @@ -2270,7 +2270,7 @@ def initialize(self):
def setup(self):
num_engine_type = len(self.options[Aircraft.Engine.NUM_ENGINES])

add_aviary_input(self, Aircraft.Wing.MOUNTING_TYPE, val=0)
add_aviary_input(self, Aircraft.Wing.MOUNT_LOCATION, val=0)
add_aviary_input(self, Aircraft.LandingGear.MASS_COEFFICIENT, val=0.04)
add_aviary_input(self, Mission.Design.GROSS_MASS, val=152000)
add_aviary_input(self, Aircraft.LandingGear.MAIN_GEAR_MASS_COEFFICIENT, val=0.85)
Expand All @@ -2291,7 +2291,7 @@ def setup(self):
self.declare_partials(Aircraft.LandingGear.MAIN_GEAR_MASS, "*")

def compute(self, inputs, outputs):
wing_loc = inputs[Aircraft.Wing.MOUNTING_TYPE]
wing_loc = inputs[Aircraft.Wing.MOUNT_LOCATION]
c_gear_mass = inputs[Aircraft.LandingGear.MASS_COEFFICIENT]
gross_wt_initial = inputs[Mission.Design.GROSS_MASS] * GRAV_ENGLISH_LBM
c_main_gear = inputs[Aircraft.LandingGear.MAIN_GEAR_MASS_COEFFICIENT]
Expand Down Expand Up @@ -2331,7 +2331,7 @@ def compute_partials(self, inputs, J):
c_gear_mass = inputs[Aircraft.LandingGear.MASS_COEFFICIENT]
gross_wt_initial = inputs[Mission.Design.GROSS_MASS] * GRAV_ENGLISH_LBM
c_main_gear = inputs[Aircraft.LandingGear.MAIN_GEAR_MASS_COEFFICIENT]
wing_loc = inputs[Aircraft.Wing.MOUNTING_TYPE]
wing_loc = inputs[Aircraft.Wing.MOUNT_LOCATION]
clearance_ratio = inputs[Aircraft.Nacelle.CLEARANCE_RATIO]
nacelle_diam = inputs[Aircraft.Nacelle.AVG_DIAMETER]

Expand Down
8 changes: 4 additions & 4 deletions aviary/subsystems/mass/gasp_based/test/test_fixed.py
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ def setUp(self):
Aircraft.Nacelle.AVG_DIAMETER, val=7.35, units="ft"
) # bug fixed value and original value
self.prob.model.set_input_defaults(
Aircraft.Wing.MOUNTING_TYPE, val=0, units="unitless")
Aircraft.Wing.MOUNT_LOCATION, val=0, units="unitless")

self.prob.setup(check=False, force_alloc_complex=True)

Expand Down Expand Up @@ -927,7 +927,7 @@ def setUp(self):
Aircraft.LandingGear.MAIN_GEAR_MASS_COEFFICIENT, val=0.85, units="unitless"
) # bug fixed value and original value
self.prob.model.set_input_defaults(
Aircraft.Wing.MOUNTING_TYPE, val=0.1, units="unitless")
Aircraft.Wing.MOUNT_LOCATION, val=0.1, units="unitless")

setup_model_options(self.prob, options)

Expand Down Expand Up @@ -1261,7 +1261,7 @@ def setUp(self):
Aircraft.Wing.SPAN, val=117.8, units="ft"
) # original GASP value
self.prob.model.set_input_defaults(
Aircraft.Wing.MOUNTING_TYPE, val=.1, units="unitless")
Aircraft.Wing.MOUNT_LOCATION, val=.1, units="unitless")
self.prob.model.set_input_defaults(
Mission.Design.GROSS_MASS, val=175400, units="lbm"
) # bug fixed value and original value
Expand Down Expand Up @@ -1600,7 +1600,7 @@ def test_case1(self):
Aircraft.Engine.HAS_PROPELLERS: ([False], 'unitless'),
Aircraft.Wing.FLAP_TYPE: ('plain', 'unitless'),
Aircraft.Wing.SWEEP: (30.0, 'deg'),
Aircraft.Wing.MOUNTING_TYPE: (0, 'unitless'),
Aircraft.Wing.MOUNT_LOCATION: (0, 'unitless'),
Aircraft.Wing.TAPER_RATIO: (0.25, 'unitless'),
Aircraft.Wing.ASPECT_RATIO: (11.0, 'unitless'),
Aircraft.Wing.SPAN: (100.0, 'ft'),
Expand Down
4 changes: 2 additions & 2 deletions aviary/subsystems/mass/gasp_based/test/test_mass_summation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2601,7 +2601,7 @@ def setUp(self):
)
self.prob.model.set_input_defaults(Aircraft.Wing.SWEEP, val=22.47, units="deg")
self.prob.model.set_input_defaults(
Aircraft.Wing.MOUNTING_TYPE, val=.1, units="unitless")
Aircraft.Wing.MOUNT_LOCATION, val=.1, units="unitless")
self.prob.model.set_input_defaults(
Aircraft.Wing.ASPECT_RATIO, val=19.565, units="unitless"
)
Expand Down Expand Up @@ -2995,7 +2995,7 @@ def setUp(self):
)
self.prob.model.set_input_defaults(Aircraft.Wing.SWEEP, val=22.47, units="deg")
self.prob.model.set_input_defaults(
Aircraft.Wing.MOUNTING_TYPE, val=.1, units="unitless")
Aircraft.Wing.MOUNT_LOCATION, val=.1, units="unitless")
self.prob.model.set_input_defaults(
Aircraft.Wing.ASPECT_RATIO, val=19.565, units="unitless"
)
Expand Down
3 changes: 2 additions & 1 deletion aviary/variable_info/variable_meta_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -5720,11 +5720,12 @@
)

add_meta_data(
Aircraft.Wing.MOUNTING_TYPE,
Aircraft.Wing.MOUNT_LOCATION,
meta_data=_MetaData,
historical_name={"GASP": 'INGASP.HWING', "FLOPS": None, "LEAPS1": None},
units='unitless',
desc='wing location on fuselage (0 = low wing, 1 = high wing)',
default_value=0.0,
)

add_meta_data(
Expand Down
2 changes: 1 addition & 1 deletion aviary/variable_info/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ class Wing:
MIN_PRESSURE_LOCATION = 'aircraft:wing:min_pressure_location'
MISC_MASS = 'aircraft:wing:misc_mass'
MISC_MASS_SCALER = 'aircraft:wing:misc_mass_scaler'
MOUNTING_TYPE = 'aircraft:wing:mounting_type'
MOUNT_LOCATION = 'aircraft:wing:mount_location'
NUM_FLAP_SEGMENTS = 'aircraft:wing:num_flap_segments'
NUM_INTEGRATION_STATIONS = 'aircraft:wing:num_integration_stations'
OPTIMUM_FLAP_DEFLECTION = 'aircraft:wing:optimum_flap_deflection'
Expand Down
12 changes: 6 additions & 6 deletions aviary/visualization/aircraft_3d_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ class HorizontalWing(object):
Chord at the top of the wing.
_position_along_fuselage : float
Position of the wing along the fuselage.
_mounting_type : float
_mount_location : float
wing location on fuselage (0 = low wing, 1 = high wing, can be fractions).
_fuselage : Fuselage
The Fuselage object used to represent the fuselage of the aircraft.
Expand All @@ -556,7 +556,7 @@ def __init__(self, reader, fuselage, wing_type):
self._sweep_angle = None
self._chord_tip = None
self._position_along_fuselage = None
self._mounting_type = None
self._mount_location = None
self._fuselage = fuselage
self._wing_type = wing_type

Expand Down Expand Up @@ -601,13 +601,13 @@ def read_variables(self):
self._chord_tip = self._chord * taper_ratio
if self._wing_type == WingType.WING:
try:
mounting_type = self._reader.get_variable_from_case(
"aircraft:wing:mounting_type"
mount_location = self._reader.get_variable_from_case(
"aircraft:wing:mount_location"
)
except AircraftModelReaderError:
mounting_type = 0.0
mount_location = 0.0
self._vertical_position = (
2.0 * (mounting_type - 0.5) * self._fuselage.radius
2.0 * (mount_location - 0.5) * self._fuselage.radius
)
self._position_along_fuselage = 0.0
elif self._wing_type == WingType.HORIZONTAL_TAIL:
Expand Down

0 comments on commit 0b55d98

Please sign in to comment.