Skip to content

Commit

Permalink
Fix for issue #26: BeamDyn initialization with non-zero initial azimuth
Browse files Browse the repository at this point in the history
The initial translation velocity calculation didn't remove the location of the root node when taking the cross product with the rotational velocity. This fixes OpenFAST#26
  • Loading branch information
bjonkman committed Aug 14, 2017
1 parent 87fd9cd commit 97d1c2a
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions modules-local/beamdyn/src/BeamDyn.f90
Original file line number Diff line number Diff line change
Expand Up @@ -4021,10 +4021,6 @@ SUBROUTINE BD_CalcIC( u, p, x)
REAL(BDKi) :: temp3(3)
REAL(BDKi) :: temp_p0(3)
REAL(BDKi) :: temp_rv(3)
REAL(BDKi) :: temp_R(3,3)
REAL(BDKi) :: GlbRot_TransVel(3) ! = MATMUL(p%GlbRot,u%RootMotion%TranslationVel(:,1))
REAL(BDKi) :: GlbRot_RotVel_tilde(3,3) ! = SkewSymMat(MATMUL(p%GlbRot,u%RootMotion%RotationVel(:,1)))
REAL(BDKi) :: temp33(3,3)
CHARACTER(*), PARAMETER :: RoutineName = 'BD_CalcIC'


Expand Down Expand Up @@ -4070,10 +4066,12 @@ SUBROUTINE BD_CalcIC( u, p, x)
temp_id = p%node_elem_idx(i,1)-1 ! Node just before the start of this element
DO j=k,p%nodes_per_elem

temp3 = p%uuN0(1:3,j,i) + x%q(1:3,temp_id+j)
temp3 = u%RootMotion%TranslationVel(:,1) + cross_product(u%RootMotion%RotationVel(:,1),temp3)
! Find distance vector from root
temp3 = (p%uuN0(1:3,j,i) + x%q(1:3,temp_id+j)) - (p%uuN0(1:3,1,1) + x%q(1:3,1))
! Calculate translational velocity of tip relative to root, and add it to the root translational velocity
x%dqdt(1:3,temp_id+j) = u%RootMotion%TranslationVel(:,1) + cross_product(u%RootMotion%RotationVel(:,1),temp3)

x%dqdt(1:3,temp_id+j) = temp3
! Rotational velocity is the same as the root rotational velocity
x%dqdt(4:6,temp_id+j) = u%RootMotion%RotationVel(1:3,1)
ENDDO
k = 2 ! start j loop at k=2 for remaining elements (i>1)
Expand Down

0 comments on commit 97d1c2a

Please sign in to comment.