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

This class implements the "No BC" boundary condition based on the "traction" form of the viscous stress tensor. More...

#include <INSMomentumNoBCBCTractionForm.h>

Inheritance diagram for INSMomentumNoBCBCTractionForm:
[legend]

Public Member Functions

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

Protected Member Functions

virtual Real computeQpResidual ()
 
virtual Real computeQpJacobian ()
 
virtual Real computeQpOffDiagJacobian (unsigned jvar)
 

Protected Attributes

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
 
unsigned _u_vel_var_number
 
unsigned _v_vel_var_number
 
unsigned _w_vel_var_number
 
unsigned _p_var_number
 
RealVectorValue _gravity
 
unsigned _component
 
bool _integrate_p_by_parts
 
const MaterialProperty< Real > & _mu
 
const MaterialProperty< Real > & _rho
 

Detailed Description

This class implements the "No BC" boundary condition based on the "traction" form of the viscous stress tensor.

Definition at line 25 of file INSMomentumNoBCBCTractionForm.h.

Constructor & Destructor Documentation

◆ INSMomentumNoBCBCTractionForm()

INSMomentumNoBCBCTractionForm::INSMomentumNoBCBCTractionForm ( const InputParameters &  parameters)

Definition at line 26 of file INSMomentumNoBCBCTractionForm.C.

27  : INSMomentumNoBCBCBase(parameters)
28 {
29 }
INSMomentumNoBCBCBase(const InputParameters &parameters)

◆ ~INSMomentumNoBCBCTractionForm()

virtual INSMomentumNoBCBCTractionForm::~INSMomentumNoBCBCTractionForm ( )
inlinevirtual

Definition at line 30 of file INSMomentumNoBCBCTractionForm.h.

30 {}

Member Function Documentation

◆ computeQpJacobian()

Real INSMomentumNoBCBCTractionForm::computeQpJacobian ( )
protectedvirtual

Definition at line 69 of file INSMomentumNoBCBCTractionForm.C.

70 {
71  // The extra contribution comes from the "2" on the diagonal of the viscous stress tensor
72  return -_mu[_qp] * (_grad_phi[_j][_qp] * _normals[_qp] +
73  _grad_phi[_j][_qp](_component) * _normals[_qp](_component)) *
74  _test[_i][_qp];
75 }
const MaterialProperty< Real > & _mu

◆ computeQpOffDiagJacobian()

Real INSMomentumNoBCBCTractionForm::computeQpOffDiagJacobian ( unsigned  jvar)
protectedvirtual

Definition at line 78 of file INSMomentumNoBCBCTractionForm.C.

79 {
80  if (jvar == _u_vel_var_number)
81  return -_mu[_qp] * _grad_phi[_j][_qp](_component) * _normals[_qp](0) * _test[_i][_qp];
82 
83  else if (jvar == _v_vel_var_number)
84  return -_mu[_qp] * _grad_phi[_j][_qp](_component) * _normals[_qp](1) * _test[_i][_qp];
85 
86  else if (jvar == _w_vel_var_number)
87  return -_mu[_qp] * _grad_phi[_j][_qp](_component) * _normals[_qp](2) * _test[_i][_qp];
88 
89  else if (jvar == _p_var_number)
90  {
92  return _phi[_j][_qp] * _normals[_qp](_component) * _test[_i][_qp];
93  else
94  return 0.;
95  }
96 
97  else
98  return 0.;
99 }
const MaterialProperty< Real > & _mu

◆ computeQpResidual()

Real INSMomentumNoBCBCTractionForm::computeQpResidual ( )
protectedvirtual

Definition at line 32 of file INSMomentumNoBCBCTractionForm.C.

33 {
34  // Compute n . sigma . v, where n is unit normal and v is the test function.
35  RealTensorValue sigma;
36 
37  // First row
38  sigma(0, 0) = 2. * _mu[_qp] * _grad_u_vel[_qp](0);
39  sigma(0, 1) = _mu[_qp] * (_grad_u_vel[_qp](1) + _grad_v_vel[_qp](0));
40  sigma(0, 2) = _mu[_qp] * (_grad_u_vel[_qp](2) + _grad_w_vel[_qp](0));
41 
42  // Second row
43  sigma(1, 0) = _mu[_qp] * (_grad_v_vel[_qp](0) + _grad_u_vel[_qp](1));
44  sigma(1, 1) = 2. * _mu[_qp] * _grad_v_vel[_qp](1);
45  sigma(1, 2) = _mu[_qp] * (_grad_v_vel[_qp](2) + _grad_w_vel[_qp](1));
46 
47  // Third row
48  sigma(2, 0) = _mu[_qp] * (_grad_w_vel[_qp](0) + _grad_u_vel[_qp](2));
49  sigma(2, 1) = _mu[_qp] * (_grad_w_vel[_qp](1) + _grad_v_vel[_qp](2));
50  sigma(2, 2) = 2. * _mu[_qp] * _grad_w_vel[_qp](2);
51 
52  // If the pressure term is integrated by parts, it is part of the
53  // no-BC-BC, otherwise, it is not.
55  {
56  sigma(0, 0) -= _p[_qp];
57  sigma(1, 1) -= _p[_qp];
58  sigma(2, 2) -= _p[_qp];
59  }
60 
61  // Set up test function
62  RealVectorValue test;
63  test(_component) = _test[_i][_qp];
64 
65  return -_normals[_qp] * (sigma * test);
66 }
const VariableGradient & _grad_v_vel
const VariableGradient & _grad_w_vel
const MaterialProperty< Real > & _mu
const VariableValue & _p
const VariableGradient & _grad_u_vel

Member Data Documentation

◆ _component

unsigned INSMomentumNoBCBCBase::_component
protectedinherited

◆ _grad_u_vel

const VariableGradient& INSMomentumNoBCBCBase::_grad_u_vel
protectedinherited

Definition at line 46 of file INSMomentumNoBCBCBase.h.

Referenced by computeQpResidual().

◆ _grad_v_vel

const VariableGradient& INSMomentumNoBCBCBase::_grad_v_vel
protectedinherited

Definition at line 47 of file INSMomentumNoBCBCBase.h.

Referenced by computeQpResidual().

◆ _grad_w_vel

const VariableGradient& INSMomentumNoBCBCBase::_grad_w_vel
protectedinherited

Definition at line 48 of file INSMomentumNoBCBCBase.h.

Referenced by computeQpResidual().

◆ _gravity

RealVectorValue INSMomentumNoBCBCBase::_gravity
protectedinherited

Definition at line 56 of file INSMomentumNoBCBCBase.h.

◆ _integrate_p_by_parts

bool INSMomentumNoBCBCBase::_integrate_p_by_parts
protectedinherited

◆ _mu

const MaterialProperty<Real>& INSMomentumNoBCBCBase::_mu
protectedinherited

◆ _p

const VariableValue& INSMomentumNoBCBCBase::_p
protectedinherited

◆ _p_var_number

unsigned INSMomentumNoBCBCBase::_p_var_number
protectedinherited

◆ _rho

const MaterialProperty<Real>& INSMomentumNoBCBCBase::_rho
protectedinherited

Definition at line 61 of file INSMomentumNoBCBCBase.h.

◆ _u_vel

const VariableValue& INSMomentumNoBCBCBase::_u_vel
protectedinherited

Definition at line 40 of file INSMomentumNoBCBCBase.h.

◆ _u_vel_var_number

unsigned INSMomentumNoBCBCBase::_u_vel_var_number
protectedinherited

Definition at line 51 of file INSMomentumNoBCBCBase.h.

Referenced by computeQpOffDiagJacobian().

◆ _v_vel

const VariableValue& INSMomentumNoBCBCBase::_v_vel
protectedinherited

Definition at line 41 of file INSMomentumNoBCBCBase.h.

◆ _v_vel_var_number

unsigned INSMomentumNoBCBCBase::_v_vel_var_number
protectedinherited

Definition at line 52 of file INSMomentumNoBCBCBase.h.

Referenced by computeQpOffDiagJacobian().

◆ _w_vel

const VariableValue& INSMomentumNoBCBCBase::_w_vel
protectedinherited

Definition at line 42 of file INSMomentumNoBCBCBase.h.

◆ _w_vel_var_number

unsigned INSMomentumNoBCBCBase::_w_vel_var_number
protectedinherited

Definition at line 53 of file INSMomentumNoBCBCBase.h.

Referenced by computeQpOffDiagJacobian().


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