-
Notifications
You must be signed in to change notification settings - Fork 827
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
[WIP] SA turb model consistent implementation #1066
Conversation
Implement original SA and Negative SA turbulence models as well as their no-ft2 versions
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.
if (spalart_allmaras || neg_spalart_allmaras || e_spalart_allmaras || comp_spalart_allmaras || e_comp_spalart_allmaras ) { | ||
if (spalart_allmaras || spalart_allmaras_noft2 || neg_spalart_allmaras || neg_spalart_allmaras_noft2 || e_spalart_allmaras || comp_spalart_allmaras || e_comp_spalart_allmaras ) { |
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.
This way of handling the new options is a no go on my part, if we do it like this we will be chasing SA bugs for months, exactly like it happened when the solver options changed. Even with SST_SUST which was just one new option I fixed a bug last month or so.
I trust you to have changed all places in the code, but other people will not be aware (because very few people follow the pull requests) and unfortunately there are 10's of branches that do not track develop closely.
So, as a bare minimum this "is SA", "is SA-neg" logic needs to be encapsulated in a single method of CConfig, and replaced everywhere.
If you want to take it further we should create a small lightweight class that condenses all SA info, including coefficients.
Actually even less work, and probably more appropriate, create a boolean option called SA_USE_FT2= YES/NO, and avoid changing all the enum's and turbulence options.
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.
I totally agree with that. I would suggest to follow the comment from @clarkpede on issue #992 so we are able to include more than one variation.
Maybe on the config file we can include a tag for all the SA variations. Something like:
SA_VARIATIONS: NO_FT2, COMP, MOD_VORT, etc
which are basically Boolean to identify whether we want to use no ft2, comp, modified vorticity, etc.
Then, on turb_sources to have only one class, the original SA model. Therein, include all possible variations.
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.
Yes that sounds reasonable for the options and there is precedent with the QCR modification of the stress tensor.
However, having classes that look like Swiss army knives by means of if's and switch's is a bad software practice IMO.
There are "modern" and very efficient ways to specialize such small aspects, I'm using (and have described) some in #1022, we can discuss them in the next developers meeting if you want.
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.
I will take a look to that!
% Possible formats : (TECPLOT, TECPLOT_BINARY, SURFACE_TECPLOT, | ||
% SURFACE_TECPLOT_BINARY, CSV, SURFACE_CSV, PARAVIEW, PARAVIEW_BINARY, SURFACE_PARAVIEW, | ||
% SURFACE_PARAVIEW_BINARY, MESH, RESTART_BINARY, RESTART_ASCII, CGNS, STL) | ||
% Possible formats : (TECPLOT, TECPLOT_ASCII, SURFACE_TECPLOT, SURFACE_TECPLOT_ASCII, | ||
% CSV, SURFACE_CSV, PARAVIEW, PARAVIEW_ASCII, PARAVIEW_LEGACY, SURFACE_PARAVIEW, | ||
% SURFACE_PARAVIEW_ASCII, SURFACE_PARAVIEW_LEGACY, PARAVIEW_MULTIBLOCK, RESTART, | ||
% RESTART_ASCII, CGNS, STL, STL_BINARY, MESH) |
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.
👍 Do we have a "MESH" option?
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.
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.
Indeed but what matters are the strings from 1642 to 1659, the enums are for internal use.
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.
Okay, but "MESH" is indeed an output option, see https://github.com/su2code/SU2/blob/develop/SU2_CFD/src/output/COutput.cpp line 388. Maybe the pairing in option_structure is missing?
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.
It is only used internally in SU2_DEF I think, it does not need to be selected by users.
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.
Good. So shall be removed from the config_template.
// Original SA model | ||
// Production = cb1*(1.0-ft2)*Shat*TurbVar_i[0]*Volume; | ||
|
||
if (transition) { |
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.
A small comment.
It looks like the BC transition model is only valid with the no-ft2 version (https://turbmodels.larc.nasa.gov/sa-bc_1eqn.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.
Thanks for pointing it out.
"the ft2 term present in (SA) may cause an undesirable delay in transition to turbulence in the RANS region, and should be avoided".
I will take it into account.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still a relevant issue please comment on it to restart the discussion. Thank you for your contributions. |
Currently each variation/correction model has its unique name identification in SU2. In order to simultaneously combine multiple correction models to a given turbulence model I suggest the following:
Here an example, What do you think? |
Implementation of the original SA and Negative SA turbulence models as well as their no-ft2 versions
Proposed Changes
Implementation of the original version of Spalart-Allmaras turbulence model (https://www.researchgate.net/publication/236888804_A_One-Equation_Turbulence_Model_for_Aerodynamic_Flows).
Implementation of the Spalart-Allmaras turbulence model without the ft2 term.
Implementation of the original version of Negative Spalart-Allmaras turbulence model (https://www.iccfd.org/iccfd7/assets/pdf/papers/ICCFD7-1902_paper.pdf)
Implementation of the Negative Spalart-Allmaras turbulence model without the ft2 term neither modified vorticity.
On the config file, choose:
SA: Original SA model
SA_NOFT2: SA model without ft2 term (the same model found in the develop branch)
SA_NEG: Original negative SA model
SA_NEG_NOFT2: Negative SA model (the same model found in the develop branch)
They are not the same as in the develop branch, because I corrected a minor bug.
Updated the template config file to be in accordance with the source code: turbulent models and OUTPUT_FILES tags
Related Work
This PR resolves issues #992 and #1051.
Regression testing
Tested on tutorials:
PR Checklist