Skip to content

Add interface to enable CurledWindfarm to be called via FLORIS - #36

Merged
skygering merged 52 commits into
Howland-Lab:mainfrom
misi9170:feature/floris-interface
Aug 17, 2026
Merged

Add interface to enable CurledWindfarm to be called via FLORIS#36
skygering merged 52 commits into
Howland-Lab:mainfrom
misi9170:feature/floris-interface

Conversation

@misi9170

@misi9170 misi9170 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Description

This PR introduces a new class, FlorisCurledWindfarm, which wraps the CurledWindfarm model so that it can be passed to the set_wake_model() method on the FlorisModel class in FLORIS. This then enabled to use the CurledWindfarm model in their FLORIS workflows.

Note that the set_wake_model() method is currently only available on this branch of FLORIS, but will soon be merged into the FLORIS v5 development branch.

To run, for now, you'll need to switch to the ehmt/solvers branch on my fork of FLORIS.

Main code

The source code is contained in a new file, mitwindfarm/FlorisInterface.py. The main code is in the FlorisCurledWindfarm class, as described above. However, to enable interaction with FLORIS-style turbine operation models, I've added a second class, RotorWrapper (I'm very happy to change the name for either of these classes). This essentially wraps Floris-style turbine operation models so that they appear as expected by MITWindfarm (note that RotorWrapper inherits from the existing Rotor class in MITWindfarm).

Other changes

In creating this PR, I've made a couple of other minor changes to the code. Some of these are not strictly needed and could be reverted, as noted.

  • Updated for numpy v2. This is necessary, as FLORIS requires numpy v2. Affects: mitwindfarm/RotorGrid.py (np.trapz -> np.trapezoid), examples/example_10_BEM_yaw_tilt.py, pyproject.toml. In talking to @skygering , it sounds like the trapz/trapezoid distinction has been important in the past, but that it's ok to convert to the trapezoid function from numpy v2 now.
  • Update from beta to beta_s in UnifiedMomentumTI and UnifiedMomentumTI_x0 classes, which follows this PR in the Unified-Momentum-Model repo (UnifiedMomentumTI and UnifiedMomentumTI_x0 inherit from UnifiedMomentum in Unified-Momentum-Model)
  • Add user-settable bounds in plot_windfarm(). I originally did this so that I could run the CurledWindfarm with absolute wind speeds (e.g., 8 m/s), but that is not strictly needed and in fact has now been removed from my examples and code. The default values for vmin and vmax preserve the existing behavior. Can be reverted.
  • Add FLORIS as a dependency in pyproject.toml. This is required, but I could set this up to only install FLORIS if a certain flag is passed, or similar, if the maintainers prefer that.

To do items

I still have a few TODO items left to address before this is ready for full review/merger:

  • Address cosine terms in C_t, a/a_n
  • Check integration with floating turbine models
  • Check on how to pass near-wake distance, x0, to the wake solver
  • Update pyproject.toml to point at FLORIS' dev/v5-beta branch

I also need to:

  • Add documentation
  • Add tests
  • Consolidate and streamline the example(s)

MITWindfarm-provided checklist:

  • Request a review from other Howland Lab members who use MITWindFarm.
  • Add at least a sentence on your change to the documentation (probably the quickstart guide).
  • Add tests for your new functionality.
  • Make sure the tests pass and the documentation notebook still runs.
  • Get approval from the folks you requested a review from.

Comment thread examples/temp_01_initial_comparison.py Outdated
Comment thread examples/temp_01_initial_comparison.py Outdated
Comment thread mitwindfarm/FlorisInterface.py Outdated
Comment thread pyproject.toml
@misi9170

misi9170 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@skygering , I think you mentioned this, but for documentation would you like me to just add a few blocks to examples/MITWindfarm_quickstart.ipynb?

EDIT: I've gone ahead and put a short description and demonstration to examples/MITWindfarm_quickstart.ipynb, but I can move it or add to it if you'd like

Comment thread pyproject.toml
misi9170 and others added 2 commits August 12, 2026 11:28
Comment thread .github/workflows/pytest.yml
Comment thread .github/workflows/pytest.yml Outdated
misi9170 and others added 2 commits August 12, 2026 11:54
Co-authored-by: Skylar A Gering <sgering@g.hmc.edu>
Co-authored-by: Skylar A Gering <sgering@g.hmc.edu>
Comment thread .github/workflows/pytest.yml Outdated
Co-authored-by: Skylar A Gering <sgering@g.hmc.edu>
Comment thread pyproject.toml Outdated
Comment thread mitwindfarm/Rotor.py Outdated
Comment thread mitwindfarm/Rotor.py Outdated
Comment thread mitwindfarm/Rotor.py Outdated
Comment thread mitwindfarm/Rotor.py Outdated
Comment thread mitwindfarm/Rotor.py Outdated
Comment thread .github/workflows/pytest.yml Outdated
Comment thread pyproject.toml Outdated
@skygering
skygering merged commit 4da2b8a into Howland-Lab:main Aug 17, 2026
8 of 10 checks passed
@misi9170
misi9170 deleted the feature/floris-interface branch August 17, 2026 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants