Skip to content
Merged
Show file tree
Hide file tree
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: 5 additions & 6 deletions modules/hydrodyn/src/Morison.f90
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ MODULE Morison
USE Waves
USE Morison_Types
USE Morison_Output
USE SeaState_Interp
USE SeaSt_WaveField
! USE HydroDyn_Output_Types
USE NWTC_Library
Expand Down Expand Up @@ -2603,7 +2602,7 @@ SUBROUTINE Morison_CalcOutput( Time, u, p, x, xd, z, OtherState, y, m, errStat,

!===============================================================================================
! Calculate the fluid kinematics at all mesh nodes and store for use in the equations below
CALL WaveField_GetWaveKin( p%WaveField, m%SeaSt_Interp_m, Time, m%DispNodePosHdn, .FALSE., m%nodeInWater, m%WaveElev1, m%WaveElev2, m%WaveElev, m%FDynP, m%FV, m%FA, m%FAMCF, ErrStat2, ErrMsg2 )
CALL WaveField_GetWaveKin( p%WaveField, m%WaveField_m, Time, m%DispNodePosHdn, .FALSE., m%nodeInWater, m%WaveElev1, m%WaveElev2, m%WaveElev, m%FDynP, m%FV, m%FA, m%FAMCF, ErrStat2, ErrMsg2 )
CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )
! Compute fluid velocity relative to the structure
DO j = 1, p%NNodes
Expand Down Expand Up @@ -3037,7 +3036,7 @@ SUBROUTINE Morison_CalcOutput( Time, u, p, x, xd, z, OtherState, y, m, errStat,
! Compute the distributed loads at the point of intersection between the member and the free surface !
!----------------------------------------------------------------------------------------------------!
! Get wave kinematics at the free-surface intersection. Set forceNodeInWater=.TRUE. to guarantee the free-surface intersection is in water.
CALL WaveField_GetNodeWaveKin( p%WaveField, m%SeaSt_Interp_m, Time, FSInt, .TRUE., nodeInWater, WaveElev1, WaveElev2, WaveElev, FDynP, FV, FA, FAMCF, ErrStat2, ErrMsg2 )
CALL WaveField_GetNodeWaveKin( p%WaveField, m%WaveField_m, Time, FSInt, .TRUE., nodeInWater, WaveElev1, WaveElev2, WaveElev, FDynP, FV, FA, FAMCF, ErrStat2, ErrMsg2 )
CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )
FDynPFSInt = REAL(FDynP,ReKi)
FVFSInt = REAL(FV, ReKi)
Expand Down Expand Up @@ -3579,7 +3578,7 @@ SUBROUTINE GetTotalWaveElev( Time, pos, Zeta, ErrStat, ErrMsg )
ErrStat = ErrID_None
ErrMsg = ""

Zeta = WaveField_GetNodeTotalWaveElev( p%WaveField, m%SeaSt_Interp_m, Time, pos, ErrStat2, ErrMsg2 )
Zeta = WaveField_GetNodeTotalWaveElev( p%WaveField, m%WaveField_m, Time, pos, ErrStat2, ErrMsg2 )
CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )

END SUBROUTINE GetTotalWaveElev
Expand All @@ -3597,7 +3596,7 @@ SUBROUTINE GetFreeSurfaceNormal( Time, pos, r, n, ErrStat, ErrMsg)
ErrStat = ErrID_None
ErrMsg = ""

CALL WaveField_GetNodeWaveNormal( p%WaveField, m%SeaSt_Interp_m, Time, pos, r, n, ErrStat2, ErrMsg2 )
CALL WaveField_GetNodeWaveNormal( p%WaveField, m%WaveField_m, Time, pos, r, n, ErrStat2, ErrMsg2 )
CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )

END SUBROUTINE GetFreeSurfaceNormal
Expand Down Expand Up @@ -4212,7 +4211,7 @@ SUBROUTINE Morison_UpdateDiscState( Time, u, p, x, xd, z, OtherState, m, errStat
END IF

! Get fluid velocity at the joint
CALL WaveField_GetNodeWaveVel( p%WaveField, m%SeaSt_Interp_m, Time, pos, .FALSE., nodeInWater, FVTmp, ErrStat2, ErrMsg2 )
CALL WaveField_GetNodeWaveVel( p%WaveField, m%WaveField_m, Time, pos, .FALSE., nodeInWater, FVTmp, ErrStat2, ErrMsg2 )
CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )
FV = REAL(FVTmp, ReKi)
vrel = ( FV - u%Mesh%TranslationVel(:,J) ) * nodeInWater
Expand Down
3 changes: 1 addition & 2 deletions modules/hydrodyn/src/Morison.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# ...... Include files (definitions from NWTC Library) ............................................................................
# make sure that the file name does not have any trailing white spaces!
include Registry_NWTC_Library.txt
usefrom SeaState_Interp.txt
usefrom SeaSt_WaveField.txt
#
#
Expand Down Expand Up @@ -323,7 +322,7 @@ typedef ^ ^ ReKi
typedef ^ ^ ReKi V_rel_n {:} - - "Normal relative flow velocity at joints" m/s
typedef ^ ^ ReKi V_rel_n_HiPass {:} - - "High-pass filtered normal relative flow velocity at joints" m/s
typedef ^ ^ MeshMapType VisMeshMap - - - "Mesh mapping for visualization mesh" -
typedef ^ ^ SeaSt_Interp_MiscVarType SeaSt_Interp_m - - - "misc var information from the SeaState Interpolation module" -
typedef ^ ^ SeaSt_WaveField_MiscVarType WaveField_m - - - "misc var information from the SeaState Interpolation module" -

# ..... Parameters ................................................................................................................
# Define parameters here:
Expand Down
11 changes: 5 additions & 6 deletions modules/hydrodyn/src/Morison_Types.f90
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
!! unpack routines associated with each defined data type. This code is automatically generated by the FAST Registry.
MODULE Morison_Types
!---------------------------------------------------------------------------------------------------------------------------------
USE SeaState_Interp_Types
USE SeaSt_WaveField_Types
USE NWTC_Library
IMPLICIT NONE
Expand Down Expand Up @@ -386,7 +385,7 @@ MODULE Morison_Types
REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: V_rel_n !< Normal relative flow velocity at joints [m/s]
REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: V_rel_n_HiPass !< High-pass filtered normal relative flow velocity at joints [m/s]
TYPE(MeshMapType) :: VisMeshMap !< Mesh mapping for visualization mesh [-]
TYPE(SeaSt_Interp_MiscVarType) :: SeaSt_Interp_m !< misc var information from the SeaState Interpolation module [-]
TYPE(SeaSt_WaveField_MiscVarType) :: WaveField_m !< misc var information from the SeaState Interpolation module [-]
END TYPE Morison_MiscVarType
! =======================
! ========= Morison_ParameterType =======
Expand Down Expand Up @@ -3570,7 +3569,7 @@ subroutine Morison_CopyMisc(SrcMiscData, DstMiscData, CtrlCode, ErrStat, ErrMsg)
call NWTC_Library_CopyMeshMapType(SrcMiscData%VisMeshMap, DstMiscData%VisMeshMap, CtrlCode, ErrStat2, ErrMsg2)
call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
if (ErrStat >= AbortErrLev) return
call SeaSt_Interp_CopyMisc(SrcMiscData%SeaSt_Interp_m, DstMiscData%SeaSt_Interp_m, CtrlCode, ErrStat2, ErrMsg2)
call SeaSt_WaveField_CopyMisc(SrcMiscData%WaveField_m, DstMiscData%WaveField_m, CtrlCode, ErrStat2, ErrMsg2)
call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
if (ErrStat >= AbortErrLev) return
end subroutine
Expand Down Expand Up @@ -3654,7 +3653,7 @@ subroutine Morison_DestroyMisc(MiscData, ErrStat, ErrMsg)
end if
call NWTC_Library_DestroyMeshMapType(MiscData%VisMeshMap, ErrStat2, ErrMsg2)
call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
call SeaSt_Interp_DestroyMisc(MiscData%SeaSt_Interp_m, ErrStat2, ErrMsg2)
call SeaSt_WaveField_DestroyMisc(MiscData%WaveField_m, ErrStat2, ErrMsg2)
call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
end subroutine

Expand Down Expand Up @@ -3694,7 +3693,7 @@ subroutine Morison_PackMisc(RF, Indata)
call RegPackAlloc(RF, InData%V_rel_n)
call RegPackAlloc(RF, InData%V_rel_n_HiPass)
call NWTC_Library_PackMeshMapType(RF, InData%VisMeshMap)
call SeaSt_Interp_PackMisc(RF, InData%SeaSt_Interp_m)
call SeaSt_WaveField_PackMisc(RF, InData%WaveField_m)
if (RegCheckErr(RF, RoutineName)) return
end subroutine

