Skip to content
52 changes: 18 additions & 34 deletions aviary/subsystems/mass/flops_based/mass_premission.py
Comment thread
xjjiang marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -126,27 +126,19 @@ def setup(self):
'engine_oil', AltEngineOilMass(), promotes_inputs=['*'], promotes_outputs=['*']
)

if design_type == AircraftTypes.BLENDED_WING_BODY:
self.add_subsystem(
'furnishings',
BWBFurnishingsGroupMass(),
promotes_inputs=['*'],
promotes_outputs=['*'],
)
else:
self.add_subsystem(
'furnishing_base',
AltFurnishingsGroupMassBase(),
promotes_inputs=['*'],
promotes_outputs=['*'],
)
self.add_subsystem(
'furnishing_base',
AltFurnishingsGroupMassBase(),
promotes_inputs=['*'],
promotes_outputs=['*'],
)

self.add_subsystem(
'furnishings',
AltFurnishingsGroupMass(),
promotes_inputs=['*'],
promotes_outputs=['*'],
)
self.add_subsystem(
'furnishings',
AltFurnishingsGroupMass(),
promotes_inputs=['*'],
promotes_outputs=['*'],
)

self.add_subsystem(
'hydraulics',
Expand Down Expand Up @@ -177,20 +169,12 @@ def setup(self):
'surf_ctrl', AltSurfaceControlMass(), promotes_inputs=['*'], promotes_outputs=['*']
)

if design_type == AircraftTypes.BLENDED_WING_BODY:
self.add_subsystem(
'fuselage',
BWBFuselageMass(),
promotes_inputs=['*'],
promotes_outputs=['*'],
)
else:
self.add_subsystem(
'fuselage',
AltFuselageMass(),
promotes_inputs=['*'],
promotes_outputs=['*'],
)
self.add_subsystem(
'fuselage',
AltFuselageMass(),
promotes_inputs=['*'],
promotes_outputs=['*'],
)

self.add_subsystem(
'htail',
Expand Down
32 changes: 15 additions & 17 deletions aviary/subsystems/mass/flops_based/wing_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import openmdao.api as om

from aviary.constants import GRAV_ENGLISH_LBM
from aviary.variable_info.enums import AircraftTypes
from aviary.variable_info.functions import add_aviary_input, add_aviary_option, add_aviary_output
from aviary.variable_info.variables import Aircraft, Mission, Settings

Expand Down Expand Up @@ -231,22 +230,22 @@ def initialize(self):
add_aviary_option(self, Settings.VERBOSITY)

def setup(self):
design_type = self.options[Aircraft.Design.TYPE]
# design_type = self.options[Aircraft.Design.TYPE]
add_aviary_input(self, Aircraft.Wing.COMPOSITE_FRACTION, units='unitless')
add_aviary_input(self, Aircraft.Wing.CONTROL_SURFACE_AREA, units='ft**2')
add_aviary_input(self, Aircraft.Design.GROSS_MASS, units='lbm')
add_aviary_input(self, Aircraft.Wing.SHEAR_CONTROL_MASS_SCALER, units='unitless')

add_aviary_output(self, Aircraft.Wing.SHEAR_CONTROL_MASS, units='lbm')

if design_type in [AircraftTypes.BLENDED_WING_BODY, AircraftTypes.TRANSPORT]:
self.A3 = 0.68
self.A4 = 0.34
self.A5 = 0.60
elif design_type is AircraftTypes.GENERAL_AVIATION:
self.A3 = 0.25
self.A4 = 0.50
self.A5 = 0.50
# For Transport and BWB
self.A3 = 0.68
self.A4 = 0.34
self.A5 = 0.60
# For GENERAL_AVIATION (not implemented):
# self.A3 = 0.25
# self.A4 = 0.50
# self.A5 = 0.50

def setup_partials(self):
self.declare_partials('*', '*')
Expand Down Expand Up @@ -311,19 +310,18 @@ def initialize(self):
add_aviary_option(self, Settings.VERBOSITY)

def setup(self):
design_type = self.options[Aircraft.Design.TYPE]
add_aviary_input(self, Aircraft.Wing.COMPOSITE_FRACTION, units='unitless')
add_aviary_input(self, Aircraft.Wing.AREA, units='ft**2')
add_aviary_input(self, Aircraft.Wing.MISC_MASS_SCALER, units='unitless')

add_aviary_output(self, Aircraft.Wing.MISC_MASS, units='lbm')

if design_type is AircraftTypes.TRANSPORT:
self.A6 = 0.035
self.A7 = 1.50
elif design_type is AircraftTypes.GENERAL_AVIATION:
self.A6 = 0.16
self.A7 = 1.2
# For Transport
self.A6 = 0.035
self.A7 = 1.50
# for GENERAL_AVIATION (not implemented):
# self.A6 = 0.16
# self.A7 = 1.2

def setup_partials(self):
self.declare_partials(
Expand Down
Loading