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

Updates to AeroDyn #538

Merged
merged 38 commits into from
Nov 9, 2020
Merged

Updates to AeroDyn #538

merged 38 commits into from
Nov 9, 2020

Conversation

bjonkman
Copy link
Contributor

@bjonkman bjonkman commented Aug 29, 2020

Complete this sentence
THIS PULL REQUEST IS NOT READY TO MERGE

Items to address before merging this code:

  • need to check that the cp/cavitation code still works (is there a test for this anywhere?)
  • @andrew-platt and/or @ebranlard should verify that the changes to UA in the FVW module make sense. I changed some logic because the dynamic lift/drag coefficients weren't used after calculating them from UA, but perhaps that was not intended to work that way. (See the email I sent the two of you on 31-Jul-2020.)
  • update the documentation:
    • significant changes to the AeroDyn driver
  • update r-test results

Feature or improvement description

This pull request updates the structure of the AeroDyn module that was required to add new linearizable dynamic stall and dynamic inflow models. In the interest of getting the code changes that affect future pull requests in OpenFAST sooner, the two new models have been disabled until they can be tested and documented further.

Other modifications include:

  • The unsteady aero filtCutOff input value is now specified as a reduced frequency instead of Hz. The default has changed from 20 Hz to 0.5.

  • Added code to turn off BEM if TSR <= 1. When TSR is below 2, it blends the BEM and non-BEM solution so that this is a gradual turning off of BEM. The GeomPhi output channel from the AeroDyn blade nodes indicates how much of the solution is BEM and how much is a geometric (non-BEM) solution.

  • The AeroDyn driver now outputs only 1 file. It also allows a time-series input file.

  • The FrozenWake option should work better. It may have been broken by New Linearization and Mode-Shape Capabilities (and more) #373.

  • The azimuth channel output from AeroDyn now is limited to [0, 360] degrees.

  • Added a DBEMTau1 output channel to AeroDyn, which outputs the tau1 value used in the DBEMT module.

  • Changes to NWTC Library

    • Fixed a fatal issue if that occurred when calling WrOver with more than ConRecL-1 characters.
    • Added a warning if the airfoil files (or any other code that uses the NWTC_Library ParseVar routines) read a variable that is wider than the field where it is stored.
  • Cleaned up the Visual Studio solution files contained in the vs-build directory.

Related issue, if one exists

Impacted areas of the software

AeroDyn, linearization, NWTC Library

Test results, if applicable

Cases that use AeroDyn will see some changes. Those changes should be very minor if unsteady aero is not used and the TSR is larger than 2. Cases that use unsteady aero may see some larger changes due to the slightly different filter that is implemented.

- added omega to UA driver time-series file
- added UAMod=4 (HGM model); linearization is incomplete
- added DBMET_Mod=3 (continuous form of constant tau); linearization is incomplete
- reorganized loops in BEM CalcOutput and UpdateStates for ease of reading/calculations
- NEED TO CHECK the Cp/Cavit stuff!!!
- added C_lalpha parameter to airfoil input file
- NWTC Library: fix fatal issue if ever calling WrOver with more than ConRecL-1 characters
- Allow AeroDyn driver to read time-history file as input
- Many AeroDyn driver (all output is in one file)
added option to blend BEM/non-BEM solution when the TSR is lower than 2. BEM is totally off when TSR is <= 1
Default has changed from 20 Hz to 0.5
NEED TO DOCUMENT THIS!!!!!
- also a couple of additional robustness checks on DBEMT CCSD (alphaE and Tu)
These get inherited from FASTlib, and it seems to be bothering newer version of Visual Studio (trying to link the FAST executable with the Registry executable)
- Add continuous state for UA in FVW
- change not-Fortran2003 `norm2()` to `TwoNorm()`
- change precision in {x|y|z}_hat_disk to 8-byte
- remove iBladeNode and iBlade from FVW%m_UA
- update `UA_UpdateState_Wrapper` to call UA routines with appropriate arguments
- attempt to call UA_UpdateStates and UA_CalcOutput with correct inputs (NEEDS A REVIEW!!!)
- CHANGED dynamic cl, cd, cm when UA is called
- fixed some error handling in `SetOutputsFromFVW`
- removed extra solution files
- modified existing ones with Registry not using Release|Win32 configurations
will need to be updated again soon
The GemoPhi output will be a number between 0 (BEM only) and 1 (no BEM) that indicates if BEM has been turned off due to either no valid value of phi error from the BEM solution or a gradual turning off because TSR is less than 2.
@bjonkman bjonkman changed the title New dynamic stall and dynamic inflow models + other aero modifications Updates to AeroDyn Sep 1, 2020
@ebranlard
Copy link
Contributor

That looks good to me, thanks for that. Right now the UA is not enabled with OLAF (an error is thrown in UA_Init_Wrapper), this is likely why we were overriding the Cl dynamic with the Cl static.

Here's some changes that we will need to do on our side after this merge:

  • add the variables Vx_elast_dot, Vy_elast_dot, omega_z to FVW_inputs and set them in SetInputsForFVW like BEM.
  • Make sure UA_Init_Wrapper perform the same steps as in BEM (should actually be fine). We should extract BEMT_Set_UA_InitData and BEMT_CheckInitUA so that they could be used by both BEM and FVW.
  • Perform UA states integration within UA_UpdateStateWrapper based on several UA input times (see BEMT.f90)
    - Extract SetInput_for_UA into common code or more likely, make our own version of it
    - Make our own version of CalculateInputsAndOtherStatesForUA
  • Check SetOutputsFromFVW so that it uses FVW%m_UA, and maybe it should call our own version of SetInput_for_UA and the dynamic coefficients are used.

