Skip to content

OLAF: fix VTK writing at the last simulation step - #3475

Merged
andrew-platt merged 4 commits into
OpenFAST:rc-5.0.1from
RBergua:OLAF_VTK_last_step
Oct 9, 2026
Merged

andrew-platt merged 4 commits into
OpenFAST:rc-5.0.1from
RBergua:OLAF_VTK_last_step

Conversation

@RBergua

@RBergua RBergua commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Feature or improvement description
In the OLAF output section, the WrVTK flag lets the user control visualization output:
0: NoVTK
1: Write VTK at each time step defined by VTK_fps
2: Write VTK at the beginning and end of the simulation

Separately, grid outputs (nGridOut) are controlled independently, with each grid defining its own TStart, TEnd, and DTOut.

Problems fixed:
1. Setting WrVTK > 0 forced every grid output to write at the last step, even though grid outputs should only follow their own schedule (TStart/TEnd/DTOut), independent of the wake's final write logic.
2. Setting WrVTK = 1 incorrectly forced an extra output at the final step, even though only WrVTK = 2 should include a start/end write.

Changes:
1. Grid outputs (nGridOut) are now written only according to their own schedule, independent from the wake WrVTK flag.
2. WrVTK = 1 no longer forces an output at the final step.

@RBergua RBergua added this to the v5.0.1 milestone Sep 25, 2026
@RBergua
RBergua marked this pull request as draft September 25, 2026 16:48
@RBergua

RBergua commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks to the failed r-test I realized that one condition was not properly handled. The failed test ad_Sphere_OLAF uses TMax=2, DT=1, WrVTK= 1, and VTK_fps=1.

From here, we would expect to write VTK outputs at: 0, 1, 2. However, the results at the last step are skipped. The proposed final step catch-up logic was failing when the last VTK_fps would exactly land at TMax for WrVTK= 1.

I updated the logic in commit 0873538. For reference, I attach the expected behavior below:

  1. If TMax=5, DT=0.1, WrVTK= 1, and VTK_fps=1, OLAF will write at instants: 0, 1, 2, 3, 4, 5.
  2. If TMax=5.4, DT=0.1, WrVTK= 1, and VTK_fps=1, OLAF will write at instants: 0, 1, 2, 3, 4, 5.
  3. If TMax=5.4 and WrVTK= 2, OLAF will write at instants: 0 (step count: 000000000), 5.4 (step count: 999999999 always).

@RBergua
RBergua marked this pull request as ready for review September 26, 2026 12:47
@andrew-platt andrew-platt self-assigned this Oct 8, 2026
@andrew-platt
andrew-platt requested a balanced review from Copilot October 8, 2026 17:02

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.

🟡 Changes recommended

Final scheduled grid output remains incorrectly dependent on the wake WrVTK setting and cadence.

1 open finding
What changed in this PR

Fixes OLAF’s final-step VTK scheduling so wake and grid outputs follow their respective schedules.

Changes:

  • Limits forced final wake output to WrVTK=2.
  • Prevents force from bypassing grid schedules.
File Description
modules/​aerodyn/​src/​FVW.f90 Adjusts final-step wake and grid VTK output logic.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread modules/aerodyn/src/FVW.f90 Outdated
@andrew-platt
andrew-platt merged commit 4562d6a into OpenFAST:rc-5.0.1 Oct 9, 2026
26 of 27 checks passed
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