18 InputParameters params = validParams<Function>();
19 params.addClassDescription(
"Function object for tests/ins/jeffery_hamel responsible for setting "
20 "the exact value of the velocity and pressure variables.");
21 params.addRequiredParam<Real>(
22 "alpha_degrees",
"The wedge half-angle size (in degrees) used in computing 'f' below.");
23 params.addRequiredParam<Real>(
"Re",
"The Reynolds number used in computing 'f' below.");
24 params.addRequiredRangeCheckedParam<
unsigned int>(
27 "The variable (0==vel_x, 1==vel_y, 2==p) we are computing the exact solution for.");
28 params.addRequiredParam<Real>(
"mu",
"dynamic viscosity");
29 params.addRequiredParam<Real>(
"rho",
"density");
30 params.addRequiredParam<Real>(
"K",
"Constant obtained by interating the Jeffery-Hamel ODE once.");
31 params.addRequiredParam<FunctionName>(
32 "f",
"The pre-computed semi-analytic exact solution f(theta) as a PiecewiseLinear function.");
33 params.addClassDescription(
34 "Function which computes the exact solution for Jeffery-Hamel flow in a wedge.");
39 : Function(parameters),
40 FunctionInterface(this),
41 _alpha_radians(
libMesh::pi * (getParam<Real>(
"alpha_degrees") / 180.)),
42 _Re(getParam<Real>(
"Re")),
43 _var_num(getParam<unsigned int>(
"var_num")),
44 _mu(getParam<Real>(
"mu")),
45 _rho(getParam<Real>(
"rho")),
47 _K(getParam<Real>(
"K")),
48 _lambda(_Re * _nu / _alpha_radians),
49 _p_star(-2 * _mu * _lambda * (1 + _K)),
57 const Real r = std::sqrt(p(0) * p(0) + p(1) * p(1));
58 const Real theta = std::atan2(p(1), p(0));
62 mooseAssert(r != 0.,
"The exact solution is singular at r=0.");
71 const Real f_value =
_f.value(eta, _point_zero);
77 const Real cs[2] = {std::cos(theta), std::sin(theta)};
84 return u_max * f_value * cs[
_var_num];