Skip to content
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

Fix SA and SST wall functions #1204

Merged
merged 51 commits into from
Jun 22, 2021
Merged

Fix SA and SST wall functions #1204

merged 51 commits into from
Jun 22, 2021

Conversation

bigfooted
Copy link
Contributor

@bigfooted bigfooted commented Feb 22, 2021

Proposed Changes

Give a brief overview of your contribution here in a few sentences.

Fixes (I think) the current implementation of the wall model. Some work still needs to be done, regarding compressible vs incompressible and validation of heated walls.

Related Work

Resolve any issues (bug fix or feature request), note any related PRs, or mention interactions with the work of others, if any.

related to #1155
Also took some ideas from feature_WallModelLES

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.

  • [ x] I am submitting my contribution to the develop branch.
  • [ x] My contribution generates no new compiler warnings (try with the '-Wall -Wextra -Wno-unused-parameter -Wno-empty-body' compiler flags, or simply --warnlevel=2 when using meson).
  • 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.

@pr-triage pr-triage bot added the PR: draft label Feb 22, 2021
Copy link
Contributor

@TobiKattmann TobiKattmann left a comment

Choose a reason for hiding this comment

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

Hi, just a few things from scrolling through the code. But I like that you stay close to the given paper and also sometimes give equation numbers. Otherwise there is still a lot of commented code but that's what WIP is for ;)

SU2_CFD/include/solvers/CFVMFlowSolverBase.inl Outdated Show resolved Hide resolved
SU2_CFD/src/solvers/CIncNSSolver.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/solvers/CIncNSSolver.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/solvers/CIncNSSolver.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/solvers/CTurbSSTSolver.cpp Outdated Show resolved Hide resolved
Copy link
Member

@pcarruscag pcarruscag left a comment

Choose a reason for hiding this comment

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

Yey wall functions. I know it is still WIP but few comments below.

SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp Outdated Show resolved Hide resolved
SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp Outdated Show resolved Hide resolved
SU2_CFD/include/solvers/CSolver.hpp Outdated Show resolved Hide resolved
Comment on lines 631 to 633
du_gust_dy = WindGustDer_i[1];
//du_gust_dz = WindGustDer_i[2];
du_gust_dt = WindGustDer_i[2];
Copy link
Member

Choose a reason for hiding this comment

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

kudos for picking up "feature requests" from CFD online 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

:-)

Copy link
Member

Choose a reason for hiding this comment

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

Did you ever check if the 3D version worked? Otherwise we gained deadcode for no reason...

SU2_CFD/src/solvers/CIncNSSolver.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/solvers/CIncNSSolver.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/solvers/CIncNSSolver.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/solvers/CIncNSSolver.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/solvers/CIncNSSolver.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/solvers/CIncNSSolver.cpp Outdated Show resolved Hide resolved
bigfooted and others added 2 commits February 24, 2021 13:36
Co-authored-by: TobiKattmann <31306376+TobiKattmann@users.noreply.github.com>
@bigfooted
Copy link
Contributor Author

I updated the code based on your comments. I have to rerun the validation test case that I have to see if it still matches with the experimental data. I also have to check the compressible vs incompressible implementation.

SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp Outdated Show resolved Hide resolved
SU2_CFD/include/solvers/CFVMFlowSolverBase.inl Outdated Show resolved Hide resolved
SU2_CFD/include/solvers/CFVMFlowSolverBase.inl Outdated Show resolved Hide resolved
SU2_CFD/include/solvers/CFVMFlowSolverBase.inl Outdated Show resolved Hide resolved
SU2_CFD/include/solvers/CFVMFlowSolverBase.inl Outdated Show resolved Hide resolved
SU2_CFD/src/solvers/CIncNSSolver.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/solvers/CNSSolver.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/solvers/CTurbSASolver.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/solvers/CTurbSSTSolver.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/solvers/CTurbSSTSolver.cpp Outdated Show resolved Hide resolved
@pcarruscag
Copy link
Member

Thanks @bigfooted, I fixed the conflicts (albeit not very well judging from the broken compilation) and left some more comments some more important than others.
For me the most important ones are those regarding avoiding any and all repetition, reference factors and so on.

