Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

Fix Viterna extrapolation bug to avoid repeated data #72

Merged
merged 1 commit into from
Oct 20, 2023

Conversation

abhineet-gupta
Copy link
Contributor

Purpose

Fix a small bug in Viterna extrapolation code where if alpha_low == -alpha_high, then the code repeats the data corresponding to alpha_low in the resulting extrapolation. This causes OpenFAST to error out due to duplicate alpha in the airfoil polar files.

Type of change

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which
    adds functionality)
  • Breaking change (non-backwards-compatible fix or feature)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Documentation update
  • Maintenance update
  • Other (please describe)

Testing

Try the Viterna extension with this code (rename code to .py) and with this file in the same folder.

Checklist

  • I have run existing tests which pass locally with my changes
  • I have added new tests or examples that prove my fix is effective or that my feature works
  • I have added necessary documentation

@ebranlard
Copy link
Collaborator

Hi @abhineet-gupta
Thanks for doing that. I'm happy to merge it as it is. If you want to add a test you could add a test here:
https://github.com/OpenFAST/python-toolbox/tree/main/pyFAST/airfoils/tests

For instance adding test_extrapolation.py and adding your airfoil file here:
https://github.com/OpenFAST/python-toolbox/tree/main/pyFAST/airfoils/data

But maybe there is no need to add an additional airfoil file, you could use one already in the repository, or set one up using a sine function (with its argument scaled a bit) or a simple linear function.

Preferably you would add a test to verify that the values of your extrapolated polar are as expected (for instance that the original data is the same and the the extrapolated data at few angles of attack match what you would expect).

Let me know if you have any questions

@ebranlard
Copy link
Collaborator

I'll merge this for now. Please feel free to add tests later on.

@ebranlard ebranlard merged commit 6369b42 into OpenFAST:dev Oct 20, 2023
4 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants