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

Allowing number of Morison number to be 0 (see #79) #258

Merged
merged 1 commit into from
Mar 8, 2019
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
8 changes: 6 additions & 2 deletions modules-local/hydrodyn/src/HydroDyn.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1437,8 +1437,12 @@ SUBROUTINE HydroDyn_Init( InitInp, u, p, x, xd, z, OtherState, y, m, Interval, I
m%y_mapped%RemapFlag = .TRUE.

CALL MeshMapCreate( y%Mesh, m%y_mapped, m%HD_MeshMap%HD_P_2_WRP_P, ErrStat2, ErrMsg2 );CALL SetErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,RoutineName)
CALL MeshMapCreate( y%Morison%LumpedMesh, m%y_mapped, m%HD_MeshMap%M_P_2_WRP_P, ErrStat2, ErrMsg2 );CALL SetErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,RoutineName)
CALL MeshMapCreate( y%Morison%DistribMesh, m%y_mapped, m%HD_MeshMap%M_L_2_WRP_P, ErrStat2, ErrMsg2 );CALL SetErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,RoutineName)
IF ( y%Morison%LumpedMesh%Committed ) THEN
CALL MeshMapCreate( y%Morison%LumpedMesh, m%y_mapped, m%HD_MeshMap%M_P_2_WRP_P, ErrStat2, ErrMsg2 );CALL SetErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,RoutineName)
ENDIF
IF ( y%Morison%DistribMesh%Committed ) THEN
CALL MeshMapCreate( y%Morison%DistribMesh, m%y_mapped, m%HD_MeshMap%M_L_2_WRP_P, ErrStat2, ErrMsg2 );CALL SetErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,RoutineName)
ENDIF

