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
Open
Show file tree
Hide file tree
Changes from 81 commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
b48133b
added new separation constraint
ArshSaja Jun 7, 2022
b930796
changes
ArshSaja Jun 8, 2022
ca5676b
new changes
ArshSaja Jun 8, 2022
ef11f9a
found the issue and meed to be fixed
ArshSaja Jun 8, 2022
0275e36
fixing
ArshSaja Jun 8, 2022
1db5cde
fixed output mode
ArshSaja Jun 9, 2022
4b9fa06
Fixed the unit vectors
ArshSaja Jun 9, 2022
f0e3d71
adding slices
ArshSaja Sep 21, 2022
89c72ee
Merge branch 'sepconstrnew' of github.com:ArshSaja/adflow into sepcon…
ArshSaja Sep 21, 2022
18bad41
adding slices corrections
ArshSaja Sep 21, 2022
a03b058
updated the addslices option
ArshSaja Sep 29, 2022
523afd1
Fixed the merge conflicts and updated adjoints
ArshSaja Oct 17, 2022
105a716
Setting default options
ArshSaja Oct 17, 2022
bd0af07
merge fix
ArshSaja Oct 17, 2022
0c70701
mulit US mesh for mphys wrapper
ArshSaja Oct 18, 2022
0f845cf
Merge branch 'sepconstrnew_cp' of github.com:ArshSaja/adflow into sep…
ArshSaja Oct 18, 2022
47233a3
Several fixes and adding test function
ArshSaja Oct 18, 2022
0547d47
Test for separation
ArshSaja Oct 18, 2022
3b868ea
multi US mesh option in mphys
ArshSaja Oct 18, 2022
2efdf90
doc update and slight tol adjustment for new test
ArshSaja Oct 18, 2022
7967bb9
test update
ArshSaja Oct 18, 2022
509a738
update aoa in ap
ArshSaja Oct 18, 2022
1e94bbe
update in ap
ArshSaja Oct 18, 2022
6f76399
jason file update
ArshSaja Oct 18, 2022
087c976
test function fixes
ArshSaja Oct 19, 2022
d8d1cff
flake8 and black
ArshSaja Oct 19, 2022
8c6d62e
fixing conflicts
ArshSaja Jan 4, 2023
f4156b6
fixed the test option for new changes
ArshSaja Jan 4, 2023
4f001ca
minnor fix
ArshSaja Jan 4, 2023
598041c
fixing conflicts
ArshSaja Mar 14, 2023
b745855
commiting fprettify changes
ArshSaja Mar 14, 2023
796e106
fixing merge conflicts
ArshSaja Mar 14, 2023
17626fb
Merge branch 'mdolab:main' into sepconstrnew_cp
ArshSaja Mar 14, 2023
6803a7e
fixing flake errors
ArshSaja Mar 14, 2023
d3ef851
Merge branch 'mdolab:main' into sepconstrnew_cp
ArshSaja May 22, 2023
e7c83b5
minor Fixes and tests function
ArshSaja May 22, 2023
8534e68
Merge branch 'sepconstrnew_cp' of github.com:ArshSaja/adflow into sep…
ArshSaja May 22, 2023
ca95d3e
tapenade files
ArshSaja May 22, 2023
aac508a
style fixes and tolerance update
ArshSaja May 23, 2023
a5263cf
Merge branch 'mdolab:main' into sepconstrnew_cp
ArshSaja May 23, 2023
fa38741
style fixes
ArshSaja May 23, 2023
6083b9f
fprettify fixes
ArshSaja May 23, 2023
efd6e88
option
ArshSaja May 23, 2023
f4d9143
Merge branch 'main' into sepconstrnew_cp
gawng May 24, 2023
28f0a80
complex test
ArshSaja May 24, 2023
b5fb379
Merge branch 'sepconstrnew_cp' of github.com:ArshSaja/adflow into sep…
ArshSaja May 24, 2023
a031566
changing variable names
ArshSaja May 24, 2023
b15e6ef
fprettify cahnge
ArshSaja May 24, 2023
0f321cc
error fix
ArshSaja May 24, 2023
eedd90e
tolerance update
ArshSaja May 24, 2023
e03f5d9
tolerance update
ArshSaja May 24, 2023
536ac7e
removing multi US mesh
ArshSaja Jun 26, 2023
eb200d2
merging main into branch
ArshSaja Jun 27, 2023
46d6fae
adding KS aggregation for separation
ArshSaja Feb 7, 2024
793be68
merging conflicts
ArshSaja Feb 7, 2024
92f3019
Tapenade changes
ArshSaja Feb 7, 2024
edaf203
KS function for separation sensor
ArshSaja Feb 7, 2024
e68d96a
setting max sepsensor to 1
ArshSaja Feb 8, 2024
1730783
separation test update
ArshSaja Feb 8, 2024
5de0dcf
separation test fixes
ArshSaja Feb 8, 2024
fa800e4
separation test fixed
ArshSaja Feb 9, 2024
5c57495
fprettify and black
ArshSaja Feb 9, 2024
0e3cb76
all tests passed
ArshSaja Feb 9, 2024
7ce61ae
black for test_separation
ArshSaja Feb 9, 2024
3aa33d0
black for test_separation
ArshSaja Feb 9, 2024
6631194
surfvec_ks option ins docs
ArshSaja Feb 9, 2024
a40b949
docs option updated and tapenade runs
ArshSaja Feb 9, 2024
45d70fa
docs option updated
ArshSaja Feb 9, 2024
2e82c05
docs option updated
ArshSaja Feb 9, 2024
0a0ba4f
docs option updated
ArshSaja Feb 12, 2024
cd72f4e
default option to surfvec
ArshSaja Feb 15, 2024
bc6fae1
minor comment edits on surfaceintegration
ArshSaja Feb 15, 2024
0727921
set surfvec to default
ArshSaja Feb 15, 2024
54bb2bf
docs update
ArshSaja Feb 15, 2024
067e6e1
option update
ArshSaja Feb 15, 2024
c7dc2eb
Merge branch 'main' into sepconstrnew_cp
ArshSaja Feb 27, 2024
d207556
addessing coments
ArshSaja Feb 29, 2024
941453b
running black
ArshSaja Feb 29, 2024
a1d1196
docs change
ArshSaja Feb 29, 2024
3332dc8
addressing comments
ArshSaja Mar 1, 2024
43e22ce
Merge branch 'main' into sepconstrnew_cp
ArshSaja Mar 1, 2024
d694c11
Merge branch 'mdolab:main' into sepconstrnew_cp
ArshSaja Apr 26, 2024
5537040
allowing some deflections in separation sensor and reformulating the …
ArshSaja Apr 30, 2024
e8a1652
fprettify and docs update
ArshSaja Apr 30, 2024
9920bb6
minor fixes
ArshSaja Apr 30, 2024
65a05ba
removing schur post group changes
ArshSaja Apr 30, 2024
94d01d8
setting the deviation angle to be at the verge of Sep
ArshSaja May 13, 2024
572c5fd
Merge branch 'main' into sepconstrnew_cp
ArshSaja May 14, 2024
60e312b
adding area separated sensor
ArshSaja May 30, 2024
b2fc0e0
Merge branch 'sepconstrnew_cp' of github.com:ArshSaja/adflow into sep…
ArshSaja May 30, 2024
5dac06d
adding area separated sensor tests
ArshSaja May 30, 2024
afb5bfd
adding area separated sensor tests
ArshSaja May 30, 2024
be47be2
setting tolerance
ArshSaja May 31, 2024
d3b1ce7
deriv fix and sensor linear
ArshSaja May 31, 2024
84dc3cb
fixing the normalization
ArshSaja Sep 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions adflow/pyADflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -5766,8 +5766,11 @@ def _getDefaultOptions():
"verifySpatial": [bool, True],
"verifyExtra": [bool, True],
# Function parmeters
"sepSensorModel": [str, ["heaviside", "surfvec", "surfvec_ks"]],
"sepSensorMaxRho": [float, 1000.0],
"sepSensorOffset": [float, 0.0],
"sepSensorSharpness": [float, 10.0],
"sepSweepAngleCorrection": [float, 0.0],
"cavSensorOffset": [float, 0.0],
"cavSensorSharpness": [float, 10.0],
"cavExponent": [int, 0],
Expand Down Expand Up @@ -6181,8 +6184,16 @@ def _getOptionMap(self):
"verifyextra": ["adjoint", "verifyextra"],
"usematrixfreedrdw": ["adjoint", "usematrixfreedrdw"],
# Parameters for functions
"sepsensormodel": {
"heaviside": self.adflow.constants.heaviside,
"surfvec": self.adflow.constants.surfvec,
"surfvec_ks": self.adflow.constants.surfvec_ks,
"location": ["cost", "sepmodel"],
},
"sepsensormaxrho": ["physics", "sepsenmax_rho"],
"sepsensoroffset": ["cost", "sepsensoroffset"],
"sepsensorsharpness": ["cost", "sepsensorsharpness"],
"sepsweepanglecorrection": ["cost", "sepsweepanglecorrection"],
"cavsensoroffset": ["cost", "cavsensoroffset"],
"cavsensorsharpness": ["cost", "cavsensorsharpness"],
"cavexponent": ["cost", "cavexponent"],
Expand Down
30 changes: 28 additions & 2 deletions doc/options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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".

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.

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?

We project the freestream over the desired surface and compute the desired flow direction based on the sweep angle of the wing (``sepSweepAngleCorrection``) in 3D cases (For airfoils, the desired direction would be the projected freestream vector over the airfoil surface).
Then we compute the deviation between the local flow velocity and this desired direction. We use a separation metric to integrate this computation over the desired surface.
``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."


sepSensorMaxRho:
desc: >
The rho parameter used for the KS aggregation used for computing maximum separation sensor value in ``surfvec_ks`` model in ``sepSensorModel``.
KS aggregation is used to compute the differentiable max separation sensor within the given family group.
A higher rho value will approach the actual max separation sensor value more accurately, at the cost of a more nonlinear function.

sepSensorOffset:
desc: >
The offset value used for the separation sensor.
The offset value used for the separation sensor in ``heaviside`` model in ``sepSensorModel``.
See "Buffet-Onset Constraint Formulation for Aerodynamic Shape Optimization" (Kenway2017b) for more details.

sepSensorSharpness:
desc: >
The sharpness parameter for the separation sensor.
The sharpness parameter for the separation sensor ``heaviside`` model in ``sepSensorModel``.
See "Buffet-Onset Constraint Formulation for Aerodynamic Shape Optimization" (Kenway2017b) for more details.

sepSweepAngleCorrection:
ArshSaja marked this conversation as resolved.
Show resolved Hide resolved
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.

This angle (in degrees) is for 3D cases only when the wing has a sweep.
For airfoils, by default, this is ``0``.
For a 3D case, the sweep angle of the wing (25% chord sweep angle) is recommended.
It represents the desired flow direction over the surface, which is normal to quarter chord line.

computeCavitation:
desc: >
Whether or not to compute cavitation related cost functions, which are `cavitation` and `cpMin`.
Expand Down
Loading