https://mooseframework.inl.gov
INSFVMomentumGravity.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 "INSFVMomentumGravity.h"
11 #include "NS.h"
12 
13 registerMooseObject("NavierStokesApp", INSFVMomentumGravity);
14 
17 {
20  params.addClassDescription(
21  "Computes a body force due to gravity in Rhie-Chow based simulations.");
22  params.addRequiredParam<RealVectorValue>("gravity", "Direction of the gravity vector");
23  params.addParam<MooseFunctorName>(NS::density, NS::density, "The value for the density");
24  return params;
25 }
26 
28  : FVElementalKernel(params),
30  _gravity(getParam<RealVectorValue>("gravity")),
31  _rho(getFunctor<ADReal>(NS::density))
32 {
33 }
34 
35 ADReal
37 {
39 }
INSFVMomentumGravity(const InputParameters &params)
registerMooseObject("NavierStokesApp", INSFVMomentumGravity)
ADReal computeQpResidual() override
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
Moose::StateArg determineState() const
const unsigned int _index
index x|y|z
static const std::string density
Definition: NS.h:33
static InputParameters validParams()
DualNumber< Real, DNDerivativeType, true > ADReal
void addRequiredParam(const std::string &name, const std::string &doc_string)
Moose::ElemArg makeElemArg(const Elem *elem, bool correct_skewnewss=false) const
const Moose::Functor< ADReal > & _rho
The density.
const Elem *const & _current_elem
Imposes a gravitational force on the momentum equation in Rhie-Chow (incompressible) contexts...
static InputParameters validParams()
All objects that contribute to pressure-based (e.g.
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
const RealVectorValue _gravity
The gravity vector.