Skip to content

Commit

Permalink
Merge pull request OpenMDAO#171 from robfalck/i170
Browse files Browse the repository at this point in the history
Fixed an issue which was causing phase info options to be ignored for…
  • Loading branch information
crecine authored Mar 13, 2024
2 parents 27dfafd + fd40ae1 commit 3eee65d
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions aviary/interface/methods_for_level2.py
Original file line number Diff line number Diff line change
Expand Up @@ -791,9 +791,15 @@ def _get_phase(self, phase_name, phase_idx):

user_options = AviaryValues(phase_options.get('user_options', ()))

fix_initial = phase_options.get('fix_initial', False)
fix_duration = phase_options.get('fix_duration', False)
initial_bounds = phase_options.get('initial_bounds', _unspecified)
try:
fix_initial = user_options.get_val('fix_initial')
except KeyError:
fix_intial = False

try:
fix_duration = user_options.get_val('fix_duration')
except KeyError:
fix_duration = False

if phase_name == 'ascent' and self.mission_method is TWO_DEGREES_OF_FREEDOM:
phase.set_time_options(
Expand Down Expand Up @@ -834,11 +840,15 @@ def _get_phase(self, phase_name, phase_idx):
time_units = phase.time_options['units']

# Make a good guess for a reasonable intitial time scaler.
init_bounds = user_options.get_item('initial_bounds')
if init_bounds[0] is not None and init_bounds[0][1] != 0.0:
try:
initial_bounds = user_options.get_val('initial_bounds', units=time_units)
except KeyError:
initial_bounds = (None, None)

if initial_bounds[0] is not None and initial_bounds[1] != 0.0:
# Upper bound is good for a ref.
user_options.set_val('initial_ref', init_bounds[0][1],
units=init_bounds[1])
user_options.set_val('initial_ref', initial_bounds[1],
units=time_units)
else:
user_options.set_val('initial_ref', 600., time_units)

Expand Down

0 comments on commit 3eee65d

Please sign in to comment.