@@ -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 }
0 commit comments