bigfooted and others added 2 commits March 3, 2021 07:42
Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com>
Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com>
bigfooted and others added 6 commits March 3, 2021 14:13
spaces

Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com>
spaces

Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com>
refvel

Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com>
const bool

Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com>
spaces

Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com>
spaces

Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com>
.vscode/launch.json Outdated Show resolved Hide resolved
Comment on lines +440 to +443
/*--- Wall shear stress values (wall functions) ---*/

numerics->SetTauWall(nodes->GetTauWall(iPoint),
nodes->GetTauWall(jPoint));
Copy link
Member

Choose a reason for hiding this comment

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

Please add or modify some test cases (comp and incomp) I will need to modify the vectorized numerics to support this and it would be helpful to have a good reference.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, I have the flat plate test case for this (Schubauer & Klebanoff), will add this

@bigfooted bigfooted marked this pull request as ready for review May 21, 2021 13:15
config_template.cfg Outdated Show resolved Hide resolved
config_template.cfg Outdated Show resolved Hide resolved
Comment on lines -626 to +619
SetStressTensor(Mean_PrimVar, Mean_GradPrimVar, Mean_turb_ke, Mean_Laminar_Viscosity, Mean_Eddy_Viscosity);
SetStressTensor(Mean_PrimVar, Mean_GradPrimVar, Mean_turb_ke,
Mean_Laminar_Viscosity, Mean_Eddy_Viscosity);
if (config->GetQCR()) AddQCR(nDim, &Mean_GradPrimVar[1], tau);
if (Mean_TauWall > 0) AddTauWall(UnitNormal, Mean_TauWall);
Copy link
Member

Choose a reason for hiding this comment

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

I've been looking into making the wall functions compatible with the vectorized classes.
I got confused, however, because it looks like the tau wall was not considered in the incompressible viscous numerics.
But your validation results looked good... So, either this makes them better, or it is not needed (here and in the other 2 viscous classes that use it).

Copy link
Member

Choose a reason for hiding this comment

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

In #1120 @EduardoMolina also added the "tau wall logic" to the incompressible class but he changed the implementation in the 3 classes to only consider tau wall if only one of the two points has it.
Which means that for edges connecting two wall points tau wall is not considered... might be worth re-running some tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think in the case of RANS wall functions, the tauwall values that you mention are always overwritten by the tauwall computed at the end of CIncNSSolver::SetTauWall_WF(..). The function addtauwall is used only for the LES implementation.

Copy link
Member

Choose a reason for hiding this comment

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

Tau wall is computed in that function as part of the preprocessing, to then be used in the numerics, I don't see any other place in the code where the computed tau wall can influence the solution.

Copy link
Member

@pcarruscag pcarruscag left a comment

Choose a reason for hiding this comment

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

Just that test case to go I guess.

Comment on lines 802 to 815
notConvergedCounter++;
cout << "Warning: Y+ did not converge within the max number of iterations!" << endl;
Copy link
Member

Choose a reason for hiding this comment

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

I was trying this on the CRM and these messages were showing up a lot, so I made some changes to print only one message with totals.
I also copied the "safe values" you had for the compressible version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi Pedro, Yes, they are present only for the first 10 iterations or so usually. Maybe we can introduce verbosity levels for such messages.

Comment on lines 877 to 876
if (Y_Plus_Start < 5.0) {
cout << "skipping stress due to wall model" << endl;
continue;
if (Y_Plus_Start < Y_Plus) {
skipCounter++;
}

while (fabs(diff) > tol) {
else while (fabs(diff) > tol) {
Copy link
Member

Choose a reason for hiding this comment

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

I also made this logic the same as the incomp solver, it seemed that certain quantities would not be computed otherwise.
Hopefully this was the right thing to do and not the opposite.

@bigfooted bigfooted merged commit 350fee9 into develop Jun 22, 2021
@bigfooted bigfooted deleted the fix_wallfunctions branch June 22, 2021 07:03
@bigfooted
Copy link
Contributor Author

Thanks @pcarruscag and @TobiKattmann ! I will add the testcase and some small things in a new PR!

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.

3 participants