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

2DOF mission phases make assumptions on subsystem inputs/outputs with aliases #549

Open
jkirk5 opened this issue Sep 27, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@jkirk5
Copy link
Contributor

jkirk5 commented Sep 27, 2024

Description

For many 2DOF mission phases such as taxi, takeoff, landing, etc. variables such as Mach number or altitude do not use the Dynamic mission hierarchy but rather custom variables like Mission.Landing.INITIAL_MACH, and any place a subsystem is added that needs that variable as an input, it is aliased like so: promotes_inputs = [(Dynamic.Mission.MACH, Mission.Landing.INITIAL_MACH)].

This causes major problems, because it assumes what the inputs and outputs are for a given subsystem, which we do not know in reality. Specifically, this prevents an electroprop from being used with 2DOF missions, because the motor model does not take altitude as an input, but the current ODE setup requires that input to exist because of aliasing.

2DOF ODEs need to be completely refactored to remove this need for aliasing

Example

No existing example in Aviary. Try this code?

from aviary.interface.methods_for_level2 import AviaryProblem
from aviary.subsystems.propulsion.turboprop_model import TurbopropModel
from aviary.subsystems.propulsion.motor.motor_builder import MotorBuilder
from aviary.utils.process_input_decks import create_vehicle

from aviary.models.large_turboprop_freighter.phase_info import phase_info

prob = AviaryProblem()

# load inputs from .csv to build engine
options, _ = create_vehicle(
    "models/large_turboprop_freighter/large_turboprop_freighter.csv"
)

motor = MotorBuilder(
    'motor',
)

electroprop = TurbopropModel(
    'electroprop', options=options, shaft_power_model=motor
)

# load_inputs needs to be updated to accept an already existing aviary options
prob.load_inputs(
    "models/large_turboprop_freighter/large_turboprop_freighter.csv",
    phase_info,
    engine_builders=[electroprop],
)

prob.check_and_preprocess_inputs()
prob.add_pre_mission_systems()
prob.add_phases()
prob.add_post_mission_systems()
prob.link_phases()
prob.add_driver("SLSQP", max_iter=0, verbosity=0)
prob.add_design_variables()
prob.add_objective()
prob.setup()
prob.set_initial_guesses()

prob.run_aviary_problem()

Aviary Version

0.9.4-dev

Relevant environment information

No response

@jkirk5 jkirk5 added the bug Something isn't working label Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant