Skip to content
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
388f85a
- Added computation of desired grid size for Scale Resolving Simulati…
Sep 15, 2023
41cb27e
- Added a more complex SAS model named SAS_COMPLICATED
Sep 15, 2023
a6be2cf
- Fixed getting coordinates of points
Sep 15, 2023
d1f4db6
- Added output of laplacian
Sep 19, 2023
35958b8
- Fixed missing variable initialization for CTurbSAVariable
Sep 19, 2023
09e977f
- Added DES implementations to SST: DDES, Improved DDES (IDDES), Simp…
Oct 5, 2023
8c8e89d
- Added SST DDES in config
Oct 5, 2023
71ac9c4
- Added Debug quantities
Oct 10, 2023
5b5fc30
- Added division by 0 protection
Oct 17, 2023
ef50283
- Added computation of LESIQ to Output
Oct 21, 2023
91c742e
Merge branch 'develop' into feature_SST_IDDES
rois1995 Oct 22, 2023
6c86a19
Merge 'origin/feature_SAS' into feature_SST_IDDES
Oct 23, 2023
48a9f3d
- modified codi
Oct 23, 2023
ae33b05
- Modified Velocity Laplacian (vector -> Matrix)
Oct 27, 2023
6443070
- Added outputs log for SST-DDES
Sep 20, 2024
caf0d41
Merge remote-tracking branch 'origin/develop' into feature_SST_IDDES
Sep 20, 2024
a584526
- update externals
Sep 20, 2024
0f3a832
Merge remote-tracking branch 'origin/develop' into feature_SST_IDDES
Oct 30, 2024
710e1dc
Fix SAS Babu implementation
Oct 30, 2024
e4f28d4
- Fixed compilation error
Oct 30, 2024
068ac21
- Moved output functions not to brake the restart
Feb 6, 2025
cbe79f7
- Added limiting to eddy viscosity (needed?)
Feb 7, 2025
d770fa1
Update SU2_CFD/include/numerics/CNumerics.hpp
rois1995 Feb 7, 2025
4dda141
Update SU2_CFD/include/numerics/CNumerics.hpp
rois1995 Feb 7, 2025
84d65bf
- change grid size computation to account for 2D
Feb 7, 2025
5337229
- Added output of debug variables to SAS
Feb 7, 2025
0806d21
- Fixed bug that always activates SAS Babu
Feb 10, 2025
0cab1ef
- Modified the C_S constant in Lvk limiter
Feb 12, 2025
ad86192
Changed computation of Laplacian
Feb 26, 2025
dcbacc8
- slight changes to functions calls
Mar 4, 2025
33c6664
Merge remote-tracking branch 'origin/develop' into feature_SST_IDDES
Mar 4, 2025
a5702d8
- align externals and submodules to develop
Mar 7, 2025
ab6bedb
-fixed compilation errors
Mar 7, 2025
e5080a1
- Solve declaration hids variable
Mar 7, 2025
c2fd653
- SRS Grid size output (fix?)
Mar 7, 2025
d377903
Merge remote-tracking branch 'origin/develop' into feature_SST_IDDES
Mar 10, 2025
d037e59
- Added SLA DDES formulation to SST
Mar 18, 2025
d9f329e
Merge remote-tracking branch 'origin/develop' into feature_SST_IDDES
Mar 18, 2025
0adcb7e
- compilation erorr
Mar 19, 2025
d50b123
- Fix memory leak
Mar 19, 2025
34a0271
- fixed formatting error
Mar 19, 2025
04dfcd3
Merge remote-tracking branch 'origin/develop' into feature_SST_IDDES
Mar 25, 2025
a60fb13
Merge remote-tracking branch 'origin/develop' into feature_SST_IDDES
Mar 28, 2025
95ccc73
- update externals
Mar 28, 2025
de45d5f
- update externals and subprojects
Mar 28, 2025
d172607
- Try changes to SA-EDDES
Mar 31, 2025
e5a916c
- Fix bug in SST-EDDES
Apr 1, 2025
c723a13
- Set debug quantities
Apr 1, 2025
d051f0b
- try fix
Apr 1, 2025
c840256
- Fix output
Apr 1, 2025
9b997d7
- Fix output
Apr 7, 2025
8f3efae
- Added come outputs
Jun 10, 2025
f716218
- minor fix
Jun 10, 2025
28490fd
Merge remote-tracking branch 'origin/develop' into feature_SST_IDDES
Jul 7, 2025
ff56f36
Merge remote-tracking branch 'origin/develop' into feature_SST_IDDES
Sep 18, 2025
707afa4
update meson and ninja
Sep 18, 2025
b249f2c
Merge remote-tracking branch 'origin/develop' into HEAD
Oct 2, 2025
f10c465
Removed SAS implementation (not working)
Oct 2, 2025
37a866f
- Removed debug quantities
Oct 2, 2025
ac2078c
- Re-introduced the virtual function
Oct 2, 2025
0c8d49a
- Fixed some notation
Oct 2, 2025
86db90b
- Fix compilation issues
Oct 2, 2025
d4564da
- Fixed variable inputs
Oct 3, 2025
177276a
- Fixed some thread sanitizer problems
Oct 3, 2025
e260cc4
- Removed unused functions
Oct 3, 2025
7e57afe
- Fixed some notation
Oct 3, 2025
f193796
- Added SST-EDDES formulation for unstructured grids
Oct 30, 2025
c5e1dee
Merge remote-tracking branch 'origin/develop' into feature_SST_IDDES
Oct 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion Common/include/option_structure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,8 @@ enum class SST_OPTIONS {
V, /*!< \brief Menter k-w SST model with vorticity production terms. */
KL, /*!< \brief Menter k-w SST model with Kato-Launder production terms. */
UQ, /*!< \brief Menter k-w SST model with uncertainty quantification modifications. */
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. */
Copy link
Member

Choose a reason for hiding this comment

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

Are these the names in the literature?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, these are just placeholders. There are no names in literature, that is why I named them according to the complexity of the model

Copy link
Member

Choose a reason for hiding this comment

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

Maybe something after the authors since the models come from different papers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, why not

};
static const MapType<std::string, SST_OPTIONS> SST_Options_Map = {
MakePair("NONE", SST_OPTIONS::NONE)
Expand All @@ -1002,6 +1004,8 @@ static const MapType<std::string, SST_OPTIONS> SST_Options_Map = {
MakePair("VORTICITY", SST_OPTIONS::V)
MakePair("KATO-LAUNDER", SST_OPTIONS::KL)
MakePair("UQ", SST_OPTIONS::UQ)
MakePair("SAS_SIMPLE", SST_OPTIONS::SAS_SIMPLE)
MakePair("SAS_COMPLICATED", SST_OPTIONS::SAS_COMPLICATED)
};

/*!
Expand All @@ -1010,8 +1014,10 @@ static const MapType<std::string, SST_OPTIONS> SST_Options_Map = {
struct SST_ParsedOptions {
SST_OPTIONS version = SST_OPTIONS::V1994; /*!< \brief Enum SST base model. */
SST_OPTIONS production = SST_OPTIONS::NONE; /*!< \brief Enum for production corrections/modifiers for SST model. */
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. */
Copy link
Member

Choose a reason for hiding this comment

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

Probably the type is enough and "none" indicates no sas.

Suggested change
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. */

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I'll modify it.

bool modified = false; /*!< \brief Bool for modified (m) SST model. */
};

