예제 #1
0
def compute_noise(config, analyses, noise_segment):
    turbofan = config.propulsors[0]

    outputfile = config.output_file
    outputfile_engine = config.output_file_engine
    print_output = config.print_output
    engine_flag = config.engine_flag  # remove engine noise component from the approach segment

    airframe_noise = noise_airframe_Fink(config, analyses, noise_segment, print_output, outputfile)

    engine_noise = noise_SAE(turbofan, noise_segment, config, analyses, print_output, outputfile_engine)

    noise_sum = 10. * np.log10(10 ** (airframe_noise[0] / 10) + engine_flag * 10 ** (engine_noise[0] / 10))

    return noise_sum
예제 #2
0
def compute_noise(config, analyses, noise_segment, noise_settings):
    """This method computes the noise of a turbofan aircraft
            
    Assumptions:
        N/A

    Source:
        N/A 

    Inputs:
        config.
        networks.turbofan     - SUAVE turbofan data structure               [None]
        output_file           - flag to write noise outout to file          [Boolean]
        output_file_engine    - flag to write engine outout to file         [Boolean]
        print_output          - flag to print outout to file                [Boolean]
        engine_flag           - flag to include engine in noise calculation [Boolean]
        
    Outputs: 
        noise_sum                                                           [dB]

    Properties Used:
        N/A 
        
    """

    turbofan = config.networks['turbofan']
    outputfile = config.output_file
    outputfile_engine = config.output_file_engine
    print_output = config.print_output
    engine_flag = config.engine_flag

    geometric = noise_geometric(noise_segment, analyses, config)

    airframe_noise = noise_airframe_Fink(noise_segment, analyses, config,
                                         noise_settings, print_output,
                                         outputfile)

    engine_noise = noise_SAE(turbofan, noise_segment, analyses, config,
                             noise_settings, print_output, outputfile_engine)

    noise_sum = 10. * np.log10(10**(airframe_noise.EPNL_total / 10) +
                               (engine_flag) * 10**
                               (engine_noise.EPNL_total / 10))

    return noise_sum
