www.mooseframework.org
NSPressureNeumannBC.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 
8 // Navier-Stokes inclues
9 #include "NS.h"
10 #include "NSPressureNeumannBC.h"
11 
12 template <>
13 InputParameters
15 {
16  InputParameters params = validParams<NSIntegratedBC>();
17 
18  params.addClassDescription("This kernel is appropriate for use with a 'zero normal flow' "
19  "boundary condition in the context of the Euler equations.");
20  params.addRequiredCoupledVar(NS::pressure, "The current value of the pressure");
21  params.addRequiredParam<unsigned>(
22  "component", "(0,1,2) = (x,y,z) for which momentum component this BC is applied to");
23 
24  return params;
25 }
26 
27 NSPressureNeumannBC::NSPressureNeumannBC(const InputParameters & parameters)
28  : NSIntegratedBC(parameters),
29  _pressure(coupledValue(NS::pressure)),
30  _component(getParam<unsigned>("component")),
31  _pressure_derivs(*this)
32 {
33 }
34 
35 Real
37 {
38  return _pressure[_qp] * _normals[_qp](_component) * _test[_i][_qp];
39 }
40 
41 Real
43 {
45  1); // <-- the on-diagonal variable number is _component+1
46 }
47 
48 Real
50 {
51  if (isNSVariable(jvar))
52  return computeJacobianHelper(mapVarNumber(jvar));
53  else
54  return 0.0;
55 }
56 
57 Real
59 {
60  return _normals[_qp](_component) * _pressure_derivs.get_grad(m) * _phi[_j][_qp] * _test[_i][_qp];
61 }
Definition: NS.h:13
bool isNSVariable(unsigned var)
This class couples together all the variables for the compressible Navier-Stokes equations to allow t...
Real get_grad(unsigned i)
The primary interfaces for computing pressure derivatives.
virtual Real computeQpOffDiagJacobian(unsigned jvar)
NSPressureNeumannBC(const InputParameters &parameters)
unsigned mapVarNumber(unsigned var)
InputParameters validParams< NSIntegratedBC >()
const VariableValue & _pressure
virtual Real computeQpResidual()
const std::string pressure
Definition: NS.h:24
InputParameters validParams< NSPressureNeumannBC >()
Real computeJacobianHelper(unsigned m)
NSPressureDerivs< NSPressureNeumannBC > _pressure_derivs
virtual Real computeQpJacobian()