Skip to content

FF: Curl/Cartesian wake fixes and AWAE VTK wake-plane output#3368

Open
andrew-platt wants to merge 24 commits into
OpenFAST:rc-5.0.1from
andrew-platt:b/FF_wake_start_noise
Open

FF: Curl/Cartesian wake fixes and AWAE VTK wake-plane output#3368
andrew-platt wants to merge 24 commits into
OpenFAST:rc-5.0.1from
andrew-platt:b/FF_wake_start_noise

Conversation

@andrew-platt

Copy link
Copy Markdown
Collaborator

Ready to merge

Feature or improvement description

This PR addresses multiple bugs and adds VTK wake-plane visualization capabilities for FAST.Farm's Curl/Cartesian wake models in the AWAE and WakeDynamics modules.

Bug fixes:

  • Fix missing Vx_wake2 initialization at T=0 for Curl/Cartesian wake models — the firstPass branch in WD_CalcOutput computed y%Vx_wake (polar) but never populated y%Vx_wake2, and the unconditional taper block overwrote it with zeros (update the solution before the convergence criteria control flow #32 taper fix also merged).
  • Fix edges of wake planes not being updated in Cartesian/Curled models (loop limits were one point short).
  • Fix uninitialized allocatable arrays in AWAE/WD.
  • Initialize values for Cartesian/Curl planes 0+1 in WakeDynamics.
  • Fix wake plane VTK output missing z contribution.
  • Fix smooth tapering from numDFull to numDBuff for curled wake.

New VTK wake-plane visualization:

  • Extract VTK wake-plane output routines into a new AWAE_vtk module (AWAE_vtk.f90), replacing inline routines in AWAE_CalcOutput.
  • Add wake-plane wireframe VTK output (Write_Planes_WireFrame, PlaneCorners helper).
  • Add per-plane VTK data outputs (Write_Planes_Data, Write_WakePlane_Data_File).
  • Add .vtk.series file writers for wireframes, wake-plane data, and disturbed-wind slices for ParaView time-series loading.
  • Move wake visualization VTK files into a subdirectory.
  • Rename VTK root paths and add separate wake VTK root.

Other changes:

  • Update MaxNumPlanes calculation for Cartesian/Curl models with larger safety factors.
  • Update FAST.Farm plan document to Rev26.
  • Add documentation for FAST.Farm wake extent and buffering.
  • Update .gitignore for VS Code and Docker build configs.

Impacted areas of the software

  • modules/awae/ — New AWAE_vtk.f90 module; changes to AWAE.f90, AWAE_IO.f90, AWAE_Registry.txt, AWAE_Types.f90, CMakeLists.txt
  • modules/wakedynamics/WakeDynamics.f90 (initialization, taper, edge update fixes)
  • glue-codes/fast-farm/FAST_Farm_Subs.f90 (MaxNumPlanes calculation)
  • docs/ — FAST.Farm plan (Rev26), wake extent documentation
  • vs-build/modules/AWAE.vfproj updated for new source file

Additional supporting information

The Curl and Cartesian wake models had several initialization and update issues that caused incorrect wake deficit values at startup and incorrect edge values during simulation. The VTK output refactoring moves wake visualization code into a dedicated module for maintainability and adds per-plane data output and ParaView .vtk.series index files for easier post-processing.

Generative AI usage

Substantial portions of the VTK output code and bug fix analysis were developed with AI assistance:

This PR description was generated with AI assistance:

Test results, if applicable

No test result changes. No r-test updates required.

  • r-test branch merging not required

andrew-platt and others added 22 commits May 12, 2026 13:07
Add Write_Planes_WireFrame and PlaneCorners helper to emit each
active wake plane's outline in the global frame using vtk_lines.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
This is not complete, but contains some of the info.
The .vtk.series file is not working as expected yet.
The edge points on the wake planes were not getting updated.  The loop limits were one point short.
New guidance for calculating with larger safety factors, and different calculation for catesian+curl than polar.

Co-authored-by: Regis Thedin <registhedin@gmail.com>
WD: fix smooth tapering from `numDFull` to `numDBuff` for curled wake
- Create modules/awae/src/AWAE_vtk.f90 containing module AWAE_vtk with
  all wake-plane VTK output routines: PlaneAxes, PlaneCorners,
  Write_Planes_WireFrame, Write_Planes_Data, Write_WakePlane_Data_File,
  Write_WakePlane_Series, and Write_NullPlane.

- Remove those routines from AWAE_CalcOutput's internal contains block
  and convert them to standalone module subroutines with explicit
  arguments (p, u, m, n, t, Tstr) replacing host association.

- Move the per-step Write_WakePlane_Series call from AWAE_CalcOutput to
  AWAE_End, writing series files once at shutdown instead of every output
  step.  Merge the former two-routine pattern (Write_WakePlane_Series +
  Write_AllWakePlane_Series) into a single Write_WakePlane_Series(p, m).

- Extract the inline null-plane block into Write_NullPlane subroutine.

- Remove unused variables: FmtStr argument, PlaneNum, fileExists,
  rootDir from the former Write_WakePlane_Series.

- Add AWAE_vtk.f90 to CMakeLists.txt and vs-build project; add
  'use AWAE_vtk' to module AWAE.

Co-authored-by: GitHub Copilot <175728472+Copilot@users.noreply.github.com>
…s files

Add a new routine Write_WireFrame_Series(p) to AWAE_vtk that writes one
ParaView .vtk.series index file per turbine for the WakePlanesWireFrame
VTK outputs. Called once at shutdown from AWAE_End alongside the existing
Write_WakePlane_Series call.

Co-authored-by: GitHub Copilot <175728472+Copilot@users.noreply.github.com>
Add Write_DisWind_Series to AWAE_vtk module to generate ParaView
.vtk.series index files for Low-resolution disturbed-wind XY, YZ,
and XZ output slices.  The routine is called from AWAE_End for each
valid slice, matching the existing pattern for wake-plane and
wireframe series files.

Co-authored-by: GitHub Copilot <noreply@github.com>
…dels

In WD_CalcOutput, the firstPass branch computed y%Vx_wake (polar) via
NearWakeCorrection but never populated y%Vx_wake2 for Cartesian/Curl models.
Additionally, the unconditional Cartesian/Curl taper block overwrote y%Vx_wake2
with xd%Vx_wake2 (still zeros) on firstPass, discarding any values set earlier.

Changes:
- Add Axisymmetric2CartesianVx conversion in the firstPass block of WD_CalcOutput
  to populate y%Vx_wake2 for Curl/Cartesian models.
- Guard the Cartesian/Curl taper block with (.not. OtherState%firstPass) so it
  does not overwrite the firstPass initialization.
- Add Mod_Wake guard and NearWakeCorrection call in InitStatesWithInputs for
  Cartesian/Curl state initialization.
- Remove unused GridTol parameter in AWAE.f90.

Co-authored-by: andrew-platt <andy.platt@nrel.gov>
@andrew-platt andrew-platt requested a review from rthedin June 19, 2026 17:24
@andrew-platt

Copy link
Copy Markdown
Collaborator Author
Screenshot 2026-06-19 at 11 25 42 AM Wake plane visualization includes wireframe outlines and wake plane data. In the future, flags will be added to individually control these.

@andrew-platt andrew-platt requested a review from jjonkman June 19, 2026 17:26

Copilot AI left a comment

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.

Pull request overview

This PR fixes several correctness issues in FAST.Farm’s Curl/Cartesian wake handling (initialization, buffer tapering, and edge updates) and refactors/extends AWAE VTK output by introducing a dedicated AWAE_vtk module that adds wake-plane wireframe/data outputs plus ParaView .vtk.series indices.

Changes:

  • Fix WakeDynamics initialization/taper behavior for Curl/Cartesian wake models and correct plane edge update loop bounds.
  • Refactor AWAE VTK output into a new AWAE_vtk module and add wake-plane wireframe + per-plane structured-grid outputs and .vtk.series writers.
  • Update build/project files and output root naming to include the new VTK module and wake-output subdirectory.

Reviewed changes

Copilot reviewed 9 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
vs-build/modules/AWAE.vfproj Adds AWAE_vtk.f90 to the Visual Studio project.
modules/wakedynamics/src/WakeDynamics.f90 Wake model fixes: initialization, Cartesian plane edge updates, buffer taper behavior, and output field setup.
modules/awae/src/AWAE.f90 Switches to AWAE_vtk, updates VTK root handling, initializes new arrays, and invokes wake-plane VTK writers/series writers.
modules/awae/src/AWAE_vtk.f90 New module implementing wake-plane VTK wireframe/data output and ParaView .vtk.series index generation.
modules/awae/src/AWAE_Types.f90 Adds new VTK-related parameters and misc storage (WakeVTK_StartN), updates pack/unpack/copy/destroy.
modules/awae/src/AWAE_Registry.txt Registry updates for new parameters/misc fields and improved field descriptions.
modules/awae/src/AWAE_IO.f90 Renames VTK output root usage to the new OutFileFFvtkRoot.
modules/awae/CMakeLists.txt Adds AWAE_vtk.f90 to the AWAE library build.
glue-codes/fast-farm/src/FAST_Farm_Subs.f90 Updates MaxNumPlanes sizing logic (different safety factors by wake model).
.gitignore Ignores VS Code workspace and devcontainer/docker-compose files.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread modules/awae/src/AWAE.f90
Comment thread modules/awae/src/AWAE_vtk.f90
Comment thread modules/wakedynamics/src/WakeDynamics.f90
andrew-platt and others added 2 commits June 19, 2026 11:31
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
I thought this was in the outer context, but apparently not.  Not sure how it was still compiling ok during testing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants