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 88 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 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
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions adflow/pyADflow.py
Expand Up @@ -5766,8 +5766,11 @@ def _getDefaultOptions():
"verifySpatial": [bool, True],
"verifyExtra": [bool, True],
# Function parmeters
"computeSepSensorKs": [bool, False],
"sepSensorMaxRho": [float, 1000.0],
"sepSensorOffset": [float, 0.0],
"sepSensorSharpness": [float, 10.0],
"sepAngleDeviation": [float, 90.0],
"cavSensorOffset": [float, 0.0],
"cavSensorSharpness": [float, 10.0],
"cavExponent": [int, 0],
Expand Down Expand Up @@ -6181,8 +6184,11 @@ def _getOptionMap(self):
"verifyextra": ["adjoint", "verifyextra"],
"usematrixfreedrdw": ["adjoint", "usematrixfreedrdw"],
# Parameters for functions
"computesepsensorks": ["cost", "computesepsensorks"],
"sepsensormaxrho": ["physics", "sepsenmaxrho"],
"sepsensoroffset": ["cost", "sepsensoroffset"],
"sepsensorsharpness": ["cost", "sepsensorsharpness"],
"sepangledeviation": ["cost", "sepangledeviation"],
"cavsensoroffset": ["cost", "cavsensoroffset"],
"cavsensorsharpness": ["cost", "cavsensorsharpness"],
"cavexponent": ["cost", "cavexponent"],
Expand Down Expand Up @@ -6326,6 +6332,7 @@ def _getObjectivesAndDVs(self):
"clqdot": self.adflow.constants.costfuncclqdot,
"cbend": self.adflow.constants.costfuncbendingcoef,
"sepsensor": self.adflow.constants.costfuncsepsensor,
"sepsensorks": self.adflow.constants.costfuncsepsensorks,
"sepsensoravgx": self.adflow.constants.costfuncsepsensoravgx,
"sepsensoravgy": self.adflow.constants.costfuncsepsensoravgy,
"sepsensoravgz": self.adflow.constants.costfuncsepsensoravgz,
Expand Down
9 changes: 9 additions & 0 deletions doc/costFunctions.yaml
Expand Up @@ -307,6 +307,15 @@ sepsensor:
The separation values for the given surface is provided by this cost function.
See :cite:t:`Kenway2017b` for more details.

sepsensorks:
desc: >
The separation sensor value based on the KS aggregation for the given surface is provided by this cost function.
We first compute the deviation of the local velocity from the projected freestream on the desired surface.
Then, we use a trigonometric function to compute the sensor by providing an allowable flow deviation angle from this projected vector.
As a result, the sensor provides values form ``1`` to ``-.inf``.
Any values that are greater than 0 are out of the alowable flow deviation.
Thus, to constraint the separation, we use KS aggregation to find the maximum value in the sensor and can constraint it to be less than or equal to ``0``.

sepsensoravgx:
desc: >
The separation sensor average in x direction.
Expand Down
26 changes: 24 additions & 2 deletions doc/options.yaml
Expand Up @@ -1527,16 +1527,38 @@ verifyExtra:
This option is for debugging the adjoint only.
It is used to verify dIda.

sepSensorMaxRho:
desc: >
The rho parameter used for the KS aggregation used for computing maximum separation sensor value in ``sepSensorKs`` cost function.
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 ``sepSensor`` cost function.
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 in ``sepSensor`` cost function.
See "Buffet-Onset Constraint Formulation for Aerodynamic Shape Optimization" (Kenway2017b) for more details.

sepAngleDeviation:
desc: >
This option is for KS based separation sensor, ``sepSensorKs`` cost function.
This angle is used to compute the allowable flow deviation region with respect to the freestream projected direction on the desired surface.
For example, on a wing, the streamlines on the upper surface flows inboard direction.
And in some regions, it goes in the outboard directions.
Therefore, we provide an allowable flow deviation from the projected freestream on the surface to compute the sensor.
For instance, when the angle is ``90`` degrees, this approximately closes to the verge of separation.
This angle (in degrees) is for 3D cases only.
For airfoils, by default, this is ``0``.

computeSepSensorKs:
desc: >
Whether or not to compute KS based separation related cost functions, which is ``sepSensorKs`` cost function.
If this option is not set to ``True``, the code will return zero for this cost function.

computeCavitation:
desc: >
Whether or not to compute cavitation related cost functions, which are `cavitation` and `cpMin`.
Expand Down
4 changes: 4 additions & 0 deletions src/adjoint/adjointUtils.F90
Expand Up @@ -2087,6 +2087,10 @@ subroutine setDiffSizes
ISIZE1OFDrfDrfbcdata_sepSensor = 0
ISIZE2OFDrfDrfbcdata_sepSensor = 0

! sepSensorKs
ISIZE1OFDrfDrfbcdata_sepSensorKs = 0
ISIZE2OFDrfDrfbcdata_sepSensorKs = 0

! Cavitation
ISIZE1OFDrfDrfbcdata_Cavitation = 0
ISIZE2OFDrfDrfbcdata_Cavitation = 0
Expand Down