Ejemplo n.º 1
0
    def setup(self):
        surface = self.options['surface']

        self.add_subsystem(
            'aero_funcs',
            VLMFunctionals(surface=surface),
            promotes_inputs=[
                'v', 'alpha', 'Mach_number', 're', 'rho', 'widths',
                'cos_sweep', 'lengths', 'S_ref', 'sec_forces', 't_over_c'
            ],
            promotes_outputs=['CDv', 'L', 'D', 'CL1', 'CDi', 'CD', 'CL'])

        if surface['fem_model_type'] == 'tube':
            self.add_subsystem(
                'struct_funcs',
                SpatialBeamFunctionals(surface=surface),
                promotes_inputs=['thickness', 'radius', 'nodes', 'disp'],
                promotes_outputs=[
                    'thickness_intersects', 'vonmises', 'failure'
                ])

        elif surface['fem_model_type'] == 'wingbox':
            self.add_subsystem('struct_funcs',
                               SpatialBeamFunctionals(surface=surface),
                               promotes_inputs=[
                                   'Qz', 'Iz', 'J', 'A_enc', 'spar_thickness',
                                   'skin_thickness', 'htop', 'hbottom',
                                   'hfront', 'hrear', 'nodes', 'disp'
                               ],
                               promotes_outputs=['vonmises', 'failure'])
        else:
            raise NameError(
                'Please select a valid `fem_model_type` from either `tube` or `wingbox`.'
            )
Ejemplo n.º 2
0
    def setup(self):
        surfaces = self.options['surfaces']

        for surface in surfaces:
            name = surface['name']

            self.connect(name + '.normals', 'aero_states.' + name + '_normals')
            # self.connect(name + '.b_pts', 'aero_states.' + name + '_b_pts')
            # self.connect(name + '.c_pts', 'aero_states.' + name + '_c_pts')
            # self.connect(name + '.cos_sweep', 'aero_states.' + name + '_cos_sweep')
            # self.connect(name + '.widths', 'aero_states.' + name + '_widths')

            # Connect the results from 'aero_states' to the performance groups
            self.connect('aero_states.' + name + '_sec_forces', name + '_perf' + '.sec_forces')

            # Connect S_ref for performance calcs
            self.connect(name + '.S_ref', name + '_perf.S_ref')
            self.connect(name + '.widths', name + '_perf.widths')
            self.connect(name + '.chords', name + '_perf.chords')
            self.connect(name + '.lengths', name + '_perf.lengths')
            self.connect(name + '.cos_sweep', name + '_perf.cos_sweep')

            # Connect S_ref for performance calcs
            self.connect(name + '.S_ref', 'total_perf.' + name + '_S_ref')
            self.connect(name + '.widths', 'total_perf.' + name + '_widths')
            self.connect(name + '.chords', 'total_perf.' + name + '_chords')
            self.connect(name + '.b_pts', 'total_perf.' + name + '_b_pts')
            self.connect(name + '_perf' + '.CL', 'total_perf.' + name + '_CL')
            self.connect(name + '_perf' + '.CD', 'total_perf.' + name + '_CD')
            self.connect('aero_states.' + name + '_sec_forces', 'total_perf.' + name + '_sec_forces')

            self.add_subsystem(name, VLMGeometry(surface=surface))

        # Add a single 'aero_states' component that solves for the circulations
        # and forces from all the surfaces.
        # While other components only depends on a single surface,
        # this component requires information from all surfaces because
        # each surface interacts with the others.
        aero_states = VLMStates(surfaces=surfaces)
        aero_states.linear_solver = LinearRunOnce()

        self.add_subsystem('aero_states',
                 aero_states,
                 promotes_inputs=['v', 'alpha', 'rho'],
                 promotes_outputs=['circulations'])

        # Explicitly connect parameters from each surface's group and the common
        # 'aero_states' group.
        # This is necessary because the VLMStates component requires information
        # from each surface, but this information is stored within each
        # surface's group.
        for surface in surfaces:
            self.add_subsystem(surface['name'] +'_perf', VLMFunctionals(surface=surface),
                    promotes_inputs=["v", "alpha", "M", "re", "rho"])

        self.add_subsystem('total_perf',
            TotalAeroPerformance(surfaces=surfaces),
            promotes_inputs=['v', 'rho', 'cg', 'S_ref_total'],
            promotes_outputs=['CM', 'CL', 'CD'])
Ejemplo n.º 3
0
    def setup(self):
        surfaces = self.options['surfaces']
        rotational = self.options['rotational']

        # Loop through each surface and connect relevant parameters
        for surface in surfaces:
            name = surface['name']

            self.connect(name + '.normals', 'aero_states.' + name + '_normals')

            # Connect the results from 'aero_states' to the performance groups
            self.connect('aero_states.' + name + '_sec_forces',
                         name + '_perf' + '.sec_forces')

            # Connect S_ref for performance calcs
            self.connect(name + '.S_ref', name + '_perf.S_ref')
            self.connect(name + '.widths', name + '_perf.widths')
            self.connect(name + '.chords', name + '_perf.chords')
            self.connect(name + '.lengths', name + '_perf.lengths')
            self.connect(name + '.cos_sweep', name + '_perf.cos_sweep')

            # Connect S_ref for performance calcs
            self.connect(name + '.S_ref', 'total_perf.' + name + '_S_ref')
            self.connect(name + '.widths', 'total_perf.' + name + '_widths')
            self.connect(name + '.chords', 'total_perf.' + name + '_chords')
            self.connect(name + '.b_pts', 'total_perf.' + name + '_b_pts')
            self.connect(name + '_perf' + '.CL', 'total_perf.' + name + '_CL')
            self.connect(name + '_perf' + '.CD', 'total_perf.' + name + '_CD')
            self.connect('aero_states.' + name + '_sec_forces',
                         'total_perf.' + name + '_sec_forces')

            self.add_subsystem(name, VLMGeometry(surface=surface))

        # Add a single 'aero_states' component that solves for the circulations
        # and forces from all the surfaces.
        # While other components only depends on a single surface,
        # this component requires information from all surfaces because
        # each surface interacts with the others.
        if self.options['compressible'] == True:
            aero_states = CompressibleVLMStates(surfaces=surfaces,
                                                rotational=rotational)
            prom_in = ['v', 'alpha', 'beta', 'rho', 'Mach_number']
        else:
            aero_states = VLMStates(surfaces=surfaces, rotational=rotational)
            prom_in = ['v', 'alpha', 'beta', 'rho']

        aero_states.linear_solver = om.LinearRunOnce()

        if rotational:
            prom_in.extend(['omega', 'cg'])

        self.add_subsystem('aero_states',
                           aero_states,
                           promotes_inputs=prom_in,
                           promotes_outputs=['circulations'])

        # Explicitly connect parameters from each surface's group and the common
        # 'aero_states' group.
        # This is necessary because the VLMStates component requires information
        # from each surface, but this information is stored within each
        # surface's group.
        for surface in surfaces:
            self.add_subsystem(surface['name'] + '_perf',
                               VLMFunctionals(surface=surface),
                               promotes_inputs=[
                                   'v', 'alpha', 'beta', 'Mach_number', 're',
                                   'rho'
                               ])

        # Add the total aero performance group to compute the CL, CD, and CM
        # of the total aircraft. This accounts for all lifting surfaces.
        self.add_subsystem(
            'total_perf',
            TotalAeroPerformance(
                surfaces=surfaces,
                user_specified_Sref=self.options['user_specified_Sref']),
            promotes_inputs=['v', 'rho', 'cg', 'S_ref_total'],
            promotes_outputs=['CM', 'CL', 'CD'])
Ejemplo n.º 4
0
    def test(self):
        surfaces = get_default_surfaces()

        comp = VLMFunctionals(surface=surfaces[0])

        run_test(self, comp)
Ejemplo n.º 5
0
    def test(self):
        surfaces = get_default_surfaces()

        comp = VLMFunctionals(surface=surfaces[0])

        run_test(self, comp, complex_flag=True, step=1e-8)