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

SA rough #259

Draft
wants to merge 78 commits into
base: main
Choose a base branch
from
Draft

SA rough #259

wants to merge 78 commits into from

Conversation

DavidAnderegg
Copy link
Collaborator

@DavidAnderegg DavidAnderegg commented Jan 30, 2023

Purpose

This extends the SA model for rough walls as described here.

How to use

To activate the rough variant, those ADflow options must be present:

"useRoughSA": True,
"useBlockette": False,

The surface roughness may be prescribed using cgns_utils overwriteBC with the following example bcfile:

4 kLow bcwall le BCDataSet_1 BCWall Dirichlet SandGrainRoughness 1e-3

Alternatively, the ADflow-method setSurfaceRoughness(self, ks, groupName=None) may be used.

Known bugs

The proposed changes work, but two bugs are still present:

  • The effect of the specified surface-roughness is to little compared to SU2:

  • The effect of the specified surface-roughness is to little compared to experiments:

  • The predicted shape of the effect seems correct.

  • The AD-gradients only agree to a relative tolerance of ~1e-8 compared to complex step.

All of this information may be found to more detail in the report i had to write.

Expected time until merged

This depends on the mdo-team. Although there are two bugs, I would argue this feature is already usable. I spent a lot of time trying to find the errors, but i was unsuccessful. My intention is to do something else and later come back and fix it.

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

I used the tutorial wing and roughened its surface. Based on this, I introduced three tests:

  • Add a new instance to test_adjoint.py with the rough wing.
  • Add a new instance to test_functionals.py with the rough wing.
  • Add a new instace to test_functionals.py where the rough SA variant is activated. But the restart and reference files are from the test rans_tut_wing. This makes sure SA rough with a roughness value of 0 is consistent to the regular SA model.

Checklist

  • I have run flake8 and black to make sure the Python code adheres to PEP-8 and is consistently formatted
  • I have formatted the Fortran code with fprettify or C/C++ code with clang-format as applicable
  • I have run unit and regression tests which pass locally with my changes
  • I have added new tests that prove my fix is effective or that my feature works
  • I have added necessary documentation

@codecov
Copy link

codecov bot commented Jan 30, 2023

Codecov Report

Attention: Patch coverage is 31.25000% with 11 lines in your changes are missing coverage. Please review.

Project coverage is 41.28%. Comparing base (de01140) to head (a784190).

❗ Current head a784190 differs from pull request most recent head 156b582. Consider uploading reports for the commit 156b582 to get more accurate results

Files Patch % Lines
adflow/pyADflow.py 31.25% 11 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #259      +/-   ##
==========================================
- Coverage   41.49%   41.28%   -0.21%     
==========================================
  Files          13       13              
  Lines        4066     4021      -45     
==========================================
- Hits         1687     1660      -27     
+ Misses       2379     2361      -18     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

Successfully merging this pull request may close these issues.

None yet

5 participants