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

This class computes the "projection" part of the "split" method for solving incompressible Navier-Stokes. More...

#include <INSProjection.h>

Inheritance diagram for INSProjection:
[legend]

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

const VariableValue & _a1
 
const VariableValue & _a2
 
const VariableValue & _a3
 
const VariableGradient & _grad_p
 
unsigned _a1_var_number
 
unsigned _a2_var_number
 
unsigned _a3_var_number
 
unsigned _p_var_number
 
unsigned _component
 
const MaterialProperty< Real > & _rho
 

Detailed Description

This class computes the "projection" part of the "split" method for solving incompressible Navier-Stokes.

This is a time-varying equation for u that is coupled to both the acceleration "a" and the pressue.

Do not use, USE INSChorinCorrector and related classes instead.

Definition at line 28 of file INSProjection.h.

Constructor & Destructor Documentation

◆ INSProjection()

INSProjection::INSProjection ( const InputParameters &  parameters)

Definition at line 40 of file INSProjection.C.

41  : Kernel(parameters),
42 
43  // Coupled variables
44  _a1(coupledValue("a1")),
45  _a2(_mesh.dimension() >= 2 ? coupledValue("a2") : _zero),
46  _a3(_mesh.dimension() == 3 ? coupledValue("a3") : _zero),
47 
48  // Gradients
49  _grad_p(coupledGradient("p")),
50 
51  // Variable numberings
52  _a1_var_number(coupled("a1")),
53  _a2_var_number(_mesh.dimension() >= 2 ? coupled("a2") : libMesh::invalid_uint),
54  _a3_var_number(_mesh.dimension() == 3 ? coupled("a3") : libMesh::invalid_uint),
55  _p_var_number(coupled("p")),
56 
57  // Required parameters
58  _component(getParam<unsigned>("component")),
59 
60  // Material properties
61  _rho(getMaterialProperty<Real>("rho_name"))
62 {
63 }
const VariableValue & _a3
Definition: INSProjection.h:43
unsigned _p_var_number
Definition: INSProjection.h:52
const MaterialProperty< Real > & _rho
Definition: INSProjection.h:58
unsigned _a1_var_number
Definition: INSProjection.h:49
unsigned _a3_var_number
Definition: INSProjection.h:51
unsigned _component
Definition: INSProjection.h:55
const VariableGradient & _grad_p
Definition: INSProjection.h:46
const VariableValue & _a1
Definition: INSProjection.h:41
unsigned _a2_var_number
Definition: INSProjection.h:50
const VariableValue & _a2
Definition: INSProjection.h:42

◆ ~INSProjection()

virtual INSProjection::~INSProjection ( )
inlinevirtual

Definition at line 33 of file INSProjection.h.

33 {}

Member Function Documentation

◆ computeQpJacobian()

Real INSProjection::computeQpJacobian ( )
protectedvirtual

Definition at line 86 of file INSProjection.C.

87 {
88  // There will be a diagonal component from the time derivative term...
89  return 0.;
90 }

◆ computeQpOffDiagJacobian()

Real INSProjection::computeQpOffDiagJacobian ( unsigned  jvar)
protectedvirtual

Definition at line 93 of file INSProjection.C.

94 {
95  if (((jvar == _a1_var_number) && (_component == 0)) ||
96  ((jvar == _a2_var_number) && (_component == 1)) ||
97  ((jvar == _a3_var_number) && (_component == 2)))
98  {
99  // The symmetric term's Jacobian is only non-zero when the
100  // component of 'a' being differentiated is the same as _component.
101  return -_phi[_j][_qp] * _test[_i][_qp];
102  }
103 
104  else if (jvar == _p_var_number)
105  {
106  return (1. / _rho[_qp]) * (_grad_phi[_j][_qp](_component) * _test[_i][_qp]);
107  }
108 
109  else
110  return 0;
111 }
unsigned _p_var_number
Definition: INSProjection.h:52
const MaterialProperty< Real > & _rho
Definition: INSProjection.h:58
unsigned _a1_var_number
Definition: INSProjection.h:49
unsigned _a3_var_number
Definition: INSProjection.h:51
unsigned _component
Definition: INSProjection.h:55
unsigned _a2_var_number
Definition: INSProjection.h:50

◆ computeQpResidual()

Real INSProjection::computeQpResidual ( )
protectedvirtual

Definition at line 66 of file INSProjection.C.

67 {
68  // Vector object for a
69  RealVectorValue a(_a1[_qp], _a2[_qp], _a3[_qp]);
70 
71  // Vector object for test function (only the component'th entry is non-zero)
72  RealVectorValue test;
73  test(_component) = _test[_i][_qp];
74 
75  // "Symmetric" part, -a.test
76  Real symmetric_part = -a(_component) * _test[_i][_qp];
77 
78  // The pressure part, (1/_rho[_qp]) * (grad(p).v)
79  Real pressure_part = (1. / _rho[_qp]) * (_grad_p[_qp] * test);
80 
81  // Return the result
82  return symmetric_part + pressure_part;
83 }
const VariableValue & _a3
Definition: INSProjection.h:43
const MaterialProperty< Real > & _rho
Definition: INSProjection.h:58
unsigned _component
Definition: INSProjection.h:55
const VariableGradient & _grad_p
Definition: INSProjection.h:46
const VariableValue & _a1
Definition: INSProjection.h:41
const VariableValue & _a2
Definition: INSProjection.h:42

Member Data Documentation

◆ _a1

const VariableValue& INSProjection::_a1
protected

Definition at line 41 of file INSProjection.h.

Referenced by computeQpResidual().

◆ _a1_var_number

unsigned INSProjection::_a1_var_number
protected

Definition at line 49 of file INSProjection.h.

Referenced by computeQpOffDiagJacobian().

◆ _a2

const VariableValue& INSProjection::_a2
protected

Definition at line 42 of file INSProjection.h.

Referenced by computeQpResidual().

◆ _a2_var_number

unsigned INSProjection::_a2_var_number
protected

Definition at line 50 of file INSProjection.h.

Referenced by computeQpOffDiagJacobian().

◆ _a3

const VariableValue& INSProjection::_a3
protected

Definition at line 43 of file INSProjection.h.

Referenced by computeQpResidual().

◆ _a3_var_number

unsigned INSProjection::_a3_var_number
protected

Definition at line 51 of file INSProjection.h.

Referenced by computeQpOffDiagJacobian().

◆ _component

unsigned INSProjection::_component
protected

Definition at line 55 of file INSProjection.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().

◆ _grad_p

const VariableGradient& INSProjection::_grad_p
protected

Definition at line 46 of file INSProjection.h.

Referenced by computeQpResidual().

◆ _p_var_number

unsigned INSProjection::_p_var_number
protected

Definition at line 52 of file INSProjection.h.

Referenced by computeQpOffDiagJacobian().

◆ _rho

const MaterialProperty<Real>& INSProjection::_rho
protected

Definition at line 58 of file INSProjection.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().


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