Skip to content

Commit

Permalink
Ensure any wind_data and control setpoints on a passed FlorisModel ar…
Browse files Browse the repository at this point in the history
…e copied over.
  • Loading branch information
misi9170 committed Oct 9, 2024
1 parent 25aa0ff commit 2e0ebd4
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions floris/par_floris_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,19 @@ def __init__(
"""
# Instantiate the underlying FlorisModel
if isinstance(configuration, FlorisModel):
configuration = configuration.core.as_dict()
super().__init__(configuration)
configuration_dict = configuration.core.as_dict()
super().__init__(configuration_dict)
# Copy over any control setpoints, wind data, if not already done.
self.set(
yaw_angles=configuration.core.farm.yaw_angles,
power_setpoints=configuration.core.farm.power_setpoints,
awc_modes=configuration.core.farm.awc_modes,
awc_amplitudes=configuration.core.farm.awc_amplitudes,
awc_frequencies=configuration.core.farm.awc_frequencies,
wind_data=configuration.wind_data,
)
else:
super().__init__(configuration)

# Save parallelization parameters
if interface == "multiprocessing":
Expand Down

0 comments on commit 2e0ebd4

Please sign in to comment.