www.mooseframework.org
NSEnergyInviscidUnspecifiedBC.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 includes
11 #include "NS.h"
13 
15 
18 {
20  params.addRequiredCoupledVar(NS::pressure, "pressure");
21  return params;
22 }
23 
25  : NSEnergyInviscidBC(parameters), _pressure(coupledValue(NS::pressure))
26 {
27 }
28 
29 Real
31 {
32  // Velocity vector object
34 
35  // Normal component
36  Real un = vel * _normals[_qp];
37 
38  return qpResidualHelper(_pressure[_qp], un);
39 }
40 
41 Real
43 {
44  return computeJacobianHelper(/*on-diagonal variable is energy=*/4);
45 }
46 
47 Real
49 {
50  if (isNSVariable(jvar))
51  return computeJacobianHelper(mapVarNumber(jvar));
52  else
53  return 0.0;
54 }
55 
56 Real
58 {
59  // Velocity vector object
61 
62  // Normal component of velocity
63  Real un = vel * _normals[_qp];
64 
65  // When both u.n and pressure are unspecified, all 3 Jacobian terms apply.
66  // See base class for details.
67  return qpJacobianTermA(var_number, _pressure[_qp]) + qpJacobianTermB(var_number, un) +
68  qpJacobianTermC(var_number, un);
69 }
bool isNSVariable(unsigned var)
const MooseArray< Point > & _normals
static InputParameters validParams()
const VariableValue & _w_vel
Real qpJacobianTermC(unsigned var_number, Real un)
unsigned int _qp
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...
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
unsigned mapVarNumber(unsigned var)
registerMooseObject("NavierStokesApp", NSEnergyInviscidUnspecifiedBC)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const VariableValue & _v_vel
Real qpJacobianTermA(unsigned var_number, Real pressure)
static const std::string pressure
Definition: NS.h:56
Real qpJacobianTermB(unsigned var_number, Real un)
const VariableValue & _u_vel
Real computeJacobianHelper(unsigned var_number)
The inviscid energy BC term with specified pressure.