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

BugFix: UA update states that were not updated #932

Merged
merged 9 commits into from
Jul 7, 2022
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
2 changes: 1 addition & 1 deletion .github/actions/tests-module-aerodyn/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ runs:
fi

if [[ ${{ inputs.test-target }} == "regression" ]] || [[ ${{ inputs.test-target }} == "all" ]]; then
ctest -VV -j7 -R ad_
ctest -VV -R ad_ # -j7 do not run these tests in parallel due to a bug in accessing shared files
fi

working-directory: ${{runner.workspace}}/openfast/build
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/automated-dev-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ jobs:
-DCMAKE_Fortran_COMPILER:STRING=${{env.FORTRAN_COMPILER}} \
-DCMAKE_CXX_COMPILER:STRING=${{env.CXX_COMPILER}} \
-DCMAKE_C_COMPILER:STRING=${{env.C_COMPILER}} \
-DCMAKE_BUILD_TYPE:STRING=Debug \
-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \
-DBUILD_OPENFAST_CPP_API:BOOL=ON \
-DBUILD_SHARED_LIBS:BOOL=ON \
-DBUILD_TESTING:BOOL=ON \
Expand Down Expand Up @@ -491,9 +491,10 @@ jobs:
uses: actions/upload-artifact@v2
if: failure()
with:
name: c-interface-reg-tests
name: interface-reg-tests
path: |
${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast-cpp
${{runner.workspace}}/openfast/build/reg_tests/glue-codes/python
${{runner.workspace}}/openfast/build/reg_tests/modules/hydrodyn
${{runner.workspace}}/openfast/build/reg_tests/modules/inflowwind
!${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast-cpp/5MW_Baseline
14 changes: 7 additions & 7 deletions modules/aerodyn/src/UnsteadyAero.f90
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,7 @@ subroutine ComputeKelvinChain( i, j, u, p, xd, OtherState, misc, AFInfo, KC, BL_
real(ReKi) :: q_minus1 !
real(ReKi) :: q_f_minus1
real(ReKi) :: Cn_pot_minus1 !
real(ReKi) :: K3prime_q !
real(ReKi) :: k_mq !
real(ReKi) :: Kprimeprime_q !
real(ReKi) :: dynamicFilterCutoffHz ! find frequency based on reduced frequency of k = BL_p%filtCutOff
real(ReKi) :: LowPassConst

Expand Down Expand Up @@ -512,19 +510,19 @@ subroutine ComputeKelvinChain( i, j, u, p, xd, OtherState, misc, AFInfo, KC, BL_
KC%Cn_q_circ = 0.0_ReKi
end if

K3prime_q = Get_ExpEqn( BL_p%b5*beta_M_Sqrd*KC%ds, 1.0_ReKi, xd%K3prime_q_minus1(i,j), BL_p%A5*(KC%q_f_cur - q_f_minus1), 0.0_ReKi ) ! Eqn 1.26
KC%Cm_q_circ = -BL_p%C_nalpha*(KC%q_f_cur - K3prime_q)*p%c(i,j)/(16.0_ReKi*beta_M*u%U) ! Eqn 1.25
KC%K3prime_q = Get_ExpEqn( BL_p%b5*beta_M_Sqrd*KC%ds, 1.0_ReKi, xd%K3prime_q_minus1(i,j), BL_p%A5*(KC%q_f_cur - q_f_minus1), 0.0_ReKi ) ! Eqn 1.26
KC%Cm_q_circ = -BL_p%C_nalpha*(KC%q_f_cur - KC%K3prime_q)*p%c(i,j)/(16.0_ReKi*beta_M*u%U) ! Eqn 1.25

KC%Cn_pot = KC%Cn_alpha_q_circ + KC%Cn_alpha_q_nc ! Eqn 1.20 [2a]

k_mq = 7.0_ReKi / (15.0_ReKi*(1.0_ReKi-M) + 1.5_ReKi * BL_p%C_nalpha * BL_p%A5 * BL_p%b5 * beta_M * M**2) ! Eqn 1.29 [2] ! CHECK THAT DENOM ISN'T ZERO!
Kprimeprime_q = Get_ExpEqn( real(p%dt,ReKi), k_mq**2*T_I , xd%Kprimeprime_q_minus1(i,j) , KC%Kq_f , Kq_f_minus1 ) ! Eqn 1.29 [3]
KC%Kprimeprime_q = Get_ExpEqn( real(p%dt,ReKi), k_mq**2*T_I , xd%Kprimeprime_q_minus1(i,j) , KC%Kq_f , Kq_f_minus1 ) ! Eqn 1.29 [3]

! Compute Cm_q_nc
if ( p%UAMod == UA_MinnemaPierce ) then
KC%Cm_q_nc = -1.0_ReKi * KC%Cn_q_nc / 4.0_ReKi - (KC%k_alpha**2) * T_I * (KC%Kq_f - Kprimeprime_q) / (3.0_ReKi*M) ! Eqn 1.31
KC%Cm_q_nc = -1.0_ReKi * KC%Cn_q_nc / 4.0_ReKi - (KC%k_alpha**2) * T_I * (KC%Kq_f - KC%Kprimeprime_q) / (3.0_ReKi*M) ! Eqn 1.31
else
KC%Cm_q_nc = -7.0_ReKi * (k_mq**2) * T_I * (KC%Kq_f - Kprimeprime_q) / (12.0_ReKi*M) ! Eqn 1.29 [1]
KC%Cm_q_nc = -7.0_ReKi * (k_mq**2) * T_I * (KC%Kq_f - KC%Kprimeprime_q) / (12.0_ReKi*M) ! Eqn 1.29 [1]
end if

if ( p%UAMod == UA_Gonzalez ) then
Expand Down Expand Up @@ -2074,6 +2072,8 @@ subroutine UA_UpdateDiscOtherState( i, j, u, p, xd, OtherState, AFInfo, m, ErrSt
xd%X4_minus1(i,j) = KC%X4
xd%Kprime_alpha_minus1(i,j) = KC%Kprime_alpha
xd%Kprime_q_minus1(i,j) = KC%Kprime_q
xd%K3prime_q_minus1(i,j) = KC%K3prime_q
xd%Kprimeprime_q_minus1(i,j)= KC%Kprimeprime_q
xd%Dp_minus1(i,j) = KC%Dp
xd%Cn_pot_minus1(i,j) = KC%Cn_pot
xd%Cn_prime_minus1(i,j) = KC%Cn_prime
Expand Down
2 changes: 2 additions & 0 deletions modules/aerodyn/src/UnsteadyAero_Registry.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ typedef ^ UA_KelvinChainType ReKi
typedef ^ UA_KelvinChainType ReKi X4 - - - "" -
typedef ^ UA_KelvinChainType ReKi Kprime_alpha - - - "" -
typedef ^ UA_KelvinChainType ReKi Kprime_q - - - "" -
typedef ^ UA_KelvinChainType ReKi K3prime_q - - - "" -
typedef ^ UA_KelvinChainType ReKi Kprimeprime_q - - - "" -
typedef ^ UA_KelvinChainType ReKi Dp - - - "" -
typedef ^ UA_KelvinChainType ReKi Cn_pot - - - "" -
typedef ^ UA_KelvinChainType ReKi Cc_pot - - - "" -
Expand Down
14 changes: 14 additions & 0 deletions modules/aerodyn/src/UnsteadyAero_Types.f90
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ MODULE UnsteadyAero_Types
REAL(ReKi) :: X4 !< [-]
REAL(ReKi) :: Kprime_alpha !< [-]
REAL(ReKi) :: Kprime_q !< [-]
REAL(ReKi) :: K3prime_q !< [-]
REAL(ReKi) :: Kprimeprime_q !< [-]
REAL(ReKi) :: Dp !< [-]
REAL(ReKi) :: Cn_pot !< [-]
REAL(ReKi) :: Cc_pot !< [-]
Expand Down Expand Up @@ -950,6 +952,8 @@ SUBROUTINE UA_CopyKelvinChainType( SrcKelvinChainTypeData, DstKelvinChainTypeDat
DstKelvinChainTypeData%X4 = SrcKelvinChainTypeData%X4
DstKelvinChainTypeData%Kprime_alpha = SrcKelvinChainTypeData%Kprime_alpha
DstKelvinChainTypeData%Kprime_q = SrcKelvinChainTypeData%Kprime_q
DstKelvinChainTypeData%K3prime_q = SrcKelvinChainTypeData%K3prime_q
DstKelvinChainTypeData%Kprimeprime_q = SrcKelvinChainTypeData%Kprimeprime_q
DstKelvinChainTypeData%Dp = SrcKelvinChainTypeData%Dp
DstKelvinChainTypeData%Cn_pot = SrcKelvinChainTypeData%Cn_pot
DstKelvinChainTypeData%Cc_pot = SrcKelvinChainTypeData%Cc_pot
Expand Down Expand Up @@ -1047,6 +1051,8 @@ SUBROUTINE UA_PackKelvinChainType( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat,
Re_BufSz = Re_BufSz + 1 ! X4
Re_BufSz = Re_BufSz + 1 ! Kprime_alpha
Re_BufSz = Re_BufSz + 1 ! Kprime_q
Re_BufSz = Re_BufSz + 1 ! K3prime_q
Re_BufSz = Re_BufSz + 1 ! Kprimeprime_q
Re_BufSz = Re_BufSz + 1 ! Dp
Re_BufSz = Re_BufSz + 1 ! Cn_pot
Re_BufSz = Re_BufSz + 1 ! Cc_pot
Expand Down Expand Up @@ -1140,6 +1146,10 @@ SUBROUTINE UA_PackKelvinChainType( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat,
Re_Xferred = Re_Xferred + 1
ReKiBuf(Re_Xferred) = InData%Kprime_q
Re_Xferred = Re_Xferred + 1
ReKiBuf(Re_Xferred) = InData%K3prime_q
Re_Xferred = Re_Xferred + 1
ReKiBuf(Re_Xferred) = InData%Kprimeprime_q
Re_Xferred = Re_Xferred + 1
ReKiBuf(Re_Xferred) = InData%Dp
Re_Xferred = Re_Xferred + 1
ReKiBuf(Re_Xferred) = InData%Cn_pot
Expand Down Expand Up @@ -1266,6 +1276,10 @@ SUBROUTINE UA_UnPackKelvinChainType( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrSta
Re_Xferred = Re_Xferred + 1
OutData%Kprime_q = ReKiBuf(Re_Xferred)
Re_Xferred = Re_Xferred + 1
OutData%K3prime_q = ReKiBuf(Re_Xferred)
Re_Xferred = Re_Xferred + 1
OutData%Kprimeprime_q = ReKiBuf(Re_Xferred)
Re_Xferred = Re_Xferred + 1
OutData%Dp = ReKiBuf(Re_Xferred)
Re_Xferred = Re_Xferred + 1
OutData%Cn_pot = ReKiBuf(Re_Xferred)
Expand Down
2 changes: 1 addition & 1 deletion reg_tests/r-test
Submodule r-test updated from fb50bb to 2668c7