www.mooseframework.org
INSMomentumTractionForm.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<INSMomentumBase>();
14  params.addClassDescription("This class computes momentum equation residual and Jacobian viscous "
15  "contributions for the 'traction' form of the governing equations.");
16  return params;
17 }
18 
19 INSMomentumTractionForm::INSMomentumTractionForm(const InputParameters & parameters)
20  : INSMomentumBase(parameters)
21 {
22 }
23 
24 Real
26 {
27  // The component'th row (or col, it's symmetric) of the viscous stress tensor
28  RealVectorValue tau_row;
29 
30  switch (_component)
31  {
32  case 0:
33  tau_row(0) = 2. * _grad_u_vel[_qp](0); // 2*du/dx1
34  tau_row(1) = _grad_u_vel[_qp](1) + _grad_v_vel[_qp](0); // du/dx2 + dv/dx1
35  tau_row(2) = _grad_u_vel[_qp](2) + _grad_w_vel[_qp](0); // du/dx3 + dw/dx1
36  break;
37 
38  case 1:
39  tau_row(0) = _grad_v_vel[_qp](0) + _grad_u_vel[_qp](1); // dv/dx1 + du/dx2
40  tau_row(1) = 2. * _grad_v_vel[_qp](1); // 2*dv/dx2
41  tau_row(2) = _grad_v_vel[_qp](2) + _grad_w_vel[_qp](1); // dv/dx3 + dw/dx2
42  break;
43 
44  case 2:
45  tau_row(0) = _grad_w_vel[_qp](0) + _grad_u_vel[_qp](2); // dw/dx1 + du/dx3
46  tau_row(1) = _grad_w_vel[_qp](1) + _grad_v_vel[_qp](2); // dw/dx2 + dv/dx3
47  tau_row(2) = 2. * _grad_w_vel[_qp](2); // 2*dw/dx3
48  break;
49 
50  default:
51  mooseError("Unrecognized _component requested.");
52  }
53 
54  // The viscous part, _mu[_qp] * tau : grad(v)
55  return _mu[_qp] * (tau_row * _grad_test[_i][_qp]);
56 }
57 
58 Real
60 {
61  // Viscous part, full stress tensor. The extra contribution comes from the "2"
62  // on the diagonal of the viscous stress tensor.
63  return _mu[_qp] * (_grad_phi[_j][_qp] * _grad_test[_i][_qp] +
64  _grad_phi[_j][_qp](_component) * _grad_test[_i][_qp](_component));
65 }
66 
67 Real
69 {
70  // In Stokes/Laplacian version, off-diag Jacobian entries wrt u,v,w are zero
71  if (jvar == _u_vel_var_number)
72  return _mu[_qp] * _grad_phi[_j][_qp](_component) * _grad_test[_i][_qp](0);
73 
74  else if (jvar == _v_vel_var_number)
75  return _mu[_qp] * _grad_phi[_j][_qp](_component) * _grad_test[_i][_qp](1);
76 
77  else if (jvar == _w_vel_var_number)
78  return _mu[_qp] * _grad_phi[_j][_qp](_component) * _grad_test[_i][_qp](2);
79 
80  else
81  return 0;
82 }
This class computes the momentum equation residual and Jacobian contributions for the incompressible ...
const MaterialProperty< Real > & _mu
Definition: INSBase.h:102
const VariableGradient & _grad_v_vel
Definition: INSBase.h:74
virtual Real computeQpOffDiagJacobianViscousPart(unsigned jvar) override
INSMomentumTractionForm(const InputParameters &parameters)
virtual Real computeQpResidualViscousPart() override
unsigned _w_vel_var_number
Definition: INSBase.h:96
InputParameters validParams< INSMomentumTractionForm >()
const VariableGradient & _grad_u_vel
Definition: INSBase.h:73
unsigned _u_vel_var_number
Definition: INSBase.h:94
const VariableGradient & _grad_w_vel
Definition: INSBase.h:75
virtual Real computeQpJacobianViscousPart() override
unsigned _v_vel_var_number
Definition: INSBase.h:95
InputParameters validParams< INSMomentumBase >()