https://mooseframework.inl.gov
NSPressureNeumannBC.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 // Navier-Stokes inclues
11 #include "NS.h"
12 #include "NSPressureNeumannBC.h"
13 
14 registerMooseObject("NavierStokesApp", NSPressureNeumannBC);
15 
18 {
20 
21  params.addClassDescription("This kernel is appropriate for use with a 'zero normal flow' "
22  "boundary condition in the context of the Euler equations.");
23  params.addRequiredCoupledVar(NS::pressure, "The current value of the pressure");
24  params.addRequiredParam<unsigned>(
25  "component", "(0,1,2) = (x,y,z) for which momentum component this BC is applied to");
26 
27  return params;
28 }
29 
31  : NSIntegratedBC(parameters),
32  _pressure(coupledValue(NS::pressure)),
33  _component(getParam<unsigned>("component")),
34  _pressure_derivs(*this)
35 {
36 }
37 
38 Real
40 {
41  return _pressure[_qp] * _normals[_qp](_component) * _test[_i][_qp];
42 }
43 
44 Real
46 {
48  1); // <-- the on-diagonal variable number is _component+1
49 }
50 
51 Real
53 {
54  if (isNSVariable(jvar))
55  return computeJacobianHelper(mapVarNumber(jvar));
56  else
57  return 0.0;
58 }
59 
60 Real
62 {
64 }
const VariableTestValue & _test
bool isNSVariable(unsigned var)
unsigned int _j
This class couples together all the variables for the compressible Navier-Stokes equations to allow t...
const MooseArray< Point > & _normals
Real get_grad(unsigned i)
The primary interfaces for computing pressure derivatives.
unsigned int _i
const VariablePhiValue & _phi
void addRequiredParam(const std::string &name, const std::string &doc_string)
unsigned int _qp
registerMooseObject("NavierStokesApp", NSPressureNeumannBC)
virtual Real computeQpOffDiagJacobian(unsigned jvar)
static InputParameters validParams()
This kernel is appropriate for use with a "zero normal flow" boundary condition in the context of the...
NSPressureNeumannBC(const InputParameters &parameters)
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
unsigned mapVarNumber(unsigned var)
const VariableValue & _pressure
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual Real computeQpResidual()
static const std::string pressure
Definition: NS.h:56
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
Real computeJacobianHelper(unsigned m)
NSPressureDerivs< NSPressureNeumannBC > _pressure_derivs
virtual Real computeQpJacobian()