Skip to content

Commit b829867

Browse files
authored
Merge pull request #1157 from su2code/transition_maintenance
Fix compilation with gcc 4.8
2 parents 165c01a + 805d9bd commit b829867

8 files changed

Lines changed: 26 additions & 32 deletions

File tree

Common/include/linear_algebra/CSysVector.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class CSysVector : public VecExpr::CVecExpr<CSysVector<ScalarType>, ScalarType>
101101
/*!
102102
* \brief Default constructor of the class.
103103
*/
104-
CSysVector() = default;
104+
CSysVector() {}
105105

106106
/*!
107107
* \brief Destructor

Common/include/parallelization/vectorization.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class Array : public CVecExpr<Array<Scalar_t,N>, Scalar_t> {
7878
static constexpr bool StoreAsRef = true;
7979

8080
private:
81-
alignas(Align) Scalar x_[N];
81+
alignas(Size*sizeof(Scalar)) Scalar x_[N];
8282

8383
public:
8484
#define ARRAY_BOILERPLATE \

Common/src/CConfig.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4381,6 +4381,10 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_
43814381
SU2_MPI::Error("BC transition model currently only available in combination with SA turbulence model!", CURRENT_FUNCTION);
43824382
}
43834383

4384+
if (Kind_Trans_Model == LM) {
4385+
SU2_MPI::Error("The LM transition model is under maintenance.", CURRENT_FUNCTION);
4386+
}
4387+
43844388
/*--- Check for constant lift mode. Initialize the update flag for
43854389
the AoA with each iteration to false ---*/
43864390

