Beispiel #1
0
def test_own_deficit_is_zero():
    for deficitModel in get_models(WakeDeficitModel):
        site = Hornsrev1Site()
        windTurbines = IEA37_WindTurbines()
        wf_model = All2AllIterative(site,
                                    windTurbines,
                                    wake_deficitModel=deficitModel(),
                                    turbulenceModel=STF2017TurbulenceModel())
        sim_res = wf_model([0], [0])
        npt.assert_array_equal(sim_res.WS_eff,
                               sim_res.WS.broadcast_like(sim_res.WS_eff))
Beispiel #2
0
def test_with_all_deficit_models(WFM):
    site = IEA37Site(16)
    windTurbines = IEA37_WindTurbines()
    for deficitModel in get_models(WakeDeficitModel):

        wfm = WFM(site, windTurbines, wake_deficitModel=deficitModel(),
                  rotorAvgModel=RotorCenter(),
                  superpositionModel=LinearSum(),
                  deflectionModel=None, turbulenceModel=STF2017TurbulenceModel())

        wfm2 = WFM(site, windTurbines, wake_deficitModel=deficitModel(),
                   rotorAvgModel=EqGridRotorAvg(1),
                   superpositionModel=LinearSum(),
                   deflectionModel=None, turbulenceModel=STF2017TurbulenceModel())
        kwargs = {'x': [0, 0, 500, 500], 'y': [0, 500, 0, 500], 'wd': [0], 'ws': [8]}
        npt.assert_equal(wfm.aep(**kwargs), wfm2.aep(**kwargs))
Beispiel #3
0
def test_get_models():
    assert cls_in(FugaDeficit, get_models(BlockageDeficitModel))
    assert cls_in(SelfSimilarityDeficit, get_models(BlockageDeficitModel))

    assert [n.__name__ for n in get_models(SuperpositionModel)
            ] == ['LinearSum', 'SquaredSum', 'MaxSum', 'WeightedSum']
Beispiel #4
0
    fm = sim_res.flow_map(XYGrid(x=np.arange(-D, 10 * D + 10, 10)))
    min_WS_line = fm.min_WS_eff()
    if 0:
        plt.figure(figsize=(14, 3))
        fm.plot_wake_map()
        min_WS_line.plot()
        plt.plot(10 * D, dy10d * D, '.', label="Ref, 10D")
        plt.legend()
        plt.show()

    npt.assert_almost_equal(min_WS_line.interp(x=10 * D).item() / D, dy10d)


@pytest.mark.parametrize(
    'deflectionModel',
    [m for m in get_models(DeflectionModel) if m is not None])
def test_plot_deflection_grid(deflectionModel):
    site = IEA37Site(16)
    x, y = [0], [0]
    windTurbines = V80()
    D = windTurbines.diameter()
    wfm = IEA37SimpleBastankhahGaussian(site,
                                        windTurbines,
                                        deflectionModel=deflectionModel())

    yaw_ilk = np.reshape([-30], (1, 1, 1))

    sim_res = wfm(x, y, yaw_ilk=yaw_ilk, wd=270, ws=10)
    fm = sim_res.flow_map(XYGrid(x=np.arange(-D, 10 * D + 10, 10)))

    plt.figure(figsize=(14, 3))
Beispiel #5
0
    sim_res = wfm(x, y, yaw=yaw_ilk, wd=270, ws=10)
    fm = sim_res.flow_map(XYGrid(x=np.arange(-D, 10 * D + 10, 10)))
    min_WS_line = fm.min_WS_eff()
    if 0:
        plt.figure(figsize=(14, 3))
        fm.plot_wake_map()
        min_WS_line.plot()
        plt.plot(10 * D, dy10d * D, '.', label="Ref, 10D")
        plt.legend()
        plt.show()

    npt.assert_almost_equal(min_WS_line.interp(x=10 * D).item() / D, dy10d)


@pytest.mark.parametrize('deflectionModel', [m for m in get_models(DeflectionModel) if m is not None])
def test_plot_deflection_grid(deflectionModel):
    site = IEA37Site(16)
    x, y = [0], [0]
    windTurbines = V80()
    D = windTurbines.diameter()
    wfm = IEA37SimpleBastankhahGaussian(site, windTurbines, deflectionModel=deflectionModel())

    yaw_ilk = np.reshape([-30], (1, 1, 1))

    sim_res = wfm(x, y, yaw=yaw_ilk, wd=270, ws=10)
    fm = sim_res.flow_map(XYGrid(x=np.arange(-D, 10 * D + 10, 10)))

    plt.figure(figsize=(14, 3))
    fm.plot_wake_map()
    fm.plot_deflection_grid()