-
Notifications
You must be signed in to change notification settings - Fork 847
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
Refactor SA source terms to modularize the specification of model variants and correction terms #1413
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
With new implementation of turbulence modeling, the current turb_sources.cpp and turb_sources.hpp are no longer useful. Because of that, I deleted almost everything related to SA in order to start from scratch.
Create a test cases directory for turbulence modeling. The selected geometry if the RAE2822 airfoil. Created the config files for the SA turb. mod. variations: - baseline - negative - Edwards - Compressibility - Edwards and Compressibility - ft2 - QCR
5 tasks
pcarruscag
reviewed
Jan 15, 2022
pcarruscag
reviewed
Jan 15, 2022
pcarruscag
reviewed
Feb 2, 2022
Co-authored-by: TobiKattmann <[email protected]>
Co-authored-by: TobiKattmann <[email protected]>
…/SU2 into feature_turbmod_variants
hmm, 0f4977f must have introduced sth that made the two (streamwise periodic) testcases fail. I think the defining feature here is, that they use the SST-turb model. But looking at the mentioned commit, the changes look equal to me 🤔 |
pcarruscag
reviewed
Mar 3, 2022
pcarruscag
reviewed
Mar 3, 2022
pcarruscag
reviewed
Mar 3, 2022
Comment on lines
+507
to
+508
/// TODO: Factory method to create combinations of the different variations based on the config. | ||
/// See PR #1413, the combinations exposed should follow https://turbmodels.larc.nasa.gov/spalart.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Main TODO for a future PR
TobiKattmann
requested changes
Mar 3, 2022
TobiKattmann
reviewed
Mar 3, 2022
TobiKattmann
approved these changes
Mar 3, 2022
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull request description
The idea of this pull request is to provide a new code structure to implement the turbulence models in SU2. In the new approach, "all" variations/correction from a turbulence model should be compatible with each other and the user can use them simultaneously. Most of these variations/corrections only affect to the source terms, thus it forms the main contribution to this pull request.
Short history summary
Originally the idea behind such an approach is given by @clarkpede in here.
The code implementation was suggested by @pcarruscag in here.
For the user interface, this is being or was discussed in here.
Some time ago, I made a PR #1066 to correct the SA model in SU2. Further I had the intention to implement the above presented approach to the SA for that pull request. However since the the presented approach can also be applied to the SST or any turbulence model, I decided to create a new pull request.
Please note that this is a very draft pull request, it is not meant to work at all.
Documentation
Down below I will explain the "theory" behind it as well as the code structure that I will try to follow, just in case someone wants to replicate it for the SST.
Regarding the user interface, I did not work on that yet. I will address it at the end.
Theory
The Spalart-Allamaras correction/variation models to be implemented in SU2 are listed below. One can find a detailed description for example in NASA TMR website.
The first step is to identify the core, i.e., the mathematical formulation that is shared/common between all of them. Below I provide a very short description of their main characteristics.
Spalart-Allmaras standard
In the literature one can find a correction that sets the ft2-term to zero. However, the current baseline model in SU2 sets this ft2-term to zero. As discussed in here in order to keep compatibility with previous SU2 versions results it is preferable to keep the current nomenclature, i.e., SA will refer to the SA-noft2 variant.
Spalart-Allmaras negative
The model is the same as the "baseline" version when the turbulence variable$\tilde \nu$ is greater than or equal to zero. The modified vorticity is modified to prevent it from acquiring negative values. When $\tilde \nu$ is negative a slightly different integral equation is solved. The viscous fluxes are redefined as well.
The boundary conditions are the same as for the standard S-A.
Spalart-Allmaras nonzero ft2 term
This is the approach corresponds to the faithful baseline. The equations are the same as for the "baseline" version (SA), except we take the term$f_{t2}$ into account.
Spalart-Allmaras mixing layer compressibility correction
This version is the same as for the "baseline" version except that an additional term is included on the right hand side of the equation.
Spalart-Allmaras Edwards modification
This version is the same as for the "baseline" version, except that$f_{t2}$ is ignored, and two variables are redefined: the modified vorticity $\tilde{S}$ and $r$ .
Note that this correction is not compatible with the negative SA model. Since there is no literature on how to handle both corrections simultaneously, the community decision was to prompt an error when trying to use them.
Spalart-Allmaras QCR-2000
The QCR correction modifies the turbulent stresses definition.
Code structure
The approach that I decided to follow is:
The baseline/standalone SA class will have several templates parameters. Each of them will correspond to one of those variables that are subject to change in a SA correction/variation. Then, when creating the SA turbulence model, one just needs to replace each of these templates by the appropriate class.
For those corrections/variations that just introduce an additional source term, I think it is better to implement them using decorators. Hence multiple corrections/variations introducing source terms can be simultaneously used.
Here is a minimal example:
Related Work
This PR closes the PR #1066.
This PR closes the issue #1364.
This PR will hopefully close the discussion #1403.
PR Checklist