www.mooseframework.org
Public Member Functions | Protected Attributes | List of all members
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

const Real _alpha_radians
 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 31 of file WedgeFunction.h.

Constructor & Destructor Documentation

◆ WedgeFunction()

WedgeFunction::WedgeFunction ( const InputParameters &  parameters)

Definition at line 38 of file WedgeFunction.C.

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")),
46  _nu(_mu / _rho),
47  _K(getParam<Real>("K")),
49  _p_star(-2 * _mu * _lambda * (1 + _K)),
50  _f(getFunction("f"))
51 {
52 }
Function & _f
The pre-computed semi-analytic exact solution f(theta) as a PiecewiseLinear function.
Definition: WedgeFunction.h:89
const Real _alpha_radians
The half-angle of the wedge, stored in radians.
Definition: WedgeFunction.h:40
const Real _p_star
The pressure constant, whose value is determined from the pressure pin.
Definition: WedgeFunction.h:83
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:75
const Real _rho
The (constant) density of the fluid. Usually specified in [GlobalParams].
Definition: WedgeFunction.h:55
const Real _nu
The kinematic viscosity = mu/rho.
Definition: WedgeFunction.h:58
const Real _K
The constant K from the Jeffery-Hamel solution, defined by: K = -f - 1/(4 * alpha^2) * (alpha * Re * ...
Definition: WedgeFunction.h:67
const Real _mu
The (constant) dynamic viscosity of the fluid. Usually specified in [GlobalParams].
Definition: WedgeFunction.h:52
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:49
const Real _Re
The Reynolds number, (u_max(r) * r * alpha) / nu.
Definition: WedgeFunction.h:46

Member Function Documentation

◆ value()

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

Definition at line 55 of file WedgeFunction.C.

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

Member Data Documentation

◆ _alpha_radians

const Real WedgeFunction::_alpha_radians
protected

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

Definition at line 40 of file WedgeFunction.h.

Referenced by value().

◆ _f

Function& WedgeFunction::_f
protected

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

Definition at line 89 of file WedgeFunction.h.

Referenced by value().

◆ _K

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 67 of file WedgeFunction.h.

Referenced by value().

◆ _lambda

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 75 of file WedgeFunction.h.

Referenced by value().

◆ _mu

const Real WedgeFunction::_mu
protected

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

Definition at line 52 of file WedgeFunction.h.

Referenced by value().

◆ _nu

const Real WedgeFunction::_nu
protected

The kinematic viscosity = mu/rho.

Definition at line 58 of file WedgeFunction.h.

◆ _p_star

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 83 of file WedgeFunction.h.

Referenced by value().

◆ _Re

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 46 of file WedgeFunction.h.

◆ _rho

const Real WedgeFunction::_rho
protected

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

Definition at line 55 of file WedgeFunction.h.

◆ _var_num

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 49 of file WedgeFunction.h.

Referenced by value().


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