Vertical wind profile #655
-
Hello, I would like to ask why does the vertical wind profile given by floris is not the same one would get using the power law. I used the same shear exponent (0.2) and hub height (90), however the results are not the same. Am I overlooking something? Best regards, import numpy as np
from floris.tools import FlorisInterface
import matplotlib.pyplot as plt
# Initialize FLORIS with the given input file via FlorisInterface.
# For basic usage, FlorisInterface provides a simplified and expressive
# entry point to the simulation routines.
fi = FlorisInterface("inputs/gch.yaml")
nelx = 101
solver_settings = {
"type": "turbine_grid",
"turbine_grid_points": nelx
}
# Create a 4-turbine layouts
fi.reinitialize(layout_x=[0], layout_y=[0], solver_settings=solver_settings)
yaw_angles = np.array([[[0]]])
# Calculate wake
fi.calculate_wake(yaw_angles = yaw_angles)
# Collect the wind speed at all the turbine points
u_points = fi.floris.flow_field.u
D = 126
hubHt = 90
xaxis = D/nelx * np.arange(0,nelx) + hubHt - D/2 + D/nelx/2
analytical_profile = 8 * ((xaxis)/hubHt)**0.2 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
Hi I think the issue is just the shear exponent in set to 0.12 inputs/gch.yaml (line 126), I ran this code (using the new point grabbing code in v3.4) and the curves match:
|
Beta Was this translation helpful? Give feedback.
-
@MiguelMarante thanks for posting your question and apologies for the super late response. Back to your script, if you plot the curves at the appropriate heights, they both line up. The plot below shows your shear profile and the one from FLORIS. The code for this is given below the plot. Also, just a heads up that it's very helpful in general to share the actual text as well as the full script you used to generate results. Sometimes the problem is a plotting issue, for example, and it's helpful for project maintainers to see how you created the results that you're showing. Including the actual text means that I can copy/paste it directly to try to recreate what you're seeing. I replaced your screen shot in the OP with the text. import matplotlib.pyplot as plt
import numpy as np
from floris.tools import FlorisInterface
nelx = 7
solver_settings = {
"type": "turbine_grid",
"turbine_grid_points": nelx
}
fi = FlorisInterface("inputs/gch.yaml")
fi.reinitialize(layout_x=[0.0], layout_y=[0.0], solver_settings=solver_settings)
fi.calculate_wake()
grid_heights = fi.floris.grid.z_sorted[0,0,0,0]
print("FLORIS grid locations - z:")
print(grid_heights)
print("FLORIS velocities at z-locations:")
u_points = fi.floris.flow_field.u[0,0,0,0]
print(u_points)
print("---")
D = 126.0
hubHt = 90.0
radius = D/2.0
SHEAR = 0.12
xaxis = D/nelx * np.arange(0,nelx) + hubHt - D/2 + D/nelx/2 # this should probably be "yaxis"
print("@MiguelMarante grid locations - z:")
print(xaxis)
analytical_profile = 8 * (xaxis / hubHt) ** SHEAR
print("@MiguelMarante analytical shear profile at z-locations:")
print(analytical_profile)
plt.plot(u_points, grid_heights, marker="+", label="FLORIS")
plt.plot(analytical_profile, xaxis, label="@MiguelMarante")
plt.legend()
plt.grid()
plt.show() |
Beta Was this translation helpful? Give feedback.
@MiguelMarante thanks for posting your question and apologies for the super late response.
In your script, you're comparing the shear profile at different heights. Specifically, you're plotting the vertical locations across the full span of the rotor swept area, but FLORIS fits a square-grid into a smaller portion of the rotor swept area. See #502 (reply in thread) for a diagram of the FLORIS grid relative to the swept area. The setting for how large to make the grid relative to the rotor diameter was a user setting in floris v2, but it is now hard-coded to half the radius. Additionally, #499 provides some info on the impact of the the size of the grid as well as the number of points in it,