@ebranlard ebranlard marked this pull request as ready for review October 26, 2020 21:32
@ebranlard
Copy link
Contributor

I don't see any issue with the cavitation check. It seems that it was not allowed with dynamic stall (AFAeroMod_BL_unsteady), I'm not sure why, but I believe it's fine to keep it that way. I can see that the code of the check (around line 1250 of AeroDyn) has not changed. Let me know if I'm missing something.

I'm not sure why some of the r-test fail. Hopefully the errors are just small numerical changes. Do you know what it could be?

@bjonkman
Copy link
Contributor Author

Thanks for checking the cavitation. I don't have that in my original code base and don't have a test for it, so it's good to have someone else take a look.

I think all of the r-tests with AD (15) are failing. I suspect most of them just have small differences because the loops in the code have been completely reordered, and some calculations are done in a slightly different order. I did see a few 5MW-model tests that had some bigger changes. I attributed those to the different UA filter. Unfortunately, we don't have a good way to visualize the failing tests here.

@ebranlard
Copy link
Contributor

ok, thanks a lot for the clarifications!

@rafmudaf
Copy link
Collaborator

@bjonkman I made a few commits to your branch so that you can now inspect the results of the regression tests from GitHub. If the reg tests fail, the test files including the html-based plots are posted to the GitHub Actions workflow artifacts: https://github.com/bjonkman/openfast/actions/runs/336987286. The html files are in glue-codes/openfast/<case-name>/<case-name>.html.

@rafmudaf
Copy link
Collaborator

One easy way to open all of these at once on a Mac is this bash command:

open `find . -name *.html`

I don't know the cmd prompt form, but I bet you do.

@andrew-platt
Copy link
Collaborator

is there a change in the way the skewed wake is calculated and applied?

From my quick look at the results, I'm seeing some changes in the loads from AD15 in the 5MW models that I'm not entirely certain about. This has the effect of changing the blade pitch a little in response. This can be seen in the root forces in the 5MW_Land_DLL_WTurb model.

@bjonkman
Copy link
Contributor Author

bjonkman commented Nov 2, 2020

I think the differences are a result of the different unsteady aero filter that is now used. I think we need to run this with the UA filter calculated the old way and compare results. For the few models that use AD15 without UA turned on, I don't see differences.

@andrew-platt
Copy link
Collaborator

Setting the filtCutOff to 20 Hz (old default) brings the 5MW models very close to the original, except for the BeamDyn case (there may be other issues triggered there).

The only other case that might be problematic is the SWRT_YFree_VS_EDG01. This shows a relatively large change in the nacelle yaw angle.

Screen Shot 2020-11-02 at 4 08 02 PM

@bjonkman
Copy link
Contributor Author

bjonkman commented Nov 3, 2020

@andrew-platt , I reverted the changes for the new UA filter (i.e., I made these changes: bjonkman@3142b2f), and this is what I get for SWRT_YFree_VS_EDG01/SWRT_YFree_VS_EDG01.html#NacYawP
image

I'll take a look at the results over here when it's finished and make sure that is the same as what I get locally.

@bjonkman
Copy link
Contributor Author

bjonkman commented Nov 3, 2020

Going through all of the manual regression test locally (with the exception of a couple of cases that didn't run because the python script didn't copy the input files and one that ran out of memory), I see only minor numerical differences between this branch using the old UA filter and previous results--including the BeamDyn and SWRT cases @andrew-platt mentioned. So, it is the UA filter that is causing differences.

@bjonkman
Copy link
Contributor Author

bjonkman commented Nov 4, 2020

I was able to look at the artifacts from here: https://github.com/bjonkman/openfast/runs/1349704167 (the code from this PR with the old UA filter put back in).

The most noticeable difference was in the UAE_Upwind_Rigid_WRamp_PwrCurve case:
image

This difference is caused by the TSR dropping below 2. In the new code, BEM starts to turn off when TSR is 2 and is turned off completely when TSR is below 1. Here is a plot of the TSR from that case:
image

I also plotted TSR of another case that had some minor differences, AWT_WSt_StartUp_HighSpShutDown. That one also has the TSR below 2 where those differences occurred.
image
image

@andrew-platt andrew-platt self-requested a review November 4, 2020 16:38
Copy link
Collaborator

@andrew-platt andrew-platt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all looks good to me. I confirmed that any differences in the results were due to the newer UA filter (as seen in rerunning with the old filter), and the change in the default cutoff frequency for the UA filter.

So, I recommend we rerun baselines and merge this.

@rafmudaf rafmudaf merged commit 8272750 into OpenFAST:dev Nov 9, 2020
@1900360
Copy link

1900360 commented Aug 11, 2021

image
I am running fast.farm_x64. exe when the above situation occurred, may I ask how to solve this problem

@jjonkman
Copy link
Collaborator

@1900360 -- It looks like you posted a similar question here: #808; I'll respond there.

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

Successfully merging this pull request may close these issues.

6 participants