Skip to content

Commit

Permalink
Apply suggestions from code review idaholab#27800 idaholab#27887 idah…
Browse files Browse the repository at this point in the history
…olab#27888

Co-authored-by: Mauricio Tano <mauriciotano@gmail.com>
  • Loading branch information
freiler and tanoret authored Jun 17, 2024
1 parent 3dece3c commit af9bcf8
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions modules/navier_stokes/src/auxkernels/RANSYPlusAux.C
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ InputParameters
RANSYPlusAux::validParams()
{
InputParameters params = AuxKernel::validParams();
params.addClassDescription("Calculates y+ value");
params.addClassDescription("Calculates non-dimensional wall distance (y+) value.");
params.addRequiredCoupledVar("u", "The velocity in the x direction.");
params.addCoupledVar("v", "The velocity in the y direction.");
params.addCoupledVar("w", "The velocity in the z direction.");
params.addRequiredParam<MooseFunctorName>(NS::TKE, "Coupled turbulent kinetic energy.");
params.addRequiredParam<MooseFunctorName>(NS::density, "fluid density");
params.addRequiredParam<MooseFunctorName>(NS::TKE, "Turbulent kinetic energy functor.");
params.addRequiredParam<MooseFunctorName>(NS::density, "Fluid density.");
params.addRequiredParam<MooseFunctorName>(NS::mu, "Dynamic viscosity.");
params.addParam<std::vector<BoundaryName>>(
"walls", {}, "Boundaries that correspond to solid walls.");
Expand All @@ -33,7 +33,7 @@ RANSYPlusAux::validParams()
wall_treatment,
"The method used for computing the wall functions "
"'eq_newton', 'eq_incremental', 'eq_linearized', 'neq'");
params.addParam<Real>("C_mu", 0.09, "Coupled turbulent kinetic energy closure.");
params.addParam<Real>("C_mu", 0.09, "Coupled turbulent kinetic energy closure coefficient.");

return params;
}
Expand Down Expand Up @@ -74,7 +74,6 @@ RANSYPlusAux::computeValue()
const auto elem_arg = makeElemArg(_current_elem);
const auto rho = _rho(elem_arg, state);
const auto mu = _mu(elem_arg, state);
const auto TKE = _k(elem_arg, state);
ADReal y_plus;

if (_wall_bounded.find(_current_elem) != _wall_bounded.end())
Expand All @@ -99,19 +98,16 @@ RANSYPlusAux::computeValue()
if (_wall_treatment == "neq")
{
// Non-equilibrium / Non-iterative
y_plus = std::pow(_C_mu, 0.25) * distance * std::sqrt(TKE) * rho / mu;
y_plus = std::pow(_C_mu, 0.25) * distance * std::sqrt(_k(elem_arg, state)) * rho / mu;
}
else
{
// Equilibrium / Iterative
y_plus = NS::findyPlus(mu, rho, std::max(parallel_speed, 1e-10), distance);
}
}
// return *std::max_element(y_plus_vec.begin(), y_plus_vec.end());
return raw_value(y_plus);
}
else
{
return 0.;
}
return 0.;
}

0 comments on commit af9bcf8

Please sign in to comment.