Skip to content

Commit 0ec4bb2

Browse files
authored
Merge pull request #3454 from RBergua/OLAF-timestep-tolerance-fix
Fix OLAF wake time-step detection losing precision over many time steps
2 parents 663fc50 + 4839314 commit 0ec4bb2

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

modules/aerodyn/src/FVW.f90

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ module FVW
3030
public :: FVW_CalcOutput
3131
public :: FVW_UpdateStates
3232

33-
! parameter for deciding if enough time has elapsed (Wake calculation, and vtk output)
34-
real(DbKi), parameter :: OneMinusEpsilon = 1 - 10000*EPSILON(1.0_DbKi)
35-
3633
contains
3734

3835
!----------------------------------------------------------------------------------------------------------------------------------
@@ -603,7 +600,7 @@ subroutine FVW_UpdateStates( t, n, u, utimes, p, x, xd, z, OtherState, AFInfo, m
603600
bReevaluation=.True.
604601
endif
605602
! Compute Induced wake effects only if time since last compute is > DTfvw
606-
if ( (( t - m%OldWakeTime ) >= p%DTfvw*OneMinusEpsilon) ) then
603+
if ( (( t - m%OldWakeTime ) >= p%DTfvw - 0.25_DbKi*p%DTaero) ) then
607604
m%OldWakeTime = t
608605
m%ComputeWakeInduced = .TRUE. ! It's time to update the induced velocities from wake
609606
else
@@ -1584,7 +1581,7 @@ subroutine WriteVTKOutputs(t, force, VTKstep, u, p, x, z, m, ErrStat, ErrMsg)
15841581
do iW=1,p%nWings
15851582
m%W(iW)%Vtot_CP = m%W(iW)%Vind_CP + m%W(iW)%Vwnd_CP - m%W(iW)%Vstr_CP
15861583
enddo
1587-
if ( force .or. (( t - m%VTKlastTime ) >= p%DTvtk*OneMinusEpsilon )) then
1584+
if ( force .or. (( t - m%VTKlastTime ) >= p%DTvtk - 0.25_DbKi*p%DTaero )) then
15881585
m%VTKlastTime = t
15891586
if ((p%VTKCoord==2).or.(p%VTKCoord==3)) then
15901587
! Hub reference coordinates, for export only, ALL VTK Will be exported in this coordinate system!
@@ -1614,7 +1611,7 @@ subroutine WriteVTKOutputs(t, force, VTKstep, u, p, x, z, m, ErrStat, ErrMsg)
16141611
CALL DistributeRequestedWind_Grid(u%V_wind, p, m)
16151612
do iGrid=1,p%nGridOut
16161613
bWithinTime = t>=m%GridOutputs(iGrid)%tStart-p%DTaero/2. .and. t<= m%GridOutputs(iGrid)%tEnd+p%DTaero/2.
1617-
bTimeToOutput = ( t - m%GridOutputs(iGrid)%tLastOutput) >= m%GridOutputs(iGrid)%DTout * OneMinusEpsilon
1614+
bTimeToOutput = ( t - m%GridOutputs(iGrid)%tLastOutput) >= m%GridOutputs(iGrid)%DTout - 0.25_DbKi*p%DTaero
16181615
if (force .or. (bWithinTime .and. bTimeToOutput) ) then
16191616
! Compute induced velocity on grid, TODO use the same Tree for all CalcOutput
16201617
call InducedVelocitiesAll_OnGrid(m%GridOutputs(iGrid), p, x, m, ErrStat2, ErrMsg2);

0 commit comments

Comments
 (0)