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

CalculateUACoeffs fails when iLow2 == iHigh2 #2447

Open
deslaughter opened this issue Oct 4, 2024 · 2 comments · Fixed by #2456
Open

CalculateUACoeffs fails when iLow2 == iHigh2 #2447

deslaughter opened this issue Oct 4, 2024 · 2 comments · Fixed by #2456
Milestone

Comments

@deslaughter
Copy link
Contributor

Bug description

The CalculateUACoefficients subroutine was modified in 030500e and the subroutine Calculate_C_alpha was added. Under some circumstances, the indices determined in this subroutine, iLow2 and iHigh2, are set to the same value. This seems to occur if min(Cd) is not close to alpha = 0. The logic used to determine alphaLower and alphaUpper results in a single point being passed to Calculate_C_alpha which requires at least two points to be provided to perform a linear curve fit. In Debug mode this results in a bounds access error in Calculate_C_alpha. In Release mode, no warning is produced though I'm not sure how the curve fit is successful.

To Reproduce

Steps to reproduce the behavior:

  1. Compile the dev branch in Debug
  2. Run any of the following regression tests:
  • AWT_YFix_WSt
  • AWT_WSt_StartUp_HighSpShutDown
  • AWT_YFree_WTurb
  • UAE_Dnwind_YRamp_WSt
  • WP_VSP_WTurb_PitchFail
  • SWRT_YFree_VS_EDG01
  1. Program exits with the array bound mismatch error shown below

Expected behavior

Simulation runs to completion.

Screenshots, if applicable

This is the backtrace produced by gfortran

Output:
----------------------------------------------------------
At line 1187 of file /projects/openfast.worktrees/dev/modules/aerodyn/src/AirfoilInfo.f90
Fortran runtime error: Array bound mismatch for dimension 1 of array 'b' (2/1)

Error termination. Backtrace:
#0  0xffffaec9d08b in ???
#1  0xffffaec9ddb3 in ???
#2  0xffffaec9e2e7 in ???
#3  0xaaaae177686f in calculate_c_alpha
	at /projects/openfast.worktrees/dev/modules/aerodyn/src/AirfoilInfo.f90:1187
#4  0xaaaae177d3b3 in calculateuacoeffs
	at /projects/openfast.worktrees/dev/modules/aerodyn/src/AirfoilInfo.f90:1065
#5  0xaaaae178aa6b in readaffile
	at /projects/openfast.worktrees/dev/modules/aerodyn/src/AirfoilInfo.f90:757
#6  0xaaaae178c4f7 in __airfoilinfo_MOD_afi_init
	at /projects/openfast.worktrees/dev/modules/aerodyn/src/AirfoilInfo.f90:146
#7  0xaaaae0f32c07 in init_afiparams
	at /projects/openfast.worktrees/dev/modules/aerodyn/src/AeroDyn.f90:4376
#8  0xaaaae1038193 in __aerodyn_MOD_ad_init
	at /projects/openfast.worktrees/dev/modules/aerodyn/src/AeroDyn.f90:380
#9  0xaaaadff5f6a7 in __fast_subs_MOD_fast_initializeall
	at /projects/openfast.worktrees/dev/modules/openfast-library/src/FAST_Subs.f90:769
#10  0xaaaadffc0bb3 in __fast_subs_MOD_fast_initializeall_t
	at /projects/openfast.worktrees/dev/modules/openfast-library/src/FAST_Subs.f90:66
#11  0xaaaadfe6d33f in fast
	at /projects/openfast.worktrees/dev/glue-codes/openfast/src/FAST_Prog.f90:97
#12  0xaaaadfe6e237 in main
	at /projects/openfast.worktrees/dev/glue-codes/openfast/src/FAST_Prog.f90:34
/projects/openfast.worktrees/dev/build/glue-codes/openfast/openfast /projects/openfast.worktrees/dev/build/reg_tests/glue-codes/openfast/AWT_YFix_WSt/AWT_YFix_WSt.fst  > /projects/openfast.worktrees/dev/build/reg_tests/glue-codes/openfast/AWT_YFix_WSt/AWT_YFix_WSt.log
COMPLETE with code 2
<end of output>

OpenFAST Version

dev branch commit 853ba8c

 **************************************************************************************************
 OpenFAST

 Copyright (C) 2024 National Renewable Energy Laboratory
 Copyright (C) 2024 Envision Energy USA LTD

 This program is licensed under Apache License Version 2.0 and comes with ABSOLUTELY NO WARRANTY.
 See the "LICENSE" file distributed with this software for details.
 **************************************************************************************************

 OpenFAST-dev
 Compile Info:
  - Compiler: GCC version 11.4.0
  - Architecture: 64 bit
  - Precision: double
  - OpenMP: No
  - Date: Oct  4 2024
  - Time: 20:10:17
 Execution Info:
  - Date: 10/04/2024
  - Time: 20:18:07+0000

System Information (please complete the following information):

  • OS: Ubuntu 22.04
  • Compiler: gfortran 11.4.0
  • Compiler settings: -DCMAKE_BUILD_TYPE=Debug

Additional context

@deslaughter deslaughter added this to the v4.0.0 milestone Oct 4, 2024
@deslaughter
Copy link
Contributor Author

@bjonkman do you have any insights?

@bjonkman
Copy link
Contributor

bjonkman commented Oct 8, 2024

Yes, we should add some logic to check that there are at least 2 points sent to this routine.

I think some of this problem comes from the airfoils having a fairly coarse discretization in the -20 to 20 degree range. Our assumption that there are sufficient points in that range may not be valid.

The file that is causing issues in the AWT model looks like this:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants