Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set FLOPS mass default #635

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
17 changes: 7 additions & 10 deletions aviary/subsystems/mass/flops_based/air_conditioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,12 @@ def initialize(self):
desc='collection of Aircraft/Mission specific options')

def setup(self):
add_aviary_input(self, Aircraft.AirConditioning.MASS_SCALER, val=1.0)
add_aviary_input(self, Aircraft.AirConditioning.MASS_SCALER)
add_aviary_input(self, Aircraft.Avionics.MASS)
add_aviary_input(self, Aircraft.Fuselage.MAX_HEIGHT)
add_aviary_input(self, Aircraft.Fuselage.PLANFORM_AREA)

add_aviary_input(self, Aircraft.Avionics.MASS, val=0.0)

add_aviary_input(self, Aircraft.Fuselage.MAX_HEIGHT, val=0.0)

add_aviary_input(self, Aircraft.Fuselage.PLANFORM_AREA, val=0.0)

add_aviary_output(self, Aircraft.AirConditioning.MASS, val=0.0)
add_aviary_output(self, Aircraft.AirConditioning.MASS)

def setup_partials(self):
self.declare_partials('*', '*')
Expand Down Expand Up @@ -91,9 +88,9 @@ def initialize(self):
desc='collection of Aircraft/Mission specific options')

def setup(self):
add_aviary_input(self, Aircraft.AirConditioning.MASS_SCALER, val=1.0)
add_aviary_input(self, Aircraft.AirConditioning.MASS_SCALER)

add_aviary_output(self, Aircraft.AirConditioning.MASS, val=0.0)
add_aviary_output(self, Aircraft.AirConditioning.MASS)

def setup_partials(self):
self.declare_partials(of=Aircraft.AirConditioning.MASS, wrt='*')
Expand Down
17 changes: 6 additions & 11 deletions aviary/subsystems/mass/flops_based/anti_icing.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,13 @@ def setup(self):
num_engine_type = len(self.options['aviary_options'].get_val(
Aircraft.Engine.NUM_ENGINES))

add_aviary_input(self, Aircraft.AntiIcing.MASS_SCALER, val=1.0)
add_aviary_input(self, Aircraft.AntiIcing.MASS_SCALER)
add_aviary_input(self, Aircraft.Fuselage.MAX_WIDTH)
add_aviary_input(self, Aircraft.Nacelle.AVG_DIAMETER, shape=num_engine_type)
add_aviary_input(self, Aircraft.Wing.SPAN)
add_aviary_input(self, Aircraft.Wing.SWEEP)

add_aviary_input(self, Aircraft.Fuselage.MAX_WIDTH, val=0.0)

add_aviary_input(self, Aircraft.Nacelle.AVG_DIAMETER,
val=np.zeros(num_engine_type))

add_aviary_input(self, Aircraft.Wing.SPAN, val=0.0)

add_aviary_input(self, Aircraft.Wing.SWEEP, val=0.0)

add_aviary_output(self, Aircraft.AntiIcing.MASS, val=0.0)
add_aviary_output(self, Aircraft.AntiIcing.MASS)

def setup_partials(self):
self.declare_partials("*", "*")
Expand Down
7 changes: 3 additions & 4 deletions aviary/subsystems/mass/flops_based/apu.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ def initialize(self):
desc='collection of Aircraft/Mission specific options')

def setup(self):
add_aviary_input(self, Aircraft.APU.MASS_SCALER, val=1.0)
add_aviary_input(self, Aircraft.APU.MASS_SCALER)
add_aviary_input(self, Aircraft.Fuselage.PLANFORM_AREA)

add_aviary_input(self, Aircraft.Fuselage.PLANFORM_AREA, val=0.0)

add_aviary_output(self, Aircraft.APU.MASS, val=0.0)
add_aviary_output(self, Aircraft.APU.MASS)

def setup_partials(self):
self.declare_partials('*', '*')
Expand Down
10 changes: 4 additions & 6 deletions aviary/subsystems/mass/flops_based/avionics.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@ def initialize(self):
desc='collection of Aircraft/Mission specific options')

