www.mooseframework.org
INSMomentumTractionFormRZ.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
11 
13 
14 template <>
15 InputParameters
17 {
18  InputParameters params = validParams<INSMomentumTractionForm>();
19  params.addClassDescription("This class computes additional momentum equation residual and "
20  "Jacobian contributions for the incompressible Navier-Stokes momentum "
21  "equation in RZ (axisymmetric cylindrical) coordinates.");
22  return params;
23 }
24 
25 INSMomentumTractionFormRZ::INSMomentumTractionFormRZ(const InputParameters & parameters)
26  : INSMomentumTractionForm(parameters)
27 {
28 }
29 
30 RealVectorValue
32 {
33  const Real & r = _q_point[_qp](0);
35  RealVectorValue(2. * _mu[_qp] * (_u_vel[_qp] / (r * r) - _grad_u_vel[_qp](0) / r),
36  -_mu[_qp] / r * (_grad_v_vel[_qp](0) + _grad_u_vel[_qp](1)),
37  0);
38 }
39 
40 RealVectorValue
42 {
43  const Real & r = _q_point[_qp](0);
44  RealVectorValue add_jac(0, 0, 0);
45  if (comp == 0)
46  {
47  add_jac(0) = 2. * _mu[_qp] * (_phi[_j][_qp] / (r * r) - _grad_phi[_j][_qp](0) / r);
48  add_jac(1) = -_mu[_qp] / r * _grad_phi[_j][_qp](1);
49  }
50  else if (comp == 1)
51  add_jac(1) = -_mu[_qp] * _grad_phi[_j][_qp](0) / r;
52 
53  return INSBase::dStrongViscDUCompTraction(comp) + add_jac;
54 }
55 
56 Real
58 {
59  // Base class residual contribution
61 
62  if (_component == 0)
63  {
64  const Real r = _q_point[_qp](0);
65 
66  // If this is the radial component of momentum, there is an extra term for RZ.
67  res_base += 2. * _mu[_qp] * _u_vel[_qp] / (r * r) * _test[_i][_qp];
68 
69  // If the pressure is also integrated by parts, there is an extra term in RZ.
71  res_base += -_p[_qp] / r * _test[_i][_qp];
72  }
73 
74  return res_base;
75 }
76 
77 Real
79 {
80  // Base class jacobian contribution
82 
83  // If this is the radial component of momentum, there is an extra term for RZ.
84  if (_component == 0)
85  {
86  const Real r = _q_point[_qp](0);
87  jac_base += 2. * _mu[_qp] * _phi[_j][_qp] * _test[_i][_qp] / (r * r);
88  }
89 
90  return jac_base;
91 }
92 
93 Real
95 {
96  // Base class jacobian contribution
98 
99  // If we're getting the pressure Jacobian contribution, and we
100  // integrated the pressure term by parts, there is an extra term for
101  // RZ.
102  if (jvar == _p_var_number && _component == 0 && _integrate_p_by_parts)
103  {
104  const Real r = _q_point[_qp](0);
105  jac_base += -_phi[_j][_qp] / r * _test[_i][_qp];
106  }
107 
108  return jac_base;
109 }
INSMomentumTractionFormRZ.h
INSMomentumTractionFormRZ::INSMomentumTractionFormRZ
INSMomentumTractionFormRZ(const InputParameters &parameters)
Definition: INSMomentumTractionFormRZ.C:25
INSMomentumBase::_component
unsigned _component
Definition: INSMomentumBase.h:43
INSMomentumBase::_integrate_p_by_parts
bool _integrate_p_by_parts
Definition: INSMomentumBase.h:44
INSMomentumBase::computeQpResidual
virtual Real computeQpResidual()
Definition: INSMomentumBase.C:40
INSBase::strongViscousTermTraction
virtual RealVectorValue strongViscousTermTraction()
Definition: INSBase.C:126
INSMomentumTractionFormRZ::strongViscousTermTraction
virtual RealVectorValue strongViscousTermTraction() override
Definition: INSMomentumTractionFormRZ.C:31
INSBase::_p_var_number
unsigned _p_var_number
Definition: INSBase.h:99
INSMomentumTractionFormRZ::computeQpOffDiagJacobian
virtual Real computeQpOffDiagJacobian(unsigned jvar) override
Definition: INSMomentumTractionFormRZ.C:94
INSMomentumBase::computeQpJacobian
virtual Real computeQpJacobian()
Definition: INSMomentumBase.C:93
INSBase::_p
const VariableValue & _p
Definition: INSBase.h:72
INSMomentumTractionForm
This class computes momentum equation residual and Jacobian viscous contributions for the "traction" ...
Definition: INSMomentumTractionForm.h:24
registerMooseObject
registerMooseObject("NavierStokesApp", INSMomentumTractionFormRZ)
INSMomentumTractionFormRZ
This class computes additional momentum equation residual and Jacobian contributions for the incompre...
Definition: INSMomentumTractionFormRZ.h:25
INSBase::_grad_u_vel
const VariableGradient & _grad_u_vel
Definition: INSBase.h:75
INSBase::_u_vel
const VariableValue & _u_vel
Definition: INSBase.h:69
INSMomentumTractionFormRZ::computeQpResidual
virtual Real computeQpResidual() override
Definition: INSMomentumTractionFormRZ.C:57
INSBase::dStrongViscDUCompTraction
virtual RealVectorValue dStrongViscDUCompTraction(unsigned comp)
Definition: INSBase.C:143
INSBase::_grad_v_vel
const VariableGradient & _grad_v_vel
Definition: INSBase.h:76
INSMomentumTractionFormRZ::dStrongViscDUCompTraction
virtual RealVectorValue dStrongViscDUCompTraction(unsigned comp) override
Definition: INSMomentumTractionFormRZ.C:41
validParams< INSMomentumTractionForm >
InputParameters validParams< INSMomentumTractionForm >()
Definition: INSMomentumTractionForm.C:16
INSMomentumBase::computeQpOffDiagJacobian
virtual Real computeQpOffDiagJacobian(unsigned jvar)
Definition: INSMomentumBase.C:137
INSBase::_mu
const MaterialProperty< Real > & _mu
Definition: INSBase.h:104
validParams< INSMomentumTractionFormRZ >
InputParameters validParams< INSMomentumTractionFormRZ >()
Definition: INSMomentumTractionFormRZ.C:16
INSMomentumTractionFormRZ::computeQpJacobian
virtual Real computeQpJacobian() override
Definition: INSMomentumTractionFormRZ.C:78