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

This class computes the "Chorin" Corrector equation in fully-discrete (both time and space) form. More...

#include <INSChorinCorrector.h>

Inheritance diagram for INSChorinCorrector:
[legend]

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

const VariableValue & _u_vel_star
 
const VariableValue & _v_vel_star
 
const VariableValue & _w_vel_star
 
const VariableGradient & _grad_p
 
unsigned _u_vel_star_var_number
 
unsigned _v_vel_star_var_number
 
unsigned _w_vel_star_var_number
 
unsigned _p_var_number
 
unsigned _component
 
const MaterialProperty< Real > & _rho
 

Detailed Description

This class computes the "Chorin" Corrector equation in fully-discrete (both time and space) form.

Definition at line 25 of file INSChorinCorrector.h.

Constructor & Destructor Documentation

◆ INSChorinCorrector()

INSChorinCorrector::INSChorinCorrector ( const InputParameters &  parameters)

Definition at line 40 of file INSChorinCorrector.C.

41  : Kernel(parameters),
42 
43  // Current velocities
44  _u_vel_star(coupledValue("u_star")),
45  _v_vel_star(_mesh.dimension() >= 2 ? coupledValue("v_star") : _zero),
46  _w_vel_star(_mesh.dimension() == 3 ? coupledValue("w_star") : _zero),
47 
48  // Pressure gradient
49  _grad_p(coupledGradient("p")),
50 
51  // Variable numberings
52  _u_vel_star_var_number(coupled("u_star")),
53  _v_vel_star_var_number(_mesh.dimension() >= 2 ? coupled("v_star") : libMesh::invalid_uint),
54  _w_vel_star_var_number(_mesh.dimension() == 3 ? coupled("w_star") : 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 & _v_vel_star
const VariableGradient & _grad_p
const VariableValue & _w_vel_star
const VariableValue & _u_vel_star
const MaterialProperty< Real > & _rho

◆ ~INSChorinCorrector()

virtual INSChorinCorrector::~INSChorinCorrector ( )
inlinevirtual

Definition at line 30 of file INSChorinCorrector.h.

30 {}

Member Function Documentation

◆ computeQpJacobian()

Real INSChorinCorrector::computeQpJacobian ( )
protectedvirtual

Definition at line 81 of file INSChorinCorrector.C.

82 {
83  // The on-diagonal Jacobian contribution is just the mass matrix entry.
84  return _phi[_j][_qp] * _test[_i][_qp];
85 }

◆ computeQpOffDiagJacobian()

Real INSChorinCorrector::computeQpOffDiagJacobian ( unsigned  jvar)
protectedvirtual

Definition at line 88 of file INSChorinCorrector.C.

89 {
90  if (((jvar == _u_vel_star_var_number) && (_component == 0)) ||
91  ((jvar == _v_vel_star_var_number) && (_component == 1)) ||
92  ((jvar == _w_vel_star_var_number) && (_component == 2)))
93  {
94  // The symmetric term's Jacobian is only non-zero when the
95  // component of 'u_star' being differentiated is the same as _component.
96  return -_phi[_j][_qp] * _test[_i][_qp];
97  }
98 
99  else if (jvar == _p_var_number)
100  return (_dt / _rho[_qp]) * _grad_phi[_j][_qp](_component) * _test[_i][_qp];
101 
102  else
103  return 0;
104 }
const MaterialProperty< Real > & _rho

◆ computeQpResidual()

Real INSChorinCorrector::computeQpResidual ( )
protectedvirtual

Definition at line 66 of file INSChorinCorrector.C.

67 {
68  // Vector object for U_star
69  RealVectorValue U_star(_u_vel_star[_qp], _v_vel_star[_qp], _w_vel_star[_qp]);
70 
71  // The symmetric part
72  Real symmetric_part = (_u[_qp] - U_star(_component)) * _test[_i][_qp];
73 
74  // The pressure part, don't forget to multiply by dt!
75  Real pressure_part = (_dt / _rho[_qp]) * _grad_p[_qp](_component) * _test[_i][_qp];
76 
77  return symmetric_part + pressure_part;
78 }
const VariableValue & _v_vel_star
const VariableGradient & _grad_p
const VariableValue & _w_vel_star
const VariableValue & _u_vel_star
const MaterialProperty< Real > & _rho

Member Data Documentation

◆ _component

unsigned INSChorinCorrector::_component
protected

Definition at line 52 of file INSChorinCorrector.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().

◆ _grad_p

const VariableGradient& INSChorinCorrector::_grad_p
protected

Definition at line 43 of file INSChorinCorrector.h.

Referenced by computeQpResidual().

◆ _p_var_number

unsigned INSChorinCorrector::_p_var_number
protected

Definition at line 49 of file INSChorinCorrector.h.

Referenced by computeQpOffDiagJacobian().

◆ _rho

const MaterialProperty<Real>& INSChorinCorrector::_rho
protected

Definition at line 55 of file INSChorinCorrector.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().

◆ _u_vel_star

const VariableValue& INSChorinCorrector::_u_vel_star
protected

Definition at line 38 of file INSChorinCorrector.h.

Referenced by computeQpResidual().

◆ _u_vel_star_var_number

unsigned INSChorinCorrector::_u_vel_star_var_number
protected

Definition at line 46 of file INSChorinCorrector.h.

Referenced by computeQpOffDiagJacobian().

◆ _v_vel_star

const VariableValue& INSChorinCorrector::_v_vel_star
protected

Definition at line 39 of file INSChorinCorrector.h.

Referenced by computeQpResidual().

◆ _v_vel_star_var_number

unsigned INSChorinCorrector::_v_vel_star_var_number
protected

Definition at line 47 of file INSChorinCorrector.h.

Referenced by computeQpOffDiagJacobian().

◆ _w_vel_star

const VariableValue& INSChorinCorrector::_w_vel_star
protected

Definition at line 40 of file INSChorinCorrector.h.

Referenced by computeQpResidual().

◆ _w_vel_star_var_number

unsigned INSChorinCorrector::_w_vel_star_var_number
protected

Definition at line 48 of file INSChorinCorrector.h.

Referenced by computeQpOffDiagJacobian().


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