def setup(self):
add_aviary_input(self, Aircraft.Avionics.MASS_SCALER, val=1.0)
add_aviary_input(self, Aircraft.Avionics.MASS_SCALER)
add_aviary_input(self, Aircraft.Fuselage.PLANFORM_AREA)
add_aviary_input(self, Mission.Design.RANGE)

add_aviary_input(self, Aircraft.Fuselage.PLANFORM_AREA, val=0.0)

add_aviary_input(self, Mission.Design.RANGE, val=0.0)

add_aviary_output(self, Aircraft.Avionics.MASS, val=0.0)
add_aviary_output(self, Aircraft.Avionics.MASS)

def setup_partials(self):
self.declare_partials('*', '*')
Expand Down
10 changes: 5 additions & 5 deletions aviary/subsystems/mass/flops_based/canard.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ def initialize(self):
desc='collection of Aircraft/Mission specific options')

def setup(self):
add_aviary_input(self, Mission.Design.GROSS_MASS, val=0.0)
add_aviary_input(self, Aircraft.Canard.AREA, val=0.0)
add_aviary_input(self, Aircraft.Canard.TAPER_RATIO, val=00)
add_aviary_input(self, Aircraft.Canard.MASS_SCALER, val=1.0)
add_aviary_input(self, Mission.Design.GROSS_MASS)
add_aviary_input(self, Aircraft.Canard.AREA)
add_aviary_input(self, Aircraft.Canard.TAPER_RATIO)
add_aviary_input(self, Aircraft.Canard.MASS_SCALER)

add_aviary_output(self, Aircraft.Canard.MASS, val=0.0)
add_aviary_output(self, Aircraft.Canard.MASS)

def setup_partials(self):
self.declare_partials("*", "*")
Expand Down
18 changes: 8 additions & 10 deletions aviary/subsystems/mass/flops_based/cargo.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from aviary.utils.aviary_values import AviaryValues
from aviary.variable_info.functions import add_aviary_input, add_aviary_output
from aviary.variable_info.variables import Aircraft, Mission
from aviary.variable_info.variables import Aircraft


class CargoMass(om.ExplicitComponent):
Expand All @@ -22,15 +22,13 @@ def initialize(self):
desc='collection of Aircraft/Mission specific options')

def setup(self):
add_aviary_output(self, Aircraft.CrewPayload.PASSENGER_MASS, 0.)
add_aviary_output(self, Aircraft.CrewPayload.BAGGAGE_MASS, 0.)
add_aviary_output(self, Aircraft.CrewPayload.PASSENGER_PAYLOAD_MASS, 0.)

add_aviary_input(self, Aircraft.CrewPayload.WING_CARGO, 0.)
add_aviary_input(self, Aircraft.CrewPayload.MISC_CARGO, 0.)

add_aviary_output(self, Aircraft.CrewPayload.CARGO_MASS, 0.)
add_aviary_output(self, Aircraft.CrewPayload.TOTAL_PAYLOAD_MASS, 0.)
add_aviary_input(self, Aircraft.CrewPayload.WING_CARGO)
add_aviary_input(self, Aircraft.CrewPayload.MISC_CARGO)
add_aviary_output(self, Aircraft.CrewPayload.PASSENGER_MASS)
add_aviary_output(self, Aircraft.CrewPayload.BAGGAGE_MASS)
add_aviary_output(self, Aircraft.CrewPayload.PASSENGER_PAYLOAD_MASS)
add_aviary_output(self, Aircraft.CrewPayload.CARGO_MASS)
add_aviary_output(self, Aircraft.CrewPayload.TOTAL_PAYLOAD_MASS)

def setup_partials(self):

Expand Down
11 changes: 4 additions & 7 deletions aviary/subsystems/mass/flops_based/cargo_containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,11 @@ def initialize(self):
desc='collection of Aircraft/Mission specific options')

def setup(self):
add_aviary_input(
self, Aircraft.CrewPayload.CARGO_CONTAINER_MASS_SCALER, val=1.0)
add_aviary_input(self, Aircraft.CrewPayload.CARGO_CONTAINER_MASS_SCALER)
add_aviary_input(self, Aircraft.CrewPayload.CARGO_MASS)
add_aviary_input(self, Aircraft.CrewPayload.BAGGAGE_MASS)

