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 25 of file INSProjection.h.

Constructor & Destructor Documentation

INSProjection::INSProjection ( const InputParameters &  parameters)

Definition at line 36 of file INSProjection.C.

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

Definition at line 30 of file INSProjection.h.

30 {}

Member Function Documentation

Real INSProjection::computeQpJacobian ( )
protectedvirtual

Definition at line 82 of file INSProjection.C.

Referenced by ~INSProjection().

83 {
84  // There will be a diagonal component from the time derivative term...
85  return 0.;
86 }
Real INSProjection::computeQpOffDiagJacobian ( unsigned  jvar)
protectedvirtual

Definition at line 89 of file INSProjection.C.

Referenced by ~INSProjection().

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

Definition at line 62 of file INSProjection.C.

Referenced by ~INSProjection().

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

Member Data Documentation

const VariableValue& INSProjection::_a1
protected

Definition at line 38 of file INSProjection.h.

Referenced by computeQpResidual().

unsigned INSProjection::_a1_var_number
protected

Definition at line 46 of file INSProjection.h.

Referenced by computeQpOffDiagJacobian().

const VariableValue& INSProjection::_a2
protected

Definition at line 39 of file INSProjection.h.

Referenced by computeQpResidual().

unsigned INSProjection::_a2_var_number
protected

Definition at line 47 of file INSProjection.h.

Referenced by computeQpOffDiagJacobian().

const VariableValue& INSProjection::_a3
protected

Definition at line 40 of file INSProjection.h.

Referenced by computeQpResidual().

unsigned INSProjection::_a3_var_number
protected

Definition at line 48 of file INSProjection.h.

Referenced by computeQpOffDiagJacobian().

unsigned INSProjection::_component
protected

Definition at line 52 of file INSProjection.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().

const VariableGradient& INSProjection::_grad_p
protected

Definition at line 43 of file INSProjection.h.

Referenced by computeQpResidual().

unsigned INSProjection::_p_var_number
protected

Definition at line 49 of file INSProjection.h.

Referenced by computeQpOffDiagJacobian().

const MaterialProperty<Real>& INSProjection::_rho
protected

Definition at line 55 of file INSProjection.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().


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