Demonstration 1: Capturing an OpenMDAO Assembly, editing it, and executing the modified assembly

Part 1: Capturing the OpenMDAO Assembly

This is the first of three Jupyter Notebooks that show an example of the workflow pictured below:

Process showing separation of creation, editing, and use of MDAO models

In this notebook engineer 1 is creating an OpenMDAO assembly that covers multiple use cases. In this example we are using the PrepGeom group from Aviary.

Note: Thanks to Ken Moore from NASA for providing the code to set this example up.
import openmdao.api as om

from aviary.subsystems.geometry.flops_based.prep_geom import PrepGeom
from aviary.utils.aviary_values import AviaryValues
from aviary.validation_cases.validation_tests import get_flops_data

from aviary.variable_info.functions import override_aviary_vars
from aviary.variable_info.variables import Aircraft

from aviary.validation_cases.validation_data.flops_data.FLOPS_Test_Data import \
    FLOPS_Test_Data
from aviary.variable_info.variables import Aircraft
from standard_evaluator import save_assembly


from aviary.subsystems.geometry.flops_based.prep_geom import PrepGeom
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[1], line 10
      6 
      7 from aviary.variable_info.functions import override_aviary_vars
      8 from aviary.variable_info.variables import Aircraft
      9 
---> 10 from aviary.validation_cases.validation_data.flops_data.FLOPS_Test_Data import \
     11     FLOPS_Test_Data
     12 from aviary.variable_info.variables import Aircraft
     13 from standard_evaluator import save_assembly

ModuleNotFoundError: No module named 'aviary.validation_cases.validation_data.flops_data'
class PreMission(om.Group):

    def initialize(self):
        self.options.declare(
            'aviary_options', types=AviaryValues,
            desc='collection of Aircraft/Mission specific options')

    def setup(self):
        self.add_subsystem('prep_geom', PrepGeom(),
                           promotes=['*'])

    def configure(self):
        aviary_options = self.options['aviary_options']

        override_aviary_vars(self, aviary_options)


case_name = 'LargeSingleAisle1FLOPS'
keys = [
    Aircraft.Fuselage.NUM_FUSELAGES,
    Aircraft.Propulsion.TOTAL_NUM_FUSELAGE_ENGINES,
    Aircraft.VerticalTail.NUM_TAILS,
    Aircraft.Wing.SPAN_EFFICIENCY_REDUCTION,
    Aircraft.Engine.NUM_ENGINES,
    Aircraft.Propulsion.TOTAL_NUM_ENGINES,
]

options = get_flops_data(case_name, preprocess=True, keys=keys)
model_options = {}
for key in keys:
    model_options[key] = options.get_item(key)[0]

prob = om.Problem(PreMission(aviary_options=options))

# Joerg, this is the Model Options feature, that lets us set component options at the top, so that OpenMDAO will
# propagate them to all the components.
prob.model_options['*'] = model_options

prob.setup(force_alloc_complex=True)

flops_data = FLOPS_Test_Data[case_name]
flops_inputs = flops_data['inputs']
flops_outputs = flops_data['outputs']

input_keys = [
        Aircraft.Fuselage.LENGTH,
        Aircraft.Fuselage.MAX_HEIGHT,
        Aircraft.Fuselage.MAX_WIDTH,
        Aircraft.Fuselage.WETTED_AREA_SCALER,

        Aircraft.HorizontalTail.AREA,
        Aircraft.HorizontalTail.ASPECT_RATIO,
        Aircraft.HorizontalTail.TAPER_RATIO,
        Aircraft.HorizontalTail.THICKNESS_TO_CHORD,
        Aircraft.HorizontalTail.VERTICAL_TAIL_FRACTION,
        Aircraft.HorizontalTail.WETTED_AREA_SCALER,

        Aircraft.Nacelle.AVG_DIAMETER,
        Aircraft.Nacelle.AVG_LENGTH,

        Aircraft.VerticalTail.AREA,
        Aircraft.VerticalTail.ASPECT_RATIO,
        Aircraft.VerticalTail.TAPER_RATIO,
        Aircraft.VerticalTail.THICKNESS_TO_CHORD,
        Aircraft.VerticalTail.WETTED_AREA_SCALER,

        Aircraft.Wing.AREA,
        Aircraft.Wing.ASPECT_RATIO,
        Aircraft.Wing.GLOVE_AND_BAT,
        Aircraft.Wing.SPAN,
        Aircraft.Wing.TAPER_RATIO,
        Aircraft.Wing.THICKNESS_TO_CHORD,
        Aircraft.Wing.WETTED_AREA_SCALER,
]

for key in input_keys:
    if key in flops_inputs:
        data = flops_inputs
    else:
        data = flops_outputs
    desired, units = data.get_item(key)
    prob.set_val(key, desired, units)

prob.run_model()
C:\Users\tf715b\Desktop\standard-evaluator\venv\Lib\site-packages\openmdao\core\system.py:2697: PromotionWarning:'prep_geom.canard' <class Canard>: input variable 'aircraft:canard:area', promoted using 'aircraft:canard:area', was already promoted using 'aircraft*'.
C:\Users\tf715b\Desktop\standard-evaluator\venv\Lib\site-packages\openmdao\core\system.py:2697: PromotionWarning:'prep_geom.canard' <class Canard>: input variable 'aircraft:canard:thickness_to_chord', promoted using 'aircraft:canard:thickness_to_chord', was already promoted using 'aircraft*'.
C:\Users\tf715b\Desktop\standard-evaluator\venv\Lib\site-packages\openmdao\core\system.py:2697: PromotionWarning:'prep_geom.canard' <class Canard>: input variable 'aircraft:canard:wetted_area_scaler', promoted using 'aircraft:canard:wetted_area_scaler', was already promoted using 'aircraft*'.
C:\Users\tf715b\Desktop\standard-evaluator\venv\Lib\site-packages\openmdao\core\system.py:2697: PromotionWarning:'prep_geom.characteristic_lengths' <class CharacteristicLengths>: input variable 'aircraft:canard:area', promoted using 'aircraft:canard:area', was already promoted using 'aircraft*'.
C:\Users\tf715b\Desktop\standard-evaluator\venv\Lib\site-packages\openmdao\core\system.py:2697: PromotionWarning:'prep_geom.characteristic_lengths' <class CharacteristicLengths>: input variable 'aircraft:canard:aspect_ratio', promoted using 'aircraft:canard:aspect_ratio', was already promoted using 'aircraft*'.
C:\Users\tf715b\Desktop\standard-evaluator\venv\Lib\site-packages\openmdao\core\system.py:2697: PromotionWarning:'prep_geom.characteristic_lengths' <class CharacteristicLengths>: input variable 'aircraft:canard:thickness_to_chord', promoted using 'aircraft:canard:thickness_to_chord', was already promoted using 'aircraft*'.
C:\Users\tf715b\Desktop\standard-evaluator\venv\Lib\site-packages\openmdao\core\system.py:2697: PromotionWarning:'prep_geom.characteristic_lengths' <class CharacteristicLengths>: input variable 'aircraft:fuselage:avg_diameter', promoted using 'aircraft:fuselage:avg_diameter', was already promoted using 'aircraft*'.
C:\Users\tf715b\Desktop\standard-evaluator\venv\Lib\site-packages\openmdao\core\system.py:2697: PromotionWarning:'prep_geom.characteristic_lengths' <class CharacteristicLengths>: input variable 'aircraft:fuselage:length', promoted using 'aircraft:fuselage:length', was already promoted using 'aircraft*'.
C:\Users\tf715b\Desktop\standard-evaluator\venv\Lib\site-packages\openmdao\core\system.py:2697: PromotionWarning:'prep_geom.characteristic_lengths' <class CharacteristicLengths>: input variable 'aircraft:horizontal_tail:area', promoted using 'aircraft:horizontal_tail:area', was already promoted using 'aircraft*'.
C:\Users\tf715b\Desktop\standard-evaluator\venv\Lib\site-packages\openmdao\core\system.py:2697: PromotionWarning:'prep_geom.characteristic_lengths' <class CharacteristicLengths>: input variable 'aircraft:horizontal_tail:aspect_ratio', promoted using 'aircraft:horizontal_tail:aspect_ratio', was already promoted using 'aircraft*'.
C:\Users\tf715b\Desktop\standard-evaluator\venv\Lib\site-packages\openmdao\core\system.py:2697: PromotionWarning:'prep_geom.characteristic_lengths' <class CharacteristicLengths>: input variable 'aircraft:horizontal_tail:thickness_to_chord', promoted using 'aircraft:horizontal_tail:thickness_to_chord', was already promoted using 'aircraft*'.
C:\Users\tf715b\Desktop\standard-evaluator\venv\Lib\site-packages\openmdao\core\system.py:2697: PromotionWarning:'prep_geom.characteristic_lengths' <class CharacteristicLengths>: input variable 'aircraft:nacelle:avg_diameter', promoted using 'aircraft:nacelle:avg_diameter', was already promoted using 'aircraft*'.
C:\Users\tf715b\Desktop\standard-evaluator\venv\Lib\site-packages\openmdao\core\system.py:2697: PromotionWarning:'prep_geom.characteristic_lengths' <class CharacteristicLengths>: input variable 'aircraft:nacelle:avg_length', promoted using 'aircraft:nacelle:avg_length', was already promoted using 'aircraft*'.
C:\Users\tf715b\Desktop\standard-evaluator\venv\Lib\site-packages\openmdao\core\system.py:2697: PromotionWarning:'prep_geom.characteristic_lengths' <class CharacteristicLengths>: input variable 'aircraft:vertical_tail:area', promoted using 'aircraft:vertical_tail:area', was already promoted using 'aircraft*'.
C:\Users\tf715b\Desktop\standard-evaluator\venv\Lib\site-packages\openmdao\core\system.py:2697: PromotionWarning:'prep_geom.characteristic_lengths' <class CharacteristicLengths>: input variable 'aircraft:vertical_tail:aspect_ratio', promoted using 'aircraft:vertical_tail:aspect_ratio', was already promoted using 'aircraft*'.
C:\Users\tf715b\Desktop\standard-evaluator\venv\Lib\site-packages\openmdao\core\system.py:2697: PromotionWarning:'prep_geom.characteristic_lengths' <class CharacteristicLengths>: input variable 'aircraft:vertical_tail:thickness_to_chord', promoted using 'aircraft:vertical_tail:thickness_to_chord', was already promoted using 'aircraft*'.
C:\Users\tf715b\Desktop\standard-evaluator\venv\Lib\site-packages\openmdao\core\system.py:2697: PromotionWarning:'prep_geom.characteristic_lengths' <class CharacteristicLengths>: input variable 'aircraft:wing:area', promoted using 'aircraft:wing:area', was already promoted using 'aircraft*'.
C:\Users\tf715b\Desktop\standard-evaluator\venv\Lib\site-packages\openmdao\core\system.py:2697: PromotionWarning:'prep_geom.characteristic_lengths' <class CharacteristicLengths>: input variable 'aircraft:wing:aspect_ratio', promoted using 'aircraft:wing:aspect_ratio', was already promoted using 'aircraft*'.
C:\Users\tf715b\Desktop\standard-evaluator\venv\Lib\site-packages\openmdao\core\system.py:2697: PromotionWarning:'prep_geom.characteristic_lengths' <class CharacteristicLengths>: input variable 'aircraft:wing:glove_and_bat', promoted using 'aircraft:wing:glove_and_bat', was already promoted using 'aircraft*'.
C:\Users\tf715b\Desktop\standard-evaluator\venv\Lib\site-packages\openmdao\core\system.py:2697: PromotionWarning:'prep_geom.characteristic_lengths' <class CharacteristicLengths>: input variable 'aircraft:wing:taper_ratio', promoted using 'aircraft:wing:taper_ratio', was already promoted using 'aircraft*'.
C:\Users\tf715b\Desktop\standard-evaluator\venv\Lib\site-packages\openmdao\core\system.py:2697: PromotionWarning:'prep_geom.characteristic_lengths' <class CharacteristicLengths>: input variable 'aircraft:wing:thickness_to_chord', promoted using 'aircraft:wing:thickness_to_chord', was already promoted using 'aircraft*'.
C:\Users\tf715b\Desktop\standard-evaluator\venv\Lib\site-packages\openmdao\core\system.py:2697: PromotionWarning:'prep_geom.fuselage' <class _Fuselage>: input variable 'aircraft:fuselage:avg_diameter', promoted using 'aircraft:fuselage:avg_diameter', was already promoted using 'aircraft*'.
C:\Users\tf715b\Desktop\standard-evaluator\venv\Lib\site-packages\openmdao\core\system.py:2697: PromotionWarning:'prep_geom.fuselage' <class _Fuselage>: input variable 'aircraft:fuselage:length', promoted using 'aircraft:fuselage:length', was already promoted using 'aircraft*'.
C:\Users\tf715b\Desktop\standard-evaluator\venv\Lib\site-packages\openmdao\core\system.py:2697: PromotionWarning:'prep_geom.fuselage' <class _Fuselage>: input variable 'aircraft:fuselage:wetted_area_scaler', promoted using 'aircraft:fuselage:wetted_area_scaler', was already promoted using 'aircraft*'.
C:\Users\tf715b\Desktop\standard-evaluator\venv\Lib\site-packages\openmdao\core\system.py:2697: PromotionWarning:'prep_geom.fuselage' <class _Fuselage>: input variable 'aircraft:horizontal_tail:thickness_to_chord', promoted using 'aircraft:horizontal_tail:thickness_to_chord', was already promoted using 'aircraft*'.
C:\Users\tf715b\Desktop\standard-evaluator\venv\Lib\site-packages\openmdao\core\system.py:2697: PromotionWarning:'prep_geom.fuselage' <class _Fuselage>: input variable 'aircraft:horizontal_tail:vertical_tail_fraction', promoted using 'aircraft:horizontal_tail:vertical_tail_fraction', was already promoted using 'aircraft*'.
C:\Users\tf715b\Desktop\standard-evaluator\venv\Lib\site-packages\openmdao\core\system.py:2697: PromotionWarning:'prep_geom.fuselage' <class _Fuselage>: input variable 'aircraft:vertical_tail:thickness_to_chord', promoted using 'aircraft:vertical_tail:thickness_to_chord', was already promoted using 'aircraft*'.
C:\Users\tf715b\Desktop\standard-evaluator\venv\Lib\site-packages\openmdao\core\system.py:2697: PromotionWarning:'prep_geom.fuselage' <class _Fuselage>: input variable 'aircraft:wing:area', promoted using 'aircraft:wing:area', was already promoted using 'aircraft*'.
C:\Users\tf715b\Desktop\standard-evaluator\venv\Lib\site-packages\openmdao\core\system.py:2697: PromotionWarning:'prep_geom.fuselage' <class _Fuselage>: input variable 'aircraft:wing:aspect_ratio', promoted using 'aircraft:wing:aspect_ratio', was already promoted using 'aircraft*'.
C:\Users\tf715b\Desktop\standard-evaluator\venv\Lib\site-packages\openmdao\core\system.py:2697: PromotionWarning:'prep_geom.fuselage' <class _Fuselage>: input variable 'aircraft:wing:glove_and_bat', promoted using 'aircraft:wing:glove_and_bat', was already promoted using 'aircraft*'.
C:\Users\tf715b\Desktop\standard-evaluator\venv\Lib\site-packages\openmdao\core\system.py:2697: PromotionWarning:'prep_geom.fuselage' <class _Fuselage>: input variable 'aircraft:wing:thickness_to_chord', promoted using 'aircraft:wing:thickness_to_chord', was already promoted using 'aircraft*'.
C:\Users\tf715b\Desktop\standard-evaluator\venv\Lib\site-packages\openmdao\core\system.py:2697: PromotionWarning:'prep_geom.nacelles' <class Nacelles>: input variable 'aircraft:nacelle:avg_diameter', promoted using 'aircraft:nacelle:avg_diameter', was already promoted using 'aircraft*'.
C:\Users\tf715b\Desktop\standard-evaluator\venv\Lib\site-packages\openmdao\core\system.py:2697: PromotionWarning:'prep_geom.nacelles' <class Nacelles>: input variable 'aircraft:nacelle:avg_length', promoted using 'aircraft:nacelle:avg_length', was already promoted using 'aircraft*'.
C:\Users\tf715b\Desktop\standard-evaluator\venv\Lib\site-packages\openmdao\core\system.py:2697: PromotionWarning:'prep_geom.nacelles' <class Nacelles>: input variable 'aircraft:nacelle:wetted_area_scaler', promoted using 'aircraft:nacelle:wetted_area_scaler', was already promoted using 'aircraft*'.
C:\Users\tf715b\Desktop\standard-evaluator\venv\Lib\site-packages\openmdao\core\system.py:2697: PromotionWarning:'prep_geom.tail' <class _Tail>: input variable 'aircraft:horizontal_tail:area', promoted using 'aircraft:horizontal_tail:area', was already promoted using 'aircraft*'.
C:\Users\tf715b\Desktop\standard-evaluator\venv\Lib\site-packages\openmdao\core\system.py:2697: PromotionWarning:'prep_geom.tail' <class _Tail>: input variable 'aircraft:horizontal_tail:vertical_tail_fraction', promoted using 'aircraft:horizontal_tail:vertical_tail_fraction', was already promoted using 'aircraft*'.
C:\Users\tf715b\Desktop\standard-evaluator\venv\Lib\site-packages\openmdao\core\system.py:2697: PromotionWarning:'prep_geom.tail' <class _Tail>: input variable 'aircraft:horizontal_tail:wetted_area_scaler', promoted using 'aircraft:horizontal_tail:wetted_area_scaler', was already promoted using 'aircraft*'.
C:\Users\tf715b\Desktop\standard-evaluator\venv\Lib\site-packages\openmdao\core\system.py:2697: PromotionWarning:'prep_geom.tail' <class _Tail>: input variable 'aircraft:vertical_tail:area', promoted using 'aircraft:vertical_tail:area', was already promoted using 'aircraft*'.
C:\Users\tf715b\Desktop\standard-evaluator\venv\Lib\site-packages\openmdao\core\system.py:2697: PromotionWarning:'prep_geom.tail' <class _Tail>: input variable 'aircraft:vertical_tail:wetted_area_scaler', promoted using 'aircraft:vertical_tail:wetted_area_scaler', was already promoted using 'aircraft*'.
C:\Users\tf715b\Desktop\standard-evaluator\venv\Lib\site-packages\openmdao\core\system.py:2697: PromotionWarning:'prep_geom.wing' <class _Wing>: input variable 'aircraft:wing:area', promoted using 'aircraft:wing:area', was already promoted using 'aircraft*'.
C:\Users\tf715b\Desktop\standard-evaluator\venv\Lib\site-packages\openmdao\core\system.py:2697: PromotionWarning:'prep_geom.wing' <class _Wing>: input variable 'aircraft:wing:wetted_area_scaler', promoted using 'aircraft:wing:wetted_area_scaler', was already promoted using 'aircraft*'.

