www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
INSMomentumTractionForm Class Reference

This class computes momentum equation residual and Jacobian viscous contributions for the "traction" form of the governing equations. More...

#include <INSMomentumTractionForm.h>

Inheritance diagram for INSMomentumTractionForm:
[legend]

Public Member Functions

 INSMomentumTractionForm (const InputParameters &parameters)
 
virtual ~INSMomentumTractionForm ()
 

Protected Member Functions

virtual Real computeQpResidualViscousPart () override
 
virtual Real computeQpJacobianViscousPart () override
 
virtual Real computeQpOffDiagJacobianViscousPart (unsigned jvar) override
 
virtual Real computeQpResidual ()
 
virtual Real computeQpJacobian ()
 
virtual Real computeQpOffDiagJacobian (unsigned jvar)
 
virtual Real computeQpPGResidual ()
 
virtual Real computeQpPGJacobian (unsigned comp)
 
virtual RealVectorValue convectiveTerm ()
 
virtual RealVectorValue dConvecDUComp (unsigned comp)
 
virtual RealVectorValue strongViscousTermLaplace ()
 
virtual RealVectorValue strongViscousTermTraction ()
 
virtual RealVectorValue dStrongViscDUCompLaplace (unsigned comp)
 
virtual RealVectorValue dStrongViscDUCompTraction (unsigned comp)
 
virtual RealVectorValue weakViscousTermLaplace (unsigned comp)
 
virtual RealVectorValue weakViscousTermTraction (unsigned comp)
 
virtual RealVectorValue dWeakViscDUCompLaplace ()
 
virtual RealVectorValue dWeakViscDUCompTraction ()
 
virtual RealVectorValue strongPressureTerm ()
 
virtual Real weakPressureTerm ()
 
virtual RealVectorValue dStrongPressureDPressure ()
 
virtual Real dWeakPressureDPressure ()
 
virtual RealVectorValue gravityTerm ()
 
virtual RealVectorValue timeDerivativeTerm ()
 
virtual RealVectorValue dTimeDerivativeDUComp (unsigned comp)
 
virtual Real tau ()
 
virtual Real dTauDUComp (unsigned comp)
 
virtual Real tauNodal ()
 Provides tau which yields superconvergence for 1D advection-diffusion. More...
 

Protected Attributes

unsigned _component
 
bool _integrate_p_by_parts
 
bool _supg
 
Function & _ffn
 
const VariablePhiSecond & _second_phi
 second derivatives of the shape function More...
 
const VariableValue & _u_vel
 
const VariableValue & _v_vel
 
const VariableValue & _w_vel
 
const VariableValue & _p
 
const VariableGradient & _grad_u_vel
 
const VariableGradient & _grad_v_vel
 
const VariableGradient & _grad_w_vel
 
const VariableGradient & _grad_p
 
const VariableSecond & _second_u_vel
 
const VariableSecond & _second_v_vel
 
const VariableSecond & _second_w_vel
 
const VariableValue & _u_vel_dot
 
const VariableValue & _v_vel_dot
 
const VariableValue & _w_vel_dot
 
const VariableValue & _d_u_vel_dot_du
 
const VariableValue & _d_v_vel_dot_dv
 
const VariableValue & _d_w_vel_dot_dw
 
unsigned _u_vel_var_number
 
unsigned _v_vel_var_number
 
unsigned _w_vel_var_number
 
unsigned _p_var_number
 
RealVectorValue _gravity
 
const MaterialProperty< Real > & _mu
 
const MaterialProperty< Real > & _rho
 
const Real & _alpha
 
bool _laplace
 
bool _convective_term
 
bool _transient_term
 

Detailed Description

This class computes momentum equation residual and Jacobian viscous contributions for the "traction" form of the governing equations.

Definition at line 25 of file INSMomentumTractionForm.h.

Constructor & Destructor Documentation

◆ INSMomentumTractionForm()

INSMomentumTractionForm::INSMomentumTractionForm ( const InputParameters &  parameters)

Definition at line 24 of file INSMomentumTractionForm.C.

25  : INSMomentumBase(parameters)
26 {
27 }
INSMomentumBase(const InputParameters &parameters)

◆ ~INSMomentumTractionForm()

virtual INSMomentumTractionForm::~INSMomentumTractionForm ( )
inlinevirtual

Definition at line 30 of file INSMomentumTractionForm.h.

30 {}

Member Function Documentation

◆ computeQpJacobian()

Real INSMomentumBase::computeQpJacobian ( )
protectedvirtualinherited

Implements INSBase.

Reimplemented in INSMomentumLaplaceFormRZ, and INSMomentumTractionFormRZ.

Definition at line 93 of file INSMomentumBase.C.

Referenced by INSMomentumTractionFormRZ::computeQpJacobian(), and INSMomentumLaplaceFormRZ::computeQpJacobian().

94 {
95  Real jac = 0;
96 
97  // viscous term
99 
100  // convective term
101  if (_convective_term)
102  jac += _test[_i][_qp] * dConvecDUComp(_component)(_component);
103 
104  if (_supg)
106 
107  return jac;
108 }
virtual Real computeQpJacobianViscousPart()=0
virtual Real computeQpPGJacobian(unsigned comp)
bool _convective_term
Definition: INSBase.h:110
virtual RealVectorValue dConvecDUComp(unsigned comp)
Definition: INSBase.C:104

