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(
101 this->template declareADProperty<Real>(
"convection_strong_residual")),
102 _destruction_strong_residual(
103 this->template declareADProperty<Real>(
"destruction_strong_residual")),
104 _diffusion_strong_residual(this->template declareADProperty<Real>(
"diffusion_strong_residual")),
105 _source_strong_residual(this->template declareADProperty<Real>(
"source_strong_residual")),
106 _time_strong_residual(this->template declareADProperty<Real>(
"time_strong_residual")),
107 _visc_strong_residual(this->template declareADProperty<Real>(
"visc_strong_residual"))
127 using std::sqrt, std::max, std::min, std::pow, std::exp;
129 T::computeQpProperties();
132 _strain_mag[_qp] = 2.0 * Utility::pow<2>(_grad_velocity[_qp](0, 0)) +
133 2.0 * Utility::pow<2>(_grad_velocity[_qp](1, 1)) +
134 2.0 * Utility::pow<2>(_grad_velocity[_qp](2, 2)) +
135 Utility::pow<2>(_grad_velocity[_qp](0, 2) + _grad_velocity[_qp](2, 0)) +
136 Utility::pow<2>(_grad_velocity[_qp](0, 1) + _grad_velocity[_qp](1, 0)) +
137 Utility::pow<2>(_grad_velocity[_qp](1, 2) + _grad_velocity[_qp](2, 1));
138 _strain_mag[_qp] = sqrt(_strain_mag[_qp] + 1e-16);
139 ADReal vorticity_mag = Utility::pow<2>(_grad_velocity[_qp](0, 2) - _grad_velocity[_qp](2, 0)) +
140 Utility::pow<2>(_grad_velocity[_qp](0, 1) - _grad_velocity[_qp](1, 0)) +
141 Utility::pow<2>(_grad_velocity[_qp](1, 2) - _grad_velocity[_qp](2, 1));
142 vorticity_mag = sqrt(vorticity_mag + 1e-16);
145 const Real d = max(_wall_dist[_qp], 1e-16);
146 const ADReal chi = _mu_tilde[_qp] / _mu[_qp];
147 const ADReal fv1 = Utility::pow<3>(chi) / (Utility::pow<3>(chi) + Utility::pow<3>(_cv1));
148 const ADReal fv2 = 1.0 - chi / (1. + chi * fv1);
149 const ADReal S_tilde =
150 vorticity_mag + _mu_tilde[_qp] * fv2 / (_kappa * _kappa * d * d * _rho[_qp]);
151 const ADReal S = S_tilde + 2 * min(0.0, _strain_mag[_qp] - vorticity_mag);
156 r = min(_mu_tilde[_qp] / (S_tilde * _kappa * _kappa * d * d * _rho[_qp]), 10.0);
157 const ADReal g = r + _cw2 * (Utility::pow<6>(r) - r);
160 pow((1. + Utility::pow<6>(_cw3)) / (Utility::pow<6>(g) + Utility::pow<6>(_cw3)), 1.0 / 6.0);
165 const ADReal ft2 = _ct3 * exp(-_ct4 * chi * chi);
166 _destruction_strong_residual[_qp] =
167 (_cw1 * fw - _cb1 * ft2 / _kappa / _kappa) * Utility::pow<2>(_mu_tilde[_qp] / d);
168 _source_strong_residual[_qp] = -(1 - ft2) * _rho[_qp] * _cb1 * S * _mu_tilde[_qp];
172 _destruction_strong_residual[_qp] = _cw1 * fw * Utility::pow<2>(_mu_tilde[_qp] / d);
173 _source_strong_residual[_qp] = -_rho[_qp] * _cb1 * S * _mu_tilde[_qp];
175 _convection_strong_residual[_qp] = _rho[_qp] * _velocity[_qp] * _grad_mu[_qp];
176 _diffusion_strong_residual[_qp] = -1.0 / _sigma * _cb2 * (_grad_mu[_qp] * _grad_mu[_qp]);
178 _time_strong_residual[_qp] = (*_visc_dot)[_qp] * _rho[_qp];
179 _visc_strong_residual[_qp] = _has_transient ? _time_strong_residual[_qp] : 0.0;
180 _visc_strong_residual[_qp] +=
181 (_convection_strong_residual[_qp] + _destruction_strong_residual[_qp] +
182 _diffusion_strong_residual[_qp] + _source_strong_residual[_qp]);
185 const auto nu_visc = (_mu[_qp] + _mu_tilde[_qp]) / _rho[_qp] / _sigma;
186 const auto transient_part = _has_transient ? 4.0 / (_dt * _dt) : 0.0;
187 const auto speed = NS::computeSpeed(_velocity[_qp]);
189 _alpha / sqrt(transient_part + (2.0 * speed / _hmax) * (2.0 * speed / _hmax) +
190 9.0 * (4.0 * nu_visc / (_hmax * _hmax)) * 4.0 * (nu_visc / (_hmax * _hmax)));
193 const auto nu = (_mu[_qp] + _mu_tilde[_qp] * fv1) / _rho[_qp];
194 _tau[_qp] = _alpha / sqrt(transient_part + (2.0 * speed / _hmax) * (2.0 * speed / _hmax) +
195 9.0 * (4.0 * nu / (_hmax * _hmax)) * 4.0 * (nu / (_hmax * _hmax)));