add_aviary_input(self, Aircraft.CrewPayload.CARGO_MASS, val=0.0)

add_aviary_input(self, Aircraft.CrewPayload.BAGGAGE_MASS, val=0.0)

add_aviary_output(self, Aircraft.CrewPayload.CARGO_CONTAINER_MASS, val=0.0)
add_aviary_output(self, Aircraft.CrewPayload.CARGO_CONTAINER_MASS)

def setup_partials(self):
self.declare_partials('*', '*')
Expand Down
10 changes: 4 additions & 6 deletions aviary/subsystems/mass/flops_based/crew.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ def initialize(self):
desc='collection of Aircraft/Mission specific options')

def setup(self):
add_aviary_input(
self, Aircraft.CrewPayload.NON_FLIGHT_CREW_MASS_SCALER, 1.)
add_aviary_input(self, Aircraft.CrewPayload.NON_FLIGHT_CREW_MASS_SCALER)

add_aviary_output(self, Aircraft.CrewPayload.NON_FLIGHT_CREW_MASS, 0)
add_aviary_output(self, Aircraft.CrewPayload.NON_FLIGHT_CREW_MASS)

def setup_partials(self):
self.declare_partials(
Expand Down Expand Up @@ -84,10 +83,9 @@ def initialize(self):
desc='collection of Aircraft/Mission specific options')

def setup(self):
add_aviary_input(
self, Aircraft.CrewPayload.FLIGHT_CREW_MASS_SCALER, 1.)
add_aviary_input(self, Aircraft.CrewPayload.FLIGHT_CREW_MASS_SCALER)

add_aviary_output(self, Aircraft.CrewPayload.FLIGHT_CREW_MASS, 0.)
add_aviary_output(self, Aircraft.CrewPayload.FLIGHT_CREW_MASS)

def setup_partials(self):
self.declare_partials(
Expand Down
12 changes: 6 additions & 6 deletions aviary/subsystems/mass/flops_based/electrical.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ def initialize(self):
desc='collection of Aircraft/Mission specific options')

def setup(self):
add_aviary_input(self, Aircraft.Fuselage.LENGTH, 0.0)
add_aviary_input(self, Aircraft.Fuselage.MAX_WIDTH, 0.0)
add_aviary_input(self, Aircraft.Electrical.MASS_SCALER, 1.0)
add_aviary_input(self, Aircraft.Fuselage.LENGTH)
add_aviary_input(self, Aircraft.Fuselage.MAX_WIDTH)
add_aviary_input(self, Aircraft.Electrical.MASS_SCALER)

add_aviary_output(self, Aircraft.Electrical.MASS, 1.0)
add_aviary_output(self, Aircraft.Electrical.MASS)

def setup_partials(self):
self.declare_partials(of='*', wrt='*')
Expand Down Expand Up @@ -85,9 +85,9 @@ def initialize(self):
desc='collection of Aircraft/Mission specific options')

def setup(self):
add_aviary_input(self, Aircraft.Electrical.MASS_SCALER, 1.0)
add_aviary_input(self, Aircraft.Electrical.MASS_SCALER)

add_aviary_output(self, Aircraft.Electrical.MASS, 1.0)
add_aviary_output(self, Aircraft.Electrical.MASS)

def setup_partials(self):
self.declare_partials(of='*', wrt='*')
Expand Down
13 changes: 5 additions & 8 deletions aviary/subsystems/mass/flops_based/empty_margin.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,12 @@ def initialize(self):
desc='collection of Aircraft/Mission specific options')

def setup(self):
add_aviary_input(self, Aircraft.Propulsion.MASS, val=0.)
add_aviary_input(self, Aircraft.Propulsion.MASS)
add_aviary_input(self, Aircraft.Design.STRUCTURE_MASS)
add_aviary_input(self, Aircraft.Design.SYSTEMS_EQUIP_MASS)
add_aviary_input(self, Aircraft.Design.EMPTY_MASS_MARGIN_SCALER)

