Skip to content

Multi-Rotor input file and glue-code changes#2838

Merged
deslaughter merged 46 commits intoOpenFAST:dev-tcfrom
deslaughter:multirotor-file-changes
Jul 8, 2025
Merged

Multi-Rotor input file and glue-code changes#2838
deslaughter merged 46 commits intoOpenFAST:dev-tcfrom
deslaughter:multirotor-file-changes

Conversation

@deslaughter
Copy link
Copy Markdown
Collaborator

This PR is ready to merge.

Feature or improvement description

This PR adds support for multiple rotors to the input files and the glue code for OpenFAST. A demo regression test was added for the multi-rotor capability in 5MW_OC4Semi_WSt_WavesWN_MR; however, this test is not run as part of the test suit as it is not fully working.

Impacted areas of the software

This PR has changes throughout the OpenFAST glue code to handle indexing, allow multiple ServoDyn instances, and allow mapping of module instances within the same rotor or across rotors. The 5MW_OC4Semi_WSt_WavesWN_MR multi-rotor regression test was added to the r-test repository, but is not enabled in CTestLists.txt (the line is commented out).

Test results, if applicable

Existing test results are unchanged.

@deslaughter deslaughter added this to the v5.0.0 milestone May 27, 2025
@deslaughter deslaughter self-assigned this May 27, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds multi‐rotor support to OpenFAST by introducing a new rotor-index parameter and updating the corresponding glue code, registry definitions, and I/O routines throughout the codebase. Key changes include:

  • Insertion of the NRotors parameter and new rotor mapping fields (e.g. iRotor) in input file readers, writers, and registry files.
  • Updates in module glue code and mapping functions to propagate rotor-specific indices for BeamDyn, ServoDyn, and other modules.
  • Modifications in the NWTC library types and helper routines to accommodate the new multi-rotor indexing scheme.

Reviewed Changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
reg_tests/r-test, CTestList.cmake Updated regression test and disabled multi-rotor test in CTestLists
openfast_io/FAST_writer.py, FAST_reader.py Added new parameter NRotors for I/O of rotor count
modules/subdyn/* Added new fields (qR0, IsFloating) and packed/unpacked routines for substructure
modules/openfast-library/* A large number of mapping, solver, and API changes to support rotor indexing
modules/nwtc-library/* Updated registry and type routines to include the rotor number (iRotor)
docs/source/user/api_change.rst Documentation updates for multi-rotor input file changes
Comments suppressed due to low confidence (2)

modules/openfast-library/src/FAST_Mapping.f90:449

  • It may be helpful to add a brief comment clarifying that an iRotor value of 0 indicates a module that is not rotor-specific, ensuring the condition is clear to future maintainers.
if ((Mods(iModSrc)%iRotor /= 0) .and. (Mods(iModDst)%iRotor /= 0) .and. (Mods(iModSrc)%iRotor /= Mods(iModDst)%iRotor)) cycle

modules/openfast-library/src/FAST_AeroMap.f90:561

  • Since the code now uses p_FAST%NumBD in related contexts, please verify that replacing nBeams with NumBD is consistent across the codebase.
do iter = 1, p_FAST%nBeams

logical, intent(in) :: Linearize
integer(IntKi), intent(out) :: ErrStat
character(ErrMsgLen), intent(out) :: ErrMsg
subroutine MV_AddModule(ModDataAry, ModID, ModAbbr, Instance, ModDT, SolverDT, Vars, Linearize, ErrStat, ErrMsg, iRotor)
Copy link

Copilot AI May 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please ensure that the optional iRotor parameter is clearly documented as defaulting to 0 (i.e. applicable for all rotors if not provided) to avoid ambiguity.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

@hkross hkross left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes look good to me, although I don't have extensive experience working in many sections of the code that were changed here.

Do we want to add the MHK multi-rotor r-test to the pull request?


Changes to the OpenFAST input file support multiple rotors in one turbine. Line 16, NRotors,
is required to specify the number of rotors in the turbine. Lines 50-56 specify the
ElastoDyn, BeamDyn, and ServoDyn input files for the second rotor. The `MirrorRotor` line
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should specify in the documentation or in the example input file (or both) that the new section only needs to list the ElastoDyn, BeamDyn, and ServoDyn input files for the additional rotors and all other modules will use the input files listed in the first rotor section.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a note about this in the paragraph, but I agree, we'll need a section in the documentation to describe how to set up a multi-rotor simulation

@deslaughter
Copy link
Copy Markdown
Collaborator Author

@hkross Adding the MHK multi-rotor would be great to this PR would be good, or we can go ahead and merge this and you could add it later. Whatever works for you.

@hkross
Copy link
Copy Markdown
Contributor

hkross commented May 27, 2025

@hkross Adding the MHK multi-rotor would be great to this PR would be good, or we can go ahead and merge this and you could add it later. Whatever works for you.

I'll work on putting those input files together, and if they are done in time, we can add them here.

@luwang00
Copy link
Copy Markdown
Contributor

Hi @deslaughter, I added a new SD driver r-test here OpenFAST/r-test#156. This provides an example where we have multiple transition pieces and rigid-body DoF tracked by SD. We can update CTestList.cmake and r-test pointer after the above PR is merged.

@deslaughter deslaughter merged commit 6add42e into OpenFAST:dev-tc Jul 8, 2025
23 of 24 checks passed
@deslaughter deslaughter deleted the multirotor-file-changes branch July 8, 2025 20:10
Copy link
Copy Markdown
Collaborator

@andrew-platt andrew-platt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Apologies for the delay in reviewing

This was referenced Mar 12, 2026
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.

5 participants