https://mooseframework.inl.gov
Loading...
Searching...
No Matches
NSGravityForce.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
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
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
30Real
32{
33 // -rho * g * phi
34 return -_rho[_qp] * _acceleration * _test[_i][_qp];
35}
36
37Real
39{
40 return 0.0;
41}
42
43Real
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)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
unsigned int _qp
unsigned int _j
unsigned int _i
const VariablePhiValue & _phi
const VariableTestValue & _test
const Real _acceleration
static InputParameters validParams()
virtual Real computeQpResidual()
NSGravityForce(const InputParameters &parameters)
virtual Real computeQpJacobian()
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
This class couples together all the variables for the compressible Navier-Stokes equations to allow t...
Definition NSKernel.h:26
static InputParameters validParams()
Definition NSKernel.C:23
unsigned _rho_var_number
Definition NSKernel.h:52
const VariableValue & _rho
Definition NSKernel.h:38