www.mooseframework.org
NSGravityForce.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #include "NSGravityForce.h"
11 
12 registerMooseObject("NavierStokesApp", NSGravityForce);
13 
14 template <>
15 InputParameters
17 {
18  InputParameters params = validParams<NSKernel>();
19  params.addClassDescription("This class computes the gravity force contribution.");
20  // The strength of the acceleration in the _component direction. Make this
21  // value negative if you want force in the -_component direction.
22  params.addRequiredParam<Real>("acceleration", "The body force vector component.");
23  return params;
24 }
25 
26 NSGravityForce::NSGravityForce(const InputParameters & parameters)
27  : NSKernel(parameters), _acceleration(getParam<Real>("acceleration"))
28 {
29 }
30 
31 Real
33 {
34  // -rho * g * phi
35  return -_rho[_qp] * _acceleration * _test[_i][_qp];
36 }
37 
38 Real
40 {
41  return 0.0;
42 }
43 
44 Real
46 {
47  if (jvar == _rho_var_number)
48  return -_phi[_j][_qp] * _acceleration * _test[_i][_qp];
49 
50  return 0.0;
51 }
validParams< NSKernel >
InputParameters validParams< NSKernel >()
Definition: NSKernel.C:22
NSGravityForce::computeQpJacobian
virtual Real computeQpJacobian()
Definition: NSGravityForce.C:39
NSKernel::_rho
const VariableValue & _rho
Definition: NSKernel.h:40
NSGravityForce::_acceleration
const Real _acceleration
Definition: NSGravityForce.h:30
NSGravityForce.h
NSGravityForce::computeQpResidual
virtual Real computeQpResidual()
Definition: NSGravityForce.C:32
validParams< NSGravityForce >
InputParameters validParams< NSGravityForce >()
Definition: NSGravityForce.C:16
NSKernel
This class couples together all the variables for the compressible Navier-Stokes equations to allow t...
Definition: NSKernel.h:29
NSKernel::_rho_var_number
unsigned _rho_var_number
Definition: NSKernel.h:54
NSGravityForce
Definition: NSGravityForce.h:20
NSGravityForce::computeQpOffDiagJacobian
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
Definition: NSGravityForce.C:45
registerMooseObject
registerMooseObject("NavierStokesApp", NSGravityForce)
NSGravityForce::NSGravityForce
NSGravityForce(const InputParameters &parameters)
Definition: NSGravityForce.C:26