Skip to content

Commit

Permalink
fix bug that ngrid=1 doesn't work correctly (#1008)
Browse files Browse the repository at this point in the history
  • Loading branch information
gogannes authored Nov 8, 2024
1 parent 4aff543 commit c66a185
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions floris/simulation/flow_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,20 @@ def _discretize_turbine_domain(self):
pt = turbine.rloc * turbine.rotor_radius

xt = [coord.x1 for coord in self.turbine_map.coords]
yt = np.linspace(
x2 - pt,
x2 + pt,
ngrid,
)
zt = np.linspace(
x3 - pt,
x3 + pt,
ngrid,
)
if ngrid == 1:
yt = [x2]
zt = [x3]
else:
yt = np.linspace(
x2 - pt,
x2 + pt,
ngrid,
)
zt = np.linspace(
x3 - pt,
x3 + pt,
ngrid,
)

x_grid[i] = xt[i]
y_grid[i] = yt
Expand Down

0 comments on commit c66a185

Please sign in to comment.