Exemplo n.º 1
0
def test_delvigne_sweeney():
    wind_speed = 10.0
    T_w = PiersonMoskowitz.peak_wave_period(wind_speed)

    assert np.isclose(DelvigneSweeney.breaking_waves_frac(wind_speed, 10.0),
                      0.016)
    assert np.isclose(DelvigneSweeney.breaking_waves_frac(wind_speed, T_w),
                      0.0213333)
def test_delvigne_sweeney():
    wind_speed = 10.0
    T_w = PiersonMoskowitz.peak_wave_period(wind_speed)

    assert np.isclose(DelvigneSweeney.breaking_waves_frac(wind_speed, 10.0),
                      0.016)
    assert np.isclose(DelvigneSweeney.breaking_waves_frac(wind_speed, T_w),
                      0.0213333)
Exemplo n.º 3
0
    def calm_between_wave_breaks(self, model_time, time_step,
                                 time_spent_in_wc=0.0):
        wind_speed = max(.1, self.waves.wind.get_value(model_time)[0])
        wave_period = PiersonMoskowitz.peak_wave_period(wind_speed)

        f_bw = DelvigneSweeney.breaking_waves_frac(wind_speed, wave_period)

        T_calm = DingFarmer.calm_between_wave_breaks(f_bw, wave_period)

        return np.clip(T_calm, 0.0, float(time_step) - time_spent_in_wc)
Exemplo n.º 4
0
    def water_column_time_fraction(self, points, model_time,
                                   water_phase_xfer_velocity):
        wave_height = self.waves.get_value(points, model_time)[0]
        wind_speed = np.clip(self.get_wind_speed(points, model_time), 0.01,
                             None)
        wave_period = PiersonMoskowitz.peak_wave_period(wind_speed)

        f_bw = DelvigneSweeney.breaking_waves_frac(wind_speed, wave_period)

        return DingFarmer.water_column_time_fraction(
            f_bw, wave_period, wave_height, water_phase_xfer_velocity)
Exemplo n.º 5
0
    def water_column_time_fraction(self, model_time,
                                   water_phase_xfer_velocity):
        wave_height = self.waves.get_value(model_time)[0]
        wind_speed = max(.1, self.waves.wind.get_value(model_time)[0])
        wave_period = PiersonMoskowitz.peak_wave_period(wind_speed)

        f_bw = DelvigneSweeney.breaking_waves_frac(wind_speed, wave_period)

        return DingFarmer.water_column_time_fraction(f_bw,
                                                     wave_period,
                                                     wave_height,
                                                     water_phase_xfer_velocity)
Exemplo n.º 6
0
    def water_column_time_fraction(self,
                                   points,
                                   model_time,
                                   water_phase_xfer_velocity):
        wave_height = self.waves.get_value(points, model_time)[0]
        wind_speed = np.clip(self.get_wind_speed(points, model_time), 0.01, None)
        wave_period = PiersonMoskowitz.peak_wave_period(wind_speed)

        f_bw = DelvigneSweeney.breaking_waves_frac(wind_speed, wave_period)

        return DingFarmer.water_column_time_fraction(f_bw,
                                                     wave_period,
                                                     wave_height,
                                                     water_phase_xfer_velocity)
Exemplo n.º 7
0
def test_ding_farmer():
    wind_speed = 10.0  # m/s
    rdelta = 200.0  # oil/water density difference (kg / m^3)
    droplet_diameter = 0.0002  # 200 microns

    wave_height = PiersonMoskowitz.significant_wave_height(wind_speed)
    wave_period = PiersonMoskowitz.peak_wave_period(wind_speed)

    f_bw = DelvigneSweeney.breaking_waves_frac(wind_speed, wave_period)
    k_w = Stokes.water_phase_xfer_velocity(rdelta, droplet_diameter)

    assert np.isclose(DingFarmer.calm_between_wave_breaks(0.5, 10), 15.0)
    assert np.isclose(DingFarmer.calm_between_wave_breaks(f_bw, wave_period),
                      347.8125)
    assert np.isclose(DingFarmer.refloat_time(wave_height, k_w), 386.0328)

    assert np.isclose(
        DingFarmer.water_column_time_fraction(f_bw, wave_period, wave_height,
                                              k_w), 1.0)
def test_ding_farmer():
    wind_speed = 10.0  # m/s
    rdelta = 0.2  # oil/water density difference
    droplet_diameter = 0.0002  # 200 microns

    wave_height = PiersonMoskowitz.significant_wave_height(wind_speed)
    wave_period = PiersonMoskowitz.peak_wave_period(wind_speed)

    f_bw = DelvigneSweeney.breaking_waves_frac(wind_speed, wave_period)
    k_w = Stokes.water_phase_xfer_velocity(rdelta, droplet_diameter)

    assert np.isclose(DingFarmer.calm_between_wave_breaks(0.5, 10),
                      15.0)
    assert np.isclose(DingFarmer.calm_between_wave_breaks(f_bw, wave_period),
                      347.8125)
    assert np.isclose(DingFarmer.refloat_time(wave_height, k_w),
                      385.90177)

    assert np.isclose(DingFarmer.water_column_time_fraction(f_bw,
                                                            wave_period,
                                                            wave_height,
                                                            k_w),
                      1.1095)