Skip to content

Commit

Permalink
BugFix: Update geometric yaw optimizer layout when called during layo…
Browse files Browse the repository at this point in the history
…ut optimization (NREL#706)

* Bug fixed: updating layout when called.

* Ruff

* fi_subset needed updating rather than fi.

* Minor import, viz bugfixes.'

* Ruff.

* isort...;
  • Loading branch information
misi9170 authored Oct 4, 2023
1 parent 77ea50d commit 05b900c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions examples/15_optimize_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import os

import matplotlib.pyplot as plt
import numpy as np

from floris.tools import FlorisInterface
Expand Down Expand Up @@ -85,3 +86,5 @@
f'from {base_aep:.1f} MWh to {opt_aep:.1f} MWh'
)
layout_opt.plot_layout_opt_results()

plt.show()
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ def _unnorm(self, val, x1, x2):
return np.array(val) * (x2 - x1) + x1

def _get_geoyaw_angles(self):
# NOTE: requires that child class saves x and y locations
# as self.x and self.y and updates them during optimization.
if self.enable_geometric_yaw:
self.yaw_opt.fi_subset.reinitialize(layout_x=self.x, layout_y=self.y)
df_opt = self.yaw_opt.optimize()
self.yaw_angles = np.vstack(df_opt['yaw_angles_opt'])[:, None, :]
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@


import numpy as np
from scipy.optimize import minimize

from floris.utilities import rotate_coordinates_rel_west

Expand Down

0 comments on commit 05b900c

Please sign in to comment.