Skip to content

Conversation

@dunapkt
Copy link
Contributor

@dunapkt dunapkt commented Jul 25, 2025

Proposed Changes

Fix a sign error in the Spalding wall function term in INC_NSSolver.cpp. The constant '+1.0' is changed to '-1.0' to match Spalding(1961) and Nichols & Nelson (2004). I've also checked the derivatives, but there were no issues.

Related Work

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 --warnlevel=3 when using meson).
  • My contribution is commented and consistent with SU2 style (https://su2code.github.io/docs_v7/Style-Guide/).
  • I used the pre-commit hook to prevent dirty commits and used pre-commit run --all to format old commits.
  • 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.

@bigfooted
Copy link
Contributor

Looks like in the incompressible flow implementation, the minus sign is wrong.
The reference from Nichols and Nelson:
image

@bigfooted bigfooted changed the title Fix sign error in Spalding composite term Fix sign error in incompressible Spalding wall function Jul 25, 2025
@bigfooted
Copy link
Contributor

The regression tests for the wall functions fail now and have to be updated. Can you do this?

You have to go to Testcases/serial_regression.py
and then these lines:

inc_turb_wallfunction_flatplate_sa.test_vals = [-6.894206, -5.715970, -6.743740, -4.242551, -9.550272, 10.000000, -2.879370, 0.001021, 0.003759]
The new values according to the checks are:
inc_turb_wallfunction_flatplate_sa.test_vals = [-6.894226, -5.716031, -6.743814, -4.242551, -9.550079, 10.000000, -2.879412, 0.001021, 0.003759]

Same for:

inc_turb_wallfunction_flatplate_sst.test_vals = [-6.881306, -5.729111, -6.724803, -4.242636, -7.162846, -2.044959, 10.000000, -2.877924, 0.001151, 0.003161, 0.000000]
new values are:
inc_turb_wallfunction_flatplate_sst.test_vals = [ -6.881321, -5.729177, -6.724837, -4.242636, -7.162893, -2.044945, 10.000000, -2.877955, 0.001151, 0.003161, 0.000000]

and in Testcases/Tutorials.py:

sudo_tutorial.test_vals = [-14.664419, -12.789769, -13.280336, -13.016392, -13.018817, -9.510066, 15.000000, -1.994192]
New values are:
sudo_tutorial.test_vals = [-10.243992, -8.397140, -8.812974, -8.525505, -8.731439, -5.183918, 15.000000, -1.941343]

@dunapkt
Copy link
Contributor Author

dunapkt commented Jul 25, 2025

I've completed all the updates you requested. Let me know if anything else needs adjusting

Copy link
Contributor

@bigfooted bigfooted left a comment

Choose a reason for hiding this comment

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

LGTM

@bigfooted bigfooted merged commit c0bf007 into su2code:develop Jul 27, 2025
37 checks passed
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.

2 participants