WedgeFunction Class Reference

Function object for tests/ins/jeffery_hamel responsible for setting the exact value of the velocity and pressure variables. More...

#include <WedgeFunction.h>

Inheritance diagram for WedgeFunction:
[legend]

## Public Member Functions

WedgeFunction (const InputParameters &parameters)

virtual Real value (Real t, const Point &p) override

## Protected Attributes

The half-angle of the wedge, stored in radians. More...

const Real _Re
The Reynolds number, (u_max(r) * r * alpha) / nu. More...

const unsigned int _var_num
The variable (vel_x==0, vel_y==1, p==2) being computed by this instance of WedgeFunction. More...

const Real _mu
The (constant) dynamic viscosity of the fluid. Usually specified in [GlobalParams]. More...

const Real _rho
The (constant) density of the fluid. Usually specified in [GlobalParams]. More...

const Real _nu
The kinematic viscosity = mu/rho. More...

const Real _K
The constant K from the Jeffery-Hamel solution, defined by: K = -f - 1/(4 * alpha^2) * (alpha * Re * f^2 + f'') which is required for computing the exact pressure: More...

const Real _lambda
The quantity u_max(r) * r, which is constant for this problem, and can be computed given the Reynolds number, nu, and alpha according to: lambda = _Re * _nu / _alpha_radians. More...

const Real _p_star
The pressure constant, whose value is determined from the pressure pin. More...

Function & _f
The pre-computed semi-analytic exact solution f(theta) as a PiecewiseLinear function. More...

## Detailed Description

Function object for tests/ins/jeffery_hamel responsible for setting the exact value of the velocity and pressure variables.

Inherits from FunctionInterface (similarly to CompositeFunction) so that it can couple to a PiecewiseLinear function which corresponds to the non-dimensional semi-analytic solution on the domain [0,1]. This function is responsible for scaling and mapping the semi-analytic solution values to the actual velocities and pressure used in the problem.

Definition at line 29 of file WedgeFunction.h.

## Constructor & Destructor Documentation

 WedgeFunction::WedgeFunction ( const InputParameters & parameters )

Definition at line 34 of file WedgeFunction.C.

35  : Function(parameters),
36  FunctionInterface(this),
37  _alpha_radians(libMesh::pi * (getParam<Real>("alpha_degrees") / 180.)),
38  _Re(getParam<Real>("Re")),
39  _var_num(getParam<unsigned int>("var_num")),
40  _mu(getParam<Real>("mu")),
41  _rho(getParam<Real>("rho")),
42  _nu(_mu / _rho),
43  _K(getParam<Real>("K")),
45  _p_star(-2 * _mu * _lambda * (1 + _K)),
46  _f(getFunction("f"))
47 {
48 }
Function & _f
The pre-computed semi-analytic exact solution f(theta) as a PiecewiseLinear function.
Definition: WedgeFunction.h:87
The half-angle of the wedge, stored in radians.
Definition: WedgeFunction.h:38
const Real _p_star
The pressure constant, whose value is determined from the pressure pin.
Definition: WedgeFunction.h:81
const Real _lambda
The quantity u_max(r) * r, which is constant for this problem, and can be computed given the Reynolds...
Definition: WedgeFunction.h:73
const Real _rho
The (constant) density of the fluid. Usually specified in [GlobalParams].
Definition: WedgeFunction.h:53
const Real _nu
The kinematic viscosity = mu/rho.
Definition: WedgeFunction.h:56
const Real _K
The constant K from the Jeffery-Hamel solution, defined by: K = -f - 1/(4 * alpha^2) * (alpha * Re * ...
Definition: WedgeFunction.h:65
const Real _mu
The (constant) dynamic viscosity of the fluid. Usually specified in [GlobalParams].
Definition: WedgeFunction.h:50
const unsigned int _var_num
The variable (vel_x==0, vel_y==1, p==2) being computed by this instance of WedgeFunction.
Definition: WedgeFunction.h:47
const Real _Re
The Reynolds number, (u_max(r) * r * alpha) / nu.
Definition: WedgeFunction.h:44

## Member Function Documentation

 Real WedgeFunction::value ( Real t, const Point & p )
overridevirtual

Definition at line 51 of file WedgeFunction.C.

52 {
53  const Real r = std::sqrt(p(0) * p(0) + p(1) * p(1));
54  const Real theta = std::atan2(p(1), p(0));
55
56  // This is really unlikely to happen unless someone does something
57  // very strange with their mesh.
58  mooseAssert(r != 0., "The exact solution is singular at r=0.");
59
60  // The "f" function is defined in terms of eta=theta/alpha, and it
61  // is only defined for positive angles, since it is symmetric about
62  // 0.
63  const Real eta = std::abs(theta) / _alpha_radians;
64
65  // We pass "eta" to the PiecewiseLinear function in place of "time",
66  // plus a dummy Point which is not used.
67  const Real f_value = _f.value(eta, Point(0., 0., 0.));
68
69  // Vars 0 and 1 are the velocities.
70  if (_var_num < 2)
71  {
72  // Converts the radial velocity vector to x and y components, respectively.
73  const Real cs[2] = {std::cos(theta), std::sin(theta)};
74
75  // Compute the centerline velocity for this r.
76  const Real u_max = _lambda / r;
77
78  // The true velocity value is simply u_max * f, times either
79  // cos(theta) or sin(theta) to convert it to Cartesian coordinates.
80  return u_max * f_value * cs[_var_num];
81  }
82
83  // Otherwise, we are computing the pressure.
84  else
85  return _p_star + (2 * _mu * _lambda) / (r * r) * (f_value + _K);
86 }
Function & _f
The pre-computed semi-analytic exact solution f(theta) as a PiecewiseLinear function.
Definition: WedgeFunction.h:87
The half-angle of the wedge, stored in radians.
Definition: WedgeFunction.h:38
const Real _p_star
The pressure constant, whose value is determined from the pressure pin.
Definition: WedgeFunction.h:81
const Real _lambda
The quantity u_max(r) * r, which is constant for this problem, and can be computed given the Reynolds...
Definition: WedgeFunction.h:73
const Real _K
The constant K from the Jeffery-Hamel solution, defined by: K = -f - 1/(4 * alpha^2) * (alpha * Re * ...
Definition: WedgeFunction.h:65
const Real _mu
The (constant) dynamic viscosity of the fluid. Usually specified in [GlobalParams].
Definition: WedgeFunction.h:50
const unsigned int _var_num
The variable (vel_x==0, vel_y==1, p==2) being computed by this instance of WedgeFunction.
Definition: WedgeFunction.h:47

## Member Data Documentation

protected

The half-angle of the wedge, stored in radians.

Definition at line 38 of file WedgeFunction.h.

Referenced by value().

 Function& WedgeFunction::_f
protected

The pre-computed semi-analytic exact solution f(theta) as a PiecewiseLinear function.

Definition at line 87 of file WedgeFunction.h.

Referenced by value().

 const Real WedgeFunction::_K
protected

The constant K from the Jeffery-Hamel solution, defined by: K = -f - 1/(4 * alpha^2) * (alpha * Re * f^2 + f'') which is required for computing the exact pressure:

p(r,theta) = p_star + (2 * mu * lambda) / (r^2) * (f(theta) + K)

Definition at line 65 of file WedgeFunction.h.

Referenced by value().

 const Real WedgeFunction::_lambda
protected

The quantity u_max(r) * r, which is constant for this problem, and can be computed given the Reynolds number, nu, and alpha according to: lambda = _Re * _nu / _alpha_radians.

Definition at line 73 of file WedgeFunction.h.

Referenced by value().

 const Real WedgeFunction::_mu
protected

The (constant) dynamic viscosity of the fluid. Usually specified in [GlobalParams].

Definition at line 50 of file WedgeFunction.h.

Referenced by value().

 const Real WedgeFunction::_nu
protected

The kinematic viscosity = mu/rho.

Definition at line 56 of file WedgeFunction.h.

 const Real WedgeFunction::_p_star
protected

The pressure constant, whose value is determined from the pressure pin.

Here, we assume the pressure is pinned to 0 at (r,theta)=(1,0). This value would need to change if the pressure was pinned to some other value.

Definition at line 81 of file WedgeFunction.h.

Referenced by value().

 const Real WedgeFunction::_Re
protected

The Reynolds number, (u_max(r) * r * alpha) / nu.

Note: the quantity u_max(r) * r := lambda = const.

Definition at line 44 of file WedgeFunction.h.

 const Real WedgeFunction::_rho
protected

The (constant) density of the fluid. Usually specified in [GlobalParams].

Definition at line 53 of file WedgeFunction.h.

 const unsigned int WedgeFunction::_var_num
protected

The variable (vel_x==0, vel_y==1, p==2) being computed by this instance of WedgeFunction.

Definition at line 47 of file WedgeFunction.h.

Referenced by value().

The documentation for this class was generated from the following files: