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

The DistributedPower kernel computes the kinetic energy contribution of the body force due to total energy in an element. More...

#include <DistributedPower.h>

Inheritance diagram for DistributedPower:
[legend]

Public Member Functions

 DistributedPower (const InputParameters &parameters)
 

Protected Member Functions

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

Protected Attributes

RealVectorValue _acceleration
 
unsigned int _rhou_var_number
 
unsigned int _rhov_var_number
 
unsigned int _rhow_var_number
 
const VariableValue & _rho_u
 
const VariableValue & _rho_v
 
const VariableValue & _rho_w
 

Detailed Description

The DistributedPower kernel computes the kinetic energy contribution of the body force due to total energy in an element.

In this kernel, the acceleration of the body force is assumed to be a constant defined by up to three dimensional components as input. This kinetic energy component is the acceleration vector dotted into the momentum vector components, yielding a scalar kinetic contribution.

Definition at line 27 of file DistributedPower.h.

Constructor & Destructor Documentation

◆ DistributedPower()

DistributedPower::DistributedPower ( const InputParameters &  parameters)

Definition at line 34 of file DistributedPower.C.

35  : Kernel(parameters),
36  // acceleration vector
37  _acceleration(getParam<RealVectorValue>("acceleration")),
38 
39  // momentum components
40  _rhou_var_number(coupled("rho_u")),
41  _rhov_var_number(isCoupled("rho_v") ? coupled("rho_v") : libMesh::invalid_uint),
42  _rhow_var_number(isCoupled("rho_w") ? coupled("rho_w") : libMesh::invalid_uint),
43  _rho_u(coupledValue("rho_u")),
44  _rho_v(isCoupled("rho_v") ? coupledValue("rho_v") : _zero),
45  _rho_w(isCoupled("rho_w") ? coupledValue("rho_w") : _zero)
46 {
47 }
const VariableValue & _rho_v
RealVectorValue _acceleration
const VariableValue & _rho_u
unsigned int _rhow_var_number
const VariableValue & _rho_w
unsigned int _rhov_var_number
unsigned int _rhou_var_number

Member Function Documentation

◆ computeQpJacobian()

Real DistributedPower::computeQpJacobian ( )
protectedvirtual

Definition at line 58 of file DistributedPower.C.

59 {
60  return 0.;
61 }

◆ computeQpOffDiagJacobian()

Real DistributedPower::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

Definition at line 64 of file DistributedPower.C.

65 {
66  if (jvar == _rhou_var_number)
67  return -_phi[_j][_qp] * _acceleration(0) * _test[_i][_qp];
68  if (jvar == _rhov_var_number)
69  return -_phi[_j][_qp] * _acceleration(1) * _test[_i][_qp];
70  if (jvar == _rhow_var_number)
71  return -_phi[_j][_qp] * _acceleration(2) * _test[_i][_qp];
72 
73  return 0;
74 }
RealVectorValue _acceleration
unsigned int _rhow_var_number
unsigned int _rhov_var_number
unsigned int _rhou_var_number

◆ computeQpResidual()

Real DistributedPower::computeQpResidual ( )
protectedvirtual

Definition at line 50 of file DistributedPower.C.

51 {
52  RealVectorValue rhou_vec(_rho_u[_qp], _rho_v[_qp], _rho_w[_qp]);
53  // -rhou dot acceleration
54  return -rhou_vec * _acceleration * _test[_i][_qp];
55 }
const VariableValue & _rho_v
RealVectorValue _acceleration
const VariableValue & _rho_u
const VariableValue & _rho_w

Member Data Documentation

◆ _acceleration

RealVectorValue DistributedPower::_acceleration
protected

Definition at line 37 of file DistributedPower.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().

◆ _rho_u

const VariableValue& DistributedPower::_rho_u
protected

Definition at line 41 of file DistributedPower.h.

Referenced by computeQpResidual().

◆ _rho_v

const VariableValue& DistributedPower::_rho_v
protected

Definition at line 42 of file DistributedPower.h.

Referenced by computeQpResidual().

◆ _rho_w

const VariableValue& DistributedPower::_rho_w
protected

Definition at line 43 of file DistributedPower.h.

Referenced by computeQpResidual().

◆ _rhou_var_number

unsigned int DistributedPower::_rhou_var_number
protected

Definition at line 38 of file DistributedPower.h.

Referenced by computeQpOffDiagJacobian().

◆ _rhov_var_number

unsigned int DistributedPower::_rhov_var_number
protected

Definition at line 39 of file DistributedPower.h.

Referenced by computeQpOffDiagJacobian().

◆ _rhow_var_number

unsigned int DistributedPower::_rhow_var_number
protected

Definition at line 40 of file DistributedPower.h.

Referenced by computeQpOffDiagJacobian().


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