◆ computeQpJacobianViscousPart()

Real INSMomentumTractionForm::computeQpJacobianViscousPart ( )
overrideprotectedvirtual

Implements INSMomentumBase.

Definition at line 64 of file INSMomentumTractionForm.C.

65 {
66  // Viscous part, full stress tensor. The extra contribution comes from the "2"
67  // on the diagonal of the viscous stress tensor.
68  return _mu[_qp] * (_grad_phi[_j][_qp] * _grad_test[_i][_qp] +
69  _grad_phi[_j][_qp](_component) * _grad_test[_i][_qp](_component));
70 }
const MaterialProperty< Real > & _mu
Definition: INSBase.h:105

◆ computeQpOffDiagJacobian()

Real INSMomentumBase::computeQpOffDiagJacobian ( unsigned  jvar)
protectedvirtualinherited

Implements INSBase.

Reimplemented in INSMomentumLaplaceFormRZ, and INSMomentumTractionFormRZ.

Definition at line 137 of file INSMomentumBase.C.

Referenced by INSMomentumTractionFormRZ::computeQpOffDiagJacobian(), and INSMomentumLaplaceFormRZ::computeQpOffDiagJacobian().

138 {
139  Real jac = 0;
140  if (jvar == _u_vel_var_number)
141  {
142  Real convective_term = _convective_term ? _test[_i][_qp] * dConvecDUComp(0)(_component) : 0.;
143  Real viscous_term = computeQpOffDiagJacobianViscousPart(jvar);
144 
145  jac += convective_term + viscous_term;
146 
147  if (_supg)
148  jac += computeQpPGJacobian(0);
149 
150  return jac;
151  }
152  else if (jvar == _v_vel_var_number)
153  {
154  Real convective_term = _convective_term ? _test[_i][_qp] * dConvecDUComp(1)(_component) : 0.;
155  Real viscous_term = computeQpOffDiagJacobianViscousPart(jvar);
156 
157  jac += convective_term + viscous_term;
158 
159  if (_supg)
160  jac += computeQpPGJacobian(1);
161 
162  return jac;
163  }
164  else if (jvar == _w_vel_var_number)
165  {
166  Real convective_term = _convective_term ? _test[_i][_qp] * dConvecDUComp(2)(_component) : 0.;
167  Real viscous_term = computeQpOffDiagJacobianViscousPart(jvar);
168 
169  jac += convective_term + viscous_term;
170 
171  if (_supg)
172  jac += computeQpPGJacobian(2);
173 
174  return jac;
175  }
176 
177  else if (jvar == _p_var_number)
178  {
180  jac += _grad_test[_i][_qp](_component) * dWeakPressureDPressure();
181  else
182  jac += _test[_i][_qp] * dStrongPressureDPressure()(_component);
183 
184  if (_supg)
185  {
186  RealVectorValue U(_u_vel[_qp], _v_vel[_qp], _w_vel[_qp]);
187  jac += tau() * U * _grad_test[_i][_qp] * dStrongPressureDPressure()(_component);
188  }
189 
190  return jac;
191  }
192 
193  else
194  return 0;
195 }
virtual Real tau()
Definition: INSBase.C:270
const VariableValue & _u_vel
Definition: INSBase.h:70
const VariableValue & _w_vel
Definition: INSBase.h:72
virtual Real computeQpOffDiagJacobianViscousPart(unsigned jvar)=0
unsigned _w_vel_var_number
Definition: INSBase.h:99
virtual RealVectorValue dStrongPressureDPressure()
Definition: INSBase.C:226
virtual Real computeQpPGJacobian(unsigned comp)
bool _convective_term
Definition: INSBase.h:110
virtual Real dWeakPressureDPressure()
Definition: INSBase.C:232
virtual RealVectorValue dConvecDUComp(unsigned comp)
Definition: INSBase.C:104
unsigned _u_vel_var_number
Definition: INSBase.h:97
const VariableValue & _v_vel
Definition: INSBase.h:71
unsigned _v_vel_var_number
Definition: INSBase.h:98
unsigned _p_var_number
Definition: INSBase.h:100

◆ computeQpOffDiagJacobianViscousPart()

Real INSMomentumTractionForm::computeQpOffDiagJacobianViscousPart ( unsigned  jvar)
overrideprotectedvirtual

Implements INSMomentumBase.

Definition at line 73 of file INSMomentumTractionForm.C.

74 {
75  // In Stokes/Laplacian version, off-diag Jacobian entries wrt u,v,w are zero
76  if (jvar == _u_vel_var_number)
77  return _mu[_qp] * _grad_phi[_j][_qp](_component) * _grad_test[_i][_qp](0);
78 
79  else if (jvar == _v_vel_var_number)
80  return _mu[_qp] * _grad_phi[_j][_qp](_component) * _grad_test[_i][_qp](1);
81 
82  else if (jvar == _w_vel_var_number)
83  return _mu[_qp] * _grad_phi[_j][_qp](_component) * _grad_test[_i][_qp](2);
84 
85  else
86  return 0;
87 }
const MaterialProperty< Real > & _mu
Definition: INSBase.h:105
unsigned _w_vel_var_number
Definition: INSBase.h:99
unsigned _u_vel_var_number
Definition: INSBase.h:97
unsigned _v_vel_var_number
Definition: INSBase.h:98