Expand Down Expand Up @@ -1048,6 +1054,16 @@ inline SST_ParsedOptions ParseSSTOptions(const SST_OPTIONS *SST_Options, unsigne
const bool sst_v = IsPresent(SST_OPTIONS::V);
const bool sst_kl = IsPresent(SST_OPTIONS::KL);
const bool sst_uq = IsPresent(SST_OPTIONS::UQ);
const bool sst_sas_simple = IsPresent(SST_OPTIONS::SAS_SIMPLE);
const bool sst_sas_comp = IsPresent(SST_OPTIONS::SAS_COMPLICATED);
const bool sst_sas = sst_sas_simple || sst_sas_comp;
if (sst_sas_simple && sst_sas_comp) {
SU2_MPI::Error("Two versions (Simple and Complicated) selected for SAS under SST_OPTIONS. Please choose only one.", CURRENT_FUNCTION);
Copy link
Member

Choose a reason for hiding this comment

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

Update simple and complicated?

} else if (sst_sas_simple) {
SSTParsedOptions.sasModel = SST_OPTIONS::SAS_SIMPLE;
} else {
SSTParsedOptions.sasModel = SST_OPTIONS::SAS_COMPLICATED;
}

if (sst_1994 && sst_2003) {
SU2_MPI::Error("Two versions (1994 and 2003) selected for SST_OPTIONS. Please choose only one.", CURRENT_FUNCTION);
Expand All @@ -1071,6 +1087,7 @@ inline SST_ParsedOptions ParseSSTOptions(const SST_OPTIONS *SST_Options, unsigne
SSTParsedOptions.sust = sst_sust;
SSTParsedOptions.modified = sst_m;
SSTParsedOptions.uq = sst_uq;
SSTParsedOptions.sas = sst_sas;
return SSTParsedOptions;
}

Expand Down Expand Up @@ -1380,14 +1397,20 @@ enum ENUM_HYBRIDRANSLES {
SA_DES = 1, /*!< \brief Kind of Hybrid RANS/LES (SA - Detached Eddy Simulation (DES)). */
SA_DDES = 2, /*!< \brief Kind of Hybrid RANS/LES (SA - Delayed DES (DDES) with Delta_max SGS ). */
SA_ZDES = 3, /*!< \brief Kind of Hybrid RANS/LES (SA - Delayed DES (DDES) with Vorticity based SGS like Zonal DES). */
SA_EDDES = 4 /*!< \brief Kind of Hybrid RANS/LES (SA - Delayed DES (DDES) with Shear Layer Adapted SGS: Enhanced DDES). */
SA_EDDES = 4, /*!< \brief Kind of Hybrid RANS/LES (SA - Delayed DES (DDES) with Shear Layer Adapted SGS: Enhanced DDES). */
SST_DDES = 5, /*!< \brief Kind of Hybrid RANS/LES (SST - Delayed DES (DDES): DDES). */
SST_IDDES = 6, /*!< \brief Kind of Hybrid RANS/LES (SST - Delayed DES (DDES): Improved DDES). */
SST_SIDDES = 7 /*!< \brief Kind of Hybrid RANS/LES (SST - Delayed DES (DDES): Simplified Improved DDES). */
};
static const MapType<std::string, ENUM_HYBRIDRANSLES> HybridRANSLES_Map = {
MakePair("NONE", NO_HYBRIDRANSLES)
MakePair("SA_DES", SA_DES)
MakePair("SA_DDES", SA_DDES)
MakePair("SA_ZDES", SA_ZDES)
MakePair("SA_EDDES", SA_EDDES)
MakePair("SST_DDES", SST_DDES)
MakePair("SST_IDDES", SST_IDDES)
MakePair("SST_SIDDES", SST_SIDDES)
};

/*!
Expand Down Expand Up @@ -2450,6 +2473,7 @@ enum PERIODIC_QUANTITIES {
PERIODIC_LIM_PRIM_1 , /*!< \brief Primitive limiter communication phase 1 of 2 (periodic only). */
PERIODIC_LIM_PRIM_2 , /*!< \brief Primitive limiter communication phase 2 of 2 (periodic only). */
PERIODIC_IMPLICIT , /*!< \brief Implicit update communication to ensure consistency across periodic boundaries. */
PERIODIC_VEL_LAPLACIAN , /*!< \brief Velocity Laplacian communication for SAS (periodic only). */
};

/*!
Expand Down Expand Up @@ -2481,6 +2505,7 @@ enum MPI_QUANTITIES {
MESH_DISPLACEMENTS , /*!< \brief Mesh displacements at the interface. */
SOLUTION_TIME_N , /*!< \brief Solution at time n. */
SOLUTION_TIME_N1 , /*!< \brief Solution at time n-1. */
VELOCITY_LAPLACIAN , /*!< \brief Velocity Laplacian communication. */
};

