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

Update of PR 391 regression tests #405

Merged
merged 5 commits into from
Mar 27, 2020
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
30 changes: 3 additions & 27 deletions .github/actions/compile-and-test/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,9 @@

FROM rafmudaf/openfast-ubuntu:dev

# Move into the openfast directory and update
# Move into the openfast directory
WORKDIR /openfast
RUN git fetch origin ${GITHUB_REF}:CI
RUN git checkout CI
RUN git submodule update

# 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
COPY entrypoint.sh /entrypoint.sh

# Run the tests

# NWTC Library tests
RUN ctest -VV -R nwtc_library_utest

# BeamDyn-specific tests
RUN ctest -VV -j7 -R bd_
RUN ctest -VV -R beamdyn_utest

# OpenFAST linearization tests
# 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
## - 9, 16 because they're very sensitive
## - 19, 20 because theyre too long
## - 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
ENTRYPOINT ["/entrypoint.sh"]
38 changes: 38 additions & 0 deletions .github/actions/compile-and-test/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

git fetch origin ${GITHUB_REF}:CI
git checkout CI
git submodule update

# Print the current git info
echo `git status`
echo `git log -1`
cd /openfast/reg_tests/r-test
echo `git status`
echo `git log -1`
cd /openfast

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

# Run the tests

# NWTC Library tests
ctest -VV -R nwtc_library_utest

# BeamDyn-specific tests
ctest -VV -j7 -R bd_
ctest -VV -R beamdyn_utest

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

# Subset of OpenFAST regression tests; do not run
## - 9, 16 because they're very sensitive
## - 19, 20 because theyre too long
## - 17, 22, 23 becuase we dont know why they fail :(
ctest -VV -j8 -I 1,1,1,2,3,4,5,6,7,8,10,11,12,13,14,15,18,21,24,25
84 changes: 33 additions & 51 deletions modules/elastodyn/src/ElastoDyn.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1331,11 +1331,6 @@ SUBROUTINE ED_CalcOutput( t, u, p, x, xd, z, OtherState, y, m, ErrStat, ErrMsg )
y%BladeLn2Mesh(K)%Orientation(2,3,NodeNum) = m%CoordSys%te2(K,J2,2)
y%BladeLn2Mesh(K)%Orientation(3,3,NodeNum) = m%CoordSys%te3(K,J2,2)

! Translational Acceleration (for water-power request for added mass calculations)
y%BladeLn2Mesh(K)%TranslationAcc(1,NodeNum) = LinAccES(1,J2,K)
y%BladeLn2Mesh(K)%TranslationAcc(2,NodeNum) = -1.*LinAccES(3,J2,K)
y%BladeLn2Mesh(K)%TranslationAcc(3,NodeNum) = LinAccES(2,J2,K)

else
! Translational Displacement (first calculate absolute position)
y%BladeLn2Mesh(K)%TranslationDisp(1,NodeNum) = m%RtHS%rS (1,K,J2) ! = the distance from the undeflected tower centerline to the current blade node in the xi ( z1) direction
Expand All @@ -1357,12 +1352,22 @@ SUBROUTINE ED_CalcOutput( t, u, p, x, xd, z, OtherState, y, m, ErrStat, ErrMsg )
! Translational Displacement (get displacement, not absolute position):
y%BladeLn2Mesh(K)%TranslationDisp(:,NodeNum) = y%BladeLn2Mesh(K)%TranslationDisp(:,NodeNum) - y%BladeLn2Mesh(K)%Position(:,NodeNum)


! Translational Velocity
y%BladeLn2Mesh(K)%TranslationVel(1,NodeNum) = m%RtHS%LinVelES(1,J2,K)
y%BladeLn2Mesh(K)%TranslationVel(2,NodeNum) = -1.*m%RtHS%LinVelES(3,J2,K)
y%BladeLn2Mesh(K)%TranslationVel(3,NodeNum) = m%RtHS%LinVelES(2,J2,K)


! Rotational Velocity
y%BladeLn2Mesh(K)%RotationVel(1,NodeNum) = m%RtHS%AngVelEM(1,J2,K)
y%BladeLn2Mesh(K)%RotationVel(2,NodeNum) = -1.*m%RtHS%AngVelEM(3,J2,K)
y%BladeLn2Mesh(K)%RotationVel(3,NodeNum) = m%RtHS%AngVelEM(2,J2,K)

! Translational Acceleration
y%BladeLn2Mesh(K)%TranslationAcc(1,NodeNum) = LinAccES(1,J2,K)
y%BladeLn2Mesh(K)%TranslationAcc(2,NodeNum) = -1.*LinAccES(3,J2,K)
y%BladeLn2Mesh(K)%TranslationAcc(3,NodeNum) = LinAccES(2,J2,K)


END DO !J = 1,p%BldNodes ! Loop through the blade nodes / elements

