https://mooseframework.inl.gov
Loading...
Searching...
No Matches
NSImposedVelocityBC.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
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
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
33Real
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}
registerMooseObject("NavierStokesApp", NSImposedVelocityBC)
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
const VariableValue & _rho
NSImposedVelocityBC(const InputParameters &parameters)
virtual Real computeQpResidual()
const VariableValue & _u
static InputParameters validParams()
const unsigned int _qp
static const std::string density
Definition NS.h:34