[WIP] Feature turbmod variants #1411
Closed
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