Skip to content

Fix OLAF wake time-step detection losing precision over many time steps - #3454

Merged
andrew-platt merged 2 commits into
OpenFAST:rc-5.0.1from
RBergua:OLAF-timestep-tolerance-fix
Sep 9, 2026
Merged

andrew-platt merged 2 commits into
OpenFAST:rc-5.0.1from
RBergua:OLAF-timestep-tolerance-fix

Conversation

@RBergua

@RBergua RBergua commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Feature or improvement description
OLAF wake solution degrades after tens of thousands of time steps. The problem was related to how OLAF decided if enough time had passed to shed a new wake panel. Before this fix, it compared (t - last_wake_time) against a tolerance built from a fixed fraction of floating-point epsilon (p%DTfvw*OneMinusEpsilon, where OneMinusEpsilon = 1 - 10000*EPSILON(1.0_DbKi) ≈ 0.99999999999778).

As the simulation time grows over many steps, the rounding error in t - last_wake_time grows too, while the epsilon-based tolerance stays fixed. Eventually the accumulated rounding error becomes bigger than the tolerance, and the check starts firing at the wrong times (sometimes skipping a wake update, sometimes doubling one up).

The fix replaces this with a tolerance based on the simulation time step (DTaero), so the tolerance stays proportional to the actual physical time discretization of the simulation instead of a fixed epsilon fraction.

All the instances with OneMinusEpsilon have been rewritten.

Related issue, if one exists
Fixes #3429

In addition, OneMinusEpsilon was also used in bTimeToOutput. This was also problematic and impacting the actual times to write down the output VTK files. For example, given a simulation with a time step of 0.002 s and defining in the output options:

GridName    GridType (1 = velocity, 2 = velocity and vorticity) TStart TEnd           DTOut (all = AeroDyn time step, default: OLAF time step)     XStart    XEnd   nX    YStart   YEnd    nY    ZStart   ZEnd   nZ
(-)           (-)                                                (s)    (s)            (s)                                                          (m)      (m)    (-)    (m)     (m)     (-)    (m)     (m)    (-)
"xy-plane"     1                                                 20.00  40.00         0.1                                                        -2.0000  20.0000 441    -2.5     2.5    101   2.18843  2.18843   1

We would expect the VTK files being exported at the steps:
20.0/0.002 = 10,000
20.1/0.002 = 10,050
20.2/0.002 = 10,100
...

However, this was not the case. Before the proposed fix, the steps were not properly detected:
image

After the fix, the steps are properly detected:
image

@andrew-platt
andrew-platt merged commit 0ec4bb2 into OpenFAST:rc-5.0.1 Sep 9, 2026
13 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.

2 participants