www.mooseframework.org
INSMomentumTractionFormRZ.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<INSMomentumTractionForm>();
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.");
17  return params;
18 }
19 
20 INSMomentumTractionFormRZ::INSMomentumTractionFormRZ(const InputParameters & parameters)
21  : INSMomentumTractionForm(parameters)
22 {
23 }
24 
25 RealVectorValue
27 {
28  const Real & r = _q_point[_qp](0);
30  RealVectorValue(2. * _mu[_qp] * (_u_vel[_qp] / (r * r) - _grad_u_vel[_qp](0) / r),
31  -_mu[_qp] / r * (_grad_v_vel[_qp](0) + _grad_u_vel[_qp](1)),
32  0);
33 }
34 
35 RealVectorValue
37 {
38  const Real & r = _q_point[_qp](0);
39  RealVectorValue add_jac(0, 0, 0);
40  if (comp == 0)
41  {
42  add_jac(0) = 2. * _mu[_qp] * (_phi[_j][_qp] / (r * r) - _grad_phi[_j][_qp](0) / r);
43  add_jac(1) = -_mu[_qp] / r * _grad_phi[_j][_qp](1);
44  }
45  else if (comp == 1)
46  add_jac(1) = -_mu[_qp] * _grad_phi[_j][_qp](0) / r;
47 
48  return INSBase::dStrongViscDUCompTraction(comp) + add_jac;
49 }
50 
51 Real
53 {
54  // Base class residual contribution
56 
57  if (_component == 0)
58  {
59  const Real r = _q_point[_qp](0);
60 
61  // If this is the radial component of momentum, there is an extra term for RZ.
62  res_base += 2. * _mu[_qp] * _u_vel[_qp] / (r * r) * _test[_i][_qp];
63 
64  // If the pressure is also integrated by parts, there is an extra term in RZ.
66  res_base += -_p[_qp] / r * _test[_i][_qp];
67  }
68 
69  return res_base;
70 }
71 
72 Real
74 {
75  // Base class jacobian contribution
77 
78  // If this is the radial component of momentum, there is an extra term for RZ.
79  if (_component == 0)
80  {
81  const Real r = _q_point[_qp](0);
82  jac_base += 2. * _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 }
const VariableValue & _p
Definition: INSBase.h:70
InputParameters validParams< INSMomentumTractionForm >()
virtual RealVectorValue dStrongViscDUCompTraction(unsigned comp)
Definition: INSBase.C:141
const VariableValue & _u_vel
Definition: INSBase.h:67
INSMomentumTractionFormRZ(const InputParameters &parameters)
const MaterialProperty< Real > & _mu
Definition: INSBase.h:102
const VariableGradient & _grad_v_vel
Definition: INSBase.h:74
virtual Real computeQpResidual()
virtual Real computeQpJacobian()
virtual RealVectorValue strongViscousTermTraction() override
virtual Real computeQpOffDiagJacobian(unsigned jvar)
const VariableGradient & _grad_u_vel
Definition: INSBase.h:73
virtual Real computeQpJacobian() override
This class computes momentum equation residual and Jacobian viscous contributions for the "traction" ...
virtual Real computeQpOffDiagJacobian(unsigned jvar) override
virtual RealVectorValue dStrongViscDUCompTraction(unsigned comp) override
virtual RealVectorValue strongViscousTermTraction()
Definition: INSBase.C:124
virtual Real computeQpResidual() override
InputParameters validParams< INSMomentumTractionFormRZ >()
unsigned _p_var_number
Definition: INSBase.h:97