https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
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");
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
40Real
42{
43 RealVectorValue vel_vec(_vel_x[_qp], _vel_y[_qp], _vel_z[_qp]);
44 return (_u[_qp] * vel_vec * _normals[_qp] + _pressure[_qp] * _normals[_qp](_component)) *
45 _test[_i][_qp];
46}
registerMooseObject("NavierStokesApp", MomentumFreeBC)
void ErrorVector unsigned int
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)
void addCoupledVar(const std::string &name, const std::string &doc_string)
unsigned int _qp
unsigned int _i
const VariableValue & _u
static InputParameters validParams()
const MooseArray< Point > & _normals
const VariableTestValue & _test
const VariableValue & _vel_y
static InputParameters validParams()
const VariableValue & _pressure
MomentumFreeBC(const InputParameters &parameters)
const VariableValue & _vel_x
virtual Real computeQpResidual()
unsigned int _component
const VariableValue & _vel_z
static const std::string pressure
Definition NS.h:57