add_aviary_input(self, Aircraft.Design.STRUCTURE_MASS, val=0.)

add_aviary_input(self, Aircraft.Design.SYSTEMS_EQUIP_MASS, val=0.)

add_aviary_input(self, Aircraft.Design.EMPTY_MASS_MARGIN_SCALER, val=0.0)

add_aviary_output(self, Aircraft.Design.EMPTY_MASS_MARGIN, val=0.0)
add_aviary_output(self, Aircraft.Design.EMPTY_MASS_MARGIN)

def setup_partials(self):
self.declare_partials('*', '*')
Expand Down
14 changes: 5 additions & 9 deletions aviary/subsystems/mass/flops_based/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,12 @@ def setup(self):
num_engine_type = len(self.options['aviary_options'].get_val(
Aircraft.Engine.NUM_ENGINES))

add_aviary_input(self, Aircraft.Engine.SCALED_SLS_THRUST,
val=np.zeros(num_engine_type))
add_aviary_input(self, Aircraft.Engine.SCALED_SLS_THRUST, shape=num_engine_type)
add_aviary_input(self, Aircraft.Engine.MASS_SCALER, shape=num_engine_type)

add_aviary_input(self, Aircraft.Engine.MASS_SCALER,
val=np.zeros(num_engine_type))

add_aviary_output(self, Aircraft.Engine.MASS, val=np.zeros(num_engine_type))
add_aviary_output(self, Aircraft.Engine.ADDITIONAL_MASS,
val=np.zeros(num_engine_type))
add_aviary_output(self, Aircraft.Propulsion.TOTAL_ENGINE_MASS, val=0.0)
add_aviary_output(self, Aircraft.Engine.MASS, shape=num_engine_type)
add_aviary_output(self, Aircraft.Engine.ADDITIONAL_MASS, shape=num_engine_type)
add_aviary_output(self, Aircraft.Propulsion.TOTAL_ENGINE_MASS)

def compute(self, inputs, outputs):
aviary_options: AviaryValues = self.options['aviary_options']
Expand Down
6 changes: 2 additions & 4 deletions aviary/subsystems/mass/flops_based/engine_controls.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,9 @@ def initialize(self):
desc='collection of Aircraft/Mission specific options')

def setup(self):
add_aviary_input(
self, Aircraft.Propulsion.TOTAL_SCALED_SLS_THRUST, val=0.0, units='lbf')
add_aviary_input(self, Aircraft.Propulsion.TOTAL_SCALED_SLS_THRUST)

add_aviary_output(
self, Aircraft.Propulsion.TOTAL_ENGINE_CONTROLS_MASS, val=0.0, units='lbm')
add_aviary_output(self, Aircraft.Propulsion.TOTAL_ENGINE_CONTROLS_MASS)

def setup_partials(self):
self.declare_partials(Aircraft.Propulsion.TOTAL_ENGINE_CONTROLS_MASS,
Expand Down
11 changes: 5 additions & 6 deletions aviary/subsystems/mass/flops_based/engine_oil.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@ def initialize(self):
desc='collection of Aircraft/Mission specific options')

def setup(self):
add_aviary_input(self, Aircraft.Propulsion.ENGINE_OIL_MASS_SCALER, val=1.0)
add_aviary_input(self, Aircraft.Propulsion.ENGINE_OIL_MASS_SCALER)
add_aviary_input(self, Aircraft.Propulsion.TOTAL_SCALED_SLS_THRUST)

add_aviary_input(self, Aircraft.Propulsion.TOTAL_SCALED_SLS_THRUST, val=0.0)

add_aviary_output(self, Aircraft.Propulsion.TOTAL_ENGINE_OIL_MASS, val=0.0)
add_aviary_output(self, Aircraft.Propulsion.TOTAL_ENGINE_OIL_MASS)

def setup_partials(self):
self.declare_partials('*', '*')
Expand Down Expand Up @@ -77,9 +76,9 @@ def initialize(self):
desc='collection of Aircraft/Mission specific options')

def setup(self):
add_aviary_input(self, Aircraft.Propulsion.ENGINE_OIL_MASS_SCALER, val=1.0)
add_aviary_input(self, Aircraft.Propulsion.ENGINE_OIL_MASS_SCALER)