END DO !K = 1,p%NumBl
Expand Down Expand Up @@ -2969,7 +2974,7 @@ SUBROUTINE Alloc_RtHS( RtHS, p, ErrStat, ErrMsg )
ErrMsg = ' Error allocating memory for the PAngVelEL array.'
RETURN
ENDIF
ALLOCATE ( RtHS%PAngVelEM(p%NumBl,p%TipNode,p%NDOF,0:1,Dims) , STAT=ErrStat )
ALLOCATE ( RtHS%PAngVelEM(p%NumBl,0:p%TipNode,p%NDOF,0:1,Dims) , STAT=ErrStat )
IF ( ErrStat /= 0_IntKi ) THEN
ErrStat = ErrID_Fatal
ErrMsg = ' Error allocating memory for the PAngVelEM array.'
Expand All @@ -2989,10 +2994,11 @@ SUBROUTINE Alloc_RtHS( RtHS, p, ErrStat, ErrMsg )
!CALL AllocAry( RtHS%LinVelET, Dims, p%TwrNodes, 'LinVelET', ErrStat, ErrMsg ); IF ( ErrStat /= ErrID_None ) RETURN

!CALL AllocAry( RtHS%LinVelESm2, p%NumBl, 'LinVelESm2',ErrStat, ErrMsg ); IF ( ErrStat /= ErrID_None ) RETURN ! The m2-component (closest to tip) of LinVelES
ALLOCATE( RtHS%LinVelES( Dims, 0:p%TipNode, p%NumBl ), STAT=ErrStat )
ALLOCATE( RtHS%LinVelES( Dims, 0:p%TipNode, p%NumBl ), &
RtHS%AngVelEM( Dims, 0:p%TipNode, p%NumBl ), STAT=ErrStat )
IF (ErrStat /= 0 ) THEN
ErrStat = ErrID_Fatal
ErrMsg = RoutineName//":Error allocating LinVelES."
ErrMsg = RoutineName//":Error allocating LinVelES and AngVelEM."
RETURN
END IF

Expand Down Expand Up @@ -3094,6 +3100,12 @@ SUBROUTINE Alloc_RtHS( RtHS, p, ErrStat, ErrMsg )
RETURN
ENDIF

ALLOCATE(RtHS%AngPosHM(Dims, p%NumBl, 0:p%TipNode), STAT=ErrStat )
IF ( ErrStat /= 0_IntKi ) THEN
ErrStat = ErrID_Fatal
ErrMsg = ' Error allocating memory for the AngPosHM arrays.'
RETURN
ENDIF

!CALL AllocAry( RtHS%LinAccESt, Dims, p%NumBl, p%TipNode,'LinAccESt', ErrStat, ErrMsg ); IF ( ErrStat /= ErrID_None ) RETURN
!CALL AllocAry( RtHS%LinAccETt, Dims, p%TwrNodes, 'LinAccETt', ErrStat, ErrMsg ); IF ( ErrStat /= ErrID_None ) RETURN
Expand All @@ -3112,7 +3124,6 @@ SUBROUTINE Alloc_RtHS( RtHS, p, ErrStat, ErrMsg )
CALL AllocAry( RtHS%FSAero, Dims, p%NumBl,p%BldNodes,'FSAero', ErrStat, ErrMsg ); IF ( ErrStat /= ErrID_None ) RETURN
CALL AllocAry( RtHS%MMAero, Dims, p%NumBl,p%BldNodes,'MMAero', ErrStat, ErrMsg ); IF ( ErrStat /= ErrID_None ) RETURN
CALL AllocAry( RtHS%FSTipDrag, Dims, p%NumBl, 'FSTipDrag', ErrStat, ErrMsg ); IF ( ErrStat /= ErrID_None ) RETURN
CALL AllocAry( RtHS%AngPosHM, Dims, p%NumBl,p%TipNode, 'AngPosHM', ErrStat, ErrMsg ); IF ( ErrStat /= ErrID_None ) RETURN
CALL AllocAry( RtHS%PFTHydro, Dims, p%TwrNodes, p%NDOF,'PFTHydro', ErrStat, ErrMsg ); IF ( ErrStat /= ErrID_None ) RETURN
CALL AllocAry( RtHS%PMFHydro, Dims, p%TwrNodes, p%NDOF,'PMFHydro', ErrStat, ErrMsg ); IF ( ErrStat /= ErrID_None ) RETURN
CALL AllocAry( RtHS%FTHydrot, Dims, p%TwrNodes, 'FTHydrot', ErrStat, ErrMsg ); IF ( ErrStat /= ErrID_None ) RETURN
Expand Down Expand Up @@ -6768,6 +6779,8 @@ SUBROUTINE CalculateAngularPosVelPAcc( p, x, CoordSys, RtHSdat )
TYPE(ED_RtHndSide), INTENT(INOUT) :: RtHSdat !< data from the RtHndSid module (contains positions to be set)