예제 #3
0
    def evaluate_noise(self, segment):
        """ Process vehicle to setup geometry, condititon and configuration
    
        Assumptions:
        None
    
        Source:
        N/4
    
        Inputs:
        self.settings.
            ground_microphone_phi_angles   - azimuth measured from observer to aircraft body frame     [radians]
            ground_microphone_theta_angles - axial angle measured from observer to aircraft body frame [radians]
            center_frequencies             - 1/3 octave band frequencies                               [unitless]
    
        Outputs:
        None
    
        Properties Used:
        self.geometry
        """

        # unpack
        config = segment.analyses.noise.geometry
        analyses = segment.analyses
        settings = self.settings
        conditions = segment.state.conditions
        print_flag = settings.print_noise_output

        # unpack
        alt = -conditions.frames.inertial.position_vector[:, 2]
        gm_phi = settings.ground_microphone_phi_angles
        gm_theta = settings.ground_microphone_theta_angles
        cf = settings.center_frequencies

        dim_alt = len(alt)
        dim_phi = len(gm_phi)
        dim_theta = len(gm_theta)
        num_mic = dim_phi * dim_theta
        dim_cf = len(cf)

        # dimension:[control point, theta, phi]
        theta = np.repeat(np.repeat(np.atleast_2d(gm_theta).T, dim_phi,
                                    axis=1)[np.newaxis, :, :],
                          dim_alt,
                          axis=0)
        phi = np.repeat(np.repeat(np.atleast_2d(gm_phi), dim_theta,
                                  axis=0)[np.newaxis, :, :],
                        dim_alt,
                        axis=0)
        altitude = np.repeat(np.repeat(np.atleast_2d(alt).T, dim_theta,
                                       axis=1)[:, :, np.newaxis],
                             dim_phi,
                             axis=2)
        x_vals = altitude / np.tan(theta)
        y_vals = altitude / np.tan(phi)
        z_vals = altitude

        # store microphone locations
        mic_locations = np.zeros((dim_alt, num_mic, 3))
        mic_locations[:, :, 0] = x_vals.reshape(dim_alt, num_mic)
        mic_locations[:, :, 1] = y_vals.reshape(dim_alt, num_mic)
        mic_locations[:, :, 2] = z_vals.reshape(dim_alt, num_mic)

        # append microphone locations to conditions
        conditions.noise.microphone_theta_angles = gm_theta
        conditions.noise.microphone_phi_angles = gm_phi
        conditions.noise.microphone_locations = mic_locations
        conditions.noise.number_of_microphones = num_mic

        ctrl_pts = len(altitude)

        # create empty arrays for results
        num_src = len(config.propulsors) + 1
        if ('lift_cruise') in config.propulsors.keys():
            num_src += 1
        source_SPLs_dBA = np.zeros((ctrl_pts, num_src, num_mic))
        source_SPL_spectra = np.zeros((ctrl_pts, num_src, num_mic, dim_cf))

        si = 1
        # iterate through sources
        for source in conditions.noise.sources.keys():
            for network in config.propulsors.keys():
                if source == 'turbofan':
                    geometric = noise_geometric(segment, analyses, config)

                    # flap noise - only applicable for turbofan aircraft
                    if 'flap' in config.wings.main_wing.control_surfaces:
                        airframe_noise = noise_airframe_Fink(
                            segment, analyses, config, settings)
                        source_SPLs_dBA[:, si, :] = airframe_noise.SPL_dBA
                        source_SPL_spectra[:, si, :, 5:] = np.repeat(
                            airframe_noise.SPL_spectrum[:, np.newaxis, :],
                            num_mic,
                            axis=1)

                    if bool(conditions.noise.sources[source].fan) and bool(
                            conditions.noise.sources[source].core):

                        config.propulsors[
                            source].fan.rotation = 0  # FUTURE WORK: NEED TO UPDATE ENGINE MODEL WITH FAN SPEED in RPM
                        config.propulsors[
                            source].fan_nozzle.noise_speed = conditions.noise.sources.turbofan.fan.exit_velocity
                        config.propulsors[
                            source].core_nozzle.noise_speed = conditions.noise.sources.turbofan.core.exit_velocity
                        engine_noise = noise_SAE(config.propulsors[source],
                                                 segment,
                                                 analyses,
                                                 config,
                                                 settings,
                                                 ioprint=print_flag)
                        source_SPLs_dBA[:, si, :] = np.repeat(
                            np.atleast_2d(engine_noise.SPL_dBA).T,
                            num_mic,
                            axis=1
                        )  # noise measures at one microphone location in segment
                        source_SPL_spectra[:, si, :, 5:] = np.repeat(
                            engine_noise.SPL_spectrum[:, np.newaxis, :],
                            num_mic,
                            axis=1
                        )  # noise measures at one microphone location in segment

                elif (source == 'propeller') or (source == 'rotor'):
                    if bool(conditions.noise.sources[source]) == True:
                        net = config.propulsors[network]
                        prop = config.propulsors[network][source]
                        acoustic_data = conditions.noise.sources[source]
                        propeller_noise = propeller_mid_fidelity(
                            net, prop, acoustic_data, segment, settings)
                        source_SPLs_dBA[:, si, :] = propeller_noise.SPL_dBA
                        source_SPL_spectra[:,
                                           si, :, :] = propeller_noise.SPL_spectrum

                        si += 1

        conditions.noise.total_SPL_dBA = SPL_arithmetic(source_SPLs_dBA,
                                                        sum_axis=1)

        return
