root.add('specific_fuel_consumption', IndepVarComp('SFC', SFC), promotes=['*'])
    root.add('design_range', IndepVarComp('R', R), promotes=['*'])

    # Independent variables that are optimization design variables
    root.add('thicknesses', IndepVarComp('t', t_0), promotes=['*'])
    root.add('local_chords', IndepVarComp('chords', chords_0), promotes=['*'])
    root.add('local_sweep_angles', IndepVarComp('sweep', sweep_0), promotes=['*'])
    root.add('wing_span', IndepVarComp('b', b_0), promotes=['*'])
    root.add('wing_twist', IndepVarComp('theta', theta_0), promotes=['*'])
    root.add('angle_of_attack', IndepVarComp('alpha', alpha_0), promotes=['*'])
    root.add('airfoil_tc_ratio', IndepVarComp('tc', tc_0), promotes=['*'])
    root.add('minimum_cabin_height', IndepVarComp('h_min', h_min), promotes=['*'])
    root.add('minimum_cabin_area', IndepVarComp('area_min', area_min), promotes=['*'])

    #Interpolation Components
    root.add('interp_struct_morph', Interpolation(ns_all, na_unique_h, function = function_type, bias = bias_morph))
    
    #Geometry and meshing Components
    root.add('aerodynamic_mesher', PanairMesher(n_sec, na, na_unique, network_info, ref_airfoil_files), promotes=['camc','chords','tc','theta','x_le','y_le','z_le'])
    root.add('aerodynamic_mesher_h', PanairMesher(n_sec, na_h, na_unique_h, network_info_h, ref_airfoil_files), promotes=['camc','chords','tc','theta','x_le','y_le','z_le','apoints_coord','apoints_coord_unique'])
    root.add('structure_mesher', StructureMesher(na_unique_h, node_id, node_id_all), promotes=['*'])
    root.add('x_leading_edge', XLeadingEdge(n_sec), promotes=['*'])

    root.add('y_leading_edge', ExecComp(
        'y_le = b/b_baseline*y_le_baseline', y_le=np.zeros(len(y_le_baseline), dtype=float), y_le_baseline=np.zeros(len(y_le_baseline), dtype=float)), promotes=['*'])

    #Planform area
    root.add('reference_surface',
             ExecComp('Sw = 2.*area_segment.sum()', area_segment=np.zeros(n_sec-1, dtype=float)), promotes=['*'])
    
    #Total wet surface
Ejemplo n.º 2
0
    root.add('wing_span', IndepVarComp('b', b), promotes=['*'])
    root.add('t_max', IndepVarComp('t_i_max', t_i_max), promotes=['*'])
    root.add('t_min', IndepVarComp('t_i_min', t_i_min), promotes=['*'])
    root.add('wing_chord', IndepVarComp('c', c), promotes=['*'])
    root.add('s_coord', IndepVarComp('node_coord', node_coord), promotes=['*'])
    root.add('s_coord_all',
             IndepVarComp('node_coord_all', node_coord_all),
             promotes=['*'])
    root.add('thicknesses', IndepVarComp('t', t), promotes=['*'])
    #    root.add('masses', IndepVarComp('m', m), promotes=['*'])
    root.add('a_coord',
             IndepVarComp('apoints_coord', apoints_coord),
             promotes=['*'])

    root.add('inter',
             Interpolation(na, ns, function=function_type, bias=bias),
             promotes=['*'])
    #    root.add('agrr', Aggregation(n_stress,p,function), promotes=['*'])

    mda = Group()

    #Add disciplines to the group
    mda.add('displacement_transfer',
            DisplacementTransfer(na, ns),
            promotes=['*'])
    mda.add('aerodynamics', Panair(na, network_info), promotes=['*'])
    mda.add('load_transfer', LoadTransfer(na, ns), promotes=['*'])
    mda.add('structures',
            NastranStatic(node_id, node_id_all, n_stress, tn, mn),
            promotes=['*'])
