Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix HydroDyn summary file nodal data is incorrect when Member is flipped #998

Merged
merged 2 commits into from
Feb 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions modules/hydrodyn/src/Morison.f90
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ SUBROUTINE WriteSummaryFile( UnSum, g, MSL2SWL, WtrDpth, numJoints, numNodes, no
INTEGER, INTENT ( OUT ) :: errStat ! returns a non-zero value when an error occurs
CHARACTER(*), INTENT ( OUT ) :: errMsg ! Error message if errStat /= ErrID_None

INTEGER :: I, J
INTEGER :: I, J, II
REAL(ReKi) :: l ! length of an element
LOGICAL :: filledFlag ! flag indicating if element is filled/flooded
CHARACTER(2) :: strFmt
Expand Down Expand Up @@ -811,7 +811,12 @@ SUBROUTINE WriteSummaryFile( UnSum, g, MSL2SWL, WtrDpth, numJoints, numNodes, no
! need to add MSL2SWL offset from this because the Positons are relative to SWL, but we should report them relative to MSL here
pos = nodes(c)%Position
pos(3) = pos(3) + MSL2SWL
write( UnSum, '(1X,I5,(2X,I10),3(2X,F10.4),4(2X,ES10.3),2(6X,L6),7(2X,ES10.3),3(7x,A5))' ) c, members(j)%MemberID, pos, members(j)%R(i), members(j)%R(i)-members(j)%Rin(i), members(j)%tMG(i), members(j)%MGdensity(i), members(j)%PropPot, fillFlag, members(j)%m_fb_u(i)+members(j)%m_fb_l(i), members(j)%Cd(i), members(j)%Ca(i), members(j)%Cp(i), members(j)%AxCd(i), members(j)%AxCa(i), members(j)%AxCp(i), ' - ', ' - ', ' - '
if (members(j)%flipped) then
II=members(j)%NElements+2-I
else
II=I
endif
write( UnSum, '(1X,I5,(2X,I10),3(2X,F10.4),4(2X,ES10.3),2(6X,L6),7(2X,ES10.3),3(7x,A5))' ) c, members(j)%MemberID, pos, members(j)%R(ii), members(j)%R(ii)-members(j)%Rin(ii), members(j)%tMG(ii), members(j)%MGdensity(ii), members(j)%PropPot, fillFlag, members(j)%m_fb_u(ii)+members(j)%m_fb_l(ii), members(j)%Cd(ii), members(j)%Ca(ii), members(j)%Cp(ii), members(j)%AxCd(ii), members(j)%AxCa(ii), members(j)%AxCp(ii), ' - ', ' - ', ' - '
end do
end do

Expand Down Expand Up @@ -1267,7 +1272,7 @@ subroutine AllocateMemberDataArrays( member, memberLoads, errStat, errMsg )

errStat = ErrID_None
errMSg = ''
call AllocAry(member%NodeIndx , member%NElements, 'member%NodeIndx' , errStat2, errMsg2); call SetErrStat(errStat2, errMsg2, errStat, errMsg, routineName)
call AllocAry(member%NodeIndx , member%NElements+1, 'member%NodeIndx' , errStat2, errMsg2); call SetErrStat(errStat2, errMsg2, errStat, errMsg, routineName)
call AllocAry(member%dRdl_mg , member%NElements, 'member%dRdl_mg' , errStat2, errMsg2); call SetErrStat(errStat2, errMsg2, errStat, errMsg, routineName)
call AllocAry(member%dRdl_in , member%NElements, 'member%dRdl_in' , errStat2, errMsg2); call SetErrStat(errStat2, errMsg2, errStat, errMsg, routineName)
call AllocAry(member%floodstatus , member%NElements, 'member%floodstatus' , errStat2, errMsg2); call SetErrStat(errStat2, errMsg2, errStat, errMsg, routineName)
Expand Down