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

HD Bug Fix for ExctnDisp and updates to CTestList.cmake with new r-tests #2031

Merged
Merged
29 changes: 5 additions & 24 deletions modules/hydrodyn/src/WAMIT.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1565,7 +1565,7 @@ SUBROUTINE WAMIT_UpdateStates( t, n, Inputs, InputTimes, p, x, xd, z, OtherState

REAL(DbKi), INTENT(IN ) :: t !< Current simulation time in seconds
INTEGER(IntKi), INTENT(IN ) :: n !< Current step of the simulation: t = n*Interval
TYPE(WAMIT_InputType), INTENT(IN ) :: Inputs(:) !< Inputs at InputTimes
TYPE(WAMIT_InputType), INTENT(INOUT) :: Inputs(:) !< Inputs at InputTimes
REAL(DbKi), INTENT(IN ) :: InputTimes(:) !< Times in seconds associated with Inputs
TYPE(WAMIT_ParameterType), INTENT(IN ) :: p !< Parameters
TYPE(WAMIT_ContinuousStateType), INTENT(INOUT) :: x !< Input: Continuous states at t;
Expand Down Expand Up @@ -1598,7 +1598,6 @@ SUBROUTINE WAMIT_UpdateStates( t, n, Inputs, InputTimes, p, x, xd, z, OtherState

TYPE(SS_Rad_InputType), ALLOCATABLE :: SS_Rdtn_u(:) ! Inputs
TYPE(SS_Exc_InputType), ALLOCATABLE :: SS_Exctn_u(:) ! Inputs
TYPE(WAMIT_InputType), ALLOCATABLE :: WAMIT_u(:) ! Inputs
TYPE(WAMIT_InputType) :: WAMIT_u_t


Expand Down Expand Up @@ -1669,23 +1668,9 @@ SUBROUTINE WAMIT_UpdateStates( t, n, Inputs, InputTimes, p, x, xd, z, OtherState
END IF

IF ( (p%ExctnMod>0).AND.(p%ExctnDisp==2) ) THEN
ALLOCATE( WAMIT_u(nTime), STAT = ErrStat )
IF (ErrStat /=0) THEN
ErrMsg = ' Failed to allocate array WAMIT_u.'
RETURN
END IF
DO I=1,nTime
ALLOCATE( WAMIT_u(I)%Mesh%TranslationDisp(3,p%NBody), STAT = ErrStat )
IF (ErrStat /=0) THEN
ErrMsg = ' Failed to allocate array WAMIT_u(I)%Mesh%TranslationDisp.'
RETURN
END IF
DO iBody=1,p%NBody
WAMIT_u(I)%Mesh%TranslationDisp(:,iBody) = Inputs(I)%Mesh%TranslationDisp(:,iBody)
END DO
END DO
! Interpolate WAMIT input at time t+dt
CALL WAMIT_Input_ExtrapInterp(WAMIT_u, InputTimes, WAMIT_u_t, t+p%dt, ErrStat, ErrMsg)
CALL WAMIT_CopyInput(Inputs(1), WAMIT_u_t, MESH_NEWCOPY, ErrStat, ErrMsg)
CALL WAMIT_Input_ExtrapInterp(Inputs, InputTimes, WAMIT_u_t, t+p%dt, ErrStat, ErrMsg)
DO iBody = 1,p%NBody
! Current unfiltered body position at time t+dt
bodyPosition(1) = WAMIT_u_t%Mesh%TranslationDisp(1,iBody)
Expand All @@ -1697,10 +1682,6 @@ SUBROUTINE WAMIT_UpdateStates( t, n, Inputs, InputTimes, p, x, xd, z, OtherState
xd%BdyPosFilt(2,iBody,1) = p%ExctnFiltConst * xd%BdyPosFilt(2,iBody,1) + (1.0_ReKi - p%ExctnFiltConst) * bodyPosition(2)
END DO
CALL WAMIT_DestroyInput( WAMIT_u_t, ErrStat, ErrMsg)
DO I=1,nTime
CALL WAMIT_DestroyInput( WAMIT_u(I), ErrStat, ErrMsg)
END DO
DEALLOCATE(WAMIT_u)
END IF
IF ( p%ExctnMod == 2 ) THEN ! Update the state-space wave excitation sub-module's states

Expand Down Expand Up @@ -1835,8 +1816,8 @@ SUBROUTINE WAMIT_CalcOutput( Time, u, p, x, xd, z, OtherState, y, m, ErrStat, Er
bodyPosition(2) = u%Mesh%TranslationDisp(2,iBody)
ELSE IF ( p%ExctnDisp == 2 ) THEN
! Use filtered body position
bodyPosition(1) = xd%BdyPosFilt(1,iBody,1)
bodyPosition(2) = xd%BdyPosFilt(2,iBody,1)
bodyPosition(1) = p%ExctnFiltConst * xd%BdyPosFilt(1,iBody,1) + (1.0_ReKi - p%ExctnFiltConst) * u%Mesh%TranslationDisp(1,iBody)
bodyPosition(2) = p%ExctnFiltConst * xd%BdyPosFilt(2,iBody,1) + (1.0_ReKi - p%ExctnFiltConst) * u%Mesh%TranslationDisp(2,iBody)
END IF
iStart = (iBody-1)*6+1
! WaveExctnGrid dimensions are: 1st: wavetime, 2nd: X, 3rd: Y, 4th: Force component for each WAMIT Body
Expand Down
22 changes: 19 additions & 3 deletions reg_tests/CTestList.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -399,16 +399,27 @@ bd_regression("bd_static_twisted_with_k1" "beamdyn;static")

# HydroDyn regression tests
hd_regression("hd_OC3tripod_offshore_fixedbottom_wavesirr" "hydrodyn;offshore")
#hd_regression("hd_5MW_ITIBarge_DLL_WTurb_WavesIrr" "hydrodyn;offshore")
#hd_regression("hd_5MW_ITIBarge_DLL_WTurb_WavesIrr" "hydrodyn;offshore")
hd_regression("hd_5MW_OC3Spar_DLL_WTurb_WavesIrr" "hydrodyn;offshore")
#hd_regression("hd_5MW_OC4Jckt_DLL_WTurb_WavesIrr_MGrowth" "hydrodyn;offshore")
#hd_regression("hd_5MW_OC4Jckt_DLL_WTurb_WavesIrr_MGrowth" "hydrodyn;offshore")
hd_regression("hd_5MW_OC4Semi_WSt_WavesWN" "hydrodyn;offshore")
hd_regression("hd_5MW_TLP_DLL_WTurb_WavesIrr_WavesMulti" "hydrodyn;offshore")
hd_regression("hd_TaperCylinderPitchMoment" "hydrodyn;offshore")
hd_regression("hd_NBodyMod1" "hydrodyn;offshore")
hd_regression("hd_NBodyMod2" "hydrodyn;offshore")
hd_regression("hd_NBodyMod3" "hydrodyn;offshore")

hd_regression("hd_WaveStMod1" "hydrodyn;offshore")
hd_regression("hd_WaveStMod2" "hydrodyn;offshore")
hd_regression("hd_WaveStMod3" "hydrodyn;offshore")
hd_regression("hd_MHstLMod2" "hydrodyn;offshore")
hd_regression("hd_MHstLMod1_compare" "hydrodyn;offshore")
hd_regression("hd_MHstLMod2_compare" "hydrodyn;offshore")
hd_regression("hd_MCF_WaveStMod0" "hydrodyn;offshore")
hd_regression("hd_MCF_WaveStMod1" "hydrodyn;offshore")
hd_regression("hd_MCF_WaveStMod2" "hydrodyn;offshore")
hd_regression("hd_MCF_WaveStMod3" "hydrodyn;offshore")
hd_regression("hd_ExctnMod1_ExctnDisp1" "hydrodyn;offshore")
hd_regression("hd_ExctnMod1_ExctnDisp2" "hydrodyn;offshore")

# Py-HydroDyn regression tests
py_hd_regression("py_hd_5MW_OC4Semi_WSt_WavesWN" "hydrodyn;offshore;python")
Expand Down Expand Up @@ -447,6 +458,11 @@ py_ifw_regression("py_ifw_turbsimff" "inflowwind;python
seast_regression("seastate_1" "seastate")
seast_regression("seastate_wavemod5" "seastate")
seast_regression("seastate_wr_kin1" "seastate")
seast_regression("seastate_CNW1" "seastate")
seast_regression("seastate_CNW2" "seastate")
seast_regression("seastate_WaveMod7_WaveStMod1" "seastate")
seast_regression("seastate_WaveMod7_WaveStMod2" "seastate")
seast_regression("seastate_WaveMod7_WaveStMod3" "seastate")

# MoorDyn regression tests
md_regression("md_5MW_OC4Semi" "moordyn")
Expand Down
2 changes: 1 addition & 1 deletion reg_tests/r-test
Submodule r-test updated 84 files
+12 −0 modules/hydrodyn/CaseList.md
+112 −0 modules/hydrodyn/hd_ExctnMod1_ExctnDisp1/HydroDyn.dat
+3,001 −0 modules/hydrodyn/hd_ExctnMod1_ExctnDisp1/PRPMotion.dat
+71 −0 modules/hydrodyn/hd_ExctnMod1_ExctnDisp1/SeaState.dat
+3,009 −0 modules/hydrodyn/hd_ExctnMod1_ExctnDisp1/driver.out
+42 −0 modules/hydrodyn/hd_ExctnMod1_ExctnDisp1/example.Comp
+23 −0 modules/hydrodyn/hd_ExctnMod1_ExctnDisp1/hd_driver.inp
+9,000 −0 modules/hydrodyn/hd_ExctnMod1_ExctnDisp1/marin_semi.1
+110,556 −0 modules/hydrodyn/hd_ExctnMod1_ExctnDisp1/marin_semi.3
+36 −0 modules/hydrodyn/hd_ExctnMod1_ExctnDisp1/marin_semi.hst
+112 −0 modules/hydrodyn/hd_ExctnMod1_ExctnDisp2/HydroDyn.dat
+3,001 −0 modules/hydrodyn/hd_ExctnMod1_ExctnDisp2/PRPMotion.dat
+71 −0 modules/hydrodyn/hd_ExctnMod1_ExctnDisp2/SeaState.dat
+3,009 −0 modules/hydrodyn/hd_ExctnMod1_ExctnDisp2/driver.out
+42 −0 modules/hydrodyn/hd_ExctnMod1_ExctnDisp2/example.Comp
+23 −0 modules/hydrodyn/hd_ExctnMod1_ExctnDisp2/hd_driver.inp
+9,000 −0 modules/hydrodyn/hd_ExctnMod1_ExctnDisp2/marin_semi.1
+110,556 −0 modules/hydrodyn/hd_ExctnMod1_ExctnDisp2/marin_semi.3
+36 −0 modules/hydrodyn/hd_ExctnMod1_ExctnDisp2/marin_semi.hst
+118 −0 modules/hydrodyn/hd_MCF_WaveStMod0/MCF_HydroDyn.dat
+72 −0 modules/hydrodyn/hd_MCF_WaveStMod0/MCF_SeaState.dat
+36,008 −0 modules/hydrodyn/hd_MCF_WaveStMod0/driver.out
+24 −0 modules/hydrodyn/hd_MCF_WaveStMod0/hd_driver.inp
+118 −0 modules/hydrodyn/hd_MCF_WaveStMod1/MCF_HydroDyn.dat
+72 −0 modules/hydrodyn/hd_MCF_WaveStMod1/MCF_SeaState.dat
+36,008 −0 modules/hydrodyn/hd_MCF_WaveStMod1/driver.out
+24 −0 modules/hydrodyn/hd_MCF_WaveStMod1/hd_driver.inp
+118 −0 modules/hydrodyn/hd_MCF_WaveStMod2/MCF_HydroDyn.dat
+72 −0 modules/hydrodyn/hd_MCF_WaveStMod2/MCF_SeaState.dat
+36,008 −0 modules/hydrodyn/hd_MCF_WaveStMod2/driver.out
+24 −0 modules/hydrodyn/hd_MCF_WaveStMod2/hd_driver.inp
+118 −0 modules/hydrodyn/hd_MCF_WaveStMod3/MCF_HydroDyn.dat
+72 −0 modules/hydrodyn/hd_MCF_WaveStMod3/MCF_SeaState.dat
+36,008 −0 modules/hydrodyn/hd_MCF_WaveStMod3/driver.out
+24 −0 modules/hydrodyn/hd_MCF_WaveStMod3/hd_driver.inp
+208 −0 modules/hydrodyn/hd_MHstLMod1_compare/driver.out
+24 −0 modules/hydrodyn/hd_MHstLMod1_compare/hd_driver.inp
+114 −0 modules/hydrodyn/hd_MHstLMod1_compare/hydrodyn_input.dat
+72 −0 modules/hydrodyn/hd_MHstLMod1_compare/seastate_input.dat
+126 −0 modules/hydrodyn/hd_MHstLMod2/HydroDyn.dat
+72 −0 modules/hydrodyn/hd_MHstLMod2/SeaState.dat
+408 −0 modules/hydrodyn/hd_MHstLMod2/driver.out
+24 −0 modules/hydrodyn/hd_MHstLMod2/hd_driver.inp
+208 −0 modules/hydrodyn/hd_MHstLMod2_compare/driver.out
+24 −0 modules/hydrodyn/hd_MHstLMod2_compare/hd_driver.inp
+114 −0 modules/hydrodyn/hd_MHstLMod2_compare/hydrodyn_input.dat
+72 −0 modules/hydrodyn/hd_MHstLMod2_compare/seastate_input.dat
+3,008 −0 modules/hydrodyn/hd_WaveStMod1/driver.out
+77 −0 modules/hydrodyn/hd_WaveStMod1/example.Comp
+24 −0 modules/hydrodyn/hd_WaveStMod1/hd_driver.inp
+136 −0 modules/hydrodyn/hd_WaveStMod1/hydrodyn_input.dat
+71 −0 modules/hydrodyn/hd_WaveStMod1/seastate_input.dat
+3,008 −0 modules/hydrodyn/hd_WaveStMod2/driver.out
+77 −0 modules/hydrodyn/hd_WaveStMod2/example.Comp
+24 −0 modules/hydrodyn/hd_WaveStMod2/hd_driver.inp
+136 −0 modules/hydrodyn/hd_WaveStMod2/hydrodyn_input.dat
+71 −0 modules/hydrodyn/hd_WaveStMod2/seastate_input.dat
+3,008 −0 modules/hydrodyn/hd_WaveStMod3/driver.out
+77 −0 modules/hydrodyn/hd_WaveStMod3/example.Comp
+24 −0 modules/hydrodyn/hd_WaveStMod3/hd_driver.inp
+136 −0 modules/hydrodyn/hd_WaveStMod3/hydrodyn_input.dat
+71 −0 modules/hydrodyn/hd_WaveStMod3/seastate_input.dat
+5 −0 modules/seastate/CaseList.md
+1 −1 modules/seastate/seastate_1/NRELOffshrBsline5MW_OC4DeepCwindSemi_SeaState.dat
+5,008 −0 modules/seastate/seastate_CNW1/seastate.SeaSt.out
+17 −0 modules/seastate/seastate_CNW1/seastate_driver.inp
+72 −0 modules/seastate/seastate_CNW1/seastate_input.dat
+5,008 −0 modules/seastate/seastate_CNW2/seastate.SeaSt.out
+17 −0 modules/seastate/seastate_CNW2/seastate_driver.inp
+72 −0 modules/seastate/seastate_CNW2/seastate_input.dat
+77 −0 modules/seastate/seastate_WaveMod7_WaveStMod1/example.Comp
+5,008 −0 modules/seastate/seastate_WaveMod7_WaveStMod1/seastate.SeaSt.out
+17 −0 modules/seastate/seastate_WaveMod7_WaveStMod1/seastate_driver.inp
+81 −0 modules/seastate/seastate_WaveMod7_WaveStMod1/seastate_input.dat
+77 −0 modules/seastate/seastate_WaveMod7_WaveStMod2/example.Comp
+5,008 −0 modules/seastate/seastate_WaveMod7_WaveStMod2/seastate.SeaSt.out
+17 −0 modules/seastate/seastate_WaveMod7_WaveStMod2/seastate_driver.inp
+81 −0 modules/seastate/seastate_WaveMod7_WaveStMod2/seastate_input.dat
+77 −0 modules/seastate/seastate_WaveMod7_WaveStMod3/example.Comp
+5,008 −0 modules/seastate/seastate_WaveMod7_WaveStMod3/seastate.SeaSt.out
+17 −0 modules/seastate/seastate_WaveMod7_WaveStMod3/seastate_driver.inp
+81 −0 modules/seastate/seastate_WaveMod7_WaveStMod3/seastate_input.dat
+1 −1 modules/seastate/seastate_wavemod5/NRELOffshrBsline5MW_OC4DeepCwindSemi_SeaState_WaveMod5.dat
+1 −1 modules/seastate/seastate_wr_kin1/NRELOffshrBsline5MW_OC4DeepCwindSemi_SeaState_WriteKin.dat