www.mooseframework.org
NSEnergyInviscidUnspecifiedBC.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  return params;
19 }
20 
22  : NSEnergyInviscidBC(parameters), _pressure(coupledValue(NS::pressure))
23 {
24 }
25 
26 Real
28 {
29  // Velocity vector object
30  RealVectorValue vel(_u_vel[_qp], _v_vel[_qp], _w_vel[_qp]);
31 
32  // Normal component
33  Real un = vel * _normals[_qp];
34 
35  return qpResidualHelper(_pressure[_qp], un);
36 }
37 
38 Real
40 {
41  return computeJacobianHelper(/*on-diagonal variable is energy=*/4);
42 }
43 
44 Real
46 {
47  if (isNSVariable(jvar))
48  return computeJacobianHelper(mapVarNumber(jvar));
49  else
50  return 0.0;
51 }
52 
53 Real
55 {
56  // Velocity vector object
57  RealVectorValue vel(_u_vel[_qp], _v_vel[_qp], _w_vel[_qp]);
58 
59  // Normal component of velocity
60  Real un = vel * _normals[_qp];
61 
62  // When both u.n and pressure are unspecified, all 3 Jacobian terms apply.
63  // See base class for details.
64  return qpJacobianTermA(var_number, _pressure[_qp]) + qpJacobianTermB(var_number, un) +
65  qpJacobianTermC(var_number, un);
66 }
Definition: NS.h:13
bool isNSVariable(unsigned var)
InputParameters validParams< NSEnergyInviscidUnspecifiedBC >()
const VariableValue & _w_vel
Real qpJacobianTermC(unsigned var_number, Real un)
virtual Real computeQpOffDiagJacobian(unsigned jvar)
NSEnergyInviscidUnspecifiedBC(const InputParameters &parameters)
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)
const VariableValue & _v_vel
InputParameters validParams< NSEnergyInviscidBC >()
Real qpJacobianTermA(unsigned var_number, Real pressure)
const std::string pressure
Definition: NS.h:24
Real qpJacobianTermB(unsigned var_number, Real un)
const VariableValue & _u_vel
Real computeJacobianHelper(unsigned var_number)