www.mooseframework.org
NSImposedVelocityBC.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 "NSImposedVelocityBC.h"
10 #include "NS.h"
11 
12 template <>
13 InputParameters
15 {
16  InputParameters params = validParams<NodalBC>();
17  params.addClassDescription("Impose Velocity BC.");
18  params.addRequiredCoupledVar(NS::density, "density");
19  params.addRequiredParam<Real>("desired_velocity", "");
20  return params;
21 }
22 
23 NSImposedVelocityBC::NSImposedVelocityBC(const InputParameters & parameters)
24  : NodalBC(parameters),
25  _rho(coupledValue(NS::density)),
26  _desired_velocity(getParam<Real>("desired_velocity"))
27 {
28 }
29 
30 Real
32 {
33  // Return the difference between the current momentum and the desired value
34  // (rho*u) - rho*desired_velocity
35  return _u[_qp] - (_rho[_qp] * _desired_velocity);
36 }
Definition: NS.h:13
const VariableValue & _rho
const std::string density
Definition: NS.h:15
InputParameters validParams< NSImposedVelocityBC >()
virtual Real computeQpResidual()
NSImposedVelocityBC(const InputParameters &parameters)