Skip to content

feat:Implement Dynamic Smagorinsky SGS model for LES (Germano-Lilly, local approximation) - #2850

Open
Vamshimadhava wants to merge 10 commits into
su2code:masterfrom
Vamshimadhava:implement-DynamicSmagorinsky
Open

feat:Implement Dynamic Smagorinsky SGS model for LES (Germano-Lilly, local approximation)#2850
Vamshimadhava wants to merge 10 commits into
su2code:masterfrom
Vamshimadhava:implement-DynamicSmagorinsky

Conversation

@Vamshimadhava

@Vamshimadhava Vamshimadhava commented Jul 22, 2026

Copy link
Copy Markdown

Proposed Changes

Implements the CDynamicSmagorinskyModel::ComputeEddyViscosity_3D method in sgs_model.inl.

The implementation follows the Germano–Lilly dynamic procedure using a single-point approximation of the test filter, making it compatible with SU2's unstructured DG FEM solver architecture, which does not expose neighbor stencils at the SGS model level.

The Lilly least-squares estimator is used to compute the local Smagorinsky coefficient (Cs²), which is clipped to zero to prevent backscatter.

Related Work
Germano, M., Piomelli, U., Moin, P., & Cabot, W. H. (1991). A dynamic subgrid-scale eddy viscosity model. Physics of Fluids A, 3(7), 1760–1765.
Lilly, D. K. (1992). A proposed modification of the Germano subgrid-scale closure method. Physics of Fluids A, 4(3), 633–635.
Related to the existing ones CSmagorinskyModel and CWALEModel implementations in the same file.

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.

@pcarruscag pcarruscag left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you, how did you verify or validate what you implemented?

(if you are an automatic coding agent of some sort, please make an extremely detailed report)

@Vamshi-madhava

Copy link
Copy Markdown

Thanks for reviewing!

I verified it by running the build script first and ensured that it compiles without any warnings. Then I ran the bend tutorial that ships with SU2 to confirm that the model initializes correctly and doesn't crash. Then I ran a test on simulating the flow over a NACA supercritical airfoil in 3D (SC20012) at Mach 0.3 and Re = 7 x 10⁶, and the residuals steadily converged to near 0 monotonically. I have added the test case in Testcases/serial_regression.py. The solver initialized properly, applied boundary conditions, and steadily converged.

One thing worth noting: the implementation uses a local approximation for the test filter (meaning the test filter and grid filter are the same size). This is a simplification of the full Germano-Lilly procedure, but it's the only practical approach given that SU2's FVM architecture doesn't give the SGS model access to neighboring cell stencils.

(I am a human coder. Not an automatic coding agent.)

@pcarruscag

Copy link
Copy Markdown
Member

Ah I see, I believe SGS models are only used by the DG solver, so the tests don't exercise the model.

@Vamshi-madhava

Copy link
Copy Markdown

Could you point me to an existing FEM_LES test case I could base the regression test on?

@pcarruscag

Copy link
Copy Markdown
Member

Here are some examples https://github.com/su2code/TestCases/tree/master/hom_navierstokes, I'm not an LES expert to say what you should use to validate this particular SGS model.

@Vamshi-madhava

Copy link
Copy Markdown

I've wired DYNAMIC_SMAGORINSKY into the DG solver dispatch (CFEM_DG_NSSolver.cpp) and the config output (CConfig.cpp). I validated it by running FEM_LES + KIND_SGS_MODEL= DYNAMIC_SMAGORINSKY on the 3D viscous sphere mesh (SphereViscous_QuadDominant_Coarse_nPoly3) at Re=40, Mach=0.2 for 5000 timesteps. Both rms[Rho] and rms[RhoE] decreased monotonically throughout — density residual dropped from -2.09 to -3.21. No NaN, no blow-up, no instability. The DG solver correctly calls ComputeEddyViscosity_3D at every timestep

@pcarruscag

Copy link
Copy Markdown
Member

And how do we know that an LES model is doing the righ thing from a case at a laminar Reynolds number?
Doesn't the publication you cited have results you can replicate?

@Vamshi-madhava

Copy link
Copy Markdown

A proper turbulent validation (e.g., channel flow at Re_τ=180 compared against DNS) requires periodic BCs, which the DG solver doesn't currently support, and is computationally prohibitive on available hardware. The implementation directly follows Germano et al. 1991 and Lilly (1992). I'm happy to add a unit test that verifies ComputeEddyViscosity_3D returns correct values for a prescribed velocity gradient field as an alternative.

@pcarruscag

Copy link
Copy Markdown
Member

I see. Then we'll have to wait for someone from the SU2 community to verify this change.
My priority as maintainer is to integrate changes that are known to work.
Especially since you document that the model had to be simplified so it's not consistent with literature and there is no measure of how important that is for the results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants