Skip to content

Commit

Permalink
FVW: check for potential divide-by-zero in induction output calculations
Browse files Browse the repository at this point in the history
  • Loading branch information
bjonkman committed Mar 15, 2022
1 parent e494370 commit 291938e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions modules/aerodyn/src/FVW_Subs.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1453,8 +1453,16 @@ subroutine FVW_AeroOuts( M_sg, M_ag, PitchAndTwist, Vstr_g, Vind_g, Vwnd_g, Kin
Vwnd_s = matmul(M_sg, Vwnd_g)
Urel_s = Vwnd_s - Vstr_s ! relative wind
Vtot_s = Vwnd_s - Vstr_s + Vind_s
AxInd = -Vind_s(1)/Urel_s(1)
TanInd = Vind_s(2)/Urel_s(2)
if (EqualRealNos(Urel_s(1),0.0_ReKi)) then
AxInd = 0.0_ReKi
else
AxInd = -Vind_s(1)/Urel_s(1)
endif
if (EqualRealNos(Urel_s(2),0.0_ReKi)) then
TanInd = 0.0_ReKi
else
TanInd = Vind_s(2)/Urel_s(2)
end if
phi = atan2( Vtot_s(1), Vtot_s(2) ) ! flow angle

if(.false.) print*,PitchAndTwist ! just to avoid unused var for now
Expand Down

0 comments on commit 291938e

Please sign in to comment.