https://mooseframework.inl.gov
INSPressureGradientBC.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 "NS.h"
11 #include "INSPressureGradientBC.h"
12 
13 registerMooseObject("NavierStokesApp", INSPressureGradientBC);
14 
17 {
19 
20  params.addClassDescription(
21  "Adds an implicit pressure term on a boundary. This is appropriate on "
22  "wall and inlet boundaries when the pressure term is integrated by parts");
23  params.addRequiredCoupledVar(NS::pressure, "The current value of the pressure");
24  params.addRequiredRangeCheckedParam<unsigned>(
25  "component",
26  "component>=0 & component<=2",
27  "(0,1,2) = (x,y,z) for which momentum component this BC is applied to");
28 
29  return params;
30 }
31 
33  : ADIntegratedBC(parameters),
34  _pressure(adCoupledValue(NS::pressure)),
35  _component(getParam<unsigned>("component"))
36 {
37 }
38 
39 void
41 {
43  mooseError("INSPressureGradientBC does not support RSPHERICAL coordinates.");
44 }
45 
46 ADReal
48 {
49  return _pressure[_qp] * _normals[_qp](_component) * _test[_i][_qp];
50 }
void addRequiredRangeCheckedParam(const std::string &name, const std::string &parsed_function, const std::string &doc_string)
virtual ADReal computeQpResidual() override
registerMooseObject("NavierStokesApp", INSPressureGradientBC)
static InputParameters validParams()
Moose::CoordinateSystemType getUniqueCoordSystem() const
Adds the exterior-face pressure contribution for a momentum equation whose pressure gradient is integ...
COORD_RSPHERICAL
virtual void initialSetup() override
static InputParameters validParams()
DualNumber< Real, DNDerivativeType, false > ADReal
unsigned int _qp
const unsigned _component
Momentum component to which this pressure contribution is added.
const ADVariableValue & _pressure
Pressure evaluated on the exterior face.
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
const ADTemplateVariableTestValue< T > & _test
static const std::string pressure
Definition: NS.h:57
void mooseError(Args &&... args) const
void addClassDescription(const std::string &doc_string)
INSPressureGradientBC(const InputParameters &parameters)
const MooseArray< ADPoint > & _normals