Conversation
…ons based on k and w - Added computation of k and w starting from SA variables - Added first implementation of SAS (Scale Adaptive Simulation) model
- Changed previous SAS model to SAS_SIMPLE
- Fixed DataType for Periodic Comms
…lified IDDES (SIDDES)
| SAS_SIMPLE, /*!< \brief Menter k-w SST model with Scale Adaptive Simulations modifications. */ | ||
| SAS_COMPLICATED, /*!< \brief Menter k-w SST model with Scale Adaptive Simulations modifications. */ |
There was a problem hiding this comment.
Are these the names in the literature?
There was a problem hiding this comment.
No, these are just placeholders. There are no names in literature, that is why I named them according to the complexity of the model
There was a problem hiding this comment.
Maybe something after the authors since the models come from different papers.
| SST_OPTIONS sasModel = SST_OPTIONS::SAS_SIMPLE; /*!< \brief Enum SST base model. */ | ||
| bool sust = false; /*!< \brief Bool for SST model with sustaining terms. */ | ||
| bool uq = false; /*!< \brief Bool for using uncertainty quantification. */ | ||
| bool sas = false; /*!< \brief Bool for using Scale Adaptive Simulations. */ |
There was a problem hiding this comment.
Probably the type is enough and "none" indicates no sas.
| SST_OPTIONS sasModel = SST_OPTIONS::SAS_SIMPLE; /*!< \brief Enum SST base model. */ | |
| bool sust = false; /*!< \brief Bool for SST model with sustaining terms. */ | |
| bool uq = false; /*!< \brief Bool for using uncertainty quantification. */ | |
| bool sas = false; /*!< \brief Bool for using Scale Adaptive Simulations. */ | |
| SST_OPTIONS sasModel = SST_OPTIONS::NONE; /*!< \brief Enum SST base model. */ | |
| bool sust = false; /*!< \brief Bool for SST model with sustaining terms. */ | |
| bool uq = false; /*!< \brief Bool for using uncertainty quantification. */ |
There was a problem hiding this comment.
Sure, I'll modify it.
| case SST_DDES: cout << "Delayed Detached Eddy Simulation (DDES) with Shear-layer Adapted SGS" << endl; break; | ||
| case SST_IDDES: cout << "Delayed Detached Eddy Simulation (DDES) with Shear-layer Adapted SGS" << endl; break; | ||
| case SST_SIDDES: cout << "Delayed Detached Eddy Simulation (DDES) with Shear-layer Adapted SGS" << endl; break; |
There was a problem hiding this comment.
The description is slightly different right?
There was a problem hiding this comment.
Yes, I planned to modify the details on the final implementation. I'll do it now
|
|
||
| su2double lengthScale_i, lengthScale_j; | ||
| su2double FTrans; /*!< \brief SAS function */ | ||
| su2double VelLapl_X, VelLapl_Y, VelLapl_Z; |
There was a problem hiding this comment.
Use a matrix type for the laplacian in CVariable and here you can have a pointer instead.
Put these variables close to other turbulence variables please.
There was a problem hiding this comment.
I think the main problem with my implementation is that the norm of the velocity laplacian stated in the paper is
There was a problem hiding this comment.
That looks like the norm of the Laplacian of the velocity components, the way you are computing it is not very accurate but maybe it is good enough. You could do it the finite volume way by reusing the numerics classes we use for scalar viscous fluxes.
| su2double VelLaplMag = VelLapl_X*VelLapl_X + VelLapl_Y*VelLapl_Y; | ||
| if (nDim == 3) VelLaplMag += VelLapl_Z*VelLapl_Z; | ||
| const su2double L_vK_1 = KolmConst * StrainMag_i / sqrt(VelLaplMag); |
There was a problem hiding this comment.
Is the velocity laplacian only used for the source term? Or will you have changes to the convection or diffusion fluxes?
There was a problem hiding this comment.
It is just for the source term
| /*! | ||
| * \brief Get the value of the turbulence kinetic energy. | ||
| * \return the value of the turbulence kinetic energy. | ||
| */ | ||
| inline su2double GetSSTVariables_k(unsigned long iPoint) const { return k(iPoint); } | ||
|
|
||
| /*! | ||
| * \brief Get the value of the turbulence frequency Omega. | ||
| * \return the value of the turbulence frequency Omega. | ||
| */ | ||
| inline su2double GetSSTVariables_omega(unsigned long iPoint) const { return Omega(iPoint); } | ||
|
|
||
| /*! | ||
| * \brief Set the value of the SST variables computed with SA solution. | ||
| * \param[in] val_k | ||
| * \param[in] val_Omega | ||
| */ | ||
| void SetSSTVariables(unsigned long iPoint, su2double val_k, su2double val_Omega) { | ||
| k(iPoint) = val_k; |
There was a problem hiding this comment.
Are these changes related to the main theme? or were just debugging? If they can be separated to another PR let's do that please.
There was a problem hiding this comment.
These are for computing the grid size for scale resolving simulations from an SA solution. Probably it has to be revised a little bit, since I found out that the formulation for the TKE is different if the QCR mod is used, thus I think I'll remove them for now.
There was a problem hiding this comment.
You need to undo this change to the codi version.
| inline virtual su2double GetVelLapl_X(unsigned long iPoint) const { return 0.0; } | ||
| /*! | ||
| * \brief Get the value of the value of FTrans. | ||
| */ | ||
| inline virtual su2double GetVelLapl_Y(unsigned long iPoint) const { return 0.0; } | ||
| /*! | ||
| * \brief Get the value of the value of FTrans. | ||
| */ | ||
| inline virtual su2double GetVelLapl_Z(unsigned long iPoint) const { return 0.0; } | ||
|
|
||
| /*! | ||
| * \brief Set the value of the value of FTrans. | ||
| */ | ||
| inline virtual void AddVelLapl(unsigned long iPoint, su2double val_VelLapl_X, su2double val_VelLapl_Y) {} | ||
| /*! | ||
| * \brief Set the value of the value of FTrans. | ||
| */ | ||
| inline virtual void AddVelLapl_Z(unsigned long iPoint, su2double val_VelLapl_Z) {} | ||
| /*! | ||
| * \brief Set the value of the value of FTrans. | ||
| */ | ||
| inline virtual void SetVelLapl(unsigned long iPoint, su2double val_VelLapl_X, su2double val_VelLapl_Y) {} |
There was a problem hiding this comment.
Use a pointer for velocity and then you only need one of each function instead of handling xyz separately.
There was a problem hiding this comment.
Yeah, I'll try using the matrix type
- Changed names of SAS models - Added descriptions of functions - Clean up of output functions - Removed SA functions or SST variables
| /*--- If iPoint is boundary it only takes contributions from other boundary points. ---*/ | ||
| if (boundary_i && !boundary_j) continue; | ||
|
|
||
| /*--- Add solution differences, with correction for compressible flows which use the enthalpy. ---*/ |
There was a problem hiding this comment.
Check if comments need updates please
|
Hi @rois1995 any progress? Would be very interesting to add this to develop, looking forward to using it actually. |
Hi @bigfooted, unfortunately I do not have enough time/computational power to perform a proper validation. I only tried something with a NACA0021 at 17 deg and 60 deg and they were promising, at least for the DDES implementation. The SAS ones are not that good. I'll upload some post-processing as soon as I have the time to do so. |
|
I find your work really interesting. I've been studying the internal flow field in compressors and have had good results using SU2's SA_EDDES for calculating the cantilevered stator with a tip clearance. If you need help with code verification, I'd be glad to assist. |
Hi @Linnnnnn23, every help on the validation/verification is gladly accepted! Let me know if you need anything by my side. |
|
|
Hi @rois1995 , I'd like to help with validation/verification if I can. Let me know if you are interested. You can contact me at berkecancfd@gmail.com. |
Hi @rois1995, I believe there is an error or a typo in the Babu's paper in the Q_SAS source term and in turn in your implementation, which may be the reason for the poor performance in SAS results. This term changes units depending on the output of the max function, which doesn't make any sense. I believe the terms in the max function should be divided by omega^2 and k^2 instead of omega and k, respectively. Which is exactly how it is done in https://resolver.tudelft.nl/uuid:5d23e2a6-5675-450d-bf3d-1dd40d736cae I will try some of the benchmark cases in these papers when I have the time. Let me know what you think. [edit: fixed the link to the tudelft repository] |
- Rearrenged and renamed outputs
- Remove unused variables
|
Should we allow DDES to be run on 2D meshes? The DDES flatplate testcase has a 2D mesh, but it does not really make any sense to run 2D cases with DDES. |
|
If someone is determined enough they'll make a 2.5D mesh and still run it 😄 |
|
I am pretty sure that the EDDES models have something that does not work in 2D, like the vortex-tilting measure (depends on the scalar product of the gradient of the velocity and the vorticity, thus in 2D it should be zero). |
|
@rois1995 @pcarruscag should we finalize this before the conflicts get out of control? If time is the issue, I propose we only add a regression test for this PR. |
pcarruscag
left a comment
There was a problem hiding this comment.
There are many variants being added Nijso, one regression is probably not enough.
| su2double **Grad_Vel = new su2double* [nDim]; | ||
| su2double **StrainMat = new su2double* [nDim]; | ||
| auto Vorticity = flowNodes->GetVorticity(iPoint); | ||
| auto PrimGrad_Flow = flowNodes->GetGradient_Primitive(iPoint); | ||
| for (unsigned short iDim = 0; iDim < nDim; iDim++) { | ||
| Grad_Vel[iDim] = new su2double [nDim]; | ||
| StrainMat[iDim] = new su2double [nDim]; | ||
| for (unsigned short jDim = 0; jDim < nDim; jDim++) { | ||
| Grad_Vel[iDim][jDim] = nodes->GetGradient_Primitive(iPoint, prim_idx.Velocity() + iDim, jDim); |
There was a problem hiding this comment.
Memory leak.
Use something with static sizes instead of allocating with new
| for (unsigned long iPoint = 0; iPoint < nPoint; iPoint++){ | ||
| su2double **Grad_Vel = new su2double* [nDim]; | ||
| su2double **StrainMat = new su2double* [nDim]; | ||
| auto Vorticity = flowNodes->GetVorticity(iPoint); | ||
| for (unsigned short iDim = 0; iDim < nDim; iDim++) { | ||
| Grad_Vel[iDim] = new su2double [nDim]; | ||
| StrainMat[iDim] = new su2double [nDim]; | ||
| for (unsigned short jDim = 0; jDim < nDim; jDim++) { | ||
| Grad_Vel[iDim][jDim] = nodes->GetGradient_Primitive(iPoint, prim_idx.Velocity() + iDim, jDim); | ||
| } |
Keep the DES length scale and the vortex tilting measure in CTurbVariable, shared by SA and SST, and the stochastic backscatter variables of develop in CTurbSAVariable. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
…A and SST EDDES Preprocessing allocated the velocity gradient and strain matrices with new for every point at every iteration and never freed them (about 300 bytes per point and iteration), so EDDES runs ran out of memory. The gradient was also read from the turbulence variables instead of the flow variables, and 2D cases wrote 3x3 strain entries into 2x2 arrays. Pass the flow primitive gradient to SetVortex_Tilting as in develop, which computes the strain without allocations, and move it to CTurbVariable so that SA and SST share it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
SST_EDDES fell through to SST_EDDES_UNSTR because of a missing break. Without vorticity (e.g. a uniform initial flow) the vorticity direction is undefined, Delta_omega vanishes and the DES length scale goes to zero, which made the k destruction term blow up at the first iteration. Use h_max there, as in standard DDES. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
…SA and SST EDDES - Vortex tilting measure: the denominator used only the diagonal of the strain tensor, 3 tr(S^2) sums the squares of all its components. It is set to 1 (F_KH = 1) where it is undefined (no vorticity or strain anisotropy). - F_KH limiter (Eq. 6): where f_d < 0.99 F_KH is set to 1, so the length scale is Delta_omega and not h_max. SA_EDDES used 0.999. - Structured Delta_omega (Eq. 1): the maximum of |n x (r_n - r_m)| over the vertices of a box with the grid spacings of the point, instead of |n x |x_j - x_i|| over the neighbors. - Without vorticity Delta_omega vanishes, h_max is used as in standard DDES. The length scale is computed by CTurbSolver::ShearLayerAdaptedLengthScale, shared by the structured and unstructured variants of SA and SST. The reference values of the ddes_flatplate test (SA_EDDES) are updated. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
|
Sorry for the long silence on this PR, I could not work on it for a while. I have now brought it up to date:
I updated the title and the description. Next I will add regression tests for the new options and set up the validation cases. |
One test for each of SST_DDES, SST_IDDES, SST_SIDDES, SST_EDDES, SST_EDDES_UNSTR, SA_EDDES and SA_EDDES_UNSTR, 5 time steps on the hexahedral grid of rans/oneram6. They restart from a SST or SA RANS solution (su2code/TestCases#206) so that the LES branch of the length scale is active and every model gives different results. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
Temporary, for the restart solutions of su2code/TestCases#206. To be reverted to develop before merging. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
|
Great! Can you add a small tutorial for the website as well? We have a lot of these implementations that are not exposed to the public. |
|
I will re-run the NACA0021 and BFS test cases, then add the NACA0021 test case to the Validation cases. |

Proposed Changes
DDES formulations for the SST model, and fixes to the shear-layer-adapted (EDDES) length scale of SA.
New
HYBRID_RANSLESoptions for SST, from Gritskevich et al., Development of DDES and IDDES Formulations for the k-ω Shear Stress Transport Model, Flow Turbulence Combust 88, 2012 (DOI):SST_DDES: DDES (Appendix 1).SST_IDDES: IDDES (Appendix 2).SST_SIDDES: simplified IDDES, i.e. IDDES without the elevating function f_e (Eq. 12).In all of them the destruction term of the k equation becomes ρ k^{3/2} / l_DES.
Shear-layer-adapted (SLA) length scale, from Shur et al., An Enhanced Version of DES with Rapid Transition from RANS to LES in Separated Flows, Flow Turbulence Combust 95, 2015 (DOI): Δ_SLA = Δ̃_ω F_KH(⟨VTM⟩), with F_KH = 1 where f_d < 0.99 (Eq. 6).
SST_EDDES: SST-DDES with Δ_SLA (as in Guseva et al., Flow Turbulence Combust 98, 2017, and Xiao et al., Int. J. Heat Fluid Flow 85, 2020).SA_EDDES_UNSTR,SST_EDDES_UNSTR: Δ̃_ω for unstructured grids. The vertices of the dual cell are approximated by the midpoints of the edges, and the maximum of |n_ω × (r_n − r_m)| is taken over all pairs. In*_EDDES, Δ̃_ω uses a box with the grid spacings of the point in each direction.The length scale is computed by
CTurbSolver::ShearLayerAdaptedLengthScale, shared by SA and SST. Where the vorticity vanishes, its direction is undefined and h_max is used, as in standard DDES.Fixes to the existing
SA_EDDES(they change the reference values of theddes_flatplatetest):Other changes
TIME_DOMAIN= YES.LESIQandSRS_GRID_SIZE(groupDDES), velocity gradient (VELOCITY_GRADIENT), SST F1, F2 and cross-diffusion (SST_QUANTITIES).Tests
ddes_oneram6_*(serial, parallel and hybrid), one per model:SST_DDES,SST_IDDES,SST_SIDDES,SST_EDDES,SST_EDDES_UNSTR,SA_EDDES,SA_EDDES_UNSTR. They run 5 time steps on the existing ONERA M6 hexahedral grid, restarting from a SST or SA RANS solution, so that the LES branch of the length scale is active and every model gives different results (about 2 s each on 2 ranks)..github/workflows/regression.ymluses thefeature_SST_IDDESbranch of TestCases until that PR is merged.Validation cases (e.g. NACA 0021 beyond stall, backward-facing step) are in progress.
Related Work
PR Checklist
pre-commit run --allto format old commits.🤖 Generated with Claude Code