www.mooseframework.org
NSImposedVelocityBC.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 "NSImposedVelocityBC.h"
12 #include "NS.h"
13 
14 registerMooseObject("NavierStokesApp", NSImposedVelocityBC);
15 
18 {
20  params.addClassDescription("Impose Velocity BC.");
21  params.addRequiredCoupledVar(NS::density, "density");
22  params.addRequiredParam<Real>("desired_velocity", "");
23  return params;
24 }
25 
27  : NodalBC(parameters),
28  _rho(coupledValue(NS::density)),
29  _desired_velocity(getParam<Real>("desired_velocity"))
30 {
31 }
32 
33 Real
35 {
36  // Return the difference between the current momentum and the desired value
37  // (rho*u) - rho*desired_velocity
38  return _u[_qp] - (_rho[_qp] * _desired_velocity);
39 }
const VariableValue & _rho
static const std::string density
Definition: NS.h:33
const unsigned int _qp
void addRequiredParam(const std::string &name, const std::string &doc_string)
virtual Real computeQpResidual()
registerMooseObject("NavierStokesApp", NSImposedVelocityBC)
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
static InputParameters validParams()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
const VariableValue & _u
NSImposedVelocityBC(const InputParameters &parameters)