ValueError in application of heterogeneous inflow in yaw optimization #756
Answered
by
rafmudaf
zevenlordsa
asked this question in
Q&A
-
I am tending to apply heterogeneous inflow in yaw optimization,but an valueerror occurs "ValueError: The het_map's wind direction dimension not equal to number of wind directions. import matplotlib.pyplot as plt
import numpy as np
from floris.tools.visualization import visualize_cut_plane
import pandas as pd
from floris.tools import FlorisInterface
from floris.tools.optimization.yaw_optimization.yaw_optimizer_sr import YawOptimizationSR
speed_multipliers = [[1.0, 1.0, 2.0, 2.0, 1.0, 1.0, 2.0, 2.0]]
x_locs = [-300.0, -300.0, -300.0, -300.0, 2600.0, 2600.0, 2600.0, 2600.0]
y_locs = [-300.0, 300.0, -300.0, 300.0, -300.0, 300.0, -300.0, 300.0]
z_locs = [540.0, 540.0, 0.0, 0.0, 540.0, 540.0, 0.0, 0.0]
heterogenous_inflow_config = {
'speed_multipliers': speed_multipliers,
'x': x_locs,
'y': y_locs,
'z': z_locs,
}
fi = FlorisInterface("gch.yaml")
fi.reinitialize(
layout_x=[80, 500, 660, 900, 1500],
layout_y=[525, 650, 470, 667, 950],
wind_directions=[270],
wind_speeds=[8.0],
heterogenous_inflow_config=heterogenous_inflow_config,
)
print(fi.floris.farm.rotor_diameters)
fi.reinitialize(wind_shear=0.0)
yaw_opt = YawOptimizationSR(fi, exploit_layout_symmetry=False)
df_opt = yaw_opt.optimize()
print("Optimization results:")
print(df_opt)
np.savetxt('data.txt', df_opt, delimiter=',', fmt='%s') |
Beta Was this translation helpful? Give feedback.
Answered by
rafmudaf
Dec 6, 2023
Replies: 1 comment 1 reply
-
Hi @zevenlordsa Your script runs fine for me using v3.5 and the GCH example input file. Can you verify that the script you posted is also failing for you? Also, please describe the differences between your input file and the one I linked to. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
zevenlordsa
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @zevenlordsa Your script runs fine for me using v3.5 and the GCH example input file. Can you verify that the script you posted is also failing for you? Also, please describe the differences between your input file and the one I linked to.