Skip to content

Commit a1bb1e8

Browse files
RBerguaandrew-platt
authored andcommitted
SubDyn_Output: short-circuit ReactSS computation when SoilDyn nonlinear loads are active
1 parent 9cf6687 commit a1bb1e8

1 file changed

Lines changed: 38 additions & 35 deletions

File tree

‎modules/subdyn/src/SubDyn_Output.f90‎

Lines changed: 38 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -443,42 +443,45 @@ SUBROUTINE SDOut_MapOutputs(u,p,x, y, m, AllOuts, ErrStat, ErrMsg )
443443
! --------------------------------------------------------------------------------{
444444
! Total base reaction forces and moments at the (0.,0.,-WtrDpth) location in SS coordinate system
445445
! "ReactFXss, ReactFYss, ReactFZss, ReactMXss, ReactMYss, ReactMZss"
446-
IF (p%OutReact) THEN
447-
ALLOCATE ( ReactNs(6*p%nNodes_C), STAT = ErrStat )
448-
IF ( ErrStat /= ErrID_None ) THEN
449-
ErrMsg = ' Error allocating space for ReactNs array.'
450-
ErrStat = ErrID_Fatal
451-
RETURN
452-
END IF
453-
ReactNs = 0.0_ReKi !Initialize
454-
DO I=1,p%nNodes_C !Do for each constrained node, they are ordered as given in the input file and so as in the order of y2mesh
455-
FK_elm2=0._ReKi !Initialize for cumulative force
456-
FM_elm2=0._ReKi !Initialize
457-
pLst => p%MOutLst3(I)
458-
!Find the joint forces
459-
DO J=1,SIZE(pLst%ElmIDs(1,:)) !for all the elements connected (normally 1)
460-
iiNode = 1
461-
call ElementForce(pLst, iiNode, J, FM_elm, FK_elm, sgn, DIRCOS, .false.)
462-
!transform back to global, need to do 3 at a time since cosine matrix is 3x3
463-
DO L=1,2
464-
FM_elm2((L-1)*3+1:L*3) = FM_elm2((L-1)*3+1:L*3) + matmul(transpose(DIRCOS),FM_elm((L-1)*3+1:L*3)) !sum forces at joint in GLOBAL REF
465-
FK_elm2((L-1)*3+1:L*3) = FK_elm2((L-1)*3+1:L*3) + matmul(transpose(DIRCOS),FK_elm((L-1)*3+1:L*3)) !signs may be wrong, we will fix that later;
466-
! I believe this is all fixed in terms of signs now ,RRD 5/20/13
467-
ENDDO
446+
IF (p%OutReact) THEN
447+
IF (p%SlDNonLinear) THEN
448+
! When SoilDyn nonlinear loads are active (e.g., SoilDyn CalcOption = 3), SubDyn reaction loads are incomplete (only the linear part is included)
449+
! The total reaction at each base reaction joint is available in the SoilDyn output sensors (e.g., "Sld1Fxg Sld1Fyg Sld1Fzg Sld1Mxg Sld1Myg Sld1Mzg")
450+
AllOuts( ReactSS(1:nDOFL_TP) ) = NaN
451+
ELSE
452+
ALLOCATE ( ReactNs(6*p%nNodes_C), STAT = ErrStat )
453+
IF ( ErrStat /= ErrID_None ) THEN
454+
ErrMsg = ' Error allocating space for ReactNs array.'
455+
ErrStat = ErrID_Fatal
456+
RETURN
457+
END IF
458+
ReactNs = 0.0_ReKi !Initialize
459+
DO I=1,p%nNodes_C !Do for each constrained node, they are ordered as given in the input file and so as in the order of y2mesh
460+
FK_elm2=0._ReKi !Initialize for cumulative force
461+
FM_elm2=0._ReKi !Initialize
462+
pLst => p%MOutLst3(I)
463+
!Find the joint forces
464+
DO J=1,SIZE(pLst%ElmIDs(1,:)) !for all the elements connected (normally 1)
465+
iiNode = 1
466+
call ElementForce(pLst, iiNode, J, FM_elm, FK_elm, sgn, DIRCOS, .false.)
467+
!transform back to global, need to do 3 at a time since cosine matrix is 3x3
468+
DO L=1,2
469+
FM_elm2((L-1)*3+1:L*3) = FM_elm2((L-1)*3+1:L*3) + matmul(transpose(DIRCOS),FM_elm((L-1)*3+1:L*3)) !sum forces at joint in GLOBAL REF
470+
FK_elm2((L-1)*3+1:L*3) = FK_elm2((L-1)*3+1:L*3) + matmul(transpose(DIRCOS),FK_elm((L-1)*3+1:L*3)) !signs may be wrong, we will fix that later;
471+
! I believe this is all fixed in terms of signs now ,RRD 5/20/13
472+
ENDDO
473+
ENDDO
474+
! FK_elm2 ! + FM_elm2 !removed the inertial component 12/13 !Not sure why I need an intermediate step here, but the sum would not work otherwise
475+
! NEED TO ADD HYDRODYNAMIC FORCES AT THE RESTRAINT NODES
476+
iSDNode = p%Nodes_C(I,1)
477+
iMeshNode = iSDNode ! input and Y2 mesh nodes are the same as subdyn
478+
Fext = (/ u%LMesh%Force(:,iMeshNode), u%LMesh%Moment(:,iMeshNode) /) + p%FG(p%NodesDOF(iMeshNode)%List(1:6))
479+
Fext(1:3) = Fext(1:3) + p%FC(p%NodesDOF(iMeshNode)%List(1:3))
480+
ReactNs((I-1)*6+1:6*I) = FK_elm2 - Fext !Accumulate reactions from all nodes in GLOBAL COORDINATES
468481
ENDDO
469-
! FK_elm2 ! + FM_elm2 !removed the inertial component 12/13 !Not sure why I need an intermediate step here, but the sum would not work otherwise
470-
! NEED TO ADD HYDRODYNAMIC FORCES AT THE RESTRAINT NODES
471-
iSDNode = p%Nodes_C(I,1)
472-
iMeshNode = iSDNode ! input and Y2 mesh nodes are the same as subdyn
473-
Fext = (/ u%LMesh%Force(:,iMeshNode), u%LMesh%Moment(:,iMeshNode) /) + p%FG(p%NodesDOF(iMeshNode)%List(1:6))
474-
Fext(1:3) = Fext(1:3) + p%FC(p%NodesDOF(iMeshNode)%List(1:3))
475-
ReactNs((I-1)*6+1:6*I) = FK_elm2 - Fext !Accumulate reactions from all nodes in GLOBAL COORDINATES
476-
ENDDO
477-
! Store into AllOuts
478-
AllOuts( ReactSS(1:nDOFL_TP) ) = matmul(p%TIreact,ReactNs)
479-
! When SoilDyn nonlinear loads are active (e.g., SoilDyn CalcOption = 3), SubDyn reaction loads are incomplete (only the linear part is included)
480-
! The total reaction at each base reaction joint is available in the SoilDyn output sensors (e.g., "Sld1Fxg Sld1Fyg Sld1Fzg Sld1Mxg Sld1Myg Sld1Mzg")
481-
IF (p%SlDNonLinear) AllOuts( ReactSS(1:nDOFL_TP) ) = NaN
482+
! Store into AllOuts
483+
AllOuts( ReactSS(1:nDOFL_TP) ) = matmul(p%TIreact,ReactNs)
484+
ENDIF
482485
ENDIF
483486
if (allocated(ReactNs)) deallocate(ReactNs)
484487
contains

0 commit comments

Comments
 (0)