Now that we have the OpenMDAO assembly we can show the values of it’s inputs. This will be useful to compare with in the other parts of the demo.

_ = prob.model.list_inputs(shape=True)
78 Input(s) in 'model'

varname                                              val              shape  prom_name                                      
---------------------------------------------------  ---------------  -----  -----------------------------------------------
prep_geom
  fuselage_prelim
    aircraft:fuselage:length                         [128.]           (1,)   aircraft:fuselage:length                       
    aircraft:fuselage:max_height                     [13.17]          (1,)   aircraft:fuselage:max_height                   
    aircraft:fuselage:max_width                      [12.33]          (1,)   aircraft:fuselage:max_width                    
  wing_prelim
    aircraft:wing:area                               [1370.]          (1,)   aircraft:wing:area                             
    aircraft:wing:glove_and_bat                      [134.]           (1,)   aircraft:wing:glove_and_bat                    
    aircraft:wing:span                               [117.83]         (1,)   aircraft:wing:span                             
  prelim
    aircraft:fuselage:avg_diameter                   [12.75]          (1,)   aircraft:fuselage:avg_diameter                 
    aircraft:fuselage:max_width                      [12.33]          (1,)   aircraft:fuselage:max_width                    
    aircraft:horizontal_tail:area                    [355.]           (1,)   aircraft:horizontal_tail:area                  
    aircraft:horizontal_tail:aspect_ratio            [6.]             (1,)   aircraft:horizontal_tail:aspect_ratio          
    aircraft:horizontal_tail:taper_ratio             [0.22]           (1,)   aircraft:horizontal_tail:taper_ratio           
    aircraft:horizontal_tail:thickness_to_chord      [0.125]          (1,)   aircraft:horizontal_tail:thickness_to_chord    
    aircraft:vertical_tail:area                      [284.]           (1,)   aircraft:vertical_tail:area                    
    aircraft:vertical_tail:aspect_ratio              [1.75]           (1,)   aircraft:vertical_tail:aspect_ratio            
    aircraft:vertical_tail:taper_ratio               [0.33]           (1,)   aircraft:vertical_tail:taper_ratio             
    aircraft:vertical_tail:thickness_to_chord        [0.1195]         (1,)   aircraft:vertical_tail:thickness_to_chord      
    aircraft:wing:area                               [1370.]          (1,)   aircraft:wing:area                             
    aircraft:wing:glove_and_bat                      [134.]           (1,)   aircraft:wing:glove_and_bat                    
    aircraft:wing:span                               [117.83]         (1,)   aircraft:wing:span                             
    aircraft:wing:taper_ratio                        [0.278]          (1,)   aircraft:wing:taper_ratio                      
    aircraft:wing:thickness_to_chord                 [0.13]           (1,)   aircraft:wing:thickness_to_chord               
  wing
    prep_geom:_Names:CROOT                           [16.415788]      (1,)   wing.prep_geom:_Names:CROOT                    
    prep_geom:_Names:CROOTB                          [15.13330021]    (1,)   wing.prep_geom:_Names:CROOTB                   
    prep_geom:_Names:XDX                             [12.75]          (1,)   wing.prep_geom:_Names:XDX                      
    prep_geom:_Names:XMULT                           [2.05031]        (1,)   wing.prep_geom:_Names:XMULT                    
    aircraft:wing:area                               [1370.]          (1,)   aircraft:wing:area                             
    aircraft:wing:wetted_area_scaler                 [1.]             (1,)   aircraft:wing:wetted_area_scaler               
  tail
    prep_geom:_Names:XMULTH                          [2.048375]       (1,)   tail.prep_geom:_Names:XMULTH                   
    prep_geom:_Names:XMULTV                          [2.0462465]      (1,)   tail.prep_geom:_Names:XMULTV                   
    aircraft:horizontal_tail:area                    [355.]           (1,)   aircraft:horizontal_tail:area                  
    aircraft:horizontal_tail:vertical_tail_fraction  [0.]             (1,)   aircraft:horizontal_tail:vertical_tail_fraction
    aircraft:horizontal_tail:wetted_area_scaler      [1.]             (1,)   aircraft:horizontal_tail:wetted_area_scaler    
    aircraft:vertical_tail:area                      [284.]           (1,)   aircraft:vertical_tail:area                    
    aircraft:vertical_tail:wetted_area_scaler        [1.]             (1,)   aircraft:vertical_tail:wetted_area_scaler      
  fuselage
    prep_geom:_Names:CROOTB                          [15.13330021]    (1,)   fuselage.prep_geom:_Names:CROOTB               
    prep_geom:_Names:CROTVT                          [19.15660306]    (1,)   fuselage.prep_geom:_Names:CROTVT               
    prep_geom:_Names:CRTHTB                          [13.50207305]    (1,)   fuselage.prep_geom:_Names:CRTHTB               
    aircraft:fuselage:avg_diameter                   [12.75]          (1,)   aircraft:fuselage:avg_diameter                 
    aircraft:fuselage:length                         [128.]           (1,)   aircraft:fuselage:length                       
    aircraft:fuselage:wetted_area_scaler             [1.]             (1,)   aircraft:fuselage:wetted_area_scaler           
    aircraft:horizontal_tail:thickness_to_chord      [0.125]          (1,)   aircraft:horizontal_tail:thickness_to_chord    
    aircraft:horizontal_tail:vertical_tail_fraction  [0.]             (1,)   aircraft:horizontal_tail:vertical_tail_fraction
    aircraft:vertical_tail:thickness_to_chord        [0.1195]         (1,)   aircraft:vertical_tail:thickness_to_chord      
    aircraft:wing:area                               [1370.]          (1,)   aircraft:wing:area                             
    aircraft:wing:aspect_ratio                       [11.232936]      (1,)   aircraft:wing:aspect_ratio                     
    aircraft:wing:glove_and_bat                      [134.]           (1,)   aircraft:wing:glove_and_bat                    
    aircraft:wing:thickness_to_chord                 [0.13]           (1,)   aircraft:wing:thickness_to_chord               
  nacelles
    aircraft:nacelle:avg_diameter                    [7.94]           (1,)   aircraft:nacelle:avg_diameter                  
    aircraft:nacelle:avg_length                      [12.3]           (1,)   aircraft:nacelle:avg_length                    
    aircraft:nacelle:wetted_area_scaler              [1.]             (1,)   aircraft:nacelle:wetted_area_scaler            
  canard
    aircraft:canard:area                             [0.]             (1,)   aircraft:canard:area                           
    aircraft:canard:thickness_to_chord               [0.]             (1,)   aircraft:canard:thickness_to_chord             
    aircraft:canard:wetted_area_scaler               [1.]             (1,)   aircraft:canard:wetted_area_scaler             
  characteristic_lengths
    prep_geom:_Names:CROOT                           [16.415788]      (1,)   characteristic_lengths.prep_geom:_Names:CROOT  
    aircraft:canard:area                             [0.]             (1,)   aircraft:canard:area                           
    aircraft:canard:aspect_ratio                     [0.]             (1,)   aircraft:canard:aspect_ratio                   
    aircraft:canard:thickness_to_chord               [0.]             (1,)   aircraft:canard:thickness_to_chord             
    aircraft:fuselage:avg_diameter                   [12.75]          (1,)   aircraft:fuselage:avg_diameter                 
    aircraft:fuselage:length                         [128.]           (1,)   aircraft:fuselage:length                       
    aircraft:horizontal_tail:area                    [355.]           (1,)   aircraft:horizontal_tail:area                  
    aircraft:horizontal_tail:aspect_ratio            [6.]             (1,)   aircraft:horizontal_tail:aspect_ratio          
    aircraft:horizontal_tail:thickness_to_chord      [0.125]          (1,)   aircraft:horizontal_tail:thickness_to_chord    
    aircraft:nacelle:avg_diameter                    [7.94]           (1,)   aircraft:nacelle:avg_diameter                  
    aircraft:nacelle:avg_length                      [12.3]           (1,)   aircraft:nacelle:avg_length                    
    aircraft:vertical_tail:area                      [284.]           (1,)   aircraft:vertical_tail:area                    
    aircraft:vertical_tail:aspect_ratio              [1.75]           (1,)   aircraft:vertical_tail:aspect_ratio            
    aircraft:vertical_tail:thickness_to_chord        [0.1195]         (1,)   aircraft:vertical_tail:thickness_to_chord      
    aircraft:wing:area                               [1370.]          (1,)   aircraft:wing:area                             
    aircraft:wing:aspect_ratio                       [11.232936]      (1,)   aircraft:wing:aspect_ratio                     
    aircraft:wing:glove_and_bat                      [134.]           (1,)   aircraft:wing:glove_and_bat                    
    aircraft:wing:taper_ratio                        [0.278]          (1,)   aircraft:wing:taper_ratio                      
    aircraft:wing:thickness_to_chord                 [0.13]           (1,)   aircraft:wing:thickness_to_chord               
  total_wetted_area
    aircraft:canard:wetted_area                      [0.]             (1,)   aircraft:canard:wetted_area                    
    aircraft:fuselage:wetted_area                    [4158.62066062]  (1,)   aircraft:fuselage:wetted_area                  
    aircraft:horizontal_tail:wetted_area             [592.64609688]   (1,)   aircraft:horizontal_tail:wetted_area           
    aircraft:nacelle:total_wetted_area               [546.9072]       (1,)   aircraft:nacelle:total_wetted_area             
    aircraft:vertical_tail:wetted_area               [581.134006]     (1,)   aircraft:vertical_tail:wetted_area             
    aircraft:wing:wetted_area                        [2396.55520449]  (1,)   aircraft:wing:wetted_area                      

We can also look at the N2 diagram for this model. If we carefully look at this diagram we can see that there are two main components that create outputs from this assembly:

  • characteristic_lengths

  • total_wetted_area

We can also see that two components are only using inputs to the group, and are not depending on the preliminary calculations done in other components in this assembly. The two components only depending on inputs to the group are:

  • nacelles

  • canard

import os
# Check if running in VS Code
if 'VSCODE_PID' in os.environ:
    display_in_notebook = False
else:
    display_in_notebook = True
om.n2(prob, 'before_NASA.n2.html', display_in_notebook=display_in_notebook,  )

The final step in this part of the workflow we are demonstrating is the engineer storing both the assembly information and the current state of the assembly in a JSON file (demo_group_nasa.json) and a HDF5 file (state.h5).

Note: We use the HDF5 format for storing the state since it is a binary file format which is compact and ensure no loss of accuracy. There are many different viewers and editors available to edit HDF5. A nice viewer is myHDF5.
save_assembly(prob, assembly_name='demo_group_nasa.json', state_name='state.h5')