Ejemplo n.º 1
0
    def test_set_efficiency(self):
        '''
        for wave height > 6.4 m, efficiency goes to 0
        '''
        # make wind large so efficiency goes to 0
        waves = Waves(constant_wind(0, 0), water=Water())
        c_disp = ChemicalDispersion(self.spill_pct, active_range, waves=waves)
        pts = np.array([[0, 0], [0, 0]])
        c_disp._set_efficiency(pts, self.spill.release_time)
        assert c_disp.efficiency == 1.0

        c_disp.efficiency = 0
        waves.wind.timeseries = (waves.wind.timeseries[0]['time'], (100, 0))
        c_disp._set_efficiency(pts, self.spill.release_time)
        assert np.all(c_disp.efficiency == 0)
Ejemplo n.º 2
0
    def test_set_efficiency(self):
        '''
        for wave height > 6.4 m, efficiency goes to 0
        '''
        # make wind large so efficiency goes to 0
        waves = Waves(constant_wind(0, 0), water=Water())
        c_disp = ChemicalDispersion(self.spill_pct,
                                    active_range,
                                    waves=waves)
        pts = np.array([[0, 0], [0, 0]])
        c_disp._set_efficiency(pts, self.spill.release_time)
        assert c_disp.efficiency == 1.0

        c_disp.efficiency = 0
        waves.wind.timeseries = (waves.wind.timeseries[0]['time'], (100, 0))
        c_disp._set_efficiency(pts, self.spill.release_time)
        assert np.all(c_disp.efficiency == 0)
Ejemplo n.º 3
0
    def test_set_efficiency(self):
        '''
        for wave height > 6.4 m, efficiency goes to 0
        '''
        # make wind large so efficiency goes to 0
        waves = Waves(constant_wind(0, 0), water=Water())
        c_disp = ChemicalDispersion(self.spill_pct,
                                    active_start,
                                    active_stop,
                                    waves=waves)
        c_disp._set_efficiency(self.spill.get('release_time'))
        assert c_disp.efficiency == 1.0

        c_disp.efficiency = None
        waves.wind.timeseries = (waves.wind.timeseries[0]['time'], (100, 0))
        c_disp._set_efficiency(self.spill.get('release_time'))
        assert c_disp.efficiency == 0
Ejemplo n.º 4
0
    def test_set_efficiency(self):
        '''
        for wave height > 6.4 m, efficiency goes to 0
        '''
        # make wind large so efficiency goes to 0
        waves = Waves(constant_wind(0, 0), water=Water())
        c_disp = ChemicalDispersion(self.spill_pct,
                                    active_start,
                                    active_stop,
                                    waves=waves)
        c_disp._set_efficiency(self.spill.release_time)
        assert c_disp.efficiency == 1.0

        c_disp.efficiency = None
        waves.wind.timeseries = (waves.wind.timeseries[0]['time'], (100, 0))
        c_disp._set_efficiency(self.spill.release_time)
        assert c_disp.efficiency == 0