Skip to content

Commit

Permalink
Merge remote-tracking branch 'NREL/dev' into f/FloatingLin
Browse files Browse the repository at this point in the history
  • Loading branch information
bjonkman committed Dec 30, 2019
2 parents ee74465 + b6bc63c commit 1829096
Show file tree
Hide file tree
Showing 18 changed files with 521 additions and 182 deletions.
12 changes: 7 additions & 5 deletions .github/actions/compile-and-test/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ RUN git fetch
RUN git pull
RUN git submodule update

# Move into the "build" directory and compile
# Move into the "build" directory, remove the old reg tests, and compile
WORKDIR /openfast/build
RUN rm -rf reg_tests
RUN cmake ..
RUN make -j4 install

Expand All @@ -34,10 +35,11 @@ RUN ctest -VV -j7 -R bd_
RUN ctest -VV -R beamdyn_utest

# OpenFAST linearization tests
RUN ctest -VV -j4 -L linear
# Dont run these in parallel, copying the case files can fail in a race condition
RUN ctest -VV -L linear

# Subset of OpenFAST regression tests; do not run
## - 3, 4, 7, 14, 15, 16, since the free yaw is not well trusted
## - 9 because its super sensitive
## - 9, 16 because they're very sensitive
## - 19, 20 because theyre too long
RUN ctest -VV -j8 -I 1,1,1,2,5,6,8,10,11,12,13,17,18,21,22,23,24,25
## - 17, 22, 23 becuase we dont know why they fail :(
RUN ctest -VV -j8 -I 1,1,1,2,3,4,5,6,7,8,10,11,12,13,14,15,18,21,24,25
1 change: 1 addition & 0 deletions glue-codes/openfast-cpp/src/OpenFAST.H
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ class OpenFAST {
void getForceNodeCoordinates(std::vector<double> & currentCoords, int iNode, int iTurbGlob);
void getForceNodeOrientation(std::vector<double> & currentOrientation, int iNode, int iTurbGlob);
void getForce(std::vector<double> & force, int iNode, int iTurbGlob);
void getRelativeVelForceNode(std::vector<double> & vel, int iNode, int iTurbGlob);
double getChord(int iNode, int iTurbGlob);

int get_ntStart() { return ntStart; }
Expand Down
11 changes: 11 additions & 0 deletions glue-codes/openfast-cpp/src/OpenFAST.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,17 @@ void fast::OpenFAST::getForceNodeOrientation(std::vector<double> & currentOrient

}

void fast::OpenFAST::getRelativeVelForceNode(std::vector<double> & currentVelocity, int iNode, int iTurbGlob) {

// Get relative velocity at current node of current turbine
int iTurbLoc = get_localTurbNo(iTurbGlob);
for(int j=0; j < iTurbLoc; j++) iNode = iNode - get_numForcePtsLoc(iTurbLoc);
currentVelocity[0] = forceNodeVel[iTurbLoc][iNode][0] - cDriver_Input_from_FAST[iTurbLoc].xdotForce[iNode];
currentVelocity[1] = forceNodeVel[iTurbLoc][iNode][1] - cDriver_Input_from_FAST[iTurbLoc].ydotForce[iNode];
currentVelocity[2] = forceNodeVel[iTurbLoc][iNode][2] - cDriver_Input_from_FAST[iTurbLoc].zdotForce[iNode];
}


void fast::OpenFAST::getForce(std::vector<double> & currentForce, int iNode, int iTurbGlob) {

// Set forces at current node of current turbine
Expand Down
6 changes: 4 additions & 2 deletions modules/aerodyn/src/AeroDyn.f90
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ subroutine AD_SetInitOut(p, InputFileData, InitOut, errStat, errMsg)
integer(IntKi) :: NumCoords
#ifdef DBG_OUTS
integer(IntKi) :: m
character(5) ::chanPrefix
character(6) ::chanPrefix
character(3) :: TmpChar
#endif
! Initialize variables for this routine

Expand All @@ -110,7 +111,8 @@ subroutine AD_SetInitOut(p, InputFileData, InitOut, errStat, errMsg)

m = (k-1)*p%NumBlNds*23 + (j-1)*23

chanPrefix = "B"//trim(num2lstr(k))//"N"//trim(num2lstr(j))
WRITE (TmpChar,'(I3.3)') j
chanPrefix = "B"//trim(num2lstr(k))//"N"//TmpChar
InitOut%WriteOutputHdr( m + 1 ) = trim(chanPrefix)//"Twst"
InitOut%WriteOutputUnt( m + 1 ) = ' (deg) '
InitOut%WriteOutputHdr( m + 2 ) = trim(chanPrefix)//"Psi"
Expand Down
2 changes: 1 addition & 1 deletion modules/aerodyn/src/AeroDyn_IO.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2725,7 +2725,7 @@ SUBROUTINE AD_PrintSum( InputFileData, p, u, y, ErrStat, ErrMsg )

WRITE (UnSu,"(15x,A)") 'Blade nodes selected for output: Output node Analysis node'
WRITE (UnSu,"(15x,A)") ' ----------- -------------'
DO I = 1,p%NBlOuts
DO I = 1,size(p%BlOutNd)
WRITE (UnSu,OutPFmt) I, p%BlOutNd(I)
END DO
end if
Expand Down
3 changes: 0 additions & 3 deletions modules/aerodyn/src/AirfoilInfo.f90
Original file line number Diff line number Diff line change
Expand Up @@ -429,9 +429,6 @@ SUBROUTINE ReadAFfile ( AFfile, NumCoefs, InCol_Alfa, InCol_Cl, InCol_Cd, InCol_

! Default to linear interpolation
DefaultInterpOrd = 1
#ifdef SPLINE_INTERP
DefaultInterpOrd = 3
#endif

CALL ParseVarWDefault ( FileInfo, CurLine, 'InterpOrd', p%InterpOrd, DefaultInterpOrd, ErrStat2, ErrMsg2, UnEc )
CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )
Expand Down
3 changes: 3 additions & 0 deletions modules/openfast-library/src/FAST_Library.f90
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,9 @@ subroutine SetOpenFOAM_pointers(iTurb, OpFM_Input_from_FAST, OpFM_Output_to_FAST
OpFM_Input_from_FAST%pxForce_Len = Turbine(iTurb)%OpFM%u%c_obj%pxForce_Len; OpFM_Input_from_FAST%pxForce = Turbine(iTurb)%OpFM%u%c_obj%pxForce
OpFM_Input_from_FAST%pyForce_Len = Turbine(iTurb)%OpFM%u%c_obj%pyForce_Len; OpFM_Input_from_FAST%pyForce = Turbine(iTurb)%OpFM%u%c_obj%pyForce
OpFM_Input_from_FAST%pzForce_Len = Turbine(iTurb)%OpFM%u%c_obj%pzForce_Len; OpFM_Input_from_FAST%pzForce = Turbine(iTurb)%OpFM%u%c_obj%pzForce
OpFM_Input_from_FAST%xdotForce_Len = Turbine(iTurb)%OpFM%u%c_obj%xdotForce_Len; OpFM_Input_from_FAST%xdotForce = Turbine(iTurb)%OpFM%u%c_obj%xdotForce
OpFM_Input_from_FAST%ydotForce_Len = Turbine(iTurb)%OpFM%u%c_obj%ydotForce_Len; OpFM_Input_from_FAST%ydotForce = Turbine(iTurb)%OpFM%u%c_obj%ydotForce
OpFM_Input_from_FAST%zdotForce_Len = Turbine(iTurb)%OpFM%u%c_obj%zdotForce_Len; OpFM_Input_from_FAST%zdotForce = Turbine(iTurb)%OpFM%u%c_obj%zdotForce
OpFM_Input_from_FAST%pOrientation_Len = Turbine(iTurb)%OpFM%u%c_obj%pOrientation_Len; OpFM_Input_from_FAST%pOrientation = Turbine(iTurb)%OpFM%u%c_obj%pOrientation
OpFM_Input_from_FAST%fx_Len = Turbine(iTurb)%OpFM%u%c_obj%fx_Len; OpFM_Input_from_FAST%fx = Turbine(iTurb)%OpFM%u%c_obj%fx
OpFM_Input_from_FAST%fy_Len = Turbine(iTurb)%OpFM%u%c_obj%fy_Len; OpFM_Input_from_FAST%fy = Turbine(iTurb)%OpFM%u%c_obj%fy
Expand Down
11 changes: 10 additions & 1 deletion modules/openfoam/src/OpenFOAM.f90
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ SUBROUTINE Init_OpFM( InitInp, p_FAST, AirDens, u_AD14, u_AD, initOut_AD, y_AD,
CALL AllocPAry( OpFM%u%pxForce, OpFM%p%NnodesForce, 'pxForce', ErrStat2, ErrMsg2 ); CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )
CALL AllocPAry( OpFM%u%pyForce, OpFM%p%NnodesForce, 'pyForce', ErrStat2, ErrMsg2 ); CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )
CALL AllocPAry( OpFM%u%pzForce, OpFM%p%NnodesForce, 'pzForce', ErrStat2, ErrMsg2 ); CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )
CALL AllocPAry( OpFM%u%xdotForce, OpFM%p%NnodesForce, 'xdotForce', ErrStat2, ErrMsg2 ); CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )
CALL AllocPAry( OpFM%u%ydotForce, OpFM%p%NnodesForce, 'ydotForce', ErrStat2, ErrMsg2 ); CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )
CALL AllocPAry( OpFM%u%zdotForce, OpFM%p%NnodesForce, 'zdotForce', ErrStat2, ErrMsg2 ); CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )
CALL AllocPAry( OpFM%u%pOrientation, 3*3*OpFM%p%NnodesForce, 'pOrientation', ErrStat2, ErrMsg2 ); CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )
CALL AllocPAry( OpFM%u%fx, OpFM%p%NnodesForce, 'fx', ErrStat2, ErrMsg2 ); CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )
CALL AllocPAry( OpFM%u%fy, OpFM%p%NnodesForce, 'fy', ErrStat2, ErrMsg2 ); CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )
Expand All @@ -145,6 +148,9 @@ SUBROUTINE Init_OpFM( InitInp, p_FAST, AirDens, u_AD14, u_AD, initOut_AD, y_AD,
OpFM%u%c_obj%pxForce_Len = OpFM%p%NnodesForce; OpFM%u%c_obj%pxForce = C_LOC( OpFM%u%pxForce(1) )
OpFM%u%c_obj%pyForce_Len = OpFM%p%NnodesForce; OpFM%u%c_obj%pyForce = C_LOC( OpFM%u%pyForce(1) )
OpFM%u%c_obj%pzForce_Len = OpFM%p%NnodesForce; OpFM%u%c_obj%pzForce = C_LOC( OpFM%u%pzForce(1) )
OpFM%u%c_obj%xdotForce_Len = OpFM%p%NnodesForce; OpFM%u%c_obj%xdotForce = C_LOC( OpFM%u%xdotForce(1) )
OpFM%u%c_obj%ydotForce_Len = OpFM%p%NnodesForce; OpFM%u%c_obj%ydotForce = C_LOC( OpFM%u%ydotForce(1) )
OpFM%u%c_obj%zdotForce_Len = OpFM%p%NnodesForce; OpFM%u%c_obj%zdotForce = C_LOC( OpFM%u%zdotForce(1) )
OpFM%u%c_obj%pOrientation_Len = OpFM%p%NnodesForce*3*3; OpFM%u%c_obj%pOrientation = C_LOC( OpFM%u%pOrientation(1) )
OpFM%u%c_obj%fx_Len = OpFM%p%NnodesForce; OpFM%u%c_obj%fx = C_LOC( OpFM%u%fx(1) )
OpFM%u%c_obj%fy_Len = OpFM%p%NnodesForce; OpFM%u%c_obj%fy = C_LOC( OpFM%u%fy(1) )
Expand Down Expand Up @@ -391,7 +397,10 @@ SUBROUTINE SetOpFMPositions(p_FAST, u_AD14, u_AD, y_ED, OpFM)
Node = Node + 1
OpFM%u%pxForce(Node) = OpFM%m%ActForceMotionsPoints(k)%Position(1,J) + OpFM%m%ActForceMotionsPoints(k)%TranslationDisp(1,J)
OpFM%u%pyForce(Node) = OpFM%m%ActForceMotionsPoints(k)%Position(2,J) + OpFM%m%ActForceMotionsPoints(k)%TranslationDisp(2,J)
OpFM%u%pzForce(Node) = OpFM%m%ActForceMotionsPoints(k)%Position(3,J) + OpFM%m%ActForceMotionsPoints(k)%TranslationDisp(3,J)
OpFM%u%pzForce(Node) = OpFM%m%ActForceMotionsPoints(k)%Position(3,J) + OpFM%m%ActForceMotionsPoints(k)%TranslationDisp(3,J)
OpFM%u%xdotForce(Node) = OpFM%m%ActForceMotionsPoints(k)%TranslationVel(1,J)
OpFM%u%ydotForce(Node) = OpFM%m%ActForceMotionsPoints(k)%TranslationVel(2,J)
OpFM%u%zdotForce(Node) = OpFM%m%ActForceMotionsPoints(k)%TranslationVel(3,J)
OpFM%u%pOrientation((Node-1)*9 + 1) = OpFM%m%ActForceMotionsPoints(k)%Orientation(1,1,J)
OpFM%u%pOrientation((Node-1)*9 + 2) = OpFM%m%ActForceMotionsPoints(k)%Orientation(2,1,J)
OpFM%u%pOrientation((Node-1)*9 + 3) = OpFM%m%ActForceMotionsPoints(k)%Orientation(3,1,J)
Expand Down
3 changes: 3 additions & 0 deletions modules/openfoam/src/OpenFOAM_Registry.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ typedef ^ InputType ReKi pzVel {:} - - "z position of velocity interface (Aerody
typedef ^ InputType ReKi pxForce {:} - - "x position of actuator force nodes" "m"
typedef ^ InputType ReKi pyForce {:} - - "y position of actuator force nodes" "m"
typedef ^ InputType ReKi pzForce {:} - - "z position of actuator force nodes" "m"
typedef ^ InputType ReKi xdotForce {:} - - "x velocity of actuator force nodes" "m/s"
typedef ^ InputType ReKi ydotForce {:} - - "y velocity of actuator force nodes" "m/s"
typedef ^ InputType ReKi zdotForce {:} - - "z velocity of actuator force nodes" "m/s"
typedef ^ InputType ReKi pOrientation {:} - - "Direction cosine matrix to transform vectors from global frame of reference to actuator force node frame of reference" -
typedef ^ InputType ReKi fx {:} - - "normalized x force at actuator force nodes" "N/kg/m^3"
typedef ^ InputType ReKi fy {:} - - "normalized y force at actuator force nodes" "N/kg/m^3"
Expand Down
Loading

0 comments on commit 1829096

Please sign in to comment.