Skip to content

Commit c878308

Browse files
committed
SubDyn floating: refactored self-weight output calculation
1 parent 5160c03 commit c878308

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

modules/subdyn/src/SubDyn_Output.f90

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,6 @@ subroutine ElementForce(pLst, iiNode, JJ, FM_elm, FK_elm, sgn, DIRCOS, bUseInput
501501
real(ReKi) , dimension(12) :: X_e, Xdd_e ! Displacement and acceleration for an element
502502
real(FEKi) , dimension(12) :: Fg_e ! Gravity + initial cable pretension load vector (reorient for floating, constant for fixed-bottom)
503503
real(FEKi) , dimension(3,3) :: CurDirCos ! Current element direction cosine matrix in the floating body frame
504-
real(R8Ki) , dimension(3,3) :: Rb2g ! Rotation matrix from body/Guyan to global frame (transpose of Rg2b)
505504
integer(IntKi), dimension(2), parameter :: NodeNumber_To_Sign = (/-1, +1/)
506505

507506
iElem = pLst%ElmIDs(iiNode,JJ) ! element number
@@ -513,21 +512,23 @@ subroutine ElementForce(pLst, iiNode, JJ, FM_elm, FK_elm, sgn, DIRCOS, bUseInput
513512
Xdd_e(1:6) = matmul(RRg2b,m%U_full_dotdot(p%NodesDOF(ElemNodes(1))%List(1:6))) ! Transform acceleration to be back in the Guyan frame
514513
Xdd_e(7:12) = matmul(RRg2b,m%U_full_dotdot(p%NodesDOF(ElemNodes(2))%List(1:6)))
515514
! Load the computed at initialization gravity + initial cable pretension load vector.
516-
! For floating systems, project the load vector into the current body/Guyan frame for Fx/Fy/Fz.
515+
! For floating systems, update the force components (Fx/Fy/Fz) from the initial body/Guyan frame to the current one.
517516
! For the self-weight bending moments, recompute them based on the current element direction cosine matrix.
518517
Fg_e = real(pLst%Fg(:,iiNode,JJ), R8Ki)
519518
if (p%Floating) then
520-
Fg_e(1:6) = matmul(RRg2b, Fg_e(1:6)) ! project node-1 forces/moments into body frame
521-
Fg_e(7:12) = matmul(RRg2b, Fg_e(7:12)) ! project node-2 forces/moments into body frame
519+
! Rotate only the force (Fx,Fy,Fz) components into the body frame
520+
Fg_e(1:3) = matmul(Rg2b, Fg_e(1:3))
521+
Fg_e(7:9) = matmul(Rg2b, Fg_e(7:9))
522522

523-
Rb2g = transpose(Rg2b) ! current body-to-global rotation needed for moment projection
524-
CurDirCos = matmul(Rb2g, p%ElemProps(iElem)%DirCos)
525-
526-
! Element self-weight bending moment contribution at the nodes:
523+
! Recompute bending moment components from current element orientation
524+
! CurDirCos = Rb2g * DirCos0 (DirCos0 is the element direction cosine matrix at initialization)
525+
CurDirCos = matmul(transpose(Rg2b), p%ElemProps(iElem)%DirCos)
527526
Fg_e(4) = -p%ElemProps(iElem)%Length**2 * p%ElemProps(iElem)%Rho * p%ElemProps(iElem)%Area * p%g / 12.0_FEKi * CurDirCos(2,3)
528527
Fg_e(5) = p%ElemProps(iElem)%Length**2 * p%ElemProps(iElem)%Rho * p%ElemProps(iElem)%Area * p%g / 12.0_FEKi * CurDirCos(1,3)
528+
Fg_e(6) = 0.0_FEKi ! no torsional self-weight moment
529529
Fg_e(10) = -Fg_e(4)
530530
Fg_e(11) = -Fg_e(5)
531+
Fg_e(12) = 0.0_FEKi
531532
endif
532533
if (.not. bUseInputDirCos) then
533534
DIRCOS=transpose(p%ElemProps(iElem)%DirCos)! global to local

0 commit comments

Comments
 (0)