feat:Implement Dynamic Smagorinsky SGS model for LES (Germano-Lilly, local approximation) - #2850
feat:Implement Dynamic Smagorinsky SGS model for LES (Germano-Lilly, local approximation)#2850Vamshimadhava wants to merge 10 commits into
Conversation
This reverts commit 37e219a.
pcarruscag
left a comment
There was a problem hiding this comment.
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)
|
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.) |
|
Ah I see, I believe SGS models are only used by the DG solver, so the tests don't exercise the model. |
|
Could you point me to an existing FEM_LES test case I could base the regression test on? |
|
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. |
|
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 |
|
And how do we know that an LES model is doing the righ thing from a case at a laminar Reynolds number? |
|
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. |
|
I see. Then we'll have to wait for someone from the SU2 community to verify this change. |
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.
pre-commit run --allto format old commits.