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

Constructor & Destructor Documentation

◆ INSTemperature()

INSTemperature::INSTemperature ( const InputParameters &  parameters)

Definition at line 36 of file INSTemperature.C.

37  : Kernel(parameters),
38 
39  // Coupled variables
40  _u_vel(coupledValue("u")),
41  _v_vel(_mesh.dimension() >= 2 ? coupledValue("v") : _zero),
42  _w_vel(_mesh.dimension() == 3 ? coupledValue("w") : _zero),
43 
44  // Variable numberings
45  _u_vel_var_number(coupled("u")),
46  _v_vel_var_number(_mesh.dimension() >= 2 ? coupled("v") : libMesh::invalid_uint),
47  _w_vel_var_number(_mesh.dimension() == 3 ? coupled("w") : libMesh::invalid_uint),
48 
49  // Material Properties
50  _rho(getMaterialProperty<Real>("rho_name")),
51  _k(getMaterialProperty<Real>("k_name")),
52  _cp(getMaterialProperty<Real>("cp_name"))
53 {
54 }
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

◆ ~INSTemperature()

virtual INSTemperature::~INSTemperature ( )
inlinevirtual

Definition at line 30 of file INSTemperature.h.

30 {}

Member Function Documentation

◆ computeQpJacobian()

Real INSTemperature::computeQpJacobian ( )
protectedvirtual

Definition at line 73 of file INSTemperature.C.

74 {
75  RealVectorValue U(_u_vel[_qp], _v_vel[_qp], _w_vel[_qp]);
76 
77  Real convective_part = _rho[_qp] * _cp[_qp] * (U * _grad_phi[_j][_qp]) * _test[_i][_qp];
78  Real conduction_part = _k[_qp] * (_grad_phi[_j][_qp] * _grad_test[_i][_qp]);
79 
80  return convective_part + conduction_part;
81 }
const VariableValue & _v_vel
const MaterialProperty< Real > & _rho
const VariableValue & _u_vel
const VariableValue & _w_vel
const MaterialProperty< Real > & _k
const MaterialProperty< Real > & _cp

◆ computeQpOffDiagJacobian()

Real INSTemperature::computeQpOffDiagJacobian ( unsigned  jvar)
protectedvirtual

Definition at line 84 of file INSTemperature.C.

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

◆ computeQpResidual()

Real INSTemperature::computeQpResidual ( )
protectedvirtual

Definition at line 57 of file INSTemperature.C.

58 {
59  // The convection part, rho * cp u.grad(T) * v.
60  // Note: _u is the temperature variable, _grad_u is its gradient.
61  Real convective_part = _rho[_qp] * _cp[_qp] *
62  (_u_vel[_qp] * _grad_u[_qp](0) + _v_vel[_qp] * _grad_u[_qp](1) +
63  _w_vel[_qp] * _grad_u[_qp](2)) *
64  _test[_i][_qp];
65 
66  // Thermal conduction part, k * grad(T) * grad(v)
67  Real conduction_part = _k[_qp] * _grad_u[_qp] * _grad_test[_i][_qp];
68 
69  return convective_part + conduction_part;
70 }
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

◆ _cp

const MaterialProperty<Real>& INSTemperature::_cp
protected

Definition at line 50 of file INSTemperature.h.

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

◆ _k

const MaterialProperty<Real>& INSTemperature::_k
protected

Definition at line 49 of file INSTemperature.h.

Referenced by computeQpJacobian(), and computeQpResidual().

◆ _rho

const MaterialProperty<Real>& INSTemperature::_rho
protected

Definition at line 48 of file INSTemperature.h.

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

◆ _u_vel

const VariableValue& INSTemperature::_u_vel
protected

Definition at line 38 of file INSTemperature.h.

Referenced by computeQpJacobian(), and computeQpResidual().

◆ _u_vel_var_number

unsigned INSTemperature::_u_vel_var_number
protected

Definition at line 43 of file INSTemperature.h.

Referenced by computeQpOffDiagJacobian().

◆ _v_vel

const VariableValue& INSTemperature::_v_vel
protected

Definition at line 39 of file INSTemperature.h.

Referenced by computeQpJacobian(), and computeQpResidual().

◆ _v_vel_var_number

unsigned INSTemperature::_v_vel_var_number
protected

Definition at line 44 of file INSTemperature.h.

Referenced by computeQpOffDiagJacobian().

◆ _w_vel

const VariableValue& INSTemperature::_w_vel
protected

Definition at line 40 of file INSTemperature.h.

Referenced by computeQpJacobian(), and computeQpResidual().

◆ _w_vel_var_number

unsigned INSTemperature::_w_vel_var_number
protected

Definition at line 45 of file INSTemperature.h.

Referenced by computeQpOffDiagJacobian().


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