Example #1
0
    def test(self):
        wing_dict = {'name': 'wing', 'num_y': 7, 'num_x': 2, 'symmetry': True}
        tail_dict = {'name': 'tail', 'num_y': 5, 'num_x': 3, 'symmetry': False}

        surfaces = [wing_dict, tail_dict]

        comp = TotalLiftDrag(surfaces=surfaces)

        run_test(self, comp, tol=1e-5)
    def setup(self):
        surfaces = self.options['surfaces']

        if not self.options['user_specified_Sref']:
            self.add_subsystem('sum_areas',
                               SumAreas(surfaces=surfaces),
                               promotes_inputs=['*S_ref'],
                               promotes_outputs=['S_ref_total'])

        if self.options['internally_connect_fuelburn']:
            promote_fuelburn = ['fuelburn']
        else:
            promote_fuelburn = []

        self.add_subsystem(
            'CL_CD',
            TotalLiftDrag(surfaces=surfaces),
            promotes_inputs=['*CL', '*CD', '*S_ref', 'S_ref_total'],
            promotes_outputs=['CL', 'CD'])

        self.add_subsystem('fuelburn',
                           BreguetRange(surfaces=surfaces),
                           promotes_inputs=[
                               '*structural_weight', 'CL', 'CD', 'CT',
                               'speed_of_sound', 'R', 'Mach_number', 'W0',
                               'load_factor'
                           ],
                           promotes_outputs=['fuelburn'])

        self.add_subsystem('L_equals_W',
                           Equilibrium(surfaces=surfaces),
                           promotes_inputs=[
                               'CL', '*structural_weight', 'S_ref_total', 'W0',
                               'load_factor', 'rho', 'v'
                           ] + promote_fuelburn,
                           promotes_outputs=['L_equals_W', 'total_weight'])

        self.add_subsystem('CG',
                           CenterOfGravity(surfaces=surfaces),
                           promotes_inputs=[
                               '*structural_weight', '*cg_location',
                               'total_weight', 'W0', 'empty_cg', 'load_factor'
                           ] + promote_fuelburn,
                           promotes_outputs=['cg'])

        self.add_subsystem('moment',
                           MomentCoefficient(surfaces=surfaces),
                           promotes_inputs=[
                               'v', 'rho', 'cg', 'S_ref_total', '*b_pts',
                               '*widths', '*chords', '*sec_forces', '*S_ref'
                           ],
                           promotes_outputs=['CM'])
    def setup(self):
        surfaces = self.options['surfaces']

        self.add_subsystem('sum_areas',
                           SumAreas(surfaces=surfaces),
                           promotes_inputs=['*S_ref'],
                           promotes_outputs=['S_ref_total'])

        self.add_subsystem(
            'CL_CD',
            TotalLiftDrag(surfaces=surfaces),
            promotes_inputs=['*CL', '*CD', '*S_ref', 'S_ref_total'],
            promotes_outputs=['CL', 'CD'])

        self.add_subsystem('fuelburn',
                           BreguetRange(surfaces=surfaces),
                           promotes_inputs=[
                               '*structural_weight', 'CL', 'CD', 'CT', 'a',
                               'R', 'M', 'W0', 'load_factor'
                           ],
                           promotes_outputs=['fuelburn'])

        self.add_subsystem('L_equals_W',
                           Equilibrium(surfaces=surfaces),
                           promotes_inputs=[
                               '*L', '*structural_weight', 'S_ref_total',
                               'fuelburn', 'W0', 'load_factor', 'rho', 'v'
                           ],
                           promotes_outputs=['L_equals_W', 'total_weight'])

        self.add_subsystem('CG',
                           CenterOfGravity(surfaces=surfaces),
                           promotes_inputs=[
                               '*structural_weight', '*cg_location',
                               'fuelburn', 'total_weight', 'W0', 'empty_cg',
                               'load_factor'
                           ],
                           promotes_outputs=['cg'])

        self.add_subsystem('moment',
                           MomentCoefficient(surfaces=surfaces),
                           promotes_inputs=[
                               'v', 'rho', 'cg', 'S_ref_total', '*b_pts',
                               '*widths', '*chords', '*sec_forces', '*S_ref'
                           ],
                           promotes_outputs=['CM'])
Example #4
0
    def test2(self):
        surfaces = get_default_surfaces()

        group = Group()

        comp = TotalLiftDrag(surfaces=surfaces)

        indep_var_comp = IndepVarComp()

        indep_var_comp.add_output('S_ref_total', val=10., units='m**2')

        group.add_subsystem('moment_calc', comp)
        group.add_subsystem('indep_var_comp', indep_var_comp)

        group.connect('indep_var_comp.S_ref_total', 'moment_calc.S_ref_total')

        run_test(self, group, tol=1e-5)
Example #5
0
    def setup(self):
        surfaces = self.options['surfaces']

        self.add_subsystem('sum_areas',
                           SumAreas(surfaces=surfaces),
                           promotes_inputs=['*S_ref'],
                           promotes_outputs=['S_ref_total'])

        self.add_subsystem(
            'CL_CD',
            TotalLiftDrag(surfaces=surfaces),
            promotes_inputs=['*CL', '*CD', '*S_ref', 'S_ref_total'],
            promotes_outputs=['CL', 'CD'])

        self.add_subsystem('moment',
                           MomentCoefficient(surfaces=surfaces),
                           promotes_inputs=[
                               'v', 'cg', 'rho', '*S_ref', '*b_pts', '*widths',
                               '*chords', '*sec_forces', 'S_ref_total'
                           ],
                           promotes_outputs=['CM'])