www.mooseframework.org
NSEnergyInviscidSpecifiedNormalFlowBC.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  params.addRequiredParam<Real>("un", "The specified value of u.n for this boundary");
22  return params;
23 }
24 
26  const InputParameters & parameters)
27  : NSEnergyInviscidBC(parameters), _pressure(coupledValue(NS::pressure)), _un(getParam<Real>("un"))
28 {
29 }
30 
31 Real
33 {
35 }
36 
37 Real
39 {
40  return computeJacobianHelper(/*on-diagonal variable is energy=*/4);
41 }
42 
43 Real
45 {
46  if (isNSVariable(jvar))
47  return computeJacobianHelper(mapVarNumber(jvar));
48  else
49  return 0.0;
50 }
51 
52 Real
54 {
55  // For specified u.n, term "A" is zero, see base class for details.
56  return qpJacobianTermB(var_number, _un) + qpJacobianTermC(var_number, _un);
57 }
bool isNSVariable(unsigned var)
static InputParameters validParams()
The inviscid energy BC term with specified normal flow.
NSEnergyInviscidSpecifiedNormalFlowBC(const InputParameters &parameters)
Real qpJacobianTermC(unsigned var_number, Real un)
void addRequiredParam(const std::string &name, const std::string &doc_string)
unsigned int _qp
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)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const std::string pressure
Definition: NS.h:56
Real qpJacobianTermB(unsigned var_number, Real un)
registerMooseObject("NavierStokesApp", NSEnergyInviscidSpecifiedNormalFlowBC)