@@ -5539,6 +5543,7 @@ void CConfig::SetOutput(unsigned short val_software, unsigned short val_izone) {
55395543
case SST_SUST: cout << "Menter's SST with sustaining terms" << endl; break;
55405544
}
55415545
if (QCR) cout << "Using Quadratic Constitutive Relation, 2000 version (QCR2000)" << endl;
5546+
if (Kind_Trans_Model == BC) cout << "Using the revised BC transition model (2020)" << endl;
55425547
cout << "Hybrid RANS/LES: ";
55435548
switch (Kind_HybridRANSLES){
55445549
case NO_HYBRIDRANSLES: cout << "No Hybrid RANS/LES" << endl; break;

SU2_CFD/src/numerics/turbulent/turb_sources.cpp

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,6 @@ CNumerics::ResidualType<> CSourcePieceWise_TurbSA::ComputeResidual(const CConfig
7676
// AD::SetPreaccIn(TurbVar_Grad_i[0], nDim);
7777
// AD::SetPreaccIn(Volume); AD::SetPreaccIn(dist_i);
7878

79-
// BC Transition Model variables
80-
su2double vmag, rey, re_theta, re_theta_t, re_v;
81-
su2double tu, nu_t, chi_1, chi_2, term1, term2, term_exponential;
82-
8379
// Set the boolean here depending on whether the point is closest to a rough wall or not.
8480
roughwall = (roughness_i > 0.0);
8581

@@ -99,16 +95,6 @@ CNumerics::ResidualType<> CSourcePieceWise_TurbSA::ComputeResidual(const CConfig
9995
Jacobian_i[0] = 0.0;
10096

10197
gamma_BC = 0.0;
102-
vmag = 0.0;
103-
tu = config->GetTurbulenceIntensity_FreeStream();
104-
rey = config->GetReynolds();
105-
106-
if (nDim==2) {
107-
vmag = sqrt(V_i[1]*V_i[1]+V_i[2]*V_i[2]);
108-
}
109-
else {
110-
vmag = sqrt(V_i[1]*V_i[1]+V_i[2]*V_i[2]+V_i[3]*V_i[3]);
111-
}
11298

11399
/*--- Evaluate Omega ---*/
114100

@@ -151,23 +137,23 @@ CNumerics::ResidualType<> CSourcePieceWise_TurbSA::ComputeResidual(const CConfig
151137

152138
if (transition) {
153139

154-
// BC model constants
155-
chi_1 = 0.002;
156-
chi_2 = 50.0;
140+
/*--- BC model constants (2020 revision). ---*/
141+
const su2double chi_1 = 0.002;
142+
const su2double chi_2 = 50.0;
143+
144+
su2double tu = config->GetTurbulenceIntensity_FreeStream();
157145

158-
nu_t = (TurbVar_i[0]*fv1); //S-A variable
159-
//nu_cr = chi_2/rey;
160-
//nu_BC = (nu_t)/(vmag*dist_i);
146+
su2double nu_t = (TurbVar_i[0]*fv1); //S-A variable
161147

162-
re_v = ((Density_i*pow(dist_i,2.))/(Laminar_Viscosity_i))*Omega;
163-
re_theta = re_v/2.193;
164-
re_theta_t = (803.73 * pow((tu + 0.6067),-1.027)); //MENTER correlation
148+
su2double re_v = ((Density_i*pow(dist_i,2.))/(Laminar_Viscosity_i))*Omega;
149+
su2double re_theta = re_v/2.193;
150+
su2double re_theta_t = (803.73 * pow((tu + 0.6067),-1.027)); //MENTER correlation
165151
//re_theta_t = 163.0 + exp(6.91-tu); //ABU-GHANNAM & SHAW correlation
166152

167-
term1 = sqrt(max(re_theta-re_theta_t,0.)/(chi_1*re_theta_t));
168-
term2 = sqrt(max((nu_t*chi_2)/nu,0.));
169-
term_exponential = (term1 + term2);
170-
gamma_BC = 1.0 - exp(-term_exponential);
153+
su2double term1 = sqrt(max(re_theta-re_theta_t,0.)/(chi_1*re_theta_t));
154+
su2double term2 = sqrt(max((nu_t*chi_2)/nu,0.));
155+
su2double term_exponential = (term1 + term2);
156+
su2double gamma_BC = 1.0 - exp(-term_exponential);
171157

172158
Production = gamma_BC*cb1*Shat*TurbVar_i[0]*Volume;
173159
}

TestCases/parallel_regression.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ def main():
546546
schubauer_klebanoff_transition.cfg_dir = "transition/Schubauer_Klebanoff"
547547
schubauer_klebanoff_transition.cfg_file = "transitional_BC_model_ConfigFile.cfg"
548548
schubauer_klebanoff_transition.test_iter = 10
549-
schubauer_klebanoff_transition.test_vals = [-7.994740, -14.268367, 0.000046, 0.007987]
549+
schubauer_klebanoff_transition.test_vals = [-7.994740, -14.268326, 0.000046, 0.007987]
550550
schubauer_klebanoff_transition.su2_exec = "parallel_computation.py -f"
551551
schubauer_klebanoff_transition.timeout = 1600
552552
schubauer_klebanoff_transition.tol = 0.00001

TestCases/serial_regression.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ def main():
643643
schubauer_klebanoff_transition.cfg_file = "transitional_BC_model_ConfigFile.cfg"
644644
schubauer_klebanoff_transition.test_iter = 10
645645
schubauer_klebanoff_transition.new_output = True
646-
schubauer_klebanoff_transition.test_vals = [-8.029786, -14.268351, 0.000053, 0.007986] #last 4 columns
646+
schubauer_klebanoff_transition.test_vals = [-8.029786, -14.268310, 0.000053, 0.007986] #last 4 columns
647647
schubauer_klebanoff_transition.su2_exec = "SU2_CFD"
648648
schubauer_klebanoff_transition.timeout = 1600
649649
schubauer_klebanoff_transition.tol = 0.00001

TestCases/tutorials.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def main():
121121
tutorial_trans_flatplate.cfg_dir = "../Tutorials/compressible_flow/Transitional_Flat_Plate"
122122
tutorial_trans_flatplate.cfg_file = "transitional_BC_model_ConfigFile.cfg"
123123
tutorial_trans_flatplate.test_iter = 0
124-
tutorial_trans_flatplate.test_vals = [-22.021786, -15.330906, 0.000000, 0.023952] #last 4 columns
124+
tutorial_trans_flatplate.test_vals = [-22.021786, -15.330766, 0.000000, 0.023952] #last 4 columns
125125
tutorial_trans_flatplate.su2_exec = "mpirun -np 2 SU2_CFD"
126126
tutorial_trans_flatplate.timeout = 1600
127127
tutorial_trans_flatplate.tol = 0.00001

config_template.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ SOLVER= EULER
2121
% Specify turbulence model (NONE, SA, SA_NEG, SST, SA_E, SA_COMP, SA_E_COMP, SST_SUST)
2222
KIND_TURB_MODEL= NONE
2323
%
24+
% Transition model (NONE, BC)
25+
KIND_TRANS_MODEL= NONE
26+
%
2427
% Specify subgrid scale model(NONE, IMPLICIT_LES, SMAGORINSKY, WALE, VREMAN)
2528
KIND_SGS_MODEL= NONE
2629
%

0 commit comments

Comments
 (0)