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 
16 {
18  params.addClassDescription("This class computes the gravity force contribution.");
19  // The strength of the acceleration in the _component direction. Make this
20  // value negative if you want force in the -_component direction.
21  params.addRequiredParam<Real>("acceleration", "The body force vector component.");
22  return params;
23 }
24 
26  : NSKernel(parameters), _acceleration(getParam<Real>("acceleration"))
27 {
28 }
29 
30 Real
32 {
33  // -rho * g * phi
34  return -_rho[_qp] * _acceleration * _test[_i][_qp];
35 }
36 
37 Real
39 {
40  return 0.0;
41 }
42 
43 Real
45 {
46  if (jvar == _rho_var_number)
47  return -_phi[_j][_qp] * _acceleration * _test[_i][_qp];
48 
49  return 0.0;
50 }
registerMooseObject("NavierStokesApp", NSGravityForce)
This class couples together all the variables for the compressible Navier-Stokes equations to allow t...
Definition: NSKernel.h:25
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
const VariableValue & _rho
Definition: NSKernel.h:38
unsigned _rho_var_number
Definition: NSKernel.h:52
void addRequiredParam(const std::string &name, const std::string &doc_string)
virtual Real computeQpJacobian()
const VariableTestValue & _test
NSGravityForce(const InputParameters &parameters)
unsigned int _i
virtual Real computeQpResidual()
unsigned int _j
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Real _acceleration
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
Definition: NSKernel.C:23
const VariablePhiValue & _phi
static InputParameters validParams()
unsigned int _qp