www.mooseframework.org
INSMomentumLaplaceFormRZ.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
8 
9 template <>
10 InputParameters
12 {
13  InputParameters params = validParams<INSMomentumLaplaceForm>();
14  params.addClassDescription("This class computes additional momentum equation residual and "
15  "Jacobian contributions for the incompressible Navier-Stokes momentum "
16  "equation in RZ (axisymmetric cylindrical) coordinates, using the "
17  "'Laplace' form of the governing equations.");
18  return params;
19 }
20 
21 INSMomentumLaplaceFormRZ::INSMomentumLaplaceFormRZ(const InputParameters & parameters)
22  : INSMomentumLaplaceForm(parameters)
23 {
24 }
25 
26 RealVectorValue
28 {
29  const Real & r = _q_point[_qp](0);
31  RealVectorValue(_mu[_qp] * (_u_vel[_qp] / (r * r) - _grad_u_vel[_qp](0) / r),
32  -_mu[_qp] * _grad_v_vel[_qp](0) / r,
33  0);
34 }
35 
36 RealVectorValue
38 {
39  const Real & r = _q_point[_qp](0);
40  RealVectorValue add_jac(0, 0, 0);
41  if (comp == 0)
42  add_jac(0) = _mu[_qp] * (_phi[_j][_qp] / (r * r) - _grad_phi[_j][_qp](0) / r);
43  else if (comp == 1)
44  add_jac(1) = -_mu[_qp] * _grad_phi[_j][_qp](0) / r;
45 
46  return INSBase::dStrongViscDUCompLaplace(comp) + add_jac;
47 }
48 
49 Real
51 {
52  // Base class residual contribution
54 
55  if (_component == 0)
56  {
57  const Real r = _q_point[_qp](0);
58 
59  // If this is the radial component of momentum, there is an extra term for RZ.
60  // The only difference between this and the traction form is a factor of 2.
61  res_base += _mu[_qp] * _u_vel[_qp] / (r * r) * _test[_i][_qp];
62 
63  // If the pressure is also integrated by parts, there is an extra term in RZ.
65  res_base += -_p[_qp] / r * _test[_i][_qp];
66  }
67 
68  return res_base;
69 }
70 
71 Real
73 {
74  // Base class jacobian contribution
76 
77  // If this is the radial component of momentum, there is an extra term for RZ.
78  if (_component == 0)
79  {
80  const Real r = _q_point[_qp](0);
81  // The only difference between this and the traction form is a factor of 2.
82  jac_base += _mu[_qp] * _phi[_j][_qp] * _test[_i][_qp] / (r * r);
83  }
84 
85  return jac_base;
86 }
87 
88 Real
90 {
91  // Base class jacobian contribution
93 
94  // If we're getting the pressure Jacobian contribution, and we
95  // integrated the pressure term by parts, there is an extra term for
96  // RZ.
97  if (jvar == _p_var_number && _component == 0 && _integrate_p_by_parts)
98  {
99  const Real r = _q_point[_qp](0);
100  jac_base += -_phi[_j][_qp] / r * _test[_i][_qp];
101  }
102 
103  return jac_base;
104 }
virtual RealVectorValue strongViscousTermLaplace()
Definition: INSBase.C:117
const VariableValue & _p
Definition: INSBase.h:70
INSMomentumLaplaceFormRZ(const InputParameters &parameters)
const VariableValue & _u_vel
Definition: INSBase.h:67
const MaterialProperty< Real > & _mu
Definition: INSBase.h:102
InputParameters validParams< INSMomentumLaplaceFormRZ >()
virtual RealVectorValue dStrongViscDUCompLaplace(unsigned comp) override
const VariableGradient & _grad_v_vel
Definition: INSBase.h:74
virtual Real computeQpResidual()
virtual Real computeQpJacobian() override
virtual Real computeQpJacobian()
virtual Real computeQpResidual() override
virtual Real computeQpOffDiagJacobian(unsigned jvar)
const VariableGradient & _grad_u_vel
Definition: INSBase.h:73
virtual Real computeQpOffDiagJacobian(unsigned jvar) override
This class computes momentum equation residual and Jacobian viscous contributions for the "Laplacian"...
virtual RealVectorValue dStrongViscDUCompLaplace(unsigned comp)
Definition: INSBase.C:132
virtual RealVectorValue strongViscousTermLaplace() override
unsigned _p_var_number
Definition: INSBase.h:97
InputParameters validParams< INSMomentumLaplaceForm >()