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