Skip to content

Conversation

@bmunguia
Copy link
Member

@bmunguia bmunguia commented Aug 1, 2020

Proposed Changes

There was a bug in the CTurbSolver::ComputeUnderRelaxation() that would return a negative UR if the change in solution was too negative (less than the allowable decrease), which could cause the solution to head in the wrong direction. I'm not really sure why the turbulent solver version of this function was written differently than the flow solver (maybe the intention was to have a different allowable increase and decrease but they ended up being the same in the end?), but I changed it to make it consistent with the flow solver version.

Also, as I mentioned in #1036, the UR parameters for the flow solver and turbulent solver both took the min of each other and were never reset for steady, meaning it was non-increasing.

While on the topic of UR, I was wondering what the community's thoughts are on changing the SST models to use UR instead of solution clipping. The limits seem somewhat arbitrary to me (is there a ref?), and the tests I've done on my mesh adaptation cases have performed well where I've replaced clipping with UR. I realize this is a very limited dataset so if anyone has any strong opinions of why we should be clipping, let me know.

PR Checklist

Put an X by all that apply. You can fill this out after submitting the PR. If you have any questions, don't hesitate to ask! We want to help. These are a guide for you to know what the reviewers will be looking for in your contribution.

  • I am submitting my contribution to the develop branch.
  • My contribution generates no new compiler warnings (try with the '-Wall -Wextra -Wno-unused-parameter -Wno-empty-body' compiler flags).
  • My contribution is commented and consistent with SU2 style.
  • I have added a test case that demonstrates my contribution, if necessary.
  • I have updated appropriate documentation (Tutorials, Docs Page, config_template.cpp) , if necessary.

Copy link
Contributor

@jayantmukho jayantmukho left a comment

Choose a reason for hiding this comment

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

Simple bug-fix. Thanks for finding it!

@pcarruscag
Copy link
Member

While on the topic of UR, I was wondering what the community's thoughts are on changing the SST models to use UR instead of solution clipping

Do you mean user-specified UR instead / on top of the automatic one? I thought the clipping was necessary to get physical solutions (at least the lower bounds).

@bmunguia
Copy link
Member Author

bmunguia commented Aug 3, 2020

While on the topic of UR, I was wondering what the community's thoughts are on changing the SST models to use UR instead of solution clipping

Do you mean user-specified UR instead / on top of the automatic one? I thought the clipping was necessary to get physical solutions (at least the lower bounds).

I just meant the automatic one. Maybe I need to read up more on k-omega but I thought the solution just had to be positive to be physical, and an allowable ratio < 1 should prevent any negative solutions, assuming the initial solution is positive.

But for now, I think we should probably just get this bug fix in and I can look into the solution clipping separately.

Comment on lines 688 to 695
/* Choose the minimum factor between mean flow and turbulence. */

localUnderRelaxation = min(localUnderRelaxation, solver_container[FLOW_SOL]->GetNodes()->GetUnderRelaxation(iPoint));
Copy link
Member

Choose a reason for hiding this comment

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

I guess some numerical issues might occur if numbers get too large/small during convergence, although that sounds more like a single precision consideration.

Is it worth keeping just this min() between flow and turbulence for now? And maybe investigate if it makes sense as part of #1036?

Copy link
Member Author

Choose a reason for hiding this comment

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

Fair enough. I'll add it back in for now since it shouldn't hurt anything

Comment on lines +668 to +669
su2double localUnderRelaxation = 1.00;
const su2double allowableRatio = 0.99;
Copy link
Member

Choose a reason for hiding this comment

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

Yep, just fyi, the original intent was to allow it to increase and decrease by separate percentages. For S-A, for instance, we often have very large increases at the start of the solve, but only very small decreases, so one may want to allow for a much larger percent increase but limit the decrease to a smaller percentage.

As for swapping out the clipping in SST for something related to under-relaxation thresholds, it could be a good idea. Worth some testing and prob a follow up PR. As you have probably seen, we are only applying the under-relaxation to some S-A variants.. I played around a little with under-relaxation with SST, but I did not have time to experiment properly (and the results seemed very sensitive to it). I do not believe the SST articles in the literature have much to say about clipping. Actually, we had been clipping S-A unnecessarily before putting in the under-relaxation and CFL adaption, which we removed, so it would be good to experiment with SST as well.

@bmunguia bmunguia merged commit 41ffb84 into develop Aug 3, 2020
@bmunguia bmunguia deleted the fix_ur branch August 3, 2020 20:18
@bmunguia bmunguia mentioned this pull request Dec 4, 2020
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants