www.mooseframework.org
INSMomentumLaplaceFormRZ.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<INSMomentumLaplaceForm>();
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, using the "
22  "'Laplace' form of the governing equations.");
23  return params;
24 }
25 
26 INSMomentumLaplaceFormRZ::INSMomentumLaplaceFormRZ(const InputParameters & parameters)
27  : INSMomentumLaplaceForm(parameters)
28 {
29 }
30 
31 RealVectorValue
33 {
34  const Real & r = _q_point[_qp](0);
36  RealVectorValue(_mu[_qp] * (_u_vel[_qp] / (r * r) - _grad_u_vel[_qp](0) / r),
37  -_mu[_qp] * _grad_v_vel[_qp](0) / r,
38  0);
39 }
40 
41 RealVectorValue
43 {
44  const Real & r = _q_point[_qp](0);
45  RealVectorValue add_jac(0, 0, 0);
46  if (comp == 0)
47  add_jac(0) = _mu[_qp] * (_phi[_j][_qp] / (r * r) - _grad_phi[_j][_qp](0) / r);
48  else if (comp == 1)
49  add_jac(1) = -_mu[_qp] * _grad_phi[_j][_qp](0) / r;
50 
51  return INSBase::dStrongViscDUCompLaplace(comp) + add_jac;
52 }
53 
54 Real
56 {
57  // Base class residual contribution
59 
60  if (_component == 0)
61  {
62  const Real r = _q_point[_qp](0);
63 
64  // If this is the radial component of momentum, there is an extra term for RZ.
65  // The only difference between this and the traction form is a factor of 2.
66  res_base += _mu[_qp] * _u_vel[_qp] / (r * r) * _test[_i][_qp];
67 
68  // If the pressure is also integrated by parts, there is an extra term in RZ.
70  res_base += -_p[_qp] / r * _test[_i][_qp];
71  }
72 
73  return res_base;
74 }
75 
76 Real
78 {
79  // Base class jacobian contribution
81 
82  // If this is the radial component of momentum, there is an extra term for RZ.
83  if (_component == 0)
84  {
85  const Real r = _q_point[_qp](0);
86  // The only difference between this and the traction form is a factor of 2.
87  jac_base += _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 }
INSMomentumLaplaceFormRZ::computeQpOffDiagJacobian
virtual Real computeQpOffDiagJacobian(unsigned jvar) override
Definition: INSMomentumLaplaceFormRZ.C:94
INSMomentumLaplaceFormRZ::INSMomentumLaplaceFormRZ
INSMomentumLaplaceFormRZ(const InputParameters &parameters)
Definition: INSMomentumLaplaceFormRZ.C:26
validParams< INSMomentumLaplaceForm >
InputParameters validParams< INSMomentumLaplaceForm >()
Definition: INSMomentumLaplaceForm.C:16
INSMomentumBase::_component
unsigned _component
Definition: INSMomentumBase.h:43
registerMooseObject
registerMooseObject("NavierStokesApp", INSMomentumLaplaceFormRZ)
INSMomentumLaplaceFormRZ::strongViscousTermLaplace
virtual RealVectorValue strongViscousTermLaplace() override
Definition: INSMomentumLaplaceFormRZ.C:32
INSMomentumLaplaceFormRZ::computeQpResidual
virtual Real computeQpResidual() override
Definition: INSMomentumLaplaceFormRZ.C:55
INSMomentumBase::_integrate_p_by_parts
bool _integrate_p_by_parts
Definition: INSMomentumBase.h:44
INSMomentumLaplaceFormRZ::computeQpJacobian
virtual Real computeQpJacobian() override
Definition: INSMomentumLaplaceFormRZ.C:77
INSMomentumBase::computeQpResidual
virtual Real computeQpResidual()
Definition: INSMomentumBase.C:40
INSBase::dStrongViscDUCompLaplace
virtual RealVectorValue dStrongViscDUCompLaplace(unsigned comp)
Definition: INSBase.C:134
INSMomentumLaplaceForm
This class computes momentum equation residual and Jacobian viscous contributions for the "Laplacian"...
Definition: INSMomentumLaplaceForm.h:24
INSBase::strongViscousTermLaplace
virtual RealVectorValue strongViscousTermLaplace()
Definition: INSBase.C:119
INSBase::_p_var_number
unsigned _p_var_number
Definition: INSBase.h:99
INSMomentumLaplaceFormRZ.h
INSMomentumBase::computeQpJacobian
virtual Real computeQpJacobian()
Definition: INSMomentumBase.C:93
INSBase::_p
const VariableValue & _p
Definition: INSBase.h:72
INSMomentumLaplaceFormRZ
This class computes additional momentum equation residual and Jacobian contributions for the incompre...
Definition: INSMomentumLaplaceFormRZ.h:26
INSMomentumLaplaceFormRZ::dStrongViscDUCompLaplace
virtual RealVectorValue dStrongViscDUCompLaplace(unsigned comp) override
Definition: INSMomentumLaplaceFormRZ.C:42
INSBase::_grad_u_vel
const VariableGradient & _grad_u_vel
Definition: INSBase.h:75
INSBase::_u_vel
const VariableValue & _u_vel
Definition: INSBase.h:69
INSBase::_grad_v_vel
const VariableGradient & _grad_v_vel
Definition: INSBase.h:76
INSMomentumBase::computeQpOffDiagJacobian
virtual Real computeQpOffDiagJacobian(unsigned jvar)
Definition: INSMomentumBase.C:137
INSBase::_mu
const MaterialProperty< Real > & _mu
Definition: INSBase.h:104
validParams< INSMomentumLaplaceFormRZ >
InputParameters validParams< INSMomentumLaplaceFormRZ >()
Definition: INSMomentumLaplaceFormRZ.C:16