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 22 of file INSChorinCorrector.h.

Constructor & Destructor Documentation

INSChorinCorrector::INSChorinCorrector ( const InputParameters &  parameters)

Definition at line 36 of file INSChorinCorrector.C.

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

Definition at line 27 of file INSChorinCorrector.h.

27 {}

Member Function Documentation

Real INSChorinCorrector::computeQpJacobian ( )
protectedvirtual

Definition at line 77 of file INSChorinCorrector.C.

Referenced by ~INSChorinCorrector().

78 {
79  // The on-diagonal Jacobian contribution is just the mass matrix entry.
80  return _phi[_j][_qp] * _test[_i][_qp];
81 }
Real INSChorinCorrector::computeQpOffDiagJacobian ( unsigned  jvar)
protectedvirtual

Definition at line 84 of file INSChorinCorrector.C.

Referenced by ~INSChorinCorrector().

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

Definition at line 62 of file INSChorinCorrector.C.

Referenced by ~INSChorinCorrector().

63 {
64  // Vector object for U_star
65  RealVectorValue U_star(_u_vel_star[_qp], _v_vel_star[_qp], _w_vel_star[_qp]);
66 
67  // The symmetric part
68  Real symmetric_part = (_u[_qp] - U_star(_component)) * _test[_i][_qp];
69 
70  // The pressure part, don't forget to multiply by dt!
71  Real pressure_part = (_dt / _rho[_qp]) * _grad_p[_qp](_component) * _test[_i][_qp];
72 
73  return symmetric_part + pressure_part;
74 }
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

unsigned INSChorinCorrector::_component
protected

Definition at line 49 of file INSChorinCorrector.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().

const VariableGradient& INSChorinCorrector::_grad_p
protected

Definition at line 40 of file INSChorinCorrector.h.

Referenced by computeQpResidual().

unsigned INSChorinCorrector::_p_var_number
protected

Definition at line 46 of file INSChorinCorrector.h.

Referenced by computeQpOffDiagJacobian().

const MaterialProperty<Real>& INSChorinCorrector::_rho
protected

Definition at line 52 of file INSChorinCorrector.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().

const VariableValue& INSChorinCorrector::_u_vel_star
protected

Definition at line 35 of file INSChorinCorrector.h.

Referenced by computeQpResidual().

unsigned INSChorinCorrector::_u_vel_star_var_number
protected

Definition at line 43 of file INSChorinCorrector.h.

Referenced by computeQpOffDiagJacobian().

const VariableValue& INSChorinCorrector::_v_vel_star
protected

Definition at line 36 of file INSChorinCorrector.h.

Referenced by computeQpResidual().

unsigned INSChorinCorrector::_v_vel_star_var_number
protected

Definition at line 44 of file INSChorinCorrector.h.

Referenced by computeQpOffDiagJacobian().

const VariableValue& INSChorinCorrector::_w_vel_star
protected

Definition at line 37 of file INSChorinCorrector.h.

Referenced by computeQpResidual().

unsigned INSChorinCorrector::_w_vel_star_var_number
protected

Definition at line 45 of file INSChorinCorrector.h.

Referenced by computeQpOffDiagJacobian().


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