Skip to content

Commit

Permalink
added new phase info file
Browse files Browse the repository at this point in the history
  • Loading branch information
crecine committed May 17, 2024
1 parent 63adaab commit b3ef408
Showing 1 changed file with 95 additions and 0 deletions.
95 changes: 95 additions & 0 deletions aviary/interface/default_phase_info/height_energy_fiti.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
from aviary.mission.flops_based.phases.time_integration_phases import SGMDetailedTakeoff, \
SGMHeightEnergy, SGMDetailedLanding
from aviary.subsystems.propulsion.propulsion_builder import CorePropulsionBuilder
from aviary.subsystems.geometry.geometry_builder import CoreGeometryBuilder
from aviary.subsystems.mass.mass_builder import CoreMassBuilder
from aviary.subsystems.aerodynamics.aerodynamics_builder import CoreAerodynamicsBuilder
from aviary.utils.aviary_values import AviaryValues
from aviary.variable_info.variable_meta_data import _MetaData as BaseMetaData
from aviary.variable_info.variables import Dynamic, Mission
from aviary.variable_info.enums import SpeedType, Verbosity, AlphaModes, LegacyCode

from aviary.interface.default_phase_info.two_dof_fiti_copy import add_default_sgm_args

FLOPS = LegacyCode.FLOPS

prop = CorePropulsionBuilder('core_propulsion', BaseMetaData)
mass = CoreMassBuilder('core_mass', BaseMetaData, FLOPS)
aero = CoreAerodynamicsBuilder('core_aerodynamics', BaseMetaData, FLOPS)
geom = CoreGeometryBuilder('core_geometry', BaseMetaData, FLOPS)

default_premission_subsystems = [prop, geom, mass, aero]
default_mission_subsystems = [aero, prop]

cruise_mach = .8,
cruise_alt = 35e3,

phase_info = {
"pre_mission": {"include_takeoff": False, "optimize_mass": True},
"climb": {
'builder': SGMHeightEnergy,
"user_options": {
'mach': (cruise_mach, 'unitless'),
'alt_trigger': (cruise_alt, 'ft'),
},
},
"cruise": {
'kwargs': dict(
input_speed_type=SpeedType.MACH,
input_speed_units="unitless",
alpha_mode=AlphaModes.REQUIRED_LIFT,
),
'builder': SGMHeightEnergy,
"user_options": {
'mach': (cruise_mach, 'unitless'),
},
},
"descent": {
'builder': SGMHeightEnergy,
"user_options": {
'mach': (cruise_mach, 'unitless'),
'alt_trigger': (1000, 'ft'),
Dynamic.Mission.THROTTLE: (0, 'unitless'),
},
},
"post_mission": {
"include_landing": False,
"constrain_range": True,
"target_range": (1906., "nmi"),
},
}


def phase_info_parameterization(phase_info, post_mission_info, aviary_inputs: AviaryValues):
"""
Modify the values in the phase_info dictionary to accomodate different values
for the following mission design inputs: cruise altitude, cruise mach number,
cruise range, design gross mass.
Parameters
----------
phase_info : dict
Dictionary of phase settings for a mission profile
aviary_inputs : <AviaryValues>
Object containing values and units for all aviary inputs and options
Returns
-------
dict
Modified phase_info that has been changed to match the new mission
parameters
"""

range_cruise = aviary_inputs.get_item(Mission.Design.RANGE)
alt_cruise = aviary_inputs.get_item(Mission.Design.CRUISE_ALTITUDE)
gross_mass = aviary_inputs.get_item(Mission.Design.GROSS_MASS)
mach_cruise = aviary_inputs.get_item(Mission.Design.MACH)

phase_info['climb']['user_options']['alt_trigger'] = alt_cruise
phase_info['climb']['user_options']['mach'] = mach_cruise

phase_info['cruise']['user_options']['mach'] = mach_cruise

phase_info['descent']['user_options']['mach'] = mach_cruise

return phase_info, post_mission_info

0 comments on commit b3ef408

Please sign in to comment.