Expand Down Expand Up @@ -3740,7 +3739,7 @@ subroutine Morison_UnPackMisc(RF, OutData)
call RegUnpackAlloc(RF, OutData%V_rel_n); if (RegCheckErr(RF, RoutineName)) return
call RegUnpackAlloc(RF, OutData%V_rel_n_HiPass); if (RegCheckErr(RF, RoutineName)) return
call NWTC_Library_UnpackMeshMapType(RF, OutData%VisMeshMap) ! VisMeshMap
call SeaSt_Interp_UnpackMisc(RF, OutData%SeaSt_Interp_m) ! SeaSt_Interp_m
call SeaSt_WaveField_UnpackMisc(RF, OutData%WaveField_m) ! WaveField_m
end subroutine

subroutine Morison_CopyParam(SrcParamData, DstParamData, CtrlCode, ErrStat, ErrMsg)
Expand Down
9 changes: 5 additions & 4 deletions modules/hydrodyn/src/SS_Excitation.f90
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
!
!**********************************************************************************************************************************
MODULE SS_Excitation
USE SeaState_Interp
USE SS_Excitation_Types
USE SS_Excitation_Types
use SeaSt_WaveField, only: WaveField_GetNodeTotalWaveElev
USE NWTC_Library

IMPLICIT NONE
Expand Down Expand Up @@ -110,8 +110,9 @@ function GetWaveElevation ( time, u_in, t_in, p, m, ErrStat, ErrMsg )
call SS_Exc_Input_ExtrapInterp(u_in, t_in, u_out, time, ErrStat2, ErrMsg2 )
call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)

do iBody = 1, p%NBody
GetWaveElevation(iBody) = SeaSt_Interp_3D( time, u_out%PtfmPos(1:2,iBody), p%WaveField%WaveElev1, p%WaveField%SeaSt_interp_p, m%SeaSt_Interp_m%FirstWarn_Clamp, ErrStat2, ErrMsg2 )
do iBody = 1, p%NBody
!FIXME: this is the total wave elevation. Should it include second order, or should it only include first order?
GetWaveElevation(iBody) = WaveField_GetNodeTotalWaveElev(p%WaveField, m%WaveField_m, time, u_out%PtfmPos(1:2,iBody), ErrStat2, ErrMsg2 )
call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
end do

Expand Down
11 changes: 5 additions & 6 deletions modules/hydrodyn/src/SS_Excitation.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
# (File) Revision #: $Rev$
# URL: $HeadURL$
###################################################################################################################################
usefrom SeaState_Interp.txt
usefrom SeaSt_WaveField.txt

typedef SS_Excitation/SS_Exc InitInputType CHARACTER(1024) InputFile - - - "Name of the input file" -
Expand All @@ -24,14 +23,14 @@ typedef ^ ^ R8Ki
typedef ^ ^ SeaSt_WaveFieldType *WaveField - - - "Pointer to SeaState wave field" -



typedef ^ InitOutputType CHARACTER(10) WriteOutputHdr {:} - - "Header of the output" -
typedef ^ InitOutputType CHARACTER(10) WriteOutputUnt {:} - - "Units of the output" -

typedef ^ ContinuousStateType R8Ki x {:} - - "Continuous States" -

typedef ^ DiscreteStateType SiKi DummyDiscState - - - "" -

# Define constraint states here:
typedef ^ ConstraintStateType SiKi DummyConstrState - - - "" -

Expand All @@ -44,7 +43,7 @@ typedef ^ ^ SS_Exc_ContinuousStateType
# Define any data that are used only for efficiency purposes (these variables are not associated with time):
# e.g. indices for searching in an array, large arrays that are local variables in any routine called multiple times, etc.
typedef ^ MiscVarType INTEGER LastIndWave - 1 - "last used index in the WaveTime array" -
typedef ^ ^ SeaSt_Interp_MiscVarType SeaSt_Interp_m - - - "misc var information from the SeaState Interpolation module" -
typedef ^ ^ SeaSt_WaveField_MiscVarType WaveField_m - - - "misc var information from the SeaState Interpolation module" -