◆ computeQpPGJacobian()

Real INSMomentumBase::computeQpPGJacobian ( unsigned  comp)
protectedvirtualinherited

Definition at line 111 of file INSMomentumBase.C.

Referenced by INSMomentumBase::computeQpJacobian(), and INSMomentumBase::computeQpOffDiagJacobian().

112 {
113  RealVectorValue U(_u_vel[_qp], _v_vel[_qp], _w_vel[_qp]);
114  RealVectorValue d_U_d_U_comp(0, 0, 0);
115  d_U_d_U_comp(comp) = _phi[_j][_qp];
116 
117  Real convective_term = _convective_term ? convectiveTerm()(_component) : 0;
118  Real d_convective_term_d_u_comp = _convective_term ? dConvecDUComp(comp)(_component) : 0;
119  Real viscous_term =
121  Real d_viscous_term_d_u_comp = _laplace ? dStrongViscDUCompLaplace(comp)(_component)
123  Real transient_term = _transient_term ? timeDerivativeTerm()(_component) : 0;
124  Real d_transient_term_d_u_comp = _transient_term ? dTimeDerivativeDUComp(comp)(_component) : 0;
125 
126  return dTauDUComp(comp) * U * _grad_test[_i][_qp] *
127  (convective_term + viscous_term + strongPressureTerm()(_component) +
128  gravityTerm()(_component) + transient_term - _ffn.value(_t, _q_point[_qp])) +
129  tau() * d_U_d_U_comp * _grad_test[_i][_qp] *
130  (convective_term + viscous_term + strongPressureTerm()(_component) +
131  gravityTerm()(_component) + transient_term - _ffn.value(_t, _q_point[_qp])) +
132  tau() * U * _grad_test[_i][_qp] *
133  (d_convective_term_d_u_comp + d_viscous_term_d_u_comp + d_transient_term_d_u_comp);
134 }
virtual RealVectorValue strongViscousTermLaplace()
Definition: INSBase.C:119
virtual RealVectorValue dStrongViscDUCompTraction(unsigned comp)
Definition: INSBase.C:143
virtual Real tau()
Definition: INSBase.C:270
const VariableValue & _u_vel
Definition: INSBase.h:70
virtual Real dTauDUComp(unsigned comp)
Definition: INSBase.C:298
const VariableValue & _w_vel
Definition: INSBase.h:72
virtual RealVectorValue timeDerivativeTerm()
Definition: INSBase.C:244
virtual RealVectorValue convectiveTerm()
Definition: INSBase.C:96
bool _convective_term
Definition: INSBase.h:110
virtual RealVectorValue strongPressureTerm()
Definition: INSBase.C:214
bool _transient_term
Definition: INSBase.h:111
virtual RealVectorValue dConvecDUComp(unsigned comp)
Definition: INSBase.C:104
virtual RealVectorValue dStrongViscDUCompLaplace(unsigned comp)
Definition: INSBase.C:134
bool _laplace
Definition: INSBase.h:109
virtual RealVectorValue gravityTerm()
Definition: INSBase.C:238
virtual RealVectorValue strongViscousTermTraction()
Definition: INSBase.C:126
const VariableValue & _v_vel
Definition: INSBase.h:71
virtual RealVectorValue dTimeDerivativeDUComp(unsigned comp)
Definition: INSBase.C:250

◆ computeQpPGResidual()

Real INSMomentumBase::computeQpPGResidual ( )
protectedvirtualinherited

Definition at line 67 of file INSMomentumBase.C.

Referenced by INSMomentumBase::computeQpResidual().

68 {
69  RealVectorValue U(_u_vel[_qp], _v_vel[_qp], _w_vel[_qp]);
70 
71  RealVectorValue convective_term = _convective_term ? convectiveTerm() : RealVectorValue(0, 0, 0);
72  RealVectorValue viscous_term =
74  RealVectorValue transient_term =
75  _transient_term ? timeDerivativeTerm() : RealVectorValue(0, 0, 0);
76 
77  return tau() * U * _grad_test[_i][_qp] *
78  ((convective_term + viscous_term + transient_term + strongPressureTerm() +
79  gravityTerm())(_component)-_ffn.value(_t, _q_point[_qp]));
80 
81  // For GLS as opposed to SUPG stabilization, one would need to modify the test function functional
82  // space to include second derivatives of the Galerkin test functions corresponding to the viscous
83  // term. This would look like:
84  // Real lap_test =
85  // _second_test[_i][_qp](0, 0) + _second_test[_i][_qp](1, 1) + _second_test[_i][_qp](2, 2);
86 
87  // Real pg_viscous_r = -_mu[_qp] * lap_test * tau() *
88  // (convective_term + viscous_term + strongPressureTerm()(_component) +
89  // gravityTerm())(_component);
90 }
virtual RealVectorValue strongViscousTermLaplace()
Definition: INSBase.C:119
virtual Real tau()
Definition: INSBase.C:270
const VariableValue & _u_vel
Definition: INSBase.h:70
const VariableValue & _w_vel
Definition: INSBase.h:72
virtual RealVectorValue timeDerivativeTerm()
Definition: INSBase.C:244
virtual RealVectorValue convectiveTerm()
Definition: INSBase.C:96
bool _convective_term
Definition: INSBase.h:110
virtual RealVectorValue strongPressureTerm()
Definition: INSBase.C:214
bool _transient_term
Definition: INSBase.h:111
bool _laplace
Definition: INSBase.h:109
virtual RealVectorValue gravityTerm()
Definition: INSBase.C:238
virtual RealVectorValue strongViscousTermTraction()
Definition: INSBase.C:126
const VariableValue & _v_vel
Definition: INSBase.h:71

