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

This class computes the residual and Jacobian contributions for the incompressible Navier-Stokes temperature (energy) equation. More...

#include <INSTemperature.h>

Inheritance diagram for INSTemperature:
[legend]

Public Member Functions

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

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
 
unsigned _u_vel_var_number
 
unsigned _v_vel_var_number
 
unsigned _w_vel_var_number
 
const MaterialProperty< Real > & _rho
 
const MaterialProperty< Real > & _k
 
const MaterialProperty< Real > & _cp
 

Detailed Description

This class computes the residual and Jacobian contributions for the incompressible Navier-Stokes temperature (energy) equation.

Definition at line 22 of file INSTemperature.h.

Constructor & Destructor Documentation

INSTemperature::INSTemperature ( const InputParameters &  parameters)

Definition at line 32 of file INSTemperature.C.

33  : Kernel(parameters),
34 
35  // Coupled variables
36  _u_vel(coupledValue("u")),
37  _v_vel(_mesh.dimension() >= 2 ? coupledValue("v") : _zero),
38  _w_vel(_mesh.dimension() == 3 ? coupledValue("w") : _zero),
39 
40  // Variable numberings
41  _u_vel_var_number(coupled("u")),
42  _v_vel_var_number(_mesh.dimension() >= 2 ? coupled("v") : libMesh::invalid_uint),
43  _w_vel_var_number(_mesh.dimension() == 3 ? coupled("w") : libMesh::invalid_uint),
44 
45  // Material Properties
46  _rho(getMaterialProperty<Real>("rho_name")),
47  _k(getMaterialProperty<Real>("k_name")),
48  _cp(getMaterialProperty<Real>("cp_name"))
49 {
50 }
const VariableValue & _v_vel
const MaterialProperty< Real > & _rho
const VariableValue & _u_vel
unsigned _v_vel_var_number
const VariableValue & _w_vel
unsigned _u_vel_var_number
unsigned _w_vel_var_number
const MaterialProperty< Real > & _k
const MaterialProperty< Real > & _cp
virtual INSTemperature::~INSTemperature ( )
inlinevirtual

Definition at line 27 of file INSTemperature.h.

27 {}

Member Function Documentation

Real INSTemperature::computeQpJacobian ( )
protectedvirtual

Definition at line 69 of file INSTemperature.C.

Referenced by ~INSTemperature().

70 {
71  RealVectorValue U(_u_vel[_qp], _v_vel[_qp], _w_vel[_qp]);
72 
73  Real convective_part = _rho[_qp] * _cp[_qp] * (U * _grad_phi[_j][_qp]) * _test[_i][_qp];
74  Real conduction_part = _k[_qp] * (_grad_phi[_j][_qp] * _grad_test[_i][_qp]);
75 
76  return convective_part + conduction_part;
77 }
const VariableValue & _v_vel
const MaterialProperty< Real > & _rho
const VariableValue & _u_vel
const VariableValue & _w_vel
const MaterialProperty< Real > & _k
const MaterialProperty< Real > & _cp
Real INSTemperature::computeQpOffDiagJacobian ( unsigned  jvar)
protectedvirtual

Definition at line 80 of file INSTemperature.C.

Referenced by ~INSTemperature().

81 {
82  if (jvar == _u_vel_var_number)
83  {
84  Real convective_part = _rho[_qp] * _cp[_qp] * _phi[_j][_qp] * _grad_u[_qp](0) * _test[_i][_qp];
85  return convective_part;
86  }
87 
88  else if (jvar == _v_vel_var_number)
89  {
90  Real convective_part = _rho[_qp] * _cp[_qp] * _phi[_j][_qp] * _grad_u[_qp](1) * _test[_i][_qp];
91  return convective_part;
92  }
93 
94  else if (jvar == _w_vel_var_number)
95  {
96  Real convective_part = _rho[_qp] * _cp[_qp] * _phi[_j][_qp] * _grad_u[_qp](2) * _test[_i][_qp];
97  return convective_part;
98  }
99  else
100  return 0;
101 }
const MaterialProperty< Real > & _rho
unsigned _v_vel_var_number
unsigned _u_vel_var_number
unsigned _w_vel_var_number
const MaterialProperty< Real > & _cp
Real INSTemperature::computeQpResidual ( )
protectedvirtual

Definition at line 53 of file INSTemperature.C.

Referenced by ~INSTemperature().

54 {
55  // The convection part, rho * cp u.grad(T) * v.
56  // Note: _u is the temperature variable, _grad_u is its gradient.
57  Real convective_part = _rho[_qp] * _cp[_qp] *
58  (_u_vel[_qp] * _grad_u[_qp](0) + _v_vel[_qp] * _grad_u[_qp](1) +
59  _w_vel[_qp] * _grad_u[_qp](2)) *
60  _test[_i][_qp];
61 
62  // Thermal conduction part, k * grad(T) * grad(v)
63  Real conduction_part = _k[_qp] * _grad_u[_qp] * _grad_test[_i][_qp];
64 
65  return convective_part + conduction_part;
66 }
const VariableValue & _v_vel
const MaterialProperty< Real > & _rho
const VariableValue & _u_vel
const VariableValue & _w_vel
const MaterialProperty< Real > & _k
const MaterialProperty< Real > & _cp

Member Data Documentation

const MaterialProperty<Real>& INSTemperature::_cp
protected

Definition at line 47 of file INSTemperature.h.

Referenced by computeQpJacobian(), computeQpOffDiagJacobian(), and computeQpResidual().

const MaterialProperty<Real>& INSTemperature::_k
protected

Definition at line 46 of file INSTemperature.h.

Referenced by computeQpJacobian(), and computeQpResidual().

const MaterialProperty<Real>& INSTemperature::_rho
protected

Definition at line 45 of file INSTemperature.h.

Referenced by computeQpJacobian(), computeQpOffDiagJacobian(), and computeQpResidual().

const VariableValue& INSTemperature::_u_vel
protected

Definition at line 35 of file INSTemperature.h.

Referenced by computeQpJacobian(), and computeQpResidual().

unsigned INSTemperature::_u_vel_var_number
protected

Definition at line 40 of file INSTemperature.h.

Referenced by computeQpOffDiagJacobian().

const VariableValue& INSTemperature::_v_vel
protected

Definition at line 36 of file INSTemperature.h.

Referenced by computeQpJacobian(), and computeQpResidual().

unsigned INSTemperature::_v_vel_var_number
protected

Definition at line 41 of file INSTemperature.h.

Referenced by computeQpOffDiagJacobian().

const VariableValue& INSTemperature::_w_vel
protected

Definition at line 37 of file INSTemperature.h.

Referenced by computeQpJacobian(), and computeQpResidual().

unsigned INSTemperature::_w_vel_var_number
protected

Definition at line 42 of file INSTemperature.h.

Referenced by computeQpOffDiagJacobian().


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