Пример #1
0
    def setup(self):
        surface = self.options['surface']

        self.add_subsystem('viscousdrag',
            ViscousDrag(surface=surface),
            promotes_inputs=['M', 're', 'widths', 'cos_sweep', 'lengths', 'S_ref'], promotes_outputs=['CDv'])

        # This component is generally not needed unless you want the sectional CLs
        self.add_subsystem('liftcoeff',
             LiftCoeff2D(surface=surface),
             promotes_inputs=['v', 'alpha', 'rho', 'widths', 'chords', 'sec_forces'],
             promotes_outputs=['Cl'])

        self.add_subsystem('liftdrag',
            LiftDrag(surface=surface),
            promotes_inputs=['alpha', 'sec_forces'],
            promotes_outputs=['L', 'D'])

        self.add_subsystem('coeffs',
            Coeffs(surface=surface),
            promotes_inputs=['v', 'rho', 'S_ref', 'L', 'D'],
            promotes_outputs=['CL1', 'CDi'])

        self.add_subsystem('CD',
            TotalDrag(surface=surface),
            promotes_inputs=['CDv', 'CDi'],
            promotes_outputs=['CD'])

        self.add_subsystem('CL',
            TotalLift(surface=surface),
            promotes_inputs=['CL1'],
            promotes_outputs=['CL'])
Пример #2
0
    def test(self):
        surface = get_default_surfaces()[0]
        surface['t_over_c_cp'] = np.array([0.1, 0.15, 0.2])

        ny = surface['num_y']
        nx = surface['num_x']
        n_cp = len(surface['t_over_c_cp'])

        group = Group()

        indep_var_comp = IndepVarComp()
        indep_var_comp.add_output('t_over_c_cp', val=surface['t_over_c_cp'])
        group.add_subsystem('indep_var_comp', indep_var_comp, promotes=['*'])

        group.add_subsystem('t_over_c_bsp',
                            BsplinesComp(in_name='t_over_c_cp',
                                         out_name='t_over_c',
                                         num_control_points=n_cp,
                                         num_points=int(ny - 1),
                                         bspline_order=min(n_cp, 4),
                                         distribution='uniform'),
                            promotes_inputs=['t_over_c_cp'],
                            promotes_outputs=['t_over_c'])

        comp = ViscousDrag(surface=surface, with_viscous=True)
        group.add_subsystem('viscousdrag', comp, promotes=['*'])

        run_test(self, group, complex_flag=True)
Пример #3
0
    def test(self):
        surface = get_default_surfaces()[0]
        surface['t_over_c_cp'] = np.array([0.1, 0.15, 0.2])

        nx = surface['mesh'].shape[0]
        ny = surface['mesh'].shape[1]
        n_cp = len(surface['t_over_c_cp'])

        group = om.Group()

        indep_var_comp = om.IndepVarComp()
        indep_var_comp.add_output('t_over_c_cp', val=surface['t_over_c_cp'])
        group.add_subsystem('indep_var_comp', indep_var_comp, promotes=['*'])

        x_interp = np.linspace(0., 1., int(ny - 1))
        comp = group.add_subsystem('t_over_c_bsp',
                                   om.SplineComp(
                                       method='bsplines',
                                       x_interp_val=x_interp,
                                       num_cp=n_cp,
                                       interp_options={'order': min(n_cp, 4)}),
                                   promotes_inputs=['t_over_c_cp'],
                                   promotes_outputs=['t_over_c'])
        comp.add_spline(y_cp_name='t_over_c_cp',
                        y_interp_name='t_over_c',
                        y_cp_val=np.zeros(n_cp))

        comp = ViscousDrag(surface=surface, with_viscous=True)
        group.add_subsystem('viscousdrag', comp, promotes=['*'])

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

        self.add_subsystem('liftcoeff',
                           LiftCoeff2D(surface=surface),
                           promotes_inputs=[
                               'v', 'alpha', 'rho', 'widths', 'chords',
                               'sec_forces'
                           ],
                           promotes_outputs=['Cl'])

        self.add_subsystem('liftdrag',
                           LiftDrag(surface=surface),
                           promotes_inputs=['alpha', 'sec_forces'],
                           promotes_outputs=['L', 'D'])

        self.add_subsystem('coeffs',
                           Coeffs(),
                           promotes_inputs=['v', 'rho', 'S_ref', 'L', 'D'],
                           promotes_outputs=['CL1', 'CDi'])

        self.add_subsystem('CL',
                           TotalLift(surface=surface),
                           promotes_inputs=['CL1'],
                           promotes_outputs=['CL'])

        self.add_subsystem('viscousdrag',
                           ViscousDrag(surface=surface),
                           promotes_inputs=[
                               'Mach_number', 're', 'widths', 'cos_sweep',
                               'lengths', 'S_ref', 't_over_c'
                           ],
                           promotes_outputs=['CDv'])

        self.add_subsystem('wavedrag',
                           WaveDrag(surface=surface),
                           promotes_inputs=[
                               'Mach_number', 'cos_sweep', 'widths', 'CL',
                               'chords', 't_over_c'
                           ],
                           promotes_outputs=['CDw'])

        self.add_subsystem('CD',
                           TotalDrag(surface=surface),
                           promotes_inputs=['CDv', 'CDi', 'CDw'],
                           promotes_outputs=['CD'])
Пример #5
0
    def test(self):
        surface = get_default_surfaces()[0]
        surface['k_lam'] = .05
        comp = ViscousDrag(surface=surface, with_viscous=True)

        run_test(self, comp, complex_flag=True)