Skip to content

Conversation

@marcosch27
Copy link

@marcosch27 marcosch27 commented Sep 17, 2025

Proposed Changes

Hello everyone,

This PR is one of two contributions resulting from my Master’s Thesis.

In this PR, I’ve added new roughness boundary conditions for the SST turbulence model, based on the approach described in this paper by Aupoix.

The attached PDF includes documentation as well as validation results for a fully turbulent flat plate test case. If needed, I can add a validation test case to the SU2 suite.

Please let me know if any modifications are needed.

Related Work

PR Checklist

  • 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

Thanks for the contribution! Can you add the new config options to config_template.cfg and add the flat plate setup? You can add the .cfg file to this PR, and the mesh and a converged restart file to a PR for the TestCases repository.

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.

Add a testcase please, something of verification quality, are there known results from literature for flatplates?

Comment on lines 1108 to 1109
NONE, /*!< \brief No option / default. */
WILCOX1998, /*!< \brief Wilcox 1998 boundary conditions for rough walls / default. */
Copy link
Member

Choose a reason for hiding this comment

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

Both are default?

Copy link
Author

Choose a reason for hiding this comment

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

I will fix this issue. When surface roughness is used, the Wilcox boundary condition should be the default. To align with the current implementation, I will set WILCOX2006 as the default boundary condition.

Comment on lines 1148 to 1150
ROUGHSSTParsedOptions.wilcox2006 = IsPresent(ROUGHSST_OPTIONS::WILCOX2006);
ROUGHSSTParsedOptions.limiter_knopp = IsPresent(ROUGHSST_OPTIONS::LIMITER_KNOPP);
ROUGHSSTParsedOptions.limiter_aupoix = IsPresent(ROUGHSST_OPTIONS::LIMITER_AUPOIX);
Copy link
Member

Choose a reason for hiding this comment

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

you don't check for 1998? Is it valid if all of these are true?

