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
20 changes: 12 additions & 8 deletions SU2_CFD/include/numerics/turbulent/turb_sources.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,9 @@ class CSourceBase_TurbSA : public CNumerics {
var.d_fv2 = 0.0;
} else {
var.fv2 = 1 - ScalarVar_i[0] / (nu + ScalarVar_i[0] * var.fv1);
var.d_fv2 = -(1 / nu - Ji_2 * var.d_fv1) / pow(1 + var.Ji * var.fv1, 2);
/*--- fv2 uses nue/nu, not Ji, which includes the roughness shift. ---*/
const su2double chi = ScalarVar_i[0] / nu;
var.d_fv2 = -(1 / nu - pow(chi, 2) * var.d_fv1) / pow(1 + chi * var.fv1, 2);
}

/*--- Evaluate Omega with a rotational correction term. ---*/
Expand Down Expand Up @@ -393,15 +395,15 @@ struct Bsl {
struct Edw {
template <class MatrixType>
static void get(const su2double*, unsigned short nDim, const MatrixType& velocity_grad, CSAVariables& var) {
su2double Sbar = 0.0;
su2double Sbar = 0.0, divVel = 0.0;
for (unsigned short iDim = 0; iDim < nDim; ++iDim) {
for (unsigned short jDim = 0; jDim < nDim; ++jDim) {
Sbar += (velocity_grad[iDim][jDim] + velocity_grad[jDim][iDim]) * velocity_grad[iDim][jDim];
}
divVel += velocity_grad[iDim][iDim];
}
for (unsigned short iDim = 0; iDim < nDim; ++iDim) {
Sbar -= (2.0 / 3.0) * pow(velocity_grad[iDim][iDim], 2);
}
/*--- The square of the divergence, not the sum of the squared normal gradients. ---*/
Sbar -= (2.0 / 3.0) * pow(divVel, 2);
var.Omega = sqrt(max(Sbar, 0.0));
}
};
Expand Down Expand Up @@ -517,11 +519,13 @@ struct Bsl {
/*! \brief Edward. */
struct Edw {
static void get(const su2double& nue, CSAVariables& var) {
var.r = min(nue * var.inv_Shat * var.inv_k2_d2, 10.0);
var.r = tanh(var.r) / tanh(1.0);
const su2double r0 = min(nue * var.inv_Shat * var.inv_k2_d2, 10.0);
var.r = tanh(r0) / tanh(1.0);

/*--- Chain rule through tanh, evaluated at the argument r0, zero where r0 is clipped. ---*/
var.d_r = (var.Shat - nue * var.d_Shat) * pow(var.inv_Shat, 2) * var.inv_k2_d2;
var.d_r = (1 - pow(tanh(var.r), 2.0)) * (var.d_r) / tanh(1.0);
var.d_r = (1 - pow(tanh(r0), 2)) * var.d_r / tanh(1.0);
if (r0 >= 10.0) var.d_r = 0.0;
}
};
};
Expand Down
6 changes: 3 additions & 3 deletions TestCases/parallel_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,7 @@ def main():
inc_flatplate_pb.cfg_dir = "incomp_rans/rough_flatplate"
inc_flatplate_pb.cfg_file = "pb_rough_flatplate_incomp.cfg"
inc_flatplate_pb.test_iter = 10
inc_flatplate_pb.test_vals = [-4.063342, -9.884401, 0.000010, 0.228472]
inc_flatplate_pb.test_vals = [-4.064345, -9.885656, 0.000010, 0.227833]
test_list.append(inc_flatplate_pb)

####################
Expand Down Expand Up @@ -1057,15 +1057,15 @@ def main():
turbmod_sa_edw_rae2822.cfg_dir = "turbulence_models/sa/rae2822"
turbmod_sa_edw_rae2822.cfg_file = "turb_SA_EDW_RAE2822.cfg"
turbmod_sa_edw_rae2822.test_iter = 20
turbmod_sa_edw_rae2822.test_vals = [-3.069523, -0.405788, -0.835321, -5.185709, 0.794436, 0.017856]
turbmod_sa_edw_rae2822.test_vals = [-3.068385, -0.406592, -0.835280, -5.180711, 0.793959, 0.017892]
test_list.append(turbmod_sa_edw_rae2822)

# SA Compressibility and Edwards
turbmod_sa_comp_edw_rae2822 = TestCase('turbmod_sa_comp_edw_rae2822')
turbmod_sa_comp_edw_rae2822.cfg_dir = "turbulence_models/sa/rae2822"
turbmod_sa_comp_edw_rae2822.cfg_file = "turb_SA_COMP_EDW_RAE2822.cfg"
turbmod_sa_comp_edw_rae2822.test_iter = 20
turbmod_sa_comp_edw_rae2822.test_vals = [-3.067904, -0.338707, -0.811157, -5.279475, 0.809906, 0.019797]
turbmod_sa_comp_edw_rae2822.test_vals = [-3.067420, -0.339121, -0.811188, -5.278079, 0.809497, 0.019818]
test_list.append(turbmod_sa_comp_edw_rae2822)

# SA QCR
Expand Down
2 changes: 1 addition & 1 deletion TestCases/serial_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ def main():
inc_flatplate_pb.cfg_dir = "incomp_rans/rough_flatplate"
inc_flatplate_pb.cfg_file = "pb_rough_flatplate_incomp.cfg"
inc_flatplate_pb.test_iter = 10
inc_flatplate_pb.test_vals = [-4.063342, -9.884401, 0.000010, 0.228472]
inc_flatplate_pb.test_vals = [-4.064345, -9.885656, 0.000010, 0.227833]
test_list.append(inc_flatplate_pb)

# FLAT PLATE, WALL FUNCTIONS, INCOMPRESSIBLE SST
Expand Down
Loading