Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 7 additions & 0 deletions Common/include/CConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,7 @@ class CConfig {
Tke_FreeStream, /*!< \brief Total turbulent kinetic energy of the fluid. */
Intermittency_FreeStream, /*!< \brief Freestream intermittency (for sagt transition model) of the fluid. */
ReThetaT_FreeStream, /*!< \brief Freestream Transition Momentum Thickness Reynolds Number (for LM transition model) of the fluid. */
A_r_FreeStream, /*!< \brief Freestream Roughness Amplification factor (for LMROUGH transition model) of the fluid. */
NuFactor_FreeStream, /*!< \brief Ratio of turbulent to laminar viscosity. */
NuFactor_Engine, /*!< \brief Ratio of turbulent to laminar viscosity at the engine. */
KFactor_LowerLimit, /*!< \Non dimensional coefficient for lower limit of K in SST model. */
Expand Down Expand Up @@ -2026,6 +2027,12 @@ class CConfig {
* \return Freestream momentum thickness Reynolds number.
*/
su2double GetReThetaT_FreeStream() const { return ReThetaT_FreeStream; }

/*!
* \brief Get the value of the freestream amplification factor for LMROUGH transition model.
* \return Freestream roughness amplification factor.
*/
su2double GetA_r_FreeStream(void) const { return A_r_FreeStream; }

/*!
* \brief Get the value of the non-dimensionalized freestream turbulence intensity.
Expand Down
4 changes: 4 additions & 0 deletions Common/include/option_structure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1225,6 +1225,7 @@ enum class LM_OPTIONS {
MEDIDA_BAEDER,/*!< \brief Kind of transition correlation model (Medida-Baeder). */
MEDIDA, /*!< \brief Kind of transition correlation model (Medida). */
MENTER_LANGTRY, /*!< \brief Kind of transition correlation model (Menter-Langtry). */
LMROUGH, /*!< \brief Kind of roughness induced transition model. */
DEFAULT /*!< \brief Kind of transition correlation model (Menter-Langtry if SST, MALAN if SA). */
};

Expand All @@ -1237,6 +1238,7 @@ static const MapType<std::string, LM_OPTIONS> LM_Options_Map = {
MakePair("KRAUSE_HYPER", LM_OPTIONS::KRAUSE_HYPER)
MakePair("MEDIDA_BAEDER", LM_OPTIONS::MEDIDA_BAEDER)
MakePair("MENTER_LANGTRY", LM_OPTIONS::MENTER_LANGTRY)
MakePair("LMROUGH", LM_OPTIONS::LMROUGH)
MakePair("DEFAULT", LM_OPTIONS::DEFAULT)
};

Expand All @@ -1260,6 +1262,7 @@ enum class TURB_TRANS_CORRELATION {
struct LM_ParsedOptions {
LM_OPTIONS version = LM_OPTIONS::NONE; /*!< \brief LM base model. */
bool LM2015 = false; /*!< \brief Use cross-flow corrections. */
bool LMROUGH = false; /*!< \brief Use roughness induced transition version. */
TURB_TRANS_CORRELATION Correlation = TURB_TRANS_CORRELATION::DEFAULT;
};

Expand All @@ -1279,6 +1282,7 @@ inline LM_ParsedOptions ParseLMOptions(const LM_OPTIONS *LM_Options, unsigned sh
};

LMParsedOptions.LM2015 = IsPresent(LM_OPTIONS::LM2015);
LMParsedOptions.LMROUGH = IsPresent(LM_OPTIONS::LMROUGH);

int NFoundCorrelations = 0;
if (IsPresent(LM_OPTIONS::MALAN)) {
Expand Down
2 changes: 2 additions & 0 deletions Common/src/CConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6414,6 +6414,8 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) {
cout << "Transition model: Langtry and Menter's 4 equation model";
if (lmParsedOptions.LM2015) {
cout << " w/ cross-flow corrections (2015)" << endl;
} else if (lmParsedOptions.LMROUGH) {
cout << " w/ roughness-induced transition effects " << endl;
} else {
cout << " (2009)" << endl;
}
Expand Down
2 changes: 1 addition & 1 deletion SU2_CFD/include/numerics/scalar/scalar_convection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
template <class FlowIndices>
class CUpwScalar : public CNumerics {
protected:
enum : unsigned short {MAXNVAR = 8};
enum : unsigned short {MAXNVAR = 16};

const FlowIndices idx; /*!< \brief Object to manage the access to the flow primitives. */
su2double a0 = 0.0; /*!< \brief The maximum of the face-normal velocity and 0. */
Expand Down
2 changes: 1 addition & 1 deletion SU2_CFD/include/numerics/scalar/scalar_diffusion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ struct CNoFlowIndices {
template <class FlowIndices>
class CAvgGrad_Scalar : public CNumerics {
protected:
enum : unsigned short {MAXNVAR = 8};
enum : unsigned short {MAXNVAR = 16};

const FlowIndices idx; /*!< \brief Object to manage the access to the flow primitives. */
su2double Proj_Mean_GradScalarVar[MAXNVAR]; /*!< \brief Mean_gradScalarVar DOT normal, corrected if required. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,11 @@
template <class FlowIndices>
using CUpwSca_TransLM = CUpwSca_TurbSST<FlowIndices>;

/*!
* \class CUpwSca_TransLMROUGH
* \brief Use modified convective fluxes for the scalar upwind discretization of LMROUGH transition model equations to handle 3 variables.
* \ingroup ConvDiscr
*/
template <class FlowIndices>
using CUpwSca_TransLMROUGH = CUpwSca_TurbLMROUGH<FlowIndices>;

83 changes: 83 additions & 0 deletions SU2_CFD/include/numerics/turbulent/transition/trans_diffusion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,86 @@ class CAvgGrad_TransLM final : public CAvgGrad_Scalar<FlowIndices> {
}

};

/*!
* \class CAvgGrad_TransLMROUGH
* \brief Class for computing viscous term using average of gradient with correction (LMROUGH transition model).
* \ingroup ViscDiscr
* \author M. Schifone.
*/
template <class FlowIndices>
class CAvgGrad_TransLMROUGH final : public CAvgGrad_Scalar<FlowIndices> {
private:
using Base = CAvgGrad_Scalar<FlowIndices>;
using Base::Laminar_Viscosity_i;
using Base::Laminar_Viscosity_j;
using Base::Eddy_Viscosity_i;
using Base::Eddy_Viscosity_j;
using Base::Density_i;
using Base::Density_j;
using Base::ScalarVar_i;
using Base::ScalarVar_j;
using Base::Proj_Mean_GradScalarVar;
using Base::proj_vector_ij;
using Base::Flux;
using Base::Jacobian_i;
using Base::Jacobian_j;

/*!
* \brief Adds any extra variables to AD
*/
void ExtraADPreaccIn() override {}

/*!
* \brief LMROUGH transition model specific steps in the ComputeResidual method
* \param[in] config - Definition of the particular problem.
*/
void FinishResidualCalc(const CConfig* config) override {
const bool implicit = config->GetKind_TimeIntScheme() == EULER_IMPLICIT;

/*--- Compute mean effective dynamic viscosity ---*/
const su2double diff_i_gamma = Laminar_Viscosity_i + Eddy_Viscosity_i;
const su2double diff_j_gamma = Laminar_Viscosity_j + Eddy_Viscosity_j;
const su2double diff_i_ReThetaT = 2.0*(Laminar_Viscosity_i + Eddy_Viscosity_i);
const su2double diff_j_ReThetaT = 2.0*(Laminar_Viscosity_j + Eddy_Viscosity_j);
// Add diffusion terms in the LMROUGH model for A_r transport equation
const su2double diff_i_A_r = 10.0*(Laminar_Viscosity_i + Eddy_Viscosity_i);
const su2double diff_j_A_r = 10.0*(Laminar_Viscosity_j + Eddy_Viscosity_j);

const su2double diff_gamma = 0.5*(diff_i_gamma + diff_j_gamma);
const su2double diff_ReThetaT = 0.5*(diff_i_ReThetaT + diff_j_ReThetaT);
//Add computation of diffusion term for LMROUGH
const su2double diff_A_r = 0.5*(diff_i_A_r + diff_j_A_r);

Flux[0] = diff_gamma*Proj_Mean_GradScalarVar[0];
Flux[1] = diff_ReThetaT*Proj_Mean_GradScalarVar[1];
Flux[2] = diff_A_r*Proj_Mean_GradScalarVar[2];

/*--- For Jacobians -> Use of TSL (Thin Shear Layer) approx. to compute derivatives of the gradients ---*/
//modifications for the LMROUGH model
if (implicit) {
const su2double proj_on_rho_i = proj_vector_ij/Density_i;
Jacobian_i[0][0] = -diff_gamma*proj_on_rho_i; Jacobian_i[0][1] = 0.0; Jacobian_i[0][2] = 0.0;
Jacobian_i[1][0] = 0.0; Jacobian_i[1][1] = -diff_ReThetaT*proj_on_rho_i; Jacobian_i[1][2] = 0.0;
Jacobian_i[2][0] = 0.0; Jacobian_i[2][1] = 0.0; Jacobian_i[2][2] = -diff_A_r*proj_on_rho_i;

const su2double proj_on_rho_j = proj_vector_ij/Density_j;
Jacobian_j[0][0] = diff_gamma*proj_on_rho_j; Jacobian_j[0][1] = 0.0; Jacobian_j[0][2] = 0.0;
Jacobian_j[1][0] = 0.0; Jacobian_j[1][1] = diff_ReThetaT*proj_on_rho_j; Jacobian_j[1][2] = 0.0;
Jacobian_j[2][0] = 0.0; Jacobian_j[2][1] = 0.0; Jacobian_j[2][2] = diff_A_r*proj_on_rho_j;
}
}

public:
/*!
* \brief Constructor of the class.
* \param[in] val_nDim - Number of dimensions of the problem.
* \param[in] val_nVar - Number of variables of the problem.
* \param[in] correct_grad - Whether to correct gradient for skewness.
* \param[in] config - Definition of the particular problem.
*/
CAvgGrad_TransLMROUGH(unsigned short val_nDim, unsigned short val_nVar, bool correct_grad, const CConfig* config)
: CAvgGrad_Scalar<FlowIndices>(val_nDim, val_nVar, correct_grad, config){
}

};
Loading