Ejemplo n.º 3
0
    #Add disciplines to the high-fidelity group CHECK INPUTS
    mda_h.add('mult_filter', Filter(ns, fidelity))
    mda_h.add('displacement_transfer_h', DisplacementTransfer(na_h, ns))
    mda_h.add(
        'aerodynamics_h',
        Panair(na_h,
               network_info_h,
               case_name_h,
               aero_template_h,
               sym_plane_index=sym_plane_index))
    mda_h.add('load_transfer_h', LoadTransfer(na_h, ns))
    mda_h.add(
        'structures_h',
        NastranStatic(node_id, node_id_all, n_stress, tn, mn, sn, case_name_h))

    mda_l.add('inter', Interpolation(na, ns, function=function_type,
                                     bias=bias))
    mda_h.add('inter_h',
              Interpolation(na_h, ns, function=function_type, bias=bias))

    #Define solver type and tolerance for MDA Lo-Fi
    mda_l.nl_solver = NLGaussSeidel()
    #The solver execution limit is used to control fidelity levels
    if fidelity == 'high':
        mda_l.nl_solver.options['maxiter'] = 0  #No Lo-Fi iterations
    elif fidelity == 'multi':
        mda_l.nl_solver.options[
            'maxiter'] = it_l  #Adds the limit for the execution of the MDA Solver

    mda_l.nl_solver.options['rutol'] = 1.e-2
    mda_l.nl_solver.options['use_aitken'] = True
    mda_l.nl_solver.options['aitken_alpha_min'] = 0.1
    root.add('root_chord', IndepVarComp('cr', cr), promotes=['*'])
    root.add('break_chord', IndepVarComp('cb', cb), promotes=['*'])
    root.add('tip_chord', IndepVarComp('ct', ct), promotes=['*'])
    root.add('sweep_angle', IndepVarComp('sweep', sweep), promotes=['*'])
    root.add('root_leading_edge_x', IndepVarComp('xr', xr), promotes=['*'])
    root.add('baseline_wing_span',
             IndepVarComp('b_baseline', b_baseline),
             promotes=['*'])
    # Independent variables that are optimization design variables
    root.add('wing_span', IndepVarComp('b', b_0), promotes=['*'])

    #Interpolation Components
    root.add(
        'interp_struct_morph',
        Interpolation(ns_all,
                      ngeom_unique,
                      function=function_type,
                      bias=bias_morph))
    root.add(
        'interp_aero_hifi_morph',
        Interpolation(na_h,
                      ngeom_unique,
                      function=function_type,
                      bias=bias_morph))

    #Geometry and meshing Components
    root.add('planform_geometry',
             PlanformGeometry(n_sec, b_sec),
             promotes=['*'])
    root.add('surface_generator',
             SurfaceGenerator(n_sec, ngeom, ngeom_unique, network_info_h,
                              ref_airfoil_file),
    root.add('break_chord', IndepVarComp('cb', cb_0), promotes=['*'])
    root.add('tip_chord', IndepVarComp('ct', ct_0), promotes=['*'])
    root.add('sweep_angle', IndepVarComp('sweep', sweep_0), promotes=['*'])
    root.add('wing_span', IndepVarComp('b', b_0), promotes=['*'])
    root.add('angle_of_attack', IndepVarComp('alpha', alpha_0), promotes=['*'])

    
    root.add('thicknesses', IndepVarComp('t', t), promotes=['*'])
    if an > 0:
        root.add('rod_sections', IndepVarComp('a', a), promotes=['*'])   
    root.add('bar_sections', IndepVarComp('s', s), promotes=['*'])
    root.add('first_moment_inertia', IndepVarComp('Ix', Ix), promotes=['*'])
    root.add('second_moment_inertia', IndepVarComp('Iy', Iy), promotes=['*'])

    #Interpolation Components
    root.add('interp_struct_morph', Interpolation(ns_all, na_unique, function = function_type, bias = bias_morph))
    root.add('interp_mda', Interpolation(na, ns, function = function_type, bias = bias_inter), promotes=['*'])

    #Geometry and meshing Components
    root.add('planform_geometry', PlanformGeometry(n_sec, b_sec), promotes=['*'])
    root.add('aerodynamic_mesher', PanairMesher(n_sec, na, na_unique, network_info, ref_airfoil_file), promotes=['*'])
    root.add('structure_mesher', StructureMesher(na_unique, node_id, node_id_all), promotes=['*'])

    root.add('y_leading_edge', ExecComp(
        'y_le = b/b_baseline*y_le_baseline', y_le=np.zeros(len(y_le_baseline), dtype=float), y_le_baseline=np.zeros(len(y_le_baseline), dtype=float)), promotes=['*'])

    root.add('tc_ratio', ExecComp(
        'tc = th/chords', tc=np.zeros(n_sec, dtype=float), th=np.zeros(n_sec, dtype=float), chords=np.zeros(n_sec, dtype=float)), promotes=['*'])

    #Explicit connections
    root.connect('interp_struct_morph.H', 'G')
    root.add('angle_of_attack', IndepVarComp('alpha', alpha), promotes=['*'])
    root.add('wing_span', IndepVarComp('b', b), promotes=['*'])
    root.add('wing_chord', IndepVarComp('c', c), promotes=['*'])
    root.add('s_coord', IndepVarComp('node_coord', node_coord), promotes=['*'])
    root.add('s_coord_all', IndepVarComp('node_coord_all', node_coord_all), promotes=['*'])
    root.add('a_coord', IndepVarComp('apoints_coord', apoints_coord), promotes=['*'])
    root.add('load_factor', IndepVarComp('n', n), promotes=['*'])
    
    root.add('thicknesses', IndepVarComp('t', t), promotes=['*'])
    if an > 0:
        root.add('rod_sections', IndepVarComp('a', a), promotes=['*'])   
    root.add('bar_sections', IndepVarComp('s', s), promotes=['*'])
    root.add('first_moment_inertia', IndepVarComp('Ix', Ix), promotes=['*'])
    root.add('second_moment_inertia', IndepVarComp('Iy', Iy), promotes=['*'])

    root.add('inter', Interpolation(na, ns, function = function_type, bias = bias), promotes=['*'])

    mda = Group()

    #Add disciplines to the group
    mda.add('displacement_transfer', DisplacementTransfer(na, ns), promotes=['*'])
    mda.add('aerodynamics', Panair(na, network_info, case_name, sym_plane_index), promotes=['*'])
    mda.add('load_transfer', LoadTransfer(na, ns), promotes=['*'])
    mda.add('structures', NastranStatic(node_id, node_id_all, n_stress, tn, mn, sn, an, case_name), promotes=['*'])

    #Define solver type and tolerance for MDA
    mda.nl_solver = NLGaussSeidel()
    # mda.nl_solver.options['maxiter'] = 0
    mda.nl_solver.options['rutol'] = 1.e-2 #2 origin
    mda.nl_solver.options['use_aitken'] = True
    mda.nl_solver.options['aitken_alpha_min'] = 0.1