Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
DistributedForce Class Reference

The DistributedForce kernel computes the body force due to the acceleration of mass in an element. More...

#include <DistributedForce.h>

Inheritance diagram for DistributedForce:

Public Member Functions

 DistributedForce (const InputParameters &parameters)

Protected Member Functions

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

Protected Attributes

unsigned int _component
Real _acceleration
unsigned int _rho_var_number
const VariableValue & _rho

Detailed Description

The DistributedForce kernel computes the body force due to the acceleration of mass in an element.

Following F=ma, the density must be integrated over the volume to yield the mass of the volume. In this kernel, the acceleration is assumed to be a constant defined by up to three dimensional components as input. The density must be obtained from the conservation of mass equation as a coupled variable. Typical use of this kernel is the gravitational force acting upon the fluid.

Definition at line 28 of file DistributedForce.h.

Constructor & Destructor Documentation

◆ DistributedForce()

DistributedForce::DistributedForce ( const InputParameters &  parameters)

Definition at line 33 of file DistributedForce.C.

34  : Kernel(parameters),
35  _component(getParam<unsigned int>("component")),
36  _acceleration(getParam<RealVectorValue>("acceleration")(_component)),
37  _rho_var_number(coupled("rho")),
38  _rho(coupledValue("rho"))
39 {
40 }
const VariableValue & _rho
unsigned int _component
unsigned int _rho_var_number

Member Function Documentation

◆ computeQpJacobian()

Real DistributedForce::computeQpJacobian ( )

Definition at line 50 of file DistributedForce.C.

51 {
52  return 0.;
53 }

◆ computeQpOffDiagJacobian()

Real DistributedForce::computeQpOffDiagJacobian ( unsigned int  jvar)

Definition at line 56 of file DistributedForce.C.

57 {
58  if (jvar == _rho_var_number)
59  return -_phi[_j][_qp] * _acceleration * _test[_i][_qp];
61  return 0;
62 }
unsigned int _rho_var_number

◆ computeQpResidual()

Real DistributedForce::computeQpResidual ( )

Definition at line 43 of file DistributedForce.C.

44 {
45  // -rho * g * phi
46  return -_rho[_qp] * _acceleration * _test[_i][_qp];
47 }
const VariableValue & _rho

Member Data Documentation

◆ _acceleration

Real DistributedForce::_acceleration

Definition at line 39 of file DistributedForce.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().

◆ _component

unsigned int DistributedForce::_component

Definition at line 38 of file DistributedForce.h.

◆ _rho

const VariableValue& DistributedForce::_rho

Definition at line 41 of file DistributedForce.h.

Referenced by computeQpResidual().

◆ _rho_var_number

unsigned int DistributedForce::_rho_var_number

Definition at line 40 of file DistributedForce.h.

Referenced by computeQpOffDiagJacobian().

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