add_aviary_output(self, Aircraft.Propulsion.TOTAL_ENGINE_OIL_MASS, val=0.0)
add_aviary_output(self, Aircraft.Propulsion.TOTAL_ENGINE_OIL_MASS)

def setup_partials(self):
self.declare_partials('*', '*')
Expand Down
25 changes: 12 additions & 13 deletions aviary/subsystems/mass/flops_based/engine_pod.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,20 @@ def setup(self):
num_engine_type = len(self.options['aviary_options'].get_val(
Aircraft.Engine.NUM_ENGINES))

add_aviary_input(self, Aircraft.Electrical.MASS, val=0.0)
add_aviary_input(self, Aircraft.Fuel.FUEL_SYSTEM_MASS, val=0.0)
add_aviary_input(self, Aircraft.Hydraulics.MASS, val=0.0)
add_aviary_input(self, Aircraft.Instruments.MASS, val=0.0)
add_aviary_input(self, Aircraft.Nacelle.MASS, val=np.zeros(num_engine_type))
add_aviary_input(self, Aircraft.Propulsion.TOTAL_ENGINE_CONTROLS_MASS, val=0.0)
add_aviary_input(self, Aircraft.Engine.MASS, val=np.zeros(num_engine_type))
add_aviary_input(self, Aircraft.Propulsion.TOTAL_STARTER_MASS, val=0.0)
add_aviary_input(self, Aircraft.Electrical.MASS)
add_aviary_input(self, Aircraft.Fuel.FUEL_SYSTEM_MASS)
add_aviary_input(self, Aircraft.Hydraulics.MASS)
add_aviary_input(self, Aircraft.Instruments.MASS)
add_aviary_input(self, Aircraft.Nacelle.MASS, shape=num_engine_type)
add_aviary_input(self, Aircraft.Propulsion.TOTAL_ENGINE_CONTROLS_MASS)
add_aviary_input(self, Aircraft.Engine.MASS, shape=num_engine_type)
add_aviary_input(self, Aircraft.Propulsion.TOTAL_STARTER_MASS)
add_aviary_input(self, Aircraft.Engine.THRUST_REVERSERS_MASS,
val=np.zeros(num_engine_type))
add_aviary_input(self, Aircraft.Engine.SCALED_SLS_THRUST,
val=np.zeros(num_engine_type))
add_aviary_input(self, Aircraft.Propulsion.TOTAL_SCALED_SLS_THRUST, val=0.0)
shape=num_engine_type)
add_aviary_input(self, Aircraft.Engine.SCALED_SLS_THRUST, shape=num_engine_type)
add_aviary_input(self, Aircraft.Propulsion.TOTAL_SCALED_SLS_THRUST)

add_aviary_output(self, Aircraft.Engine.POD_MASS, val=np.zeros(num_engine_type))
add_aviary_output(self, Aircraft.Engine.POD_MASS, shape=num_engine_type)

def setup_partials(self):
self.declare_partials('*', '*')
Expand Down
10 changes: 5 additions & 5 deletions aviary/subsystems/mass/flops_based/fin.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ def initialize(self):
desc='collection of Aircraft/Mission specific options')

def setup(self):
add_aviary_input(self, Mission.Design.GROSS_MASS, val=0.0)
add_aviary_input(self, Aircraft.Fins.AREA, val=0.0)
add_aviary_input(self, Aircraft.Fins.TAPER_RATIO, val=0.0)
add_aviary_input(self, Aircraft.Fins.MASS_SCALER, val=1.0)
add_aviary_input(self, Mission.Design.GROSS_MASS)
add_aviary_input(self, Aircraft.Fins.AREA)
add_aviary_input(self, Aircraft.Fins.TAPER_RATIO)
add_aviary_input(self, Aircraft.Fins.MASS_SCALER)

add_aviary_output(self, Aircraft.Fins.MASS, val=0.0)
add_aviary_output(self, Aircraft.Fins.MASS)

def setup_partials(self):
self.declare_partials("*", "*")
Expand Down
Loading
Loading