/*!
Expand Down
3 changes: 3 additions & 0 deletions Common/src/CConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6157,6 +6157,9 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) {
case SA_DDES: cout << "Delayed Detached Eddy Simulation (DDES) with Standard SGS" << endl; break;
case SA_ZDES: cout << "Delayed Detached Eddy Simulation (DDES) with Vorticity-based SGS" << endl; break;
case SA_EDDES: cout << "Delayed Detached Eddy Simulation (DDES) with Shear-layer Adapted SGS" << endl; break;
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;
Copy link
Member

Choose a reason for hiding this comment

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

The description is slightly different right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I planned to modify the details on the final implementation. I'll do it now

}
break;
case MAIN_SOLVER::NEMO_EULER:
Expand Down
34 changes: 34 additions & 0 deletions SU2_CFD/include/numerics/CNumerics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ class CNumerics {

bool bounded_scalar = false; /*!< \brief Flag for bounded scalar problem */

su2double lengthScale_i, lengthScale_j;
su2double FTrans; /*!< \brief SAS function */
su2double VelLapl_X, VelLapl_Y, VelLapl_Z;
Copy link
Member

Choose a reason for hiding this comment

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

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the main problem with my implementation is that the norm of the velocity laplacian stated in the paper is $||U''||=\sqrt{\sum_i \left( \frac{\partial^2 U_i}{\partial x_j \partial x_j}\right)^2}$ and I am not sure that this is what I am computing. Do I need to store a matrix for each velocity component, compute it as gradient of the gradient and then sum the traces of each matrix?

