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

Separation constraint using surface vector projection #238

Open
wants to merge 95 commits into
base: main
Choose a base branch
from

Conversation

ArshSaja
Copy link
Contributor

@ArshSaja ArshSaja commented Oct 18, 2022

Purpose

This PR includes the new separation constraint in ADflow. The previous separation constraint and the new one is available. Each options can be selected through adflow option.

Expected time until merged

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

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

@ArshSaja ArshSaja requested a review from a team as a code owner October 18, 2022 19:24
@codecov
Copy link

codecov bot commented Oct 18, 2022

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 41.07%. Comparing base (5a885c2) to head (84dc3cb).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #238      +/-   ##
==========================================
- Coverage   41.45%   41.07%   -0.39%     
==========================================
  Files          13       13              
  Lines        4069     4119      +50     
==========================================
+ Hits         1687     1692       +5     
- Misses       2382     2427      +45     

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

Copy link
Collaborator

@sseraj sseraj left a comment

Choose a reason for hiding this comment

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

The implementation looks good. I left some minor comments

doc/options.yaml Outdated Show resolved Hide resolved
doc/options.yaml Outdated Show resolved Hide resolved
doc/options.yaml Outdated Show resolved Hide resolved
src/output/outputMod.F90 Outdated Show resolved Hide resolved
src/output/outputMod.F90 Outdated Show resolved Hide resolved
tests/reg_tests/test_separation.py Show resolved Hide resolved
tests/reg_tests/test_separation.py Outdated Show resolved Hide resolved
src/solver/surfaceIntegrations.F90 Outdated Show resolved Hide resolved
src/solver/surfaceIntegrations.F90 Outdated Show resolved Hide resolved
Copy link
Collaborator

@sseraj sseraj left a comment

Choose a reason for hiding this comment

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

Thanks for addressing my comments. I have just a couple more

doc/options.yaml Outdated Show resolved Hide resolved
tests/reg_tests/refs/separation_tests_heaviside.json Outdated Show resolved Hide resolved
@ArshSaja
Copy link
Contributor Author

ArshSaja commented Mar 1, 2024

Thanks for addressing my comments. I have just a couple more

Thanks for the comments @sseraj

@sseraj sseraj changed the title Separation constraint and several minor changes Separation constraint using surface vector projection Mar 1, 2024
sseraj
sseraj previously approved these changes Mar 1, 2024
Copy link
Contributor

@anilyil anilyil left a comment

Choose a reason for hiding this comment

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

I have several detailed comments on the docstrings. Besides that, you should change code variables to use camelcase (e.g. sepsenmax_family should be changed to sepsenmaxFamily throughout).

doc/options.yaml Outdated
sepSensorModel:
desc: >
This option allows to pick 3 separation sensor models.
heaviside: Based on (Kenway2017b)
Copy link
Contributor

Choose a reason for hiding this comment

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

Also briefly explain this method like you explained the other 2 options.

doc/options.yaml Outdated
@@ -1527,16 +1527,42 @@ verifyExtra:
This option is for debugging the adjoint only.
It is used to verify dIda.

sepSensorModel:
desc: >
This option allows to pick 3 separation sensor models.
Copy link
Contributor

Choose a reason for hiding this comment

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

change to "pick one of 3 separation sensor methods".

doc/options.yaml Outdated
``0`` means no separation and ``1`` means that the flow is fully separated.
Although this method is formulated for 3D cases, it is appropriate for airfoils. However, for 3D cases, please use ``surfvec_ks`` option, which has KS aggregation to aggregate the maximum separation sensor value to be constrained. This option will effectively alleviate separation anywhere on the interested surface and provide separation free design. On the other hand, ``surfvec`` option may not guarantee to achieve separation free design when the separation happens in a very smaller region and thus, the integration over this region may not violate the constraint.
surfvec_ks: This method uses similar formulation to ``surfvec`` to compute the maximum separation sensor value on a desired surface instead of integrating over this surface.
Therefore, this maximum separation sensor value from KS aggregation function can be constrained to alleviate separation.
Copy link
Contributor

Choose a reason for hiding this comment

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

change to "... function can be used to constrain separation."

doc/options.yaml Outdated
desc: >
This option allows to pick 3 separation sensor models.
heaviside: Based on (Kenway2017b)
surfvec: Surface vector projection. The separation is based on how much the local flow velocity deviates from the desired flow direction.
Copy link
Contributor

Choose a reason for hiding this comment

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

I have several problems with this explanation. First, the sweep angle is not explained. Why would we want to correct for sweep in the first place?

You say this is formulated for 3d, but applies to airfoils. That makes no sense. If it is only applicable to airfoils say so.

How the value varies from 0 to 1 is not well explained. Again, this is also with how the sweep is defined.

What is a common use case? Do you constrain separation to be below 0.0 or 0.5?

doc/options.yaml Outdated
See "Buffet-Onset Constraint Formulation for Aerodynamic Shape Optimization" (Kenway2017b) for more details.

sepSweepAngleCorrection:
desc: >
This option is only for ``surfvec`` and ``surfvec_ks`` separation models in ``sepSensorModel``.
Copy link
Contributor

Choose a reason for hiding this comment

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

what is the sweep direction? Do you account for fwd or bwd sweep? Do you account for lift direction being y or z?

This explanation needs to be a lot better. Right now it is not clear at all what it is doing.

@ArshSaja
Copy link
Contributor Author

Thanks for the comments @anilyil

@ArshSaja
Copy link
Contributor Author

@sseraj and @anilyil, the new changes are ready for your review.

@ArshSaja ArshSaja requested a review from A-CGray August 26, 2024 17:32
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.

4 participants