예제 #4
0
    def evaluate_noise(self, segment):
        """ Process vehicle to setup geometry, condititon and configuration
    
        Assumptions:
        None
    
        Source:
        N/4
    
        Inputs:
        self.settings.
            center_frequencies  - 1/3 octave band frequencies   [unitless]
    
        Outputs:
        None
    
        Properties Used:
        self.geometry
        """

        # unpack
        config = segment.analyses.noise.geometry
        analyses = segment.analyses
        settings = self.settings
        print_flag = settings.print_noise_output
        conditions = segment.state.conditions
        dim_cf = len(settings.center_frequencies)
        ctrl_pts = int(segment.state.numerics.number_control_points)
        min_x = settings.level_ground_microphone_min_x
        max_x = settings.level_ground_microphone_max_x
        min_y = settings.level_ground_microphone_min_y
        max_y = settings.level_ground_microphone_max_y
        x_resolution = settings.level_ground_microphone_x_resolution
        y_resolution = settings.level_ground_microphone_y_resolution

        # generate noise valuation points
        settings.ground_microphone_locations = generate_ground_microphone_points(
            min_x, max_x, min_y, max_y, x_resolution, y_resolution)

        GM_THETA, GM_PHI, GML, num_gm_mic = compute_ground_noise_evaluation_locations(
            settings, segment)

        BM_THETA, BM_PHI, UCML, num_b_mic = compute_building_noise_evaluation_locations(
            settings, segment)

        mic_locations = np.concatenate((GML, UCML), axis=1)
        THETA = np.concatenate((GM_THETA, BM_THETA), axis=1)
        PHI = np.concatenate((GM_PHI, BM_PHI), axis=1)

        num_mic = num_b_mic + num_gm_mic

        # append microphone locations to conditions
        conditions.noise.ground_microphone_theta_angles = GM_THETA
        conditions.noise.building_microphone_theta_angles = BM_THETA
        conditions.noise.total_microphone_theta_angles = THETA

        conditions.noise.ground_microphone_phi_angles = GM_PHI
        conditions.noise.building_microphone_phi_angles = BM_PHI
        conditions.noise.total_microphone_phi_angles = PHI

        conditions.noise.ground_microphone_locations = GML
        conditions.noise.building_microphone_locations = UCML
        conditions.noise.total_microphone_locations = mic_locations

        conditions.noise.number_ground_microphones = num_gm_mic
        conditions.noise.number_building_microphones = num_b_mic
        conditions.noise.total_number_of_microphones = num_mic

        # create empty arrays for results
        num_src = len(config.networks) + 1
        if ('lift_cruise') in config.networks.keys():
            num_src += 1
        source_SPLs_dBA = np.zeros((ctrl_pts, num_src, num_mic))
        source_SPL_spectra = np.zeros((ctrl_pts, num_src, num_mic, dim_cf))

        si = 1
        # iterate through sources
        for source in conditions.noise.sources.keys():
            for network in config.networks.keys():
                if source == 'turbofan':
                    geometric = noise_geometric(segment, analyses, config)

                    # flap noise - only applicable for turbofan aircraft
                    if 'flap' in config.wings.main_wing.control_surfaces:
                        airframe_noise = noise_airframe_Fink(
                            segment, analyses, config, settings)
                        source_SPLs_dBA[:, si, :] = airframe_noise.SPL_dBA
                        source_SPL_spectra[:, si, :, 5:] = np.repeat(
                            airframe_noise.SPL_spectrum[:, np.newaxis, :],
                            num_mic,
                            axis=1)

                    if bool(conditions.noise.sources[source].fan) and bool(
                            conditions.noise.sources[source].core):

                        config.networks[
                            source].fan.rotation = 0  # FUTURE WORK: NEED TO UPDATE ENGINE MODEL WITH FAN SPEED in RPM
                        config.networks[
                            source].fan_nozzle.noise_speed = conditions.noise.sources.turbofan.fan.exit_velocity
                        config.networks[
                            source].core_nozzle.noise_speed = conditions.noise.sources.turbofan.core.exit_velocity
                        engine_noise = noise_SAE(config.networks[source],
                                                 segment,
                                                 analyses,
                                                 config,
                                                 settings,
                                                 ioprint=print_flag)
                        source_SPLs_dBA[:, si, :] = np.repeat(
                            np.atleast_2d(engine_noise.SPL_dBA).T,
                            num_mic,
                            axis=1
                        )  # noise measures at one microphone location in segment
                        source_SPL_spectra[:, si, :, 5:] = np.repeat(
                            engine_noise.SPL_spectrum[:, np.newaxis, :],
                            num_mic,
                            axis=1
                        )  # noise measures at one microphone location in segment

                elif (source == 'propellers') or (source == 'lift_rotors'):
                    if bool(conditions.noise.sources[source]) == True:
                        net = config.networks[network]
                        acoustic_data = conditions.noise.sources[source]
                        propeller_noise = propeller_mid_fidelity(
                            net, acoustic_data, segment, settings, source)
                        source_SPLs_dBA[:, si, :] = propeller_noise.SPL_dBA
                        source_SPL_spectra[:,
                                           si, :, :] = propeller_noise.SPL_spectrum

                        si += 1

        conditions.noise.total_SPL_dBA = SPL_arithmetic(source_SPLs_dBA,
                                                        sum_axis=1)

        return