OpenMDAO / OpenMDAO/Aviary

Promote `aircraft:*` and `mission:*` input variables from the mission group

Open
#825 4 comments 0 reactions 1 assignee View on GitHub

@Kenneth-T-Moore is already working on this.

Since Feb 13, 2026.

Dominant language
Python
Stars
287
Forks
140
Avg merge
6d 14h
Merged PRs (30d)
18

Description

Desired capability or behavior.

In a pre-mission group, Aviary promotes all variables starting with aircraft:* and mission:* to the top level, as documented in this page.

However, the promotion/variable connections for these variables work differently for a mission group. For a mission group, we need to declare these inputs as Dymos parameters in get_parameters in a builder. Dymos then connects the parameters from params_comp to rhs_all, and it also promotes params_comp inputs to the top-level. For time-independent variables like aircraft:wing:wetted_area, I believe Dymos's params_comp only passes these variables through but doesn't do anything essential (I might be missing something).

I am wondering if we could skip the Dymos parameters for static variables, and instead promote all aircraft:* and mission:* inputs to the top-level like we already do in a pre-mission group. The benefits are (1) we don't need to add all inputs in get_parameters in a builder, and (2) this reduces the number of variables Dymos's params_comp takes care and simplifies the N2 diagram (in my opinion). However there would be some pitfalls I overlook.

I'm not sure if this is a good modification for general cases, or maybe it's just my preference for organizing variables, so I wanted to hear what the dev team and other users think.

Prototype

Here is a prototype implementation that promotes all aircraft:* and mission:design:* inputs from the rhs_all group to the top-level. I also removed get_parameters from all builders. You can find the complete set of the code in my branch

class AviaryGroup:
...
    def configure(self):
        ...
        # Promote all inputs of the mission group that start with `aircraft:*` or `mission:design:*` to the top-level
        for phase_name in self.options['phase_info']:
            if phase_name not in ['pre_mission', 'post_mission']:
                # find all inputs of the `rhs_all` group that start with `aircraft:*` or `mission:design:*`
                rhs_group = getattr(self.traj.phases, phase_name).rhs_all
                list_inputs = rhs_group.list_inputs(out_stream=None, includes=['aircraft:*', 'mission:design:*'])

                # get a list of input variables to promote
                list_inputs_to_promote = []
                for _, input_meta in list_inputs:
                    # check for duplicates
                    if input_meta['prom_name'] not in list_inputs_to_promote:
                        list_inputs_to_promote.append(input_meta['prom_name'])

                # promote those variables to the top-level
                # TODO: check shape of the variable, and if it's not a scaler we should skip promotion?
                for input_name in list_inputs_to_promote:
                    print(f'Promoting {input_name} from traj.phases.{phase_name}.rhs_all to top-level')
                    self.promotes('traj', inputs=[(f'{phase_name}.rhs_all.{input_name}', input_name)])

Notes:

  • I wasn't sure if I should promote mission:design:* or all mission:*.
  • This assumes that the builder promotes all aircraft:* and mission:design:* to the mission group level (or rhs_all level).
N2 diagrams before and after this modification

You can find the N2 diagrams of run_level2_example.py with and without this modification: https://github.com/kanekosh/Aviary/tree/promote_aircraft_vars/N2
Originally we see a lot of aircraft: variables for the aero model in Dymos parameters, but with the proposed changes they go straight up to the top-level auto_IVC.

Is your feature request related to a problem? Please describe.

No response

Associated Bug Report

No response

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.