Skip to content

Conversation

andrew-platt
Copy link
Collaborator

@andrew-platt andrew-platt commented Dec 11, 2023

This PR is ready to merge.

Feature or improvement description
A new module named ExtLoads interfaces with CFD to transfer loads from a CFD solver into OpenFAST. This module is an alternative to AeroDyn.

To stabilize the CFD solution, AeroDyn loads are used during initialization and then blended into the CFD solution after the transients die out. The time AD15 loads are used is user configurable (set in radians of rotation -- typically a few revolutions). This requires that AeroDyn is used in addition to the ExtLoads module.

During the simulation, the CFD code will call OpenFAST multiple times for each CFD timestep. This may require rewinding the OpenFAST simulation to the prior CFD timestep and recalculating all the intervening times using updated CFD information. To accomplish this, the size of the state variables (and other things) was increased from 2 to 4 so that a saved copy of the previous and current state information (3,4) at the CFD time step can be used. When rewinding OpenFAST back to the previous CFD time, this data will be copied over to the previous and current state information (1,2).

Other additional features include:

  • the ability to rewind multiple timesteps when called through the cpp interface from CFD

Related issue, if one exists

Impacted areas of the software

  • Cpp interface
  • glue code
    • additional copies of states, inputs, miscvars to store a checkpoint (copy of previous state and this state at some specific time in history)
    • additional logic for the ExtLoads module
  • FAST_Library.f90
    • name changes
      • FAST_ExtInfw_Solution0 renamed FAST_CFD_Solution0
      • FAST_ExtInfw_Step renamed FAST_CFD_Step and split into multiple routines
    • routines with new variables
      • FAST_ExtInfw_Restart new variable numElementsTower_c
    • new routines
      • FAST_ExtLoads_Restart
      • FAST_CFD_Store_SS
      • FAST_CFD_Reset_SS
      • FAST_CFD_Prework
      • FAST_CFD_UpdateStates
      • FAST_CFD_AdvanceToNextTimeStep
      • FAST_CFD_WriteOutput
  • FAST_Subs.f90
    • new routines -- split out from FAST_Solution
      • FAST_Prework
      • FAST_UpdateStates
      • FAST_AdvanceToNextTimeStep
      • FAST_WriteOutput
    • new routines for substep management
      • FAST_Store_SS
      • FAST_Reset_SS
      • FAST_InitIOarrays_SS

Additional supporting information

Test results

To do

  • update api_change.rst
  • verify documentation renders correctly

@andrew-platt andrew-platt self-assigned this Dec 11, 2023
@andrew-platt andrew-platt marked this pull request as draft December 11, 2023 20:34
@andrew-platt andrew-platt added this to the v4.0.0 milestone Dec 11, 2023
@andrew-platt andrew-platt marked this pull request as ready for review December 15, 2023 03:36
@andrew-platt andrew-platt merged commit db3f101 into OpenFAST:dev Dec 15, 2023
andrew-platt added a commit that referenced this pull request Dec 15, 2023
@andrew-platt
Copy link
Collaborator Author

Screen Shot 2023-12-14 at 4 11 31 PM

Simulation from NALU-Wind coupled to OpenFAST through the ExtLoads module.

This was referenced Dec 18, 2023
andrew-platt added a commit that referenced this pull request Dec 29, 2023
@andrew-platt andrew-platt deleted the f/ExtLoads_rebase branch January 8, 2024 21:35

ELSE IF (p_FAST%CompAero == Module_ExtLd ) THEN

DO K = 1,SIZE(u_ED%BladePtLoads,1) ! Loop through all blades (p_ED%NumBl)
Copy link
Contributor

Choose a reason for hiding this comment

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

This code to blend AD and ExtLd data is repeated in both BeamDyn and ElastoDyn routines, and actually called twice in ED because ExtLd_ConvertOpDataForOpenFAST is called for both tower and blade loads. Since the code is just adding AeroDyn output data to the ExtLd output mesh, it seems like that should have been done in a different routine so that these routines to set BeamDyn and ElastoDyn inputs don't actually change the ExtLd outputs. That would mean you don't need the extra p, u, and m variables from ExtLd, making it match the way the other modules are handled here. Otherwise, that blending should be stored someplace other than the ExtLd output type.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@gantech, FYI.

n_t_global_next = n_t_global+1
t_global_next = t_initial + n_t_global_next*p_FAST%DT ! = m_FAST%t_global + p_FAST%dt

y_FAST%WriteThisStep = NeedWriteOutput(n_t_global_next, t_global_next, p_FAST)
Copy link
Contributor

@bjonkman bjonkman Mar 5, 2024

Choose a reason for hiding this comment

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

I'm wondering why this line wasn't included in FAST_Prework.

y_FAST%WriteThisStep is used in FAST_UpdateStates. While it doesn't matter in this glue code, I assume the reason this routine was split into FAST_Prework, FAST_UpdateStates, etc, is that the individual routines would be called by a glue code instead of calling FAST_Solution, in which case, y_FAST%WriteThisStep would probably not be set properly.

Is there another reason for keeping it here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good question. Since the AMR-Wind has the ability to reset OpenFAST back multiple timesteps, it may be that they didn't want to have the write outputs updated during intermediate steps that may be redone. @gantech, do you happen to remember?

Copy link
Contributor

Choose a reason for hiding this comment

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

If they aren't directly setting y_FAST%WriteThisStep, then it is probably just using the initial value of true. If you don't need file output at every integration step, you will get performance improvements by setting this value.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point. I suspect they aren't setting that at all. I'll move it into the FAST_PreWork routine.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Corrected with #2076 (on the dev-unstable-pointers branch which will be merged to dev soonish).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants