Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

Hello everybody,

I am using unsteady discrete adjoint for an optimization case where I want to decrease the maximum pressure over a wall. I was using SURFACE_STATIC_PRESSURE until now and I want to alter this to trick the adjoint code so it can optimize the maximum pressure over this wall. I applied L_infinity norm to the SURFACE_STATIC_PRESSURE part in the CFlowOutput::SetAnalyzeSurface and compared the results for some test cases to see if I am getting the max pressure. It works up to a degree that I can use. You can see the equations from the picture below.

However, when I started a shape optimization simulation I don't think it works. Should I also update some parts in the CAdjEulerSolver.cpp?

Can anybody help me with this problem?

Screenshot from 2025-09-29 11-45-23
You must be logged in to vote

Replies: 2 comments · 3 replies

Comment options

CAdjEulerSolver is only for continuous adjoint.
Do you have your changes to the code somewhere that can be checked? Are the derivatives 0? why do you say it doesn't seem to work?

You must be logged in to vote
3 replies
@ErcanUmut60
Comment options

CFlowOutput.cpp

You can find the changes in this file. I only changed 3 lines of code to implement norm. Derivatives are not zero. When I check the history output it should show higher values of pressure at DSN_001, but it shows the same value where average is applied. At the end it doesn't even reach the same pressure that is obtained with average pressure calculations.

@pcarruscag
Comment options

Is it not normal that the maximum is larger than the average? Maybe you can attend a developer meeting and explain the problem. The schedule is in our Slack channel.

@ErcanUmut60
Comment options

Well, it could be normal if it would start with higher pressures. I don't understand why the first pressure calculation is the same in both averaged and norm-applied surface static pressure.

I will try to attend the meeting tomorrow.

Comment options

I realized when I put SURFACE_STATIC_PRESSURE in the history output (without any modification) for unsteady flows, outputs are shown as 0. Using a custom output for this actually works. I guess this affects the unsteady adjoint solver as well.

HISTORY_OUTPUT=(ITER, CUSTOM, SURFACE_STATIC_PRESSURE)
CUSTOM_OUTPUTS = ' \
  avg : AreaAvg{(PRESSURE)}[wall]; \ '

output is like this:

"Avg_Press"   ,       "avg"      
        0,               99113.33338              
        0,               99118.62438                
        0,               99119.00277     

Is this a bug or am I missing something?

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.