86    _cw1(_cb1 / _kappa / _kappa + (1 + _cb2) / _sigma),
 
   94    _mu_tilde(adCoupledValue(
"mu_tilde")),
 
   95    _grad_mu(adCoupledGradient(
"mu_tilde")),
 
   96    _tau_visc(this->template declareADProperty<Real>(
"tau_viscosity")),
 
   97    _wall_dist(coupledValue(
"wall_distance_var")),
 
   98    _use_ft2_term(this->template getParam<bool>(
"use_ft2_term")),
 
   99    _strain_mag(this->template declareADProperty<Real>(
"strain_mag")),
 
  100    _convection_strong_residual(this->template
 
  101        declareADProperty<Real>(
"convection_strong_residual")),
 
  102    _destruction_strong_residual(this->template
 
  103        declareADProperty<Real>(
"destruction_strong_residual")),
 
  104    _diffusion_strong_residual(this->template
 
  105        declareADProperty<Real>(
"diffusion_strong_residual")),
 
  106    _source_strong_residual(this->template
 
  107        declareADProperty<Real>(
"source_strong_residual")),
 
  108    _time_strong_residual(this->template
 
  109        declareADProperty<Real>(
"time_strong_residual")),
 
  110    _visc_strong_residual(this->template
 
  111        declareADProperty<Real>(
"visc_strong_residual"))
 
 
  131  T::computeQpProperties();
 
  134  _strain_mag[_qp] = 2.0 * Utility::pow<2>(_grad_velocity[_qp](0, 0)) +
 
  135                     2.0 * Utility::pow<2>(_grad_velocity[_qp](1, 1)) +
 
  136                     2.0 * Utility::pow<2>(_grad_velocity[_qp](2, 2)) +
 
  137                     Utility::pow<2>(_grad_velocity[_qp](0, 2) + _grad_velocity[_qp](2, 0)) +
 
  138                     Utility::pow<2>(_grad_velocity[_qp](0, 1) + _grad_velocity[_qp](1, 0)) +
 
  139                     Utility::pow<2>(_grad_velocity[_qp](1, 2) + _grad_velocity[_qp](2, 1));
 
  140  _strain_mag[_qp] = std::sqrt(_strain_mag[_qp] + 1e-16);
 
  141  ADReal vorticity_mag =
 
  142      Utility::pow<2>(_grad_velocity[_qp](0, 2) - _grad_velocity[_qp](2, 0)) +
 
  143      Utility::pow<2>(_grad_velocity[_qp](0, 1) - _grad_velocity[_qp](1, 0)) +
 
  144      Utility::pow<2>(_grad_velocity[_qp](1, 2) - _grad_velocity[_qp](2, 1));
 
  145  vorticity_mag = std::sqrt(vorticity_mag + 1e-16);
 
  148  const Real d = std::max(_wall_dist[_qp], 1e-16); 
 
  149  const ADReal chi = _mu_tilde[_qp] / _mu[_qp];
 
  150  const ADReal fv1 = Utility::pow<3>(chi) / (Utility::pow<3>(chi) + Utility::pow<3>(_cv1));
 
  151  const ADReal fv2 = 1.0 - chi / (1. + chi * fv1);
 
  152  const ADReal S_tilde =
 
  153    vorticity_mag + _mu_tilde[_qp] * fv2 / (_kappa * _kappa * d * d * _rho[_qp]);
 
  154  const ADReal S = S_tilde + 2 * std::min(0.0, _strain_mag[_qp] - vorticity_mag);
 
  159    r = std::min(_mu_tilde[_qp] / (S_tilde * _kappa * _kappa * d * d * _rho[_qp]), 10.0);
 
  160  const ADReal g = r + _cw2 * (Utility::pow<6>(r) - r);
 
  161  const ADReal fw = g * std::pow((1. + Utility::pow<6>(_cw3)) /
 
  162                           (Utility::pow<6>(g) + Utility::pow<6>(_cw3)),
 
  168    const ADReal ft2 = _ct3 * std::exp(-_ct4 * chi * chi);
 
  169    _destruction_strong_residual[_qp] =
 
  170      (_cw1 * fw - _cb1 * ft2 / _kappa / _kappa) * Utility::pow<2>(_mu_tilde[_qp] / d);
 
  171    _source_strong_residual[_qp] = -(1 - ft2) * _rho[_qp] * _cb1 * S * _mu_tilde[_qp];
 
  175    _destruction_strong_residual[_qp] = _cw1 * fw * Utility::pow<2>(_mu_tilde[_qp] / d);
 
  176    _source_strong_residual[_qp] = -_rho[_qp] * _cb1 * S * _mu_tilde[_qp];
 
  178  _convection_strong_residual[_qp] = _rho[_qp] * _velocity[_qp] * _grad_mu[_qp];
 
  179  _diffusion_strong_residual[_qp] = -1.0 / _sigma * _cb2 * (_grad_mu[_qp] * _grad_mu[_qp]);
 
  181    _time_strong_residual[_qp] = (*_visc_dot)[_qp] * _rho[_qp];
 
  182  _visc_strong_residual[_qp] = _has_transient ? _time_strong_residual[_qp] : 0.0;
 
  183  _visc_strong_residual[_qp] += (_convection_strong_residual[_qp] +
 
  184                                 _destruction_strong_residual[_qp] +
 
  185                                 _diffusion_strong_residual[_qp] +
 
  186                                 _source_strong_residual[_qp]);
 
  189  const auto nu_visc = (_mu[_qp] + _mu_tilde[_qp]) / _rho[_qp] / _sigma;
 
  190  const auto transient_part = _has_transient ? 4.0 / (_dt * _dt) : 0.0;
 
  191  const auto speed = NS::computeSpeed(_velocity[_qp]);
 
  192  _tau_visc[_qp] = _alpha / std::sqrt(transient_part +
 
  193                                      (2.0 * speed / _hmax) * (2.0 * speed / _hmax) +
 
  194                                      9.0 * (4.0 * nu_visc / (_hmax * _hmax)) *
 
  195                                      4.0 * (nu_visc / (_hmax * _hmax)));
 
  198  const auto nu = (_mu[_qp] + _mu_tilde[_qp] * fv1) / _rho[_qp];
 
  199  _tau[_qp] = _alpha / std::sqrt(transient_part +
 
  200                                 (2.0 * speed / _hmax) * (2.0 * speed / _hmax) +
 
  201                                 9.0 * (4.0 * nu / (_hmax * _hmax)) *
 
  202                                 4.0 * (nu / (_hmax * _hmax)));