# ..... Parameters .........................
Expand Down
11 changes: 5 additions & 6 deletions modules/hydrodyn/src/SS_Excitation_Types.f90
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
!! unpack routines associated with each defined data type. This code is automatically generated by the FAST Registry.
MODULE SS_Excitation_Types
!---------------------------------------------------------------------------------------------------------------------------------
USE SeaState_Interp_Types
USE SeaSt_WaveField_Types
USE NWTC_Library
IMPLICIT NONE
Expand Down Expand Up @@ -74,7 +73,7 @@ MODULE SS_Excitation_Types
! ========= SS_Exc_MiscVarType =======
TYPE, PUBLIC :: SS_Exc_MiscVarType
INTEGER(IntKi) :: LastIndWave = 1 !< last used index in the WaveTime array [-]
TYPE(SeaSt_Interp_MiscVarType) :: SeaSt_Interp_m !< misc var information from the SeaState Interpolation module [-]
TYPE(SeaSt_WaveField_MiscVarType) :: WaveField_m !< misc var information from the SeaState Interpolation module [-]
END TYPE SS_Exc_MiscVarType
! =======================
! ========= SS_Exc_ParameterType =======
Expand Down Expand Up @@ -495,7 +494,7 @@ subroutine SS_Exc_CopyMisc(SrcMiscData, DstMiscData, CtrlCode, ErrStat, ErrMsg)
ErrStat = ErrID_None
ErrMsg = ''
DstMiscData%LastIndWave = SrcMiscData%LastIndWave
call SeaSt_Interp_CopyMisc(SrcMiscData%SeaSt_Interp_m, DstMiscData%SeaSt_Interp_m, CtrlCode, ErrStat2, ErrMsg2)
call SeaSt_WaveField_CopyMisc(SrcMiscData%WaveField_m, DstMiscData%WaveField_m, CtrlCode, ErrStat2, ErrMsg2)
call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
if (ErrStat >= AbortErrLev) return
end subroutine
Expand All @@ -509,7 +508,7 @@ subroutine SS_Exc_DestroyMisc(MiscData, ErrStat, ErrMsg)
character(*), parameter :: RoutineName = 'SS_Exc_DestroyMisc'
ErrStat = ErrID_None
ErrMsg = ''
call SeaSt_Interp_DestroyMisc(MiscData%SeaSt_Interp_m, ErrStat2, ErrMsg2)
call SeaSt_WaveField_DestroyMisc(MiscData%WaveField_m, ErrStat2, ErrMsg2)
call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
end subroutine

Expand All @@ -519,7 +518,7 @@ subroutine SS_Exc_PackMisc(RF, Indata)
character(*), parameter :: RoutineName = 'SS_Exc_PackMisc'
if (RF%ErrStat >= AbortErrLev) return
call RegPack(RF, InData%LastIndWave)
call SeaSt_Interp_PackMisc(RF, InData%SeaSt_Interp_m)
call SeaSt_WaveField_PackMisc(RF, InData%WaveField_m)
if (RegCheckErr(RF, RoutineName)) return
end subroutine

Expand All @@ -529,7 +528,7 @@ subroutine SS_Exc_UnPackMisc(RF, OutData)
character(*), parameter :: RoutineName = 'SS_Exc_UnPackMisc'
if (RF%ErrStat /= ErrID_None) return
call RegUnpack(RF, OutData%LastIndWave); if (RegCheckErr(RF, RoutineName)) return
call SeaSt_Interp_UnpackMisc(RF, OutData%SeaSt_Interp_m) ! SeaSt_Interp_m
call SeaSt_WaveField_UnpackMisc(RF, OutData%WaveField_m) ! WaveField_m
end subroutine

subroutine SS_Exc_CopyParam(SrcParamData, DstParamData, CtrlCode, ErrStat, ErrMsg)
Expand Down
19 changes: 9 additions & 10 deletions modules/hydrodyn/src/WAMIT.f90
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,10 @@ MODULE WAMIT
USE WAMIT_Types
USE WAMIT_Interp
USE NWTC_Library
! USE Waves_Types
USE Conv_Radiation
USE SS_Radiation
USE SS_Excitation
USE NWTC_FFTPACK
use SeaState_Interp

IMPLICIT NONE