IF ( ErrStat >= AbortErrLev ) THEN
CALL CleanUp()
Expand Down
54 changes: 35 additions & 19 deletions modules-local/openfast-library/src/FAST_Solver.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2443,13 +2443,19 @@ SUBROUTINE FullOpt1_InputOutputSolve( this_time, p_FAST, calcJacobian &
! HD motion inputs: (from SD and ED)
IF (p_FAST%CompHydro == Module_HD ) THEN

! Make copies of the accelerations we just solved for (so we don't overwrite them)
MeshMapData%u_HD_M_LumpedMesh%RotationAcc = u_HD%Morison%LumpedMesh%RotationAcc
MeshMapData%u_HD_M_LumpedMesh%TranslationAcc = u_HD%Morison%LumpedMesh%TranslationAcc
MeshMapData%u_HD_M_DistribMesh%RotationAcc = u_HD%Morison%DistribMesh%RotationAcc
MeshMapData%u_HD_M_DistribMesh%TranslationAcc = u_HD%Morison%DistribMesh%TranslationAcc
MeshMapData%u_HD_Mesh%RotationAcc = u_HD%Mesh%RotationAcc
MeshMapData%u_HD_Mesh%TranslationAcc = u_HD%Mesh%TranslationAcc
! Make copies of the accelerations we just solved for (so we don't overwrite them)
IF (MeshMapData%u_HD_M_LumpedMesh%Committed) THEN
MeshMapData%u_HD_M_LumpedMesh%RotationAcc = u_HD%Morison%LumpedMesh%RotationAcc
MeshMapData%u_HD_M_LumpedMesh%TranslationAcc = u_HD%Morison%LumpedMesh%TranslationAcc
ENDIF
IF (MeshMapData%u_HD_M_DistribMesh%Committed) THEN
MeshMapData%u_HD_M_DistribMesh%RotationAcc = u_HD%Morison%DistribMesh%RotationAcc
MeshMapData%u_HD_M_DistribMesh%TranslationAcc = u_HD%Morison%DistribMesh%TranslationAcc
ENDIF
IF (MeshMapData%u_HD_Mesh%Committed) THEN
MeshMapData%u_HD_Mesh%RotationAcc = u_HD%Mesh%RotationAcc
MeshMapData%u_HD_Mesh%TranslationAcc = u_HD%Mesh%TranslationAcc
ENDIF

! transfer the output data to inputs

Expand All @@ -2472,13 +2478,19 @@ SUBROUTINE FullOpt1_InputOutputSolve( this_time, p_FAST, calcJacobian &
END IF


! put the acceleration data (calucluted in this routine) back
u_HD%Morison%LumpedMesh%RotationAcc = MeshMapData%u_HD_M_LumpedMesh%RotationAcc
u_HD%Morison%LumpedMesh%TranslationAcc = MeshMapData%u_HD_M_LumpedMesh%TranslationAcc
u_HD%Morison%DistribMesh%RotationAcc = MeshMapData%u_HD_M_DistribMesh%RotationAcc
u_HD%Morison%DistribMesh%TranslationAcc = MeshMapData%u_HD_M_DistribMesh%TranslationAcc
u_HD%Mesh%RotationAcc = MeshMapData%u_HD_Mesh%RotationAcc
u_HD%Mesh%TranslationAcc = MeshMapData%u_HD_Mesh%TranslationAcc
! put the acceleration data (calucluted in this routine) back
IF (MeshMapData%u_HD_M_LumpedMesh%Committed) THEN
u_HD%Morison%LumpedMesh%RotationAcc = MeshMapData%u_HD_M_LumpedMesh%RotationAcc
u_HD%Morison%LumpedMesh%TranslationAcc = MeshMapData%u_HD_M_LumpedMesh%TranslationAcc
ENDIF
IF (MeshMapData%u_HD_M_DistribMesh%Committed) THEN
u_HD%Morison%DistribMesh%RotationAcc = MeshMapData%u_HD_M_DistribMesh%RotationAcc
u_HD%Morison%DistribMesh%TranslationAcc = MeshMapData%u_HD_M_DistribMesh%TranslationAcc
ENDIF
IF (MeshMapData%u_HD_Mesh%Committed) THEN
u_HD%Mesh%RotationAcc = MeshMapData%u_HD_Mesh%RotationAcc
u_HD%Mesh%TranslationAcc = MeshMapData%u_HD_Mesh%TranslationAcc
ENDIF

!......

Expand Down Expand Up @@ -2771,12 +2783,16 @@ SUBROUTINE U_FullOpt1_Residual( y_ED2, y_SD2, y_HD2, y_BD2, y_Orca2, y_ExtPtfm2,
CALL SetErrStat(ErrStat2,ErrMsg2, ErrStat, ErrMsg, RoutineName)

! These are the motions for the lumped point loads associated viscous drag on the WAMIT body and/or filled/flooded lumped forces of the WAMIT body
CALL Transfer_Point_to_Point( y_ED2%PlatformPtMesh, MeshMapData%u_HD_M_LumpedMesh, MeshMapData%ED_P_2_HD_M_P, ErrStat2, ErrMsg2 )
CALL SetErrStat(ErrStat2,ErrMsg2, ErrStat, ErrMsg, RoutineName)
if (MeshMapData%u_HD_M_LumpedMesh%Committed) then
CALL Transfer_Point_to_Point( y_ED2%PlatformPtMesh, MeshMapData%u_HD_M_LumpedMesh, MeshMapData%ED_P_2_HD_M_P, ErrStat2, ErrMsg2 )
CALL SetErrStat(ErrStat2,ErrMsg2, ErrStat, ErrMsg, RoutineName)
endif

! These are the motions for the line2 (distributed) loads associated viscous drag on the WAMIT body and/or filled/flooded distributed forces of the WAMIT body
CALL Transfer_Point_to_Line2( y_ED2%PlatformPtMesh, MeshMapData%u_HD_M_DistribMesh, MeshMapData%ED_P_2_HD_M_L, ErrStat2, ErrMsg2 )
CALL SetErrStat(ErrStat2,ErrMsg2, ErrStat, ErrMsg, RoutineName)
if (MeshMapData%u_HD_M_DistribMesh%Committed) then
CALL Transfer_Point_to_Line2( y_ED2%PlatformPtMesh, MeshMapData%u_HD_M_DistribMesh, MeshMapData%ED_P_2_HD_M_L, ErrStat2, ErrMsg2 )
CALL SetErrStat(ErrStat2,ErrMsg2, ErrStat, ErrMsg, RoutineName)
endif

!..................
! Get ED loads input (from HD only)
Expand Down Expand Up @@ -4057,7 +4073,7 @@ SUBROUTINE InitModuleMappings(p_FAST, ED, BD, AD14, AD, HD, SD, ExtPtfm, SrvD, M
CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName//':ED_P_2_HD_M_P' )
END IF

! ElastoDyn point mesh to HydroDyn Morison line mesh (ED sets inputs, but gets outputs from HD%y%AllHdroOriginin floating case)
! ElastoDyn point mesh to HydroDyn Morison line mesh (ED sets inputs, but gets outputs from HD%y%AllHdroOrigin in floating case)
IF ( HD%Input(1)%Morison%DistribMesh%Committed ) THEN
CALL MeshMapCreate( ED%Output(1)%PlatformPtMesh, HD%Input(1)%Morison%DistribMesh, MeshMapData%ED_P_2_HD_M_L, ErrStat2, ErrMsg2 )
CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName//':ED_P_2_HD_M_L' )
Expand Down