!Local variables

REAL(ReKi) :: AngVelHM (3) ! Angular velocity of eleMent J of blade K (body M) in the hub (body H).
! REAL(ReKi) :: AngVelEN (3) ! Angular velocity of the nacelle (body N) in the inertia frame (body E for earth).
REAL(ReKi) :: AngAccELt (3) ! Portion of the angular acceleration of the low-speed shaft (body L) in the inertia frame (body E for earth) associated with everything but the QD2T()'s.
INTEGER(IntKi) :: J ! Counter for elements
Expand Down Expand Up @@ -6887,54 +6900,23 @@ SUBROUTINE CalculateAngularPosVelPAcc( p, x, CoordSys, RtHSdat )

DO K = 1,p%NumBl ! Loop through all blades

! Define the partial angular velocities of the tip (body M(p%BldFlexL)) in the inertia frame:
! NOTE: PAngVelEM(K,J,I,D,:) = the Dth-derivative of the partial angular velocity of DOF I for body M of blade K, element J in body E.

RtHSdat%PAngVelEM(K,p%TipNode, :,0,:) = RtHSdat%PAngVelEH(:,0,:)
RtHSdat%PAngVelEM(K,p%TipNode,DOF_BF(K,1),0,:) = - p%TwistedSF(K,2,1,p%TipNode,1)*CoordSys%j1(K,:) &
+ p%TwistedSF(K,1,1,p%TipNode,1)*CoordSys%j2(K,:)
RtHSdat%PAngVelEM(K,p%TipNode,DOF_BF(K,2),0,:) = - p%TwistedSF(K,2,2,p%TipNode,1)*CoordSys%j1(K,:) &
+ p%TwistedSF(K,1,2,p%TipNode,1)*CoordSys%j2(K,:)
RtHSdat%PAngVelEM(K,p%TipNode,DOF_BE(K,1),0,:) = - p%TwistedSF(K,2,3,p%TipNode,1)*CoordSys%j1(K,:) &
+ p%TwistedSF(K,1,3,p%TipNode,1)*CoordSys%j2(K,:)
! AngVelHM(K,p%TipNode ,:) = RtHSdat%AngVelEH + x%QDT(DOF_BF(K,1))*RtHSdat%PAngVelEM(K,p%TipNode,DOF_BF(K,1),0,:) & ! Currently
! + x%QDT(DOF_BF(K,2))*RtHSdat%PAngVelEM(K,p%TipNode,DOF_BF(K,2),0,:) & ! unused
! + x%QDT(DOF_BE(K,1))*RtHSdat%PAngVelEM(K,p%TipNode,DOF_BE(K,1),0,:) ! calculations
RtHSdat%AngPosHM(:,K,p%TipNode) = x%QT (DOF_BF(K,1))*RtHSdat%PAngVelEM(K,p%TipNode,DOF_BF(K,1),0,:) &
+ x%QT (DOF_BF(K,2))*RtHSdat%PAngVelEM(K,p%TipNode,DOF_BF(K,2),0,:) &
+ x%QT (DOF_BE(K,1))*RtHSdat%PAngVelEM(K,p%TipNode,DOF_BE(K,1),0,:)


! Define the 1st derivatives of the partial angular velocities of the tip
! (body M(p%BldFlexL)) in the inertia frame:

! NOTE: These are currently unused by the code, therefore, they need not
! be calculated. Thus, they are currently commented out. If it
! turns out that they are ever needed (i.e., if inertias of the
! blade elements are ever added, etc...) simply uncomment out these
! computations:
! RtHSdat%PAngVelEM(K,p%TipNode, :,1,:) = RtHSdat%PAngVelEH(:,1,:)
! RtHSdat%PAngVelEM(K,p%TipNode,DOF_BF(K,1),1,:) = CROSS_PRODUCT( RtHSdat%AngVelEH, RtHSdat%PAngVelEM(K,p%TipNode,DOF_BF(K,1),0,:) )
! RtHSdat%PAngVelEM(K,p%TipNode,DOF_BF(K,2),1,:) = CROSS_PRODUCT( RtHSdat%AngVelEH, RtHSdat%PAngVelEM(K,p%TipNode,DOF_BF(K,2),0,:) )
! RtHSdat%PAngVelEM(K,p%TipNode,DOF_BE(K,1),1,:) = CROSS_PRODUCT( RtHSdat%AngVelEH, RtHSdat%PAngVelEM(K,p%TipNode,DOF_BE(K,1),0,:) )


DO J = 1,p%BldNodes ! Loop through the blade nodes / elements
DO J = 0,p%TipNode ! Loop through the blade nodes / elements
! Define the partial angular velocities of the current node (body M(RNodes(J))) in the inertia frame:
! NOTE: PAngVelEM(K,J,I,D,:) = the Dth-derivative of the partial angular velocity
! of DOF I for body M of blade K, element J in body E.

