https://mooseframework.inl.gov
MomentumFreeBC.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 #include "MomentumFreeBC.h"
11 #include "MooseMesh.h"
12 #include "NS.h"
13 
14 registerMooseObject("NavierStokesApp", MomentumFreeBC);
15 
18 {
20  params.addRequiredCoupledVar("vel_x", "x-component of velocity");
21  params.addCoupledVar("vel_y", "y-component of velocity");
22  params.addCoupledVar("vel_z", "z-component of velocity");
23  params.addRequiredParam<unsigned int>("component", "Component of the momentum equation");
24  params.addRequiredCoupledVar(NS::pressure, "The value of pressure");
25  params.addClassDescription(
26  "Implements free flow boundary conditions for one of the momentum equations.");
27  return params;
28 }
29 
31  : IntegratedBC(parameters),
32  _component(getParam<unsigned int>("component")),
33  _pressure(coupledValue(NS::pressure)),
34  _vel_x(coupledValue("vel_x")),
35  _vel_y(_mesh.dimension() >= 2 ? coupledValue("vel_y") : _zero),
36  _vel_z(_mesh.dimension() >= 3 ? coupledValue("vel_z") : _zero)
37 {
38 }
39 
40 Real
42 {
44  return (_u[_qp] * vel_vec * _normals[_qp] + _pressure[_qp] * _normals[_qp](_component)) *
45  _test[_i][_qp];
46 }
const VariableTestValue & _test
const MooseArray< Point > & _normals
virtual Real computeQpResidual()
static InputParameters validParams()
unsigned int _i
const VariableValue & _vel_z
const VariableValue & _vel_y
const VariableValue & _pressure
const VariableValue & _vel_x
void addRequiredParam(const std::string &name, const std::string &doc_string)
unsigned int _qp
MomentumFreeBC(const InputParameters &parameters)
void addCoupledVar(const std::string &name, const std::string &doc_string)
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const std::string pressure
Definition: NS.h:56
static InputParameters validParams()
void addClassDescription(const std::string &doc_string)
registerMooseObject("NavierStokesApp", MomentumFreeBC)
unsigned int _component
void ErrorVector unsigned int
const VariableValue & _u