◆ computeQpResidual()

Real INSMomentumBase::computeQpResidual ( )
protectedvirtualinherited

Implements INSBase.

Reimplemented in INSMomentumLaplaceFormRZ, and INSMomentumTractionFormRZ.

Definition at line 40 of file INSMomentumBase.C.

Referenced by INSMomentumTractionFormRZ::computeQpResidual(), and INSMomentumLaplaceFormRZ::computeQpResidual().

41 {
42  Real r = 0;
43 
44  // viscous term
46 
47  // pressure term
49  r += _grad_test[_i][_qp](_component) * weakPressureTerm();
50  else
51  r += _test[_i][_qp] * strongPressureTerm()(_component);
52 
53  // body force term
54  r += _test[_i][_qp] * (gravityTerm()(_component) - _ffn.value(_t, _q_point[_qp]));
55 
56  // convective term
57  if (_convective_term)
58  r += _test[_i][_qp] * convectiveTerm()(_component);
59 
60  if (_supg)
61  r += computeQpPGResidual();
62 
63  return r;
64 }
virtual Real computeQpResidualViscousPart()=0
virtual Real computeQpPGResidual()
virtual RealVectorValue convectiveTerm()
Definition: INSBase.C:96
bool _convective_term
Definition: INSBase.h:110
virtual RealVectorValue strongPressureTerm()
Definition: INSBase.C:214
virtual RealVectorValue gravityTerm()
Definition: INSBase.C:238
virtual Real weakPressureTerm()
Definition: INSBase.C:220

◆ computeQpResidualViscousPart()

Real INSMomentumTractionForm::computeQpResidualViscousPart ( )
overrideprotectedvirtual

Implements INSMomentumBase.

Definition at line 30 of file INSMomentumTractionForm.C.

31 {
32  // The component'th row (or col, it's symmetric) of the viscous stress tensor
33  RealVectorValue tau_row;
34 
35  switch (_component)
36  {
37  case 0:
38  tau_row(0) = 2. * _grad_u_vel[_qp](0); // 2*du/dx1
39  tau_row(1) = _grad_u_vel[_qp](1) + _grad_v_vel[_qp](0); // du/dx2 + dv/dx1
40  tau_row(2) = _grad_u_vel[_qp](2) + _grad_w_vel[_qp](0); // du/dx3 + dw/dx1
41  break;
42 
43  case 1:
44  tau_row(0) = _grad_v_vel[_qp](0) + _grad_u_vel[_qp](1); // dv/dx1 + du/dx2
45  tau_row(1) = 2. * _grad_v_vel[_qp](1); // 2*dv/dx2
46  tau_row(2) = _grad_v_vel[_qp](2) + _grad_w_vel[_qp](1); // dv/dx3 + dw/dx2
47  break;
48 
49  case 2:
50  tau_row(0) = _grad_w_vel[_qp](0) + _grad_u_vel[_qp](2); // dw/dx1 + du/dx3
51  tau_row(1) = _grad_w_vel[_qp](1) + _grad_v_vel[_qp](2); // dw/dx2 + dv/dx3
52  tau_row(2) = 2. * _grad_w_vel[_qp](2); // 2*dw/dx3
53  break;
54 
55  default:
56  mooseError("Unrecognized _component requested.");
57  }
58 
59  // The viscous part, _mu[_qp] * tau : grad(v)
60  return _mu[_qp] * (tau_row * _grad_test[_i][_qp]);
61 }
const MaterialProperty< Real > & _mu
Definition: INSBase.h:105
const VariableGradient & _grad_v_vel
Definition: INSBase.h:77
const VariableGradient & _grad_u_vel
Definition: INSBase.h:76
const VariableGradient & _grad_w_vel
Definition: INSBase.h:78

◆ convectiveTerm()

RealVectorValue INSBase::convectiveTerm ( )
protectedvirtualinherited

Definition at line 96 of file INSBase.C.

Referenced by INSMomentumBase::computeQpPGJacobian(), INSMass::computeQpPGOffDiagJacobian(), INSMass::computeQpPGResidual(), INSMomentumBase::computeQpPGResidual(), and INSMomentumBase::computeQpResidual().

97 {
98  RealVectorValue U(_u_vel[_qp], _v_vel[_qp], _w_vel[_qp]);
99  return _rho[_qp] *
100  RealVectorValue(U * _grad_u_vel[_qp], U * _grad_v_vel[_qp], U * _grad_w_vel[_qp]);
101 }
const MaterialProperty< Real > & _rho
Definition: INSBase.h:106
const VariableValue & _u_vel
Definition: INSBase.h:70
const VariableGradient & _grad_v_vel
Definition: INSBase.h:77
const VariableValue & _w_vel
Definition: INSBase.h:72
const VariableGradient & _grad_u_vel
Definition: INSBase.h:76
const VariableGradient & _grad_w_vel
Definition: INSBase.h:78
const VariableValue & _v_vel
Definition: INSBase.h:71

◆ dConvecDUComp()

RealVectorValue INSBase::dConvecDUComp ( unsigned  comp)
protectedvirtualinherited

Definition at line 104 of file INSBase.C.

Referenced by INSMomentumBase::computeQpJacobian(), INSMomentumBase::computeQpOffDiagJacobian(), INSMomentumBase::computeQpPGJacobian(), and INSMass::computeQpPGOffDiagJacobian().

105 {
106  RealVectorValue U(_u_vel[_qp], _v_vel[_qp], _w_vel[_qp]);
107  RealVectorValue d_U_d_comp(0, 0, 0);
108  d_U_d_comp(comp) = _phi[_j][_qp];
109 
110  RealVectorValue convective_term = _rho[_qp] * RealVectorValue(d_U_d_comp * _grad_u_vel[_qp],
111  d_U_d_comp * _grad_v_vel[_qp],
112  d_U_d_comp * _grad_w_vel[_qp]);
113  convective_term(comp) += _rho[_qp] * U * _grad_phi[_j][_qp];
114 
115  return convective_term;
116 }
const MaterialProperty< Real > & _rho
Definition: INSBase.h:106
const VariableValue & _u_vel
Definition: INSBase.h:70
const VariableGradient & _grad_v_vel
Definition: INSBase.h:77
const VariableValue & _w_vel
Definition: INSBase.h:72
const VariableGradient & _grad_u_vel
Definition: INSBase.h:76
const VariableGradient & _grad_w_vel
Definition: INSBase.h:78
const VariableValue & _v_vel
Definition: INSBase.h:71

◆ dStrongPressureDPressure()

RealVectorValue INSBase::dStrongPressureDPressure ( )
protectedvirtualinherited

Definition at line 226 of file INSBase.C.

Referenced by INSMomentumBase::computeQpOffDiagJacobian(), and INSMass::computeQpPGJacobian().

227 {
228  return _grad_phi[_j][_qp];
229 }

◆ dStrongViscDUCompLaplace()

RealVectorValue INSBase::dStrongViscDUCompLaplace ( unsigned  comp)
protectedvirtualinherited

Reimplemented in INSMassRZ, and INSMomentumLaplaceFormRZ.

Definition at line 134 of file INSBase.C.

Referenced by INSMomentumBase::computeQpPGJacobian(), INSMass::computeQpPGOffDiagJacobian(), INSMomentumLaplaceFormRZ::dStrongViscDUCompLaplace(), and INSMassRZ::dStrongViscDUCompLaplace().

135 {
136  RealVectorValue viscous_term(0, 0, 0);
137  viscous_term(comp) = -_mu[_qp] * _second_phi[_j][_qp].tr();
138 
139  return viscous_term;
140 }
const VariablePhiSecond & _second_phi
second derivatives of the shape function
Definition: INSBase.h:67
const MaterialProperty< Real > & _mu
Definition: INSBase.h:105

◆ dStrongViscDUCompTraction()

RealVectorValue INSBase::dStrongViscDUCompTraction ( unsigned  comp)
protectedvirtualinherited

Reimplemented in INSMassRZ, and INSMomentumTractionFormRZ.

Definition at line 143 of file INSBase.C.

Referenced by INSMomentumBase::computeQpPGJacobian(), INSMass::computeQpPGOffDiagJacobian(), INSMomentumTractionFormRZ::dStrongViscDUCompTraction(), and INSMassRZ::dStrongViscDUCompTraction().

144 {
145  RealVectorValue viscous_term(0, 0, 0);
146  viscous_term(comp) = -_mu[_qp] * (_second_phi[_j][_qp](0, 0) + _second_phi[_j][_qp](1, 1) +
147  _second_phi[_j][_qp](2, 2));
148  for (unsigned i = 0; i < 3; i++)
149  viscous_term(i) += -_mu[_qp] * _second_phi[_j][_qp](i, comp);
150 
151  return viscous_term;
152 }
const VariablePhiSecond & _second_phi
second derivatives of the shape function
Definition: INSBase.h:67
const MaterialProperty< Real > & _mu
Definition: INSBase.h:105

◆ dTauDUComp()

Real INSBase::dTauDUComp ( unsigned  comp)
protectedvirtualinherited

Definition at line 298 of file INSBase.C.

Referenced by INSMomentumBase::computeQpPGJacobian(), and INSMass::computeQpPGOffDiagJacobian().

299 {
300  Real nu = _mu[_qp] / _rho[_qp];
301  RealVectorValue U(_u_vel[_qp], _v_vel[_qp], _w_vel[_qp]);
302  Real h = _current_elem->hmax();
303  Real transient_part = _transient_term ? 4. / (_dt * _dt) : 0.;
304  return -_alpha / 2. * std::pow(transient_part + (2. * U.norm() / h) * (2. * U.norm() / h) +
305  9. * (4. * nu / (h * h)) * (4. * nu / (h * h)),
306  -1.5) *
307  2. * (2. * U.norm() / h) * 2. / h * U(comp) * _phi[_j][_qp] /
308  (U.norm() + std::numeric_limits<double>::epsilon());
309 }
const MaterialProperty< Real > & _rho
Definition: INSBase.h:106
const VariableValue & _u_vel
Definition: INSBase.h:70
const MaterialProperty< Real > & _mu
Definition: INSBase.h:105
const VariableValue & _w_vel
Definition: INSBase.h:72
bool _transient_term
Definition: INSBase.h:111
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const VariableValue & _v_vel
Definition: INSBase.h:71
const Real & _alpha
Definition: INSBase.h:108

