www.mooseframework.org
NSGravityForce.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 "NSGravityForce.h"
8 
9 template <>
10 InputParameters
12 {
13  InputParameters params = validParams<NSKernel>();
14  params.addClassDescription("This class computes the gravity force contribution.");
15  // The strength of the acceleration in the _component direction. Make this
16  // value negative if you want force in the -_component direction.
17  params.addRequiredParam<Real>("acceleration", "The body force vector component.");
18  return params;
19 }
20 
21 NSGravityForce::NSGravityForce(const InputParameters & parameters)
22  : NSKernel(parameters), _acceleration(getParam<Real>("acceleration"))
23 {
24 }
25 
26 Real
28 {
29  // -rho * g * phi
30  return -_rho[_qp] * _acceleration * _test[_i][_qp];
31 }
32 
33 Real
35 {
36  return 0.0;
37 }
38 
39 Real
41 {
42  if (jvar == _rho_var_number)
43  return -_phi[_j][_qp] * _acceleration * _test[_i][_qp];
44 
45  return 0.0;
46 }
This class couples together all the variables for the compressible Navier-Stokes equations to allow t...
Definition: NSKernel.h:27
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
const VariableValue & _rho
Definition: NSKernel.h:38
unsigned _rho_var_number
Definition: NSKernel.h:52
InputParameters validParams< NSKernel >()
Definition: NSKernel.C:20
InputParameters validParams< NSGravityForce >()
virtual Real computeQpJacobian()
NSGravityForce(const InputParameters &parameters)
virtual Real computeQpResidual()
const Real _acceleration