Copy link
Member

Choose a reason for hiding this comment

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

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.


public:
/*!
* \brief Return type used in some "ComputeResidual" overloads to give a
Expand Down Expand Up @@ -707,6 +711,26 @@ class CNumerics {
*/
virtual void SetCrossDiff(su2double val_CDkw_i) {/* empty */};

/*!
* \brief Get the value of the value of FTrans.
*/
inline virtual su2double GetFTrans() const { return 0.0; }

/*!
* \brief Get the value of the value of FTrans.
*/
inline void SetVelLapl(su2double val_VelLapl_X, su2double val_VelLapl_Y) {
VelLapl_X = val_VelLapl_X;
VelLapl_Y = val_VelLapl_Y;
}

/*!
* \brief Get the value of the value of FTrans.
*/
inline void SetVelLapl_Z(su2double val_VelLapl_Z) {
VelLapl_Z = val_VelLapl_Z;
}

/*!
* \brief Set the value of the effective intermittency for the LM model.
* \param[in] intermittency_eff_i - Value of the effective intermittency at point i.
Expand Down Expand Up @@ -828,6 +852,16 @@ class CNumerics {
dist_j = val_dist_j;
}

/*!
* \brief Set the value of the length scale for SST.
* \param[in] val_lengthScale_i - Value of of the length scale for SST from point i.
* \param[in] val_lengthScale_j - Value of of the length scale for SST from point j.
*/
void SetLengthScale(su2double val_lengthScale_i, su2double val_lengthScale_j) {
lengthScale_i = val_lengthScale_i;
lengthScale_j = val_lengthScale_j;
}

/*!
* \brief Set the value of the roughness from the nearest wall.
* \param[in] val_dist_i - Value of of the roughness of the nearest wall from point i
Expand Down
68 changes: 64 additions & 4 deletions SU2_CFD/include/numerics/turbulent/turb_sources.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,7 @@ class CSourcePieceWise_TurbSST final : public CNumerics {
/*--- Closure constants ---*/
const su2double sigma_k_1, sigma_k_2, sigma_w_1, sigma_w_2, beta_1, beta_2, beta_star, a1, alfa_1, alfa_2;
const su2double prod_lim_const;
const su2double cTrans;

/*--- Ambient values for SST-SUST. ---*/
const su2double kAmb, omegaAmb;
Expand Down Expand Up @@ -689,6 +690,7 @@ class CSourcePieceWise_TurbSST final : public CNumerics {
alfa_1(constants[8]),
alfa_2(constants[9]),
prod_lim_const(constants[10]),
cTrans(1.25),
kAmb(val_kine_Inf),
omegaAmb(val_omega_Inf) {
/*--- "Allocate" the Jacobian using the static buffer. ---*/
Expand Down Expand Up @@ -834,6 +836,9 @@ class CSourcePieceWise_TurbSST final : public CNumerics {
/*--- Dissipation ---*/

su2double dk = beta_star * Density_i * ScalarVar_i[1] * ScalarVar_i[0];
if (config->GetKind_HybridRANSLES() != NO_HYBRIDRANSLES)
dk = Density_i * sqrt(ScalarVar_i[0]*ScalarVar_i[0]*ScalarVar_i[0]) / lengthScale_i;
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
dk = Density_i * sqrt(ScalarVar_i[0]*ScalarVar_i[0]*ScalarVar_i[0]) / lengthScale_i;
dk = Density_i * sqrt(pow(ScalarVar_i[0], 3)) / lengthScale_i;


su2double dw = beta_blended * Density_i * ScalarVar_i[1] * ScalarVar_i[1];

/*--- LM model coupling with production and dissipation term for k transport equation---*/
Expand All @@ -847,9 +852,53 @@ class CSourcePieceWise_TurbSST final : public CNumerics {
Residual[0] += pk * Volume;
Residual[1] += pw * Volume;

/*--- Add the dissipation terms to the residuals.---*/
/*--- Compute SAS source term. ---*/
su2double Q_SAS = 0.0;

if (sstParsedOptions.sas && sstParsedOptions.sasModel == SST_OPTIONS::SAS_COMPLICATED) {

const su2double KolmConst = 0.41;
const su2double csi2 = 3.51;
const su2double sigma_phi = 2.0/3.0;
const su2double C = 2.0;
const su2double C_s = 0.5; // Honestly I do not know if it is the right one.
const su2double gridSize = pow(Volume, 1.0/3.0);
// Scale of the modeled turbulence
const su2double L = sqrt(ScalarVar_i[0]) / (pow(beta_star, 0.25) * ScalarVar_i[1]);
// Von Karman Length Scale
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);
Copy link
Member

Choose a reason for hiding this comment

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

Is the velocity laplacian only used for the source term? Or will you have changes to the convection or diffusion fluxes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is just for the source term

const su2double L_vK_2 = C_s * sqrt(KolmConst * csi2 / (beta_blended/beta_star - alfa_blended)) * gridSize;
const su2double L_vK = max(L_vK_1, L_vK_2);

su2double gradOmega = 0.0;
for (unsigned short iDim = 0; iDim < nDim; iDim++)
gradOmega += ScalarVar_Grad_i[1][iDim]*ScalarVar_Grad_i[1][iDim];
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 geometry toolbox for this type of operation, there are some examples in this file I think


gradOmega /= ScalarVar_i[1];

su2double gradTKE = 0.0;
for (unsigned short iDim = 0; iDim < nDim; iDim++)
gradTKE += ScalarVar_Grad_i[0][iDim]*ScalarVar_Grad_i[0][iDim];

gradTKE /= ScalarVar_i[0];

const su2double Q_SAS_1 = csi2 * KolmConst * StrainMag_i * StrainMag_i * (L/L_vK) * (L/L_vK);
const su2double Q_SAS_2 = C * (2*ScalarVar_i[0] / sigma_phi) * max(gradOmega, gradTKE);

Q_SAS = max(Q_SAS_1 - Q_SAS_2, 0.0);

Residual[1] += Density_i * Q_SAS * Volume;

}

Residual[0] -= dk * Volume;
/*--- Add the dissipation terms to the residuals.---*/
FTrans = 1.0;
if (sstParsedOptions.sas && sstParsedOptions.sasModel == SST_OPTIONS::SAS_SIMPLE) {
FTrans = max(1.0, pow(StrainMag_i / (cTrans * VorticityMag), 2.0));
}
Residual[0] -= dk * Volume * FTrans;
Residual[1] -= dw * Volume;

/*--- Cross diffusion ---*/
Expand All @@ -862,15 +911,26 @@ class CSourcePieceWise_TurbSST final : public CNumerics {

/*--- Implicit part ---*/

Jacobian_i[0][0] = -beta_star * ScalarVar_i[1] * Volume;
Jacobian_i[0][1] = -beta_star * ScalarVar_i[0] * Volume;
Jacobian_i[0][0] = -beta_star * ScalarVar_i[1] * Volume * FTrans;
Jacobian_i[0][1] = -beta_star * ScalarVar_i[0] * Volume * FTrans;
Jacobian_i[1][0] = 0.0;
Jacobian_i[1][1] = -2.0 * beta_blended * ScalarVar_i[1] * Volume;

if (sstParsedOptions.sas && sstParsedOptions.sasModel == SST_OPTIONS::SAS_COMPLICATED) {
Jacobian_i[0][0] += Q_SAS * Volume / ScalarVar_i[0];
}
}

AD::SetPreaccOut(Residual, nVar);
AD::EndPreacc();

return ResidualType<>(Residual, Jacobian_i, nullptr);
}

/*!
* \brief Get the value of the FTrans.
*/
inline su2double GetFTrans() const override { return FTrans; }


};
10 changes: 10 additions & 0 deletions SU2_CFD/include/solvers/CTurbSSTSolver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,16 @@ class CTurbSSTSolver final : public CTurbSolver {
const CConfig *config,
unsigned short val_marker);

/*!
* \brief A virtual member.
* \param[in] solver - Solver container
* \param[in] geometry - Geometrical definition.
* \param[in] config - Definition of the particular problem.
*/
void SetDES_LengthScale(CSolver** solver,
CGeometry *geometry,
CConfig *config);

public:
/*!
* \brief Constructor.
Expand Down
38 changes: 24 additions & 14 deletions SU2_CFD/include/variables/CTurbSAVariable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@
class CTurbSAVariable final : public CTurbVariable {

private:
VectorType DES_LengthScale;
VectorType Vortex_Tilting;

VectorType k, Omega; /*!< \brief SST variables as computed through SA solution. */

public:
/*!
* \brief Constructor of the class.
Expand All @@ -60,19 +61,6 @@ class CTurbSAVariable final : public CTurbVariable {
*/
~CTurbSAVariable() override = default;

/*!
* \brief Get the DES length scale
* \param[in] iPoint - Point index.
* \return Value of the DES length Scale.
*/
inline su2double GetDES_LengthScale(unsigned long iPoint) const override { return DES_LengthScale(iPoint); }

/*!
* \brief Set the DES Length Scale.
* \param[in] iPoint - Point index.
*/
inline void SetDES_LengthScale(unsigned long iPoint, su2double val_des_lengthscale) override { DES_LengthScale(iPoint) = val_des_lengthscale; }

/*!
* \brief Set the vortex tilting measure for computation of the EDDES length scale
* \param[in] iPoint - Point index.
Expand All @@ -87,4 +75,26 @@ class CTurbSAVariable final : public CTurbVariable {
*/
inline su2double GetVortex_Tilting(unsigned long iPoint) const override { return Vortex_Tilting(iPoint); }

/*!
* \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;
Copy link
Member

Choose a reason for hiding this comment

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

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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.

Omega(iPoint) = val_Omega;
}

};
Loading