Skip to content

Commit

Permalink
Adding mesh mapping for SF in jacobian calc
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-platt committed Nov 3, 2023
1 parent a2a585c commit 3f42516
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions modules/openfast-library/src/FAST_Solver.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2407,12 +2407,12 @@ SUBROUTINE U_ED_SF_Residual( y_ED2, y_SF2, u_IN, U_Resid)
integer(IntKi) :: j ! Generic counter
TYPE(MeshType), POINTER :: SubstructureMotion
TYPE(MeshType), POINTER :: PlatformMotions
TYPE(MeshType), POINTER :: SubstructureMotion2HD
TYPE(MeshType), POINTER :: SubstructureMotion2SF

! SD cannot be used, so these all point to the same place. Using separate variables so they match with values in the full option 1 solve
PlatformMotions => y_ED2%PlatformPtMesh
SubstructureMotion => y_ED2%PlatformPtMesh
SubstructureMotion2HD => y_ED2%PlatformPtMesh
SubstructureMotion2SF => y_ED2%PlatformPtMesh

! This is only called is there is no flexible substructure model (RIGID substructure)

Expand All @@ -2435,7 +2435,7 @@ SUBROUTINE U_ED_SF_Residual( y_ED2, y_SF2, u_IN, U_Resid)
! we're mapping loads, so we also need the sibling meshes' displacements:
IF ( ALLOCATED(y_SrvD%SStCLoadMesh) ) THEN ! Platform
do j=1,size(y_SrvD%SStCLoadMesh)
IF (y_SrvD%SStCLoadMesh(j)%Committed) THEN
F (y_SrvD%SStCLoadMesh(j)%Committed) THEN
CALL Transfer_Point_to_Point( y_SrvD%SStCLoadMesh(j), MeshMapData%SubstructureLoads_Tmp2, MeshMapData%SStC_P_P_2_SubStructure(j), ErrStat2, ErrMsg2, u_SrvD%SStCMotionMesh(j), SubstructureMotion )
CALL SetErrStat(ErrStat2,ErrMsg2,ErrStat, ErrMsg,RoutineName//':u_ED%PlatformPtMesh' )
MeshMapData%SubstructureLoads_Tmp%Force = MeshMapData%SubstructureLoads_Tmp%Force + MeshMapData%SubstructureLoads_Tmp2%Force
Expand All @@ -2445,10 +2445,22 @@ SUBROUTINE U_ED_SF_Residual( y_ED2, y_SF2, u_IN, U_Resid)
ENDIF
ENDIF


! we use copies of the input meshes (we don't need to update values in the original data structures):

! Need to transfer motions first
CALL Transfer_SubStructureMotion_to_SF( SubStructureMotionMesh2SF, u_SF%SeaFEMMesh, MeshMapData, ErrStat2, ErrMsg2 )
CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )

if ( y_SF2%SeaFEMMesh%Committed ) then

MeshMapData%SubstructureLoads_Tmp%Force = y_SF2%SeaFEMMesh%Force
MeshMapData%SubstructureLoads_Tmp%Moment = y_SF2%SeaFEMMesh%Moment
! we're mapping loads, so we also need the sibling meshes' displacements:
CALL Transfer_Point_to_Point( y_SF%SeaFEMMesh, MeshMapData%SubstructureLoads_Tmp2, MeshMapData%SF_P_2_SubStructure, ErrStat2, ErrMsg2, u_SF%SeaFEMMesh, SubStructureMotionMesh2SF )
CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )

MeshMapData%SubstructureLoads_Tmp%Force = MeshMapData%SubstructureLoads_Tmp%Force + MeshMapData%SubstructureLoads_Tmp2%Force
MeshMapData%SubstructureLoads_Tmp%Moment = MeshMapData%SubstructureLoads_Tmp%Moment + MeshMapData%SubstructureLoads_Tmp2%Moment


end if

Expand Down

0 comments on commit 3f42516

Please sign in to comment.