/*--- Aupoix eddy viscosity limiter ---*/
else if (roughsstParsedOptions.limiter_aupoix) {

su2double k0Plus = ( 1.0 /sqrt( constants[6])) * tanh(((log((kPlus +EPS ) / 30.0) / log(10.0)) + 1.0 - 1.0*tanh( (kPlus + EPS) / 125.0))*tanh((kPlus + EPS) / 125.0));
Copy link
Member

Choose a reason for hiding this comment

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

why log / log(10) instead of log10(...)?

Copy link
Author

Choose a reason for hiding this comment

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

In the implementation, the current expression is retained to remain consistent with the formulation in the reference paper, even though it would be mathematically equivalent to using a base-10 logarithm.

Copy link
Member

Choose a reason for hiding this comment

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

Put a comment if you like, but this is log10, thanks.

solution[1] = FrictionVel*FrictionVel*S_R/(laminar_viscosity/density);
}
/*--- Knopp eddy viscosity limiter ---*/
else if (roughsstParsedOptions.limiter_knopp) {
Copy link
Member

Choose a reason for hiding this comment

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

The options are mutually exclusive so allowing a list of enums in the config is not the most appropriate.
Better to change to a single enum option?
If it ever becomes possible to specify a list, the config syntax will still be compatible.

Comment on lines 464 to 466
S_R = (200/(kPlus+EPS))*(200/(kPlus+EPS));
else
S_R = 100/(kPlus+EPS) + ((200/(kPlus+EPS))*(200/(kPlus+EPS)) - 100/(kPlus+EPS))*exp(5-kPlus);
Copy link
Member

Choose a reason for hiding this comment

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

Use the pow function please

Suggested change
S_R = (200/(kPlus+EPS))*(200/(kPlus+EPS));
else
S_R = 100/(kPlus+EPS) + ((200/(kPlus+EPS))*(200/(kPlus+EPS)) - 100/(kPlus+EPS))*exp(5-kPlus);
S_R = pow(200/(kPlus+EPS), 2);
else
S_R = 100/(kPlus+EPS) + (pow(200/(kPlus+EPS), 2) - 100/(kPlus+EPS))*exp(5-kPlus);

Comment on lines 447 to 448

su2double solution[2];
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
su2double solution[2];
su2double solution[2] = {};

@marcosch27
Copy link
Author

Thanks for the contribution! Can you add the new config options to config_template.cfg and add the flat plate setup? You can add the .cfg file to this PR, and the mesh and a converged restart file to a PR for the TestCases repository.

Thanks for the reply. I added just one entry to select the boundary condition at the wall, which is "ROUGHSST_OPTIONS", since surface roughness is specified using the existing entry "WALL_ROUGHNESS". As shown in the document attached to the PR, the present test case is the NASA ZPG Flat Plate test case with the addition of surface roughness to verify the effects of different boundary conditions for rough walls for the SST model. I will upload the test case in a PR for the TestCases repository.

@marcosch27
Copy link
Author

Add a testcase please, something of verification quality, are there known results from literature for flatplates?

I will add the test case, and in this paper, it is possible to find an overview of the effects of the boundary conditions for rough walls for the SST model on a fully turbulent flat plate test case, including the boundary conditions that I have implemented.

@marcosch27
Copy link
Author

Hi @pcarruscag and @bigfooted,

As part of this pull request, I’ve a validation test case for the new roughness boundary condition in the SST model.
I’d like to open a pull request to add this test case to the su2code/TestCases repository, but I currently don’t have permission to push a new branch there.

Could you please grant me temporary access or let me know the preferred procedure for contributing this test case?
Alternatively, I can open a pull request from my fork if that’s the standard approach.

Thanks a lot for your help!

@pcarruscag
Copy link
Member

I've invited you to the SU2 organization

@marcosch27
Copy link
Author

Hi!

I’ve opened a pull request at su2code/TestCases#178, where I’ve uploaded the validation test case for the newly implemented boundary conditions.

The results obtained with the different boundary conditions are presented in terms of the log-law profiles and velocity shift, confirming the findings reported in the literature.

@pcarruscag
Copy link
Member

Great, can you add regression tests to *_regression.py scripts?
You can modify regression.yaml to target your new branch with the mesh and restart files.
The configs you just add to the code repo (so this PR) because that's is easier to maintain when options change.

Comment on lines 98 to 100
su2double limiter = a1*Solution(iPoint,1) / (F2(iPoint)*vorticity_mag + EPS);
limiter = min(1.0, limiter);
SST_Limiter(iPoint) = limiter;
Copy link
Member

Choose a reason for hiding this comment

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

@marcosch27 can you leave this for another PR please?
We already use a lot of memory, especially for adjoint, so I'm not keen on adding more storage just to output values.

Copy link
Author

Choose a reason for hiding this comment

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

Ok, that's clear, I've removed all the changes related to the SST limiter output.

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.

Thank you for the tests, I think it's good to go after these minor comments.

Comment on lines 171 to 178
% Monotonic Upwind Scheme for Conservation Laws (TVD) in the turbulence equations.
% Required for 2nd order upwind schemes (NO, YES)
MUSCL_TURB= NO
%
% Slope limiter (VENKATAKRISHNAN, MINMOD)
SLOPE_LIMITER_TURB= VENKATAKRISHNAN
%
% Time discretization (EULER_IMPLICIT)
Copy link
Member

Choose a reason for hiding this comment

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

Can you cleanup the unused/default options please? Take a look at our other config files to see what I mean.

Suggested change
% Monotonic Upwind Scheme for Conservation Laws (TVD) in the turbulence equations.
% Required for 2nd order upwind schemes (NO, YES)
MUSCL_TURB= NO
%
% Slope limiter (VENKATAKRISHNAN, MINMOD)
SLOPE_LIMITER_TURB= VENKATAKRISHNAN
%
% Time discretization (EULER_IMPLICIT)
MUSCL_TURB= NO

Comment on lines 156 to 157
% Slope limiter (NONE, VENKATAKRISHNAN, VENKATAKRISHNAN_WANG,
% BARTH_JESPERSEN, VAN_ALBADA_EDGE)
Copy link
Member

Choose a reason for hiding this comment

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

We no longer put the lists of options in all configs because then if we remove or add an option everything is out of date.

Suggested change
% Slope limiter (NONE, VENKATAKRISHNAN, VENKATAKRISHNAN_WANG,
% BARTH_JESPERSEN, VAN_ALBADA_EDGE)

Comment on lines 125 to 144
% Multi-Grid Levels (0 = no multi-grid)
MGLEVEL= 0
%
% Multi-grid cycle (V_CYCLE, W_CYCLE, FULLMG_CYCLE)
MGCYCLE= V_CYCLE
%
% Multi-grid pre-smoothing level
MG_PRE_SMOOTH= ( 1, 2, 3, 3 )
%
% Multi-grid post-smoothing level
MG_POST_SMOOTH= ( 2, 2, 2, 2)
%
% Jacobi implicit smoothing of the correction
MG_CORRECTION_SMOOTH= ( 0, 0, 0, 0 )
%
% Damping factor for the residual restriction
MG_DAMP_RESTRICTION= 0.8
%
% Damping factor for the correction prolongation
MG_DAMP_PROLONGATION= 0.8
Copy link
Member

Choose a reason for hiding this comment

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

None of this is used if the level is 0, etc.

Comment on lines 4 to 8
% Case description: Turbulent flow over flat plate with zero pressure gradient %
% Author: Thomas D. Economon %
% Institution: Stanford University %
% Date: 2011.11.10 %
% File Version 5.0.0 "Raven" %
Copy link
Member

Choose a reason for hiding this comment

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

You can probably grab and modify our most recent config for a flatplate to make it easier to cleanup the files

nodes->SetSolution(iPoint,solution);
LinSysRes.SetBlock_Zero(iPoint);

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change

Comment on lines 264 to 278
# FLAT PLATE, ROUGHNESS BC KNOPP SST
turb_flatplate_sst_roughBCKnopp = TestCase('turb_sst_flatplate_roughBCKnopp')
turb_flatplate_sst_roughBCKnopp.cfg_dir = "rans/flatplate/roughness/bc_knopp"
turb_flatplate_sst_roughBCKnopp.cfg_file = "turb_SST_flatplate_roughBCKnopp.cfg"
turb_flatplate_sst_roughBCKnopp.test_iter = 10
turb_flatplate_sst_roughBCKnopp.test_vals = [10.000000, 0.053020, -3.454853, -0.684543, -0.886080, 2.140376, 1.043068, 4.808919, -0.203494, 0.053645]
test_list.append(turb_flatplate_sst_roughBCKnopp)

# FLAT PLATE, ROUGHNESS BC AUPOIX SST
turb_flatplate_sst_roughBCAupoix = TestCase('turb_sst_flatplate_roughBCAupoix')
turb_flatplate_sst_roughBCAupoix.cfg_dir = "rans/flatplate/roughness/bc_aupoix"
turb_flatplate_sst_roughBCAupoix.cfg_file = "turb_SST_flatplate_roughBCAupoix.cfg"
turb_flatplate_sst_roughBCAupoix.test_iter = 10
turb_flatplate_sst_roughBCAupoix.test_vals = [10.000000, 0.053252, -3.575414, -0.761810, -0.998912, 2.003238, 0.907276, 4.807309, -0.197354, 0.051349]
test_list.append(turb_flatplate_sst_roughBCAupoix)
Copy link
Member

Choose a reason for hiding this comment

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

Move a couple of these tests to parallel_regression, please, so that all actions take more or less the same time.

WALL_ROUGHNESS = (wall, 400e-6)
KIND_ROUGHSST_MODEL = WILCOX2006
MATH_PROBLEM= DIRECT
RESTART_SOL= NO
Copy link
Member

Choose a reason for hiding this comment

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

You are adding restart files to the testcases repo, so the cases should probably be restarted? (which is good to track converged values instead of just a few iterations)

Suggested change
RESTART_SOL= NO
RESTART_SOL= YES

with:
# -t <Tutorials-branch> -c <Testcases-branch>
args: -b ${{github.ref}} -t develop -c develop -s ${{matrix.testscript}}
args: -b ${{github.ref}} -t develop -c feature_turb_flatplate_SST_RoughBCs -s ${{matrix.testscript}}
Copy link
Member

Choose a reason for hiding this comment

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

Remember to revert this to develop

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