def setup(self):
        surface = self.options['surface']

        self.add_subsystem('nodes',
                 ComputeNodes(surface=surface),
                 promotes_inputs=['mesh'], promotes_outputs=['nodes'])

        self.add_subsystem('assembly',
                 AssembleKGroup(surface=surface),
                 promotes_inputs=['A', 'Iy', 'Iz', 'J', 'nodes'], promotes_outputs=['local_stiff_transformed'])

        self.add_subsystem('structural_mass',
                 Weight(surface=surface),
                 promotes_inputs=['A', 'nodes'],
                 promotes_outputs=['structural_mass', 'element_mass'])

        self.add_subsystem('structural_cg',
            StructuralCG(surface=surface),
            promotes_inputs=['nodes', 'structural_mass', 'element_mass'],
            promotes_outputs=['cg_location'])

        if surface['fem_model_type'] == 'wingbox':
            self.add_subsystem('fuel_vol',
                WingboxFuelVol(surface=surface),
                promotes_inputs=['nodes', 'A_int'],
                promotes_outputs=['fuel_vols'])
    def test(self):
        surface = get_default_surfaces()[0]

        group = om.Group()

        comp = StructuralCG(surface=surface)

        indep_var_comp = om.IndepVarComp()

        ny = surface['mesh'].shape[1]

        indep_var_comp.add_output('nodes', val=np.random.random((ny, 3)), units='m')
        indep_var_comp.add_output('structural_mass', val=1., units='kg')
        indep_var_comp.add_output('element_mass', val=np.ones((ny-1)), units='kg')

        group.add_subsystem('indep_var_comp', indep_var_comp, promotes=['*'])
        group.add_subsystem('structural_cg', comp, promotes=['*'])

        run_test(self, group, complex_flag=True, compact_print=False)
Пример #3
0
    def test(self):
        surface = get_default_surfaces()[0]

        group = Group()

        comp = StructuralCG(surface=surface)

        indep_var_comp = IndepVarComp()

        ny = surface['num_y']

        indep_var_comp.add_output('nodes', val=np.ones((ny, 3)), units='m')
        indep_var_comp.add_output('structural_weight', val=1., units='N')
        indep_var_comp.add_output('element_weights',
                                  val=np.ones((ny - 1)),
                                  units='N')

        group.add_subsystem('indep_var_comp', indep_var_comp, promotes=['*'])
        group.add_subsystem('structural_cg', comp, promotes=['*'])

        run_test(self, group, complex_flag=True)
Пример #4
0
    def setup(self):
        surface = self.options['surface']

        self.add_subsystem('nodes',
                           ComputeNodes(surface=surface),
                           promotes_inputs=['mesh'],
                           promotes_outputs=['nodes'])

        self.add_subsystem('assembly',
                           AssembleK(surface=surface),
                           promotes_inputs=['A', 'Iy', 'Iz', 'J', 'nodes'],
                           promotes_outputs=['K'])

        self.add_subsystem(
            'structural_weight',
            Weight(surface=surface),
            promotes_inputs=['A', 'nodes', 'load_factor'],
            promotes_outputs=['structural_weight', 'element_weights'])

        self.add_subsystem(
            'structural_cg',
            StructuralCG(surface=surface),
            promotes_inputs=['nodes', 'structural_weight', 'element_weights'],
            promotes_outputs=['cg_location'])