www.mooseframework.org
NSGravityPower.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 #include "NSGravityPower.h"
8 
9 template <>
10 InputParameters
12 {
13  InputParameters params = validParams<Kernel>();
14  params.addClassDescription("This class computes the momentum contributed by gravity.");
15  params.addRequiredCoupledVar("momentum", "");
16  params.addRequiredParam<Real>("acceleration", "The body force vector component.");
17  return params;
18 }
19 
20 NSGravityPower::NSGravityPower(const InputParameters & parameters)
21  : Kernel(parameters),
22  _momentum_var(coupled("momentum")),
23  _momentum(coupledValue("momentum")),
24  _acceleration(getParam<Real>("acceleration"))
25 {
26 }
27 
28 Real
30 {
31  // -(rho * U * g) * phi
32  return -_momentum[_qp] * _acceleration * _test[_i][_qp];
33 }
34 
35 Real
37 {
38  return 0.0;
39 }
40 
41 Real
43 {
44  if (jvar == _momentum_var)
45  return -_phi[_j][_qp] * _acceleration * _test[_i][_qp];
46 
47  return 0.0;
48 }
virtual Real computeQpResidual()
const Real _acceleration
InputParameters validParams< NSGravityPower >()
unsigned int _momentum_var
NSGravityPower(const InputParameters &parameters)
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
virtual Real computeQpJacobian()
const VariableValue & _momentum