www.mooseframework.org
NSEnergyInviscidSpecifiedNormalFlowBC.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 includes
9 #include "NS.h"
11 
12 template <>
13 InputParameters
15 {
16  InputParameters params = validParams<NSEnergyInviscidBC>();
17  params.addRequiredCoupledVar(NS::pressure, "pressure");
18  params.addRequiredParam<Real>("un", "The specified value of u.n for this boundary");
19  return params;
20 }
21 
23  const InputParameters & parameters)
24  : NSEnergyInviscidBC(parameters), _pressure(coupledValue(NS::pressure)), _un(getParam<Real>("un"))
25 {
26 }
27 
28 Real
30 {
31  return qpResidualHelper(_pressure[_qp], _un);
32 }
33 
34 Real
36 {
37  return computeJacobianHelper(/*on-diagonal variable is energy=*/4);
38 }
39 
40 Real
42 {
43  if (isNSVariable(jvar))
44  return computeJacobianHelper(mapVarNumber(jvar));
45  else
46  return 0.0;
47 }
48 
49 Real
51 {
52  // For specified u.n, term "A" is zero, see base class for details.
53  return qpJacobianTermB(var_number, _un) + qpJacobianTermC(var_number, _un);
54 }
Definition: NS.h:13
bool isNSVariable(unsigned var)
NSEnergyInviscidSpecifiedNormalFlowBC(const InputParameters &parameters)
Real qpJacobianTermC(unsigned var_number, Real un)
Real qpResidualHelper(Real pressure, Real un)
This class corresponds to the inviscid part of the "natural" boundary condition for the energy equati...
unsigned mapVarNumber(unsigned var)
InputParameters validParams< NSEnergyInviscidBC >()
const std::string pressure
Definition: NS.h:24
Real qpJacobianTermB(unsigned var_number, Real un)
InputParameters validParams< NSEnergyInviscidSpecifiedNormalFlowBC >()