https://mooseframework.inl.gov
Loading...
Searching...
No Matches
INSPressureGradientDGKernel.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"
12
14
17{
19
20 params.addClassDescription("Adds the pressure term on interior faces. This is appropriate when "
21 "the pressure term is integrated by parts");
22 params.addRequiredCoupledVar(NS::pressure, "The current value of the pressure");
23 params.addRequiredRangeCheckedParam<unsigned>(
24 "component",
25 "component>=0 & component<=2",
26 "(0,1,2) = (x,y,z) for which momentum component this BC is applied to");
27
28 return params;
29}
30
32 : ADDGKernel(parameters),
33 _pressure(adCoupledValue(NS::pressure)),
34 _pressure_neighbor(adCoupledNeighborValue(NS::pressure)),
35 _component(getParam<unsigned>("component"))
36{
37}
38
39void
41{
43 mooseError("INSPressureGradientDGKernel does not support RSPHERICAL coordinates.");
44}
45
48{
49 const auto avg_pressure = 0.5 * (_pressure[_qp] + _pressure_neighbor[_qp]);
50 switch (type)
51 {
52 case Moose::Element:
53 return avg_pressure * _normals[_qp](_component) * _test[_i][_qp];
54 case Moose::Neighbor:
55 return -avg_pressure * _normals[_qp](_component) * _test_neighbor[_i][_qp];
56 default:
57 libmesh_assert(false);
58 return 0;
59 }
60}
DualNumber< Real, DNDerivativeType, true > ADReal
registerMooseObject("NavierStokesApp", INSPressureGradientDGKernel)
const VariableTestValue & _test_neighbor
static InputParameters validParams()
const VariableTestValue & _test
unsigned int _i
unsigned int _qp
const MooseArray< Point > & _normals
Adds the centered interior-face pressure contribution for a discontinuous momentum equation whose pre...
const ADVariableValue & _pressure
Pressure on the current element side.
virtual ADReal computeQpResidual(Moose::DGResidualType type) override
const unsigned _component
Momentum component to which this pressure contribution is added.
INSPressureGradientDGKernel(const InputParameters &parameters)
const ADVariableValue & _pressure_neighbor
Pressure on the neighboring element side.
void addRequiredRangeCheckedParam(const std::string &name, const std::string &parsed_function, const std::string &doc_string)
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
const std::string & type() const
void mooseError(Args &&... args) const
Moose::CoordinateSystemType getUniqueCoordSystem() const
MooseMesh & _mesh
DGResidualType
COORD_RSPHERICAL
static const std::string pressure
Definition NS.h:57