From c6551aa842a55a8068429239dfa9c4d13562fb59 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Thu, 14 Mar 2024 12:51:10 -0600 Subject: [PATCH 1/3] HD Bug Fix: Correct the indices of mean drift load components in WAMIT2 --- modules/hydrodyn/src/WAMIT2.f90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/hydrodyn/src/WAMIT2.f90 b/modules/hydrodyn/src/WAMIT2.f90 index 21c4f18ffc..1e958e10a5 100644 --- a/modules/hydrodyn/src/WAMIT2.f90 +++ b/modules/hydrodyn/src/WAMIT2.f90 @@ -1220,8 +1220,8 @@ SUBROUTINE MnDrift_InitCalc( InitInp, p, MnDriftData, MnDriftForce, ErrMsg, ErrS ! Now rotate the force components with platform orientation - MnDriftForce(1:2) = MATMUL( RotateZMatrixT, MnDriftForce(1:2) ) ! Fx and Fy, rotation about z - MnDriftForce(4:5) = MATMUL( RotateZMatrixT, MnDriftForce(4:5) ) ! Mx and My, rotation about z + MnDriftForce((IBody-1)*6 + 1:2) = MATMUL( RotateZMatrixT, MnDriftForce((IBody-1)*6 + 1:2) ) ! Fx and Fy, rotation about z + MnDriftForce((IBody-1)*6 + 4:5) = MATMUL( RotateZMatrixT, MnDriftForce((IBody-1)*6 + 4:5) ) ! Mx and My, rotation about z ENDDO ! IBody From 598fe9b60a57f9a63304ec826ea8c3549acaa79d Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Thu, 14 Mar 2024 15:46:23 -0600 Subject: [PATCH 2/3] HD fix bad syntax introduced in the last commit (c6551aa842a55a8068429239dfa9c4d13562fb59) --- modules/hydrodyn/src/WAMIT2.f90 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/hydrodyn/src/WAMIT2.f90 b/modules/hydrodyn/src/WAMIT2.f90 index 1e958e10a5..f46796b8b4 100644 --- a/modules/hydrodyn/src/WAMIT2.f90 +++ b/modules/hydrodyn/src/WAMIT2.f90 @@ -1220,8 +1220,9 @@ SUBROUTINE MnDrift_InitCalc( InitInp, p, MnDriftData, MnDriftForce, ErrMsg, ErrS ! Now rotate the force components with platform orientation - MnDriftForce((IBody-1)*6 + 1:2) = MATMUL( RotateZMatrixT, MnDriftForce((IBody-1)*6 + 1:2) ) ! Fx and Fy, rotation about z - MnDriftForce((IBody-1)*6 + 4:5) = MATMUL( RotateZMatrixT, MnDriftForce((IBody-1)*6 + 4:5) ) ! Mx and My, rotation about z + Idx = (IBody-1)*6 + MnDriftForce( (Idx+1):(Idx+2) ) = MATMUL( RotateZMatrixT, MnDriftForce( (Idx+1):(Idx+2) ) ) ! Fx and Fy, rotation about z + MnDriftForce( (Idx+4):(Idx+5) ) = MATMUL( RotateZMatrixT, MnDriftForce( (Idx+4):(Idx+5) ) ) ! Mx and My, rotation about z ENDDO ! IBody From cbc6822d0687d119c2badc044a3726a86470b0aa Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Thu, 14 Mar 2024 17:36:49 -0600 Subject: [PATCH 3/3] HD Bug Fix: Corrected the rotation matrix for second-order wave loads --- modules/hydrodyn/src/WAMIT2.f90 | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/hydrodyn/src/WAMIT2.f90 b/modules/hydrodyn/src/WAMIT2.f90 index f46796b8b4..37d8d7f73d 100644 --- a/modules/hydrodyn/src/WAMIT2.f90 +++ b/modules/hydrodyn/src/WAMIT2.f90 @@ -1105,8 +1105,8 @@ SUBROUTINE MnDrift_InitCalc( InitInp, p, MnDriftData, MnDriftForce, ErrMsg, ErrS endif ! NOTE: RotateZMatrixT is the rotation from local to global. - RotateZMatrixT(:,1) = (/ cos(InitInp%PtfmRefztRot(IBody)), -sin(InitInp%PtfmRefztRot(IBody)) /) - RotateZMatrixT(:,2) = (/ sin(InitInp%PtfmRefztRot(IBody)), cos(InitInp%PtfmRefztRot(IBody)) /) + RotateZMatrixT(1,:) = (/ cos(InitInp%PtfmRefztRot(IBody)), -sin(InitInp%PtfmRefztRot(IBody)) /) + RotateZMatrixT(2,:) = (/ sin(InitInp%PtfmRefztRot(IBody)), cos(InitInp%PtfmRefztRot(IBody)) /) DO ThisDim=1,6 @@ -1805,8 +1805,8 @@ SUBROUTINE NewmanApp_InitCalc( InitInp, p, NewmanAppData, NewmanAppForce, ErrMsg ! Set rotation ! NOTE: RotateZMatrixT is the rotation from local to global. - RotateZMatrixT(:,1) = (/ cos(InitInp%PtfmRefztRot(IBody)), -sin(InitInp%PtfmRefztRot(IBody)) /) - RotateZMatrixT(:,2) = (/ sin(InitInp%PtfmRefztRot(IBody)), cos(InitInp%PtfmRefztRot(IBody)) /) + RotateZMatrixT(1,:) = (/ cos(InitInp%PtfmRefztRot(IBody)), -sin(InitInp%PtfmRefztRot(IBody)) /) + RotateZMatrixT(2,:) = (/ sin(InitInp%PtfmRefztRot(IBody)), cos(InitInp%PtfmRefztRot(IBody)) /) ! Loop through all the frequencies DO J=1,InitInp%WaveField%NStepWave2 @@ -2332,8 +2332,8 @@ SUBROUTINE DiffQTF_InitCalc( InitInp, p, DiffQTFData, DiffQTFForce, ErrMsg, ErrS ! Set rotation ! NOTE: RotateZMatrixT is the rotation from local to global. - RotateZMatrixT(:,1) = (/ cos(InitInp%PtfmRefztRot(IBody)), -sin(InitInp%PtfmRefztRot(IBody)) /) - RotateZMatrixT(:,2) = (/ sin(InitInp%PtfmRefztRot(IBody)), cos(InitInp%PtfmRefztRot(IBody)) /) + RotateZMatrixT(1,:) = (/ cos(InitInp%PtfmRefztRot(IBody)), -sin(InitInp%PtfmRefztRot(IBody)) /) + RotateZMatrixT(2,:) = (/ sin(InitInp%PtfmRefztRot(IBody)), cos(InitInp%PtfmRefztRot(IBody)) /) ! Loop through all the frequencies DO J=1,InitInp%WaveField%NStepWave2 @@ -2932,8 +2932,8 @@ SUBROUTINE SumQTF_InitCalc( InitInp, p, SumQTFData, SumQTFForce, ErrMsg, ErrStat ! Set rotation ! NOTE: RotateZMatrixT is the rotation from local to global. - RotateZMatrixT(:,1) = (/ cos(InitInp%PtfmRefztRot(IBody)), -sin(InitInp%PtfmRefztRot(IBody)) /) - RotateZMatrixT(:,2) = (/ sin(InitInp%PtfmRefztRot(IBody)), cos(InitInp%PtfmRefztRot(IBody)) /) + RotateZMatrixT(1,:) = (/ cos(InitInp%PtfmRefztRot(IBody)), -sin(InitInp%PtfmRefztRot(IBody)) /) + RotateZMatrixT(2,:) = (/ sin(InitInp%PtfmRefztRot(IBody)), cos(InitInp%PtfmRefztRot(IBody)) /) ! Loop through all the frequencies DO J=1,InitInp%WaveField%NStepWave2