-
Notifications
You must be signed in to change notification settings - Fork 509
AeroAcoustics code cleanup #2948
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- do not call `stop` on error - check if fatal error occurs before moving on
also use `NumCoords` instead of checking size; size() does not necessarily work on unallocated arrays on some compilers
Make the inner loop vary fastest for efficiency
switch index 2 and 3 for efficiency
Was taking 3 lines instead of 1, so table started on different line in the file than all other text-based output files.
- output files that have relative names will be put in the directory relative to the primary output (determined by OutFileRoot) - output file can now be specified as "DEFAULT" so that it can use the default OutFileRoot name (with same root as the echo file) - added a check that the NrOutFile is a valid number between 1 and 4, and no longer allocate the AAOutFile array based on that; instead I made it an array of dimension 4, the maximum number of files it can contain. - the AA output files now use the '.AA' nickname instead of '.NN'. For example, echo files will be <RootName>.AD.AA.ech
- remove UnEcho from AA_Init (needed only in the file reading routine) - fix error handling in file read routines - add echo file option to ReadBLTables() - added more checks on data validity before allocating arrays based on sizes from input file data - added check that each Reynolds number in the airfoil BL file contains the same AoA (which is what the code assumes in interpolation scheme) - added check that each airfoil file contains the same Reynolds values if there are more than 1 listed in the file (code used to keep track of Re data from only the last airfoil file).
ITURB, IInflow, ITRIP, ILAM, ITIP, IBLUNT variables had parameters describing the valid cases, but the rest of the code hard-coded values. I changed the code to use the parameters for readability purposes.
interpolation routine assumes this, but it was never checked.
was making large jump near 0.
subroutines -> functions where appropriate
bi-linear interpolation, which will use nearest neighbor above/below AoA values not in the tables (instead of producing fatal error). AlphaNoise is also adjusted to be between [-180,180] before calling the routine, so hopefully that will help somewhat. There may be an issue of jumps if AoA is near +/-180 degrees if the tables aren't set up to handle large AoA.
- removed error handling that wasn't used in a meaningful way - changed some subroutines to functions
…dn't produce errors - removed unnecessary InitOutput variables (delim and version not necessary) - nested some IF statements
- remove unused variables from registry (many discrete states, some parameters) - made some parameters arrays instead of 4 separate variables - moved output arrays to misc vars, since they are duplicates of the WriteOutput* arrays - cleaned up some logic in exiting DO loops early - close output files on end
- moved integer-like discrete state to other state (allregcounter) - removed variables and calculations that weren't used - made observer XYZ locations a 2-dim array instead of 3 separate arrays - condensed duplicate calculations in `CalcAeroAcousticsOutput` - update `LE_Location` on UpdateStates routine instead of reusing old values from CalcOutput - added more documentation on which routines are using rad vs deg for AoA
ptrbortolotti
approved these changes
Aug 7, 2025
Contributor
ptrbortolotti
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will have to try it, but for now thank you for all the cleaning up
andrew-platt
approved these changes
Aug 11, 2025
Collaborator
andrew-platt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for fixing these issues and reorganizing the code!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Feature or improvement description
This PR updates some of the code related to the AeroAcoustics module. It
log10(0)does not occur. I've added a parameter,AA_EPSILONset to 1E-16, to indicate the smallest value allowed in the log equation.AA_OutputToSeparateFilethat can be hardcoded to allow the outputs normally put in 4 separate text files (TRUE) to be sent to AeroDyn's WriteOutput array for output to the main OpenFAST output file (FALSE). It is set to TRUE now<RootName>.AD.AA#.outnaming conventionRelated issue, if one exists
none
Impacted areas of the software
AeroDyn/AeroAcoustics
Additional supporting information
Test results, if applicable
I don't believe that the current r-test framework checks the results of the AA text output files. I am aware of only one aeroacoustics r-test, and its output files are basically unchanged.