◆ dTimeDerivativeDUComp()

RealVectorValue INSBase::dTimeDerivativeDUComp ( unsigned  comp)
protectedvirtualinherited

Definition at line 250 of file INSBase.C.

Referenced by INSMomentumBase::computeQpPGJacobian(), and INSMass::computeQpPGOffDiagJacobian().

251 {
252  Real base = _rho[_qp] * _phi[_j][_qp];
253  switch (comp)
254  {
255  case 0:
256  return RealVectorValue(base * _d_u_vel_dot_du[_qp], 0, 0);
257 
258  case 1:
259  return RealVectorValue(0, base * _d_v_vel_dot_dv[_qp], 0);
260 
261  case 2:
262  return RealVectorValue(0, 0, base * _d_w_vel_dot_dw[_qp]);
263 
264  default:
265  mooseError("comp must be 0, 1, or 2");
266  }
267 }
const MaterialProperty< Real > & _rho
Definition: INSBase.h:106
const VariableValue & _d_v_vel_dot_dv
Definition: INSBase.h:93
const VariableValue & _d_w_vel_dot_dw
Definition: INSBase.h:94
const VariableValue & _d_u_vel_dot_du
Definition: INSBase.h:92

◆ dWeakPressureDPressure()

Real INSBase::dWeakPressureDPressure ( )
protectedvirtualinherited

Definition at line 232 of file INSBase.C.

Referenced by INSMomentumBase::computeQpOffDiagJacobian().

233 {
234  return -_phi[_j][_qp];
235 }

◆ dWeakViscDUCompLaplace()

RealVectorValue INSBase::dWeakViscDUCompLaplace ( )
protectedvirtualinherited

Definition at line 202 of file INSBase.C.

203 {
204  return _mu[_qp] * _grad_phi[_j][_qp];
205 }
const MaterialProperty< Real > & _mu
Definition: INSBase.h:105

◆ dWeakViscDUCompTraction()

RealVectorValue INSBase::dWeakViscDUCompTraction ( )
protectedvirtualinherited

Definition at line 208 of file INSBase.C.

209 {
210  return _mu[_qp] * _grad_phi[_j][_qp];
211 }
const MaterialProperty< Real > & _mu
Definition: INSBase.h:105

◆ gravityTerm()

RealVectorValue INSBase::gravityTerm ( )
protectedvirtualinherited

Definition at line 238 of file INSBase.C.

Referenced by INSMomentumBase::computeQpPGJacobian(), INSMass::computeQpPGOffDiagJacobian(), INSMass::computeQpPGResidual(), INSMomentumBase::computeQpPGResidual(), and INSMomentumBase::computeQpResidual().

239 {
240  return -_rho[_qp] * _gravity;
241 }
const MaterialProperty< Real > & _rho
Definition: INSBase.h:106
RealVectorValue _gravity
Definition: INSBase.h:102

◆ strongPressureTerm()

RealVectorValue INSBase::strongPressureTerm ( )
protectedvirtualinherited

◆ strongViscousTermLaplace()

RealVectorValue INSBase::strongViscousTermLaplace ( )
protectedvirtualinherited

Reimplemented in INSMassRZ, and INSMomentumLaplaceFormRZ.

Definition at line 119 of file INSBase.C.

Referenced by INSMomentumBase::computeQpPGJacobian(), INSMass::computeQpPGOffDiagJacobian(), INSMass::computeQpPGResidual(), INSMomentumBase::computeQpPGResidual(), INSMomentumLaplaceFormRZ::strongViscousTermLaplace(), INSMassRZ::strongViscousTermLaplace(), and INSBase::strongViscousTermTraction().

120 {
121  return -_mu[_qp] *
122  RealVectorValue(_second_u_vel[_qp].tr(), _second_v_vel[_qp].tr(), _second_w_vel[_qp].tr());
123 }
const MaterialProperty< Real > & _mu
Definition: INSBase.h:105
const VariableSecond & _second_u_vel
Definition: INSBase.h:82
const VariableSecond & _second_v_vel
Definition: INSBase.h:83
const VariableSecond & _second_w_vel
Definition: INSBase.h:84

◆ strongViscousTermTraction()

RealVectorValue INSBase::strongViscousTermTraction ( )
protectedvirtualinherited

Reimplemented in INSMassRZ, and INSMomentumTractionFormRZ.

Definition at line 126 of file INSBase.C.

Referenced by INSMomentumBase::computeQpPGJacobian(), INSMass::computeQpPGOffDiagJacobian(), INSMass::computeQpPGResidual(), INSMomentumBase::computeQpPGResidual(), INSMomentumTractionFormRZ::strongViscousTermTraction(), and INSMassRZ::strongViscousTermTraction().

127 {
128  return strongViscousTermLaplace() -
129  _mu[_qp] *
130  (_second_u_vel[_qp].row(0) + _second_v_vel[_qp].row(1) + _second_w_vel[_qp].row(2));
131 }
virtual RealVectorValue strongViscousTermLaplace()
Definition: INSBase.C:119
const MaterialProperty< Real > & _mu
Definition: INSBase.h:105
const VariableSecond & _second_u_vel
Definition: INSBase.h:82
const VariableSecond & _second_v_vel
Definition: INSBase.h:83
const VariableSecond & _second_w_vel
Definition: INSBase.h:84

◆ tau()

Real INSBase::tau ( )
protectedvirtualinherited

Definition at line 270 of file INSBase.C.

Referenced by Advection::computeQpJacobian(), INSMomentumBase::computeQpOffDiagJacobian(), INSMass::computeQpPGJacobian(), INSMomentumBase::computeQpPGJacobian(), INSMass::computeQpPGOffDiagJacobian(), INSMass::computeQpPGResidual(), INSMomentumBase::computeQpPGResidual(), and Advection::computeQpResidual().

271 {
272  Real nu = _mu[_qp] / _rho[_qp];
273  RealVectorValue U(_u_vel[_qp], _v_vel[_qp], _w_vel[_qp]);
274  Real h = _current_elem->hmax();
275  Real transient_part = _transient_term ? 4. / (_dt * _dt) : 0.;
276  return _alpha / std::sqrt(transient_part + (2. * U.norm() / h) * (2. * U.norm() / h) +
277  9. * (4. * nu / (h * h)) * (4. * nu / (h * h)));
278 }
const MaterialProperty< Real > & _rho
Definition: INSBase.h:106
const VariableValue & _u_vel
Definition: INSBase.h:70
const MaterialProperty< Real > & _mu
Definition: INSBase.h:105
const VariableValue & _w_vel
Definition: INSBase.h:72
bool _transient_term
Definition: INSBase.h:111
const VariableValue & _v_vel
Definition: INSBase.h:71
const Real & _alpha
Definition: INSBase.h:108

◆ tauNodal()

Real INSBase::tauNodal ( )
protectedvirtualinherited

Provides tau which yields superconvergence for 1D advection-diffusion.

Definition at line 281 of file INSBase.C.

Referenced by Advection::computeQpJacobian(), and Advection::computeQpResidual().

282 {
283  Real nu = _mu[_qp] / _rho[_qp];
284  RealVectorValue U(_u_vel[_qp], _v_vel[_qp], _w_vel[_qp]);
285  Real h = _current_elem->hmax();
286  Real xi;
287  if (nu < std::numeric_limits<Real>::epsilon())
288  xi = 1;
289  else
290  {
291  Real alpha = U.norm() * h / (2 * nu);
292  xi = 1. / std::tanh(alpha) - 1. / alpha;
293  }
294  return h / (2 * U.norm()) * xi;
295 }
const MaterialProperty< Real > & _rho
Definition: INSBase.h:106
const VariableValue & _u_vel
Definition: INSBase.h:70
const MaterialProperty< Real > & _mu
Definition: INSBase.h:105
const VariableValue & _w_vel
Definition: INSBase.h:72
const VariableValue & _v_vel
Definition: INSBase.h:71

◆ timeDerivativeTerm()

RealVectorValue INSBase::timeDerivativeTerm ( )
protectedvirtualinherited

Definition at line 244 of file INSBase.C.

Referenced by INSMomentumBase::computeQpPGJacobian(), INSMass::computeQpPGOffDiagJacobian(), INSMass::computeQpPGResidual(), and INSMomentumBase::computeQpPGResidual().

245 {
246  return _rho[_qp] * RealVectorValue(_u_vel_dot[_qp], _v_vel_dot[_qp], _w_vel_dot[_qp]);
247 }
const MaterialProperty< Real > & _rho
Definition: INSBase.h:106
const VariableValue & _w_vel_dot
Definition: INSBase.h:89
const VariableValue & _u_vel_dot
Definition: INSBase.h:87
const VariableValue & _v_vel_dot
Definition: INSBase.h:88

◆ weakPressureTerm()

Real INSBase::weakPressureTerm ( )
protectedvirtualinherited

Definition at line 220 of file INSBase.C.

Referenced by INSMomentumBase::computeQpResidual().

221 {
222  return -_p[_qp];
223 }
const VariableValue & _p
Definition: INSBase.h:73

◆ weakViscousTermLaplace()

RealVectorValue INSBase::weakViscousTermLaplace ( unsigned  comp)
protectedvirtualinherited

Definition at line 155 of file INSBase.C.

156 {
157  switch (comp)
158  {
159  case 0:
160  return _mu[_qp] * _grad_u_vel[_qp];
161 
162  case 1:
163  return _mu[_qp] * _grad_v_vel[_qp];
164 
165  case 2:
166  return _mu[_qp] * _grad_w_vel[_qp];
167 
168  default:
169  return _zero[_qp];
170  }
171 }
const MaterialProperty< Real > & _mu
Definition: INSBase.h:105
const VariableGradient & _grad_v_vel
Definition: INSBase.h:77
const VariableGradient & _grad_u_vel
Definition: INSBase.h:76
const VariableGradient & _grad_w_vel
Definition: INSBase.h:78

◆ weakViscousTermTraction()

RealVectorValue INSBase::weakViscousTermTraction ( unsigned  comp)
protectedvirtualinherited

Definition at line 174 of file INSBase.C.

175 {
176  switch (comp)
177  {
178  case 0:
179  {
180  RealVectorValue transpose(_grad_u_vel[_qp](0), _grad_v_vel[_qp](0), _grad_w_vel[_qp](0));
181  return _mu[_qp] * _grad_u_vel[_qp] + _mu[_qp] * transpose;
182  }
183 
184  case 1:
185  {
186  RealVectorValue transpose(_grad_u_vel[_qp](1), _grad_v_vel[_qp](1), _grad_w_vel[_qp](1));
187  return _mu[_qp] * _grad_v_vel[_qp] + _mu[_qp] * transpose;
188  }
189 
190  case 2:
191  {
192  RealVectorValue transpose(_grad_u_vel[_qp](2), _grad_v_vel[_qp](2), _grad_w_vel[_qp](2));
193  return _mu[_qp] * _grad_w_vel[_qp] + _mu[_qp] * transpose;
194  }
195 
196  default:
197  return _zero[_qp];
198  }
199 }
const MaterialProperty< Real > & _mu
Definition: INSBase.h:105
const VariableGradient & _grad_v_vel
Definition: INSBase.h:77
const VariableGradient & _grad_u_vel
Definition: INSBase.h:76
const VariableGradient & _grad_w_vel
Definition: INSBase.h:78

Member Data Documentation

◆ _alpha

const Real& INSBase::_alpha
protectedinherited

Definition at line 108 of file INSBase.h.

Referenced by INSBase::dTauDUComp(), and INSBase::tau().

◆ _component

unsigned INSMomentumBase::_component
protectedinherited

◆ _convective_term

bool INSBase::_convective_term
protectedinherited

◆ _d_u_vel_dot_du

const VariableValue& INSBase::_d_u_vel_dot_du
protectedinherited

Definition at line 92 of file INSBase.h.

Referenced by INSBase::dTimeDerivativeDUComp().

◆ _d_v_vel_dot_dv

const VariableValue& INSBase::_d_v_vel_dot_dv
protectedinherited

Definition at line 93 of file INSBase.h.

Referenced by INSBase::dTimeDerivativeDUComp().

◆ _d_w_vel_dot_dw

const VariableValue& INSBase::_d_w_vel_dot_dw
protectedinherited

Definition at line 94 of file INSBase.h.

Referenced by INSBase::dTimeDerivativeDUComp().

◆ _ffn

Function& INSMomentumBase::_ffn
protectedinherited

◆ _grad_p

const VariableGradient& INSBase::_grad_p
protectedinherited

Definition at line 79 of file INSBase.h.

Referenced by INSBase::strongPressureTerm().

◆ _grad_u_vel

const VariableGradient& INSBase::_grad_u_vel
protectedinherited

◆ _grad_v_vel

const VariableGradient& INSBase::_grad_v_vel
protectedinherited

◆ _grad_w_vel

const VariableGradient& INSBase::_grad_w_vel
protectedinherited

◆ _gravity

RealVectorValue INSBase::_gravity
protectedinherited

Definition at line 102 of file INSBase.h.

Referenced by INSBase::gravityTerm().

◆ _integrate_p_by_parts

bool INSMomentumBase::_integrate_p_by_parts
protectedinherited

◆ _laplace

bool INSBase::_laplace
protectedinherited

◆ _mu

const MaterialProperty<Real>& INSBase::_mu
protectedinherited

◆ _p

const VariableValue& INSBase::_p
protectedinherited

◆ _p_var_number

unsigned INSBase::_p_var_number
protectedinherited

◆ _rho

const MaterialProperty<Real>& INSBase::_rho
protectedinherited

◆ _second_phi

const VariablePhiSecond& INSBase::_second_phi
protectedinherited

second derivatives of the shape function

Definition at line 67 of file INSBase.h.

Referenced by INSBase::dStrongViscDUCompLaplace(), and INSBase::dStrongViscDUCompTraction().

◆ _second_u_vel

const VariableSecond& INSBase::_second_u_vel
protectedinherited

◆ _second_v_vel

const VariableSecond& INSBase::_second_v_vel
protectedinherited

◆ _second_w_vel

const VariableSecond& INSBase::_second_w_vel
protectedinherited

◆ _supg

bool INSMomentumBase::_supg
protectedinherited

◆ _transient_term

bool INSBase::_transient_term
protectedinherited

◆ _u_vel

const VariableValue& INSBase::_u_vel
protectedinherited

◆ _u_vel_dot

const VariableValue& INSBase::_u_vel_dot
protectedinherited

Definition at line 87 of file INSBase.h.

Referenced by INSBase::timeDerivativeTerm().

◆ _u_vel_var_number

unsigned INSBase::_u_vel_var_number
protectedinherited

◆ _v_vel

const VariableValue& INSBase::_v_vel
protectedinherited

◆ _v_vel_dot

const VariableValue& INSBase::_v_vel_dot
protectedinherited

Definition at line 88 of file INSBase.h.

Referenced by INSBase::timeDerivativeTerm().

◆ _v_vel_var_number

unsigned INSBase::_v_vel_var_number
protectedinherited

◆ _w_vel

const VariableValue& INSBase::_w_vel
protectedinherited

◆ _w_vel_dot

const VariableValue& INSBase::_w_vel_dot
protectedinherited

Definition at line 89 of file INSBase.h.

Referenced by INSBase::timeDerivativeTerm().

◆ _w_vel_var_number

unsigned INSBase::_w_vel_var_number
protectedinherited

The documentation for this class was generated from the following files: