Skip to content

Commit

Permalink
Update INSFVTurbulentViscosityWallFunction.C idaholab#27800 idaholab#…
Browse files Browse the repository at this point in the history
  • Loading branch information
freiler committed Jun 17, 2024
1 parent b1f7cb1 commit 6df0240
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,14 @@ INSFVTurbulentViscosityWallFunction::boundaryValue(const FaceInfo & fi) const

// Switch for determining the near wall quantities
// wall_treatment can be: "eq_newton eq_incremental eq_linearized neq"
ADReal u_tau;
ADReal y_plus;
const ADReal mut_visc = mu; // laminar sublayer viscosity
ADReal mut_log; // turbulent log-layer viscosity
ADReal mu_wall; // total wall viscosity to obtain the shear stress at the wall

if (_wall_treatment == "eq_newton")
{
// Full Newton-Raphson solve to find the wall quantities from the law of the wall
u_tau = NS::findUStar(mu, rho, parallel_speed, wall_dist);
const auto u_tau = NS::findUStar(mu, rho, parallel_speed, wall_dist);
y_plus = wall_dist * u_tau * rho / mu;
mu_wall = rho * Utility::pow<2>(u_tau) * wall_dist / parallel_speed;
mut_log = mu_wall - mu;
Expand All @@ -105,7 +103,7 @@ INSFVTurbulentViscosityWallFunction::boundaryValue(const FaceInfo & fi) const
(std::log(NS::E_turb_constant * std::max(wall_dist, 1.0) / mu) + 1.0);
const ADReal c_c = parallel_speed;

u_tau = (-b_c + std::sqrt(std::pow(b_c, 2) + 4.0 * a_c * c_c)) / (2.0 * a_c);
const auto u_tau = (-b_c + std::sqrt(std::pow(b_c, 2) + 4.0 * a_c * c_c)) / (2.0 * a_c);
y_plus = wall_dist * u_tau * rho / mu;
mu_wall = rho * Utility::pow<2>(u_tau) * wall_dist / parallel_speed;
mut_log = mu_wall - mu;
Expand All @@ -119,6 +117,9 @@ INSFVTurbulentViscosityWallFunction::boundaryValue(const FaceInfo & fi) const
std::log(std::max(NS::E_turb_constant * y_plus, 1 + 1e-4)));
mut_log = mu_wall - mu;
}
else
mooseAssert(false,"Should not reach here");

if (y_plus <= 5.0)
// sub-laminar layer
return 0.0;
Expand Down

0 comments on commit 6df0240

Please sign in to comment.