RtHSdat%PAngVelEM(K,J, :,0,:) = RtHSdat%PAngVelEH(:,0,:)
RtHSdat%PAngVelEM(K,J,DOF_BF(K,1),0,:) = - p%TwistedSF(K,2,1,J,1)*CoordSys%j1(K,:) &
+ p%TwistedSF(K,1,1,J,1)*CoordSys%j2(K,:)
+ p%TwistedSF(K,1,1,J,1)*CoordSys%j2(K,:)
RtHSdat%PAngVelEM(K,J,DOF_BF(K,2),0,:) = - p%TwistedSF(K,2,2,J,1)*CoordSys%j1(K,:) &
+ p%TwistedSF(K,1,2,J,1)*CoordSys%j2(K,:)
+ p%TwistedSF(K,1,2,J,1)*CoordSys%j2(K,:)
RtHSdat%PAngVelEM(K,J,DOF_BE(K,1),0,:) = - p%TwistedSF(K,2,3,J,1)*CoordSys%j1(K,:) &
+ p%TwistedSF(K,1,3,J,1)*CoordSys%j2(K,:)
! AngVelHM(K,J ,:) = RtHSdat%AngVelEH + x%QDT(DOF_BF(K,1))*RtHSdat%PAngVelEM(K,J,DOF_BF(K,1),0,:) & ! Currently
! + x%QDT(DOF_BF(K,2))*RtHSdat%PAngVelEM(K,J,DOF_BF(K,2),0,:) & ! unused
! + x%QDT(DOF_BE(K,1))*RtHSdat%PAngVelEM(K,J,DOF_BE(K,1),0,:) ! calculations
RtHSdat%AngPosHM(:,K,J ) = x%QT (DOF_BF(K,1))*RtHSdat%PAngVelEM(K,J,DOF_BF(K,1),0,:) &
+ p%TwistedSF(K,1,3,J,1)*CoordSys%j2(K,:)
AngVelHM = RtHSdat%AngVelEH + x%QDT(DOF_BF(K,1))*RtHSdat%PAngVelEM(K,J,DOF_BF(K,1),0,:) &
+ x%QDT(DOF_BF(K,2))*RtHSdat%PAngVelEM(K,J,DOF_BF(K,2),0,:) &
+ x%QDT(DOF_BE(K,1))*RtHSdat%PAngVelEM(K,J,DOF_BE(K,1),0,:)
RtHSdat%AngVelEM(:,J,K ) = RtHSdat%AngVelEH + AngVelHM
RtHSdat%AngPosHM(:,K,J ) = x%QT (DOF_BF(K,1))*RtHSdat%PAngVelEM(K,J,DOF_BF(K,1),0,:) &
+ x%QT (DOF_BF(K,2))*RtHSdat%PAngVelEM(K,J,DOF_BF(K,2),0,:) &
+ x%QT (DOF_BE(K,1))*RtHSdat%PAngVelEM(K,J,DOF_BE(K,1),0,:)

Expand Down
1 change: 1 addition & 0 deletions modules/elastodyn/src/ElastoDyn_Registry.txt
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ typedef ^ ED_RtHndSide ReKi PAngVelEG {:}{:}{:} - - "Partial angular velocity (a
typedef ^ ED_RtHndSide ReKi PAngVelEH {:}{:}{:} - - "Partial angular velocity (and its 1st time derivative) of the hub (body H) in the inertia frame (body E for earth)"
typedef ^ ED_RtHndSide ReKi PAngVelEL {:}{:}{:} - - "Partial angular velocity (and its 1st time derivative) of the low-speed shaft (body L) in the inertia frame (body E for earth)"
typedef ^ ED_RtHndSide ReKi PAngVelEM {:}{:}{:}{:}{:} - - "Partial angular velocity (and its 1st time derivative) of eleMent J of blade K (body M) in the inertia frame (body E for earth)"
typedef ^ ED_RtHndSide ReKi AngVelEM {:}{:}{:} - - "Angular velocity of of eleMent J of blade K (body M) in the inertia frame (body E for earth)"
typedef ^ ED_RtHndSide ReKi PAngVelEN {:}{:}{:} - - "Partial angular velocity (and its 1st time derivative) of the nacelle (body N) in the inertia frame (body E for earth)"
typedef ^ ED_RtHndSide ReKi AngVelEA 3 - - "Angular velocity of the tail (body A) in the inertia frame (body E for earth)"
typedef ^ ED_RtHndSide ReKi PAngVelEB {:}{:}{:} - - "Partial angular velocity (and its 1st time derivative) of the base plate (body B) in the inertia frame (body E for earth)"
Expand Down
Loading