Expand Down Expand Up @@ -976,13 +974,13 @@ SUBROUTINE WAMIT_Init( InitInp, u, p, x, xd, z, OtherState, y, m, Interval, ErrS
END IF

if (p%ExctnDisp > 0 ) then
ALLOCATE ( WaveExctnCGrid(0:p%WaveField%NStepWave2 ,p%WaveField%SeaSt_Interp_p%n(2)*p%WaveField%SeaSt_Interp_p%n(3),6*p%NBody) , STAT=ErrStat2 )
ALLOCATE ( WaveExctnCGrid(0:p%WaveField%NStepWave2 ,p%WaveField%GridParams%n(2)*p%WaveField%GridParams%n(3),6*p%NBody) , STAT=ErrStat2 )
IF ( ErrStat2 /= 0 ) THEN
CALL SetErrStat( ErrID_Fatal, 'Error allocating memory for the WaveExctnC array.', ErrStat, ErrMsg, RoutineName)
CALL Cleanup()
RETURN
END IF
ALLOCATE ( p%WaveExctnGrid (0:p%WaveField%NStepWave,p%WaveField%SeaSt_Interp_p%n(2),p%WaveField%SeaSt_Interp_p%n(3), 6*p%NBody) , STAT=ErrStat2 )
ALLOCATE ( p%WaveExctnGrid (0:p%WaveField%NStepWave,p%WaveField%GridParams%n(2),p%WaveField%GridParams%n(3), 6*p%NBody) , STAT=ErrStat2 )
IF ( ErrStat2 /= 0 ) THEN
CALL SetErrStat( ErrID_Fatal, 'Error allocating memory for the WaveExctn array.', ErrStat, ErrMsg, RoutineName)
CALL Cleanup()
Expand Down Expand Up @@ -1141,7 +1139,7 @@ SUBROUTINE WAMIT_Init( InitInp, u, p, x, xd, z, OtherState, y, m, Interval, ErrS
CALL Cleanup()
RETURN
END IF
do iGrid = 1, p%WaveField%SeaSt_Interp_p%n(2)*p%WaveField%SeaSt_Interp_p%n(3)
do iGrid = 1, p%WaveField%GridParams%n(2)*p%WaveField%GridParams%n(3)
WaveExctnCGrid(I,iGrid,J) = WaveExctnC(I,J) * CMPLX(p%WaveField%WaveElevC(1,I,iGrid), p%WaveField%WaveElevC(2,I,iGrid))
end do
END DO ! J - All wave excitation forces and moments
Expand All @@ -1158,9 +1156,9 @@ SUBROUTINE WAMIT_Init( InitInp, u, p, x, xd, z, OtherState, y, m, Interval, ErrS
END IF

DO J = 1,6*p%NBody ! Loop through all wave excitation forces and moments
do iGrid = 1, p%WaveField%SeaSt_Interp_p%n(2)*p%WaveField%SeaSt_Interp_p%n(3)
iX = mod(iGrid-1, p%WaveField%SeaSt_Interp_p%n(2)) + 1 ! 1st n index is time
iY = (iGrid-1) / p%WaveField%SeaSt_Interp_p%n(2) + 1
do iGrid = 1, p%WaveField%GridParams%n(2)*p%WaveField%GridParams%n(3)
iX = mod(iGrid-1, p%WaveField%GridParams%n(2)) + 1 ! 1st n index is time
iY = (iGrid-1) / p%WaveField%GridParams%n(2) + 1
CALL ApplyFFT_cx ( p%WaveExctnGrid(0:p%WaveField%NStepWave-1,iX,iY,J), WaveExctnCGrid(:,iGrid,J), FFT_Data, ErrStat2 )
CALL SetErrStat( ErrStat2, ' An error occured while applying an FFT to WaveExctnC.', ErrStat, ErrMsg, RoutineName)
IF ( ErrStat >= AbortErrLev) THEN
Expand Down Expand Up @@ -1842,7 +1840,7 @@ SUBROUTINE WAMIT_CalcOutput( Time, u, p, x, xd, z, OtherState, y, m, ErrStat, Er
END IF
iStart = (iBody-1)*6+1
! WaveExctnGrid dimensions are: 1st: wavetime, 2nd: X, 3rd: Y, 4th: Force component for each WAMIT Body
m%F_Waves1(iStart:iStart+5) = SeaSt_Interp_3D_Vec6( Time, bodyPosition, p%WaveExctnGrid(:,:,:,iStart:iStart+5), p%WaveField%SeaSt_interp_p, m%seast_interp_m%FirstWarn_Clamp, ErrStat2, ErrMsg2 )
m%F_Waves1(iStart:iStart+5) = WAMIT_ForceWaves_Interp( Time, bodyPosition, p%WaveExctnGrid(:,:,:,iStart:iStart+5), p%WaveField%GridParams, m%WaveField_m, ErrStat2, ErrMsg2 )
call SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, 'SeaState_CalcOutput' )
END DO
end if
Expand Down Expand Up @@ -1931,8 +1929,9 @@ SUBROUTINE WAMIT_CalcOutput( Time, u, p, x, xd, z, OtherState, y, m, ErrStat, Er

! Output channels will be dealt with by the HydroDyn module


END SUBROUTINE WAMIT_CalcOutput


!----------------------------------------------------------------------------------------------------------------------------------
!> Tight coupling routine for computing derivatives of continuous states
SUBROUTINE WAMIT_CalcContStateDeriv( Time, u, p, x, xd, z, OtherState, m, dxdt, ErrStat, ErrMsg )
Expand Down
Loading