https://mooseframework.inl.gov
Loading...
Searching...
No Matches
INSMomentumTractionForm.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
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
16{
18 params.addClassDescription("This class computes momentum equation residual and Jacobian viscous "
19 "contributions for the 'traction' form of the governing equations.");
20 return params;
21}
22
27
28Real
30{
31 // The component'th row (or col, it's symmetric) of the viscous stress tensor
32 RealVectorValue tau_row;
33
34 switch (_component)
35 {
36 case 0:
37 tau_row(0) = 2. * _grad_u_vel[_qp](0); // 2*du/dx1
38 tau_row(1) = _grad_u_vel[_qp](1) + _grad_v_vel[_qp](0); // du/dx2 + dv/dx1
39 tau_row(2) = _grad_u_vel[_qp](2) + _grad_w_vel[_qp](0); // du/dx3 + dw/dx1
40 break;
41
42 case 1:
43 tau_row(0) = _grad_v_vel[_qp](0) + _grad_u_vel[_qp](1); // dv/dx1 + du/dx2
44 tau_row(1) = 2. * _grad_v_vel[_qp](1); // 2*dv/dx2
45 tau_row(2) = _grad_v_vel[_qp](2) + _grad_w_vel[_qp](1); // dv/dx3 + dw/dx2
46 break;
47
48 case 2:
49 tau_row(0) = _grad_w_vel[_qp](0) + _grad_u_vel[_qp](2); // dw/dx1 + du/dx3
50 tau_row(1) = _grad_w_vel[_qp](1) + _grad_v_vel[_qp](2); // dw/dx2 + dv/dx3
51 tau_row(2) = 2. * _grad_w_vel[_qp](2); // 2*dw/dx3
52 break;
53
54 default:
55 mooseError("Unrecognized _component requested.");
56 }
57
58 // The viscous part, _mu[_qp] * tau : grad(v)
59 return _mu[_qp] * (tau_row * _grad_test[_i][_qp]);
60}
61
62Real
64{
65 // Viscous part, full stress tensor. The extra contribution comes from the "2"
66 // on the diagonal of the viscous stress tensor.
67 return _mu[_qp] * (_grad_phi[_j][_qp] * _grad_test[_i][_qp] +
69}
70
71Real
73{
74 // In Stokes/Laplacian version, off-diag Jacobian entries wrt u,v,w are zero
75 if (jvar == _u_vel_var_number)
76 return _mu[_qp] * _grad_phi[_j][_qp](_component) * _grad_test[_i][_qp](0);
77
78 else if (jvar == _v_vel_var_number)
79 return _mu[_qp] * _grad_phi[_j][_qp](_component) * _grad_test[_i][_qp](1);
80
81 else if (jvar == _w_vel_var_number)
82 return _mu[_qp] * _grad_phi[_j][_qp](_component) * _grad_test[_i][_qp](2);
83
84 else
85 return 0;
86}
registerMooseObject("NavierStokesApp", INSMomentumTractionForm)
const VariableGradient & _grad_w_vel
Definition INSBase.h:106
const MaterialProperty< Real > & _mu
Definition INSBase.h:133
const VariableGradient & _grad_u_vel
Definition INSBase.h:104
unsigned _w_vel_var_number
Definition INSBase.h:127
const VariableGradient & _grad_v_vel
Definition INSBase.h:105
unsigned _v_vel_var_number
Definition INSBase.h:126
unsigned _u_vel_var_number
Definition INSBase.h:125
This class computes the momentum equation residual and Jacobian contributions for the incompressible ...
static InputParameters validParams()
This class computes momentum equation residual and Jacobian viscous contributions for the "traction" ...
INSMomentumTractionForm(const InputParameters &parameters)
static InputParameters validParams()
virtual Real computeQpResidualViscousPart() override
virtual Real computeQpJacobianViscousPart() override
virtual Real computeQpOffDiagJacobianViscousPart(unsigned jvar) override
void addClassDescription(const std::string &doc_string)
unsigned int _qp
unsigned int _j
unsigned int _i
const VariablePhiGradient & _grad_phi
const VariableTestGradient & _grad_test
void mooseError(Args &&... args) const