AeroDyn/UnsteadyAero_Driver: Fix for bug #1346#1347
AeroDyn/UnsteadyAero_Driver: Fix for bug #1346#1347ebranlard merged 4 commits intoOpenFAST:mainfrom RiekeJ:UA_driver_bug
Conversation
…ency model) is used. Un-allocated variables are handed over to subroutines with intent(in), which causes a runtime error.
|
There may be some additional logic required for the |
|
As a side note, we currently don't have r-tests for unsteady aerodynamics. I think it's because it requires a recompile of OpenFAST with |
|
Thank you for doing the changes and fixing this bug! (we indeed use 3 spaces for indentation. As for indenting the comments and the "error checks" 3 extra spaces, that's not my favorite style, but it is present elsewhere in the code and has been adopted by other developers.). |
| u%v_ac(1) = sin(u%alpha)*u%U | ||
| u%v_ac(2) = cos(u%alpha)*u%U | ||
| else | ||
| errStat = -1 |
There was a problem hiding this comment.
ErrStat should be set to ErrID_Fatal here. All of the error handling in OpenFAST assumes that errors are values > 0, and it's best practice to use the error level parameters.
Also, ErrStat and ErrMsg are not initialized in the other branches of the nested IF statement. So, this will result in unpredictable results on some compilers.
| indx = min(n,size(timeArr)) | ||
| indx = max(1, indx) ! use constant data at initialization | ||
| ! check optional variables and allocation status | ||
| if (any( (/ allocated(timeArr),allocated(AOAarr),allocated(OmegaArr),allocated(Uarr) /) )) then |
There was a problem hiding this comment.
Based on the error message below, I think you want to use all() instead of any() here.
|
Hi, We need to add: And further correct: And also: BR, |
|
We have now reverted this pull request. @RiekeJ can you redo your pull request? If possible, chose "dev" as the target branch for your pull request (I didn't notice, but I've merged this pull request into main. I should have spotted that.). |
|
@RiekeJ, our apologies for the mixup on our end with merging. The corrections you posted above look good! |
|
Hi, |
|
@RiekJ, I'm sorry about all the confusion here. We had a mixup on our end with the merge. I recreated the PR using your commit, and added the modifications from your comment above. See #1356 Again, my apologies for the issues on our end. And many thanks for contributing your code improvements! |
|
@andrew-platt no worries. I'm happy, that I could contribute here a tiny bit. Thanks for having OpenFAST, which is really a great tool. |
This pull request fixes a bug in AeroDyn/UnsteadyAero_Driver:
bug #1346: If SimMod==1 (reduced frequency model) is used, non-allocated variables are handed over to subroutines with intent(in), which causes a runtime error.
Feature or improvement description
Fix for bug #1346, added some if clauses and making some arrays 'optional'.
Related issue, if one exists
none
Impacted areas of the software
AeroDyn -> UnsteadyAero_Driver.f90
Additional supporting information
UnsteadyAero_Driver is only used for stand-alone run of a single airfoil unsteady aerodynamics tests.