www.mooseframework.org
INSMassRZ.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 /****************************************************************/
7 #include "INSMassRZ.h"
8 
9 template <>
10 InputParameters
12 {
13  InputParameters params = validParams<INSMass>();
14  params.addClassDescription("This class computes the mass equation residual and Jacobian "
15  "contributions for the incompressible Navier-Stokes momentum equation "
16  "in RZ coordinates.");
17  return params;
18 }
19 
20 INSMassRZ::INSMassRZ(const InputParameters & parameters) : INSMass(parameters) {}
21 
22 RealVectorValue
24 {
25  const Real & r = _q_point[_qp](0);
27  RealVectorValue(_mu[_qp] * (_u_vel[_qp] / (r * r) - _grad_u_vel[_qp](0) / r),
28  -_mu[_qp] * _grad_v_vel[_qp](0) / r,
29  0);
30 }
31 
32 RealVectorValue
34 {
35  const Real & r = _q_point[_qp](0);
36  RealVectorValue add_jac(0, 0, 0);
37  if (comp == 0)
38  add_jac(0) = _mu[_qp] * (_phi[_j][_qp] / (r * r) - _grad_phi[_j][_qp](0) / r);
39  else if (comp == 1)
40  add_jac(1) = -_mu[_qp] * _grad_phi[_j][_qp](0) / r;
41 
42  return INSBase::dStrongViscDUCompLaplace(comp) + add_jac;
43 }
44 
45 RealVectorValue
47 {
48  const Real & r = _q_point[_qp](0);
50  RealVectorValue(2. * _mu[_qp] * (_u_vel[_qp] / (r * r) - _grad_u_vel[_qp](0) / r),
51  -_mu[_qp] / r * (_grad_v_vel[_qp](0) + _grad_u_vel[_qp](1)),
52  0);
53 }
54 
55 RealVectorValue
57 {
58  const Real & r = _q_point[_qp](0);
59  RealVectorValue add_jac(0, 0, 0);
60  if (comp == 0)
61  {
62  add_jac(0) = 2. * _mu[_qp] * (_phi[_j][_qp] / (r * r) - _grad_phi[_j][_qp](0) / r);
63  add_jac(1) = -_mu[_qp] / r * _grad_phi[_j][_qp](1);
64  }
65  else if (comp == 1)
66  add_jac(1) = -_mu[_qp] * _grad_phi[_j][_qp](0) / r;
67 
68  return INSBase::dStrongViscDUCompTraction(comp) + add_jac;
69 }
70 
71 Real
73 {
74  // Base class residual contribution
75  Real res_base = INSMass::computeQpResidual();
76 
77  // The radial coordinate value.
78  const Real r = _q_point[_qp](0);
79 
80  // The sign of this term is multiplied by -1 here.
81  res_base -= _u_vel[_qp] / r * _test[_i][_qp];
82 
83  return res_base;
84 }
85 
86 Real
88 {
89  // Base class jacobian contribution
90  Real jac_base = INSMass::computeQpOffDiagJacobian(jvar);
91 
92  // The radial coordinate value.
93  const Real r = _q_point[_qp](0);
94 
95  if (jvar == _u_vel_var_number)
96  jac_base -= _phi[_j][_qp] / r * _test[_i][_qp];
97 
98  return jac_base;
99 }
virtual RealVectorValue strongViscousTermLaplace()
Definition: INSBase.C:117
virtual RealVectorValue dStrongViscDUCompTraction(unsigned comp) override
Definition: INSMassRZ.C:56
virtual Real computeQpOffDiagJacobian(unsigned jvar) override
Definition: INSMassRZ.C:87
virtual RealVectorValue dStrongViscDUCompTraction(unsigned comp)
Definition: INSBase.C:141
virtual RealVectorValue strongViscousTermTraction() override
Definition: INSMassRZ.C:46
virtual Real computeQpOffDiagJacobian(unsigned jvar)
Definition: INSMass.C:88
const VariableValue & _u_vel
Definition: INSBase.h:67
const MaterialProperty< Real > & _mu
Definition: INSBase.h:102
const VariableGradient & _grad_v_vel
Definition: INSBase.h:74
This class computes the mass equation residual and Jacobian contributions for the incompressible Navi...
Definition: INSMass.h:23
virtual Real computeQpResidual() override
Definition: INSMassRZ.C:72
INSMassRZ(const InputParameters &parameters)
Definition: INSMassRZ.C:20
const VariableGradient & _grad_u_vel
Definition: INSBase.h:73
virtual RealVectorValue dStrongViscDUCompLaplace(unsigned comp) override
Definition: INSMassRZ.C:33
unsigned _u_vel_var_number
Definition: INSBase.h:94
virtual RealVectorValue dStrongViscDUCompLaplace(unsigned comp)
Definition: INSBase.C:132
virtual RealVectorValue strongViscousTermLaplace() override
Definition: INSMassRZ.C:23
virtual RealVectorValue strongViscousTermTraction()
Definition: INSBase.C:124
virtual Real computeQpResidual()
Definition: INSMass.C:38
InputParameters validParams< INSMassRZ >()
Definition: INSMassRZ.C:11
InputParameters validParams< INSMass >()
Definition: INSMass.C:12