https://mooseframework.inl.gov
CNSFVMomImplicitPressureBC.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 
11 #include "NS.h"
12 
14 
17 {
19  MooseEnum momentum_component("x=0 y=1 z=2");
21  "momentum_component",
22  momentum_component,
23  "The component of the momentum equation that this BC applies to.");
24  params.addParam<bool>(
25  "include_porosity", false, "Whether to multiply the pressure times porosity");
26  params.addClassDescription("Adds an implicit pressure flux contribution on the boundary using "
27  "interior cell information");
28  return params;
29 }
30 
32  : FVFluxBC(parameters),
33  _eps(getParam<bool>("include_porosity") ? &getMaterialProperty<Real>(NS::porosity) : nullptr),
34  _pressure(getADMaterialProperty<Real>(NS::pressure)),
35  _index(getParam<MooseEnum>("momentum_component"))
36 {
37 }
38 
39 ADReal
41 {
42  auto resid = _normal(_index) * _pressure[_qp];
43  if (_eps)
44  resid *= (*_eps)[_qp];
45  return resid;
46 }
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
static InputParameters validParams()
virtual ADReal computeQpResidual() override
DualNumber< Real, DNDerivativeType, true > ADReal
void addRequiredParam(const std::string &name, const std::string &doc_string)
const unsigned int _qp
const MaterialProperty< Real > *const _eps
porosity
static const std::string porosity
Definition: NS.h:104
const ADMaterialProperty< Real > & _pressure
The pressure on the elem.
ADRealVectorValue _normal
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
registerMooseObject("NavierStokesApp", CNSFVMomImplicitPressureBC)
static const std::string pressure
Definition: NS.h:56
Implicit boundary conditions for the boundary pressure term from the momentum equation.
void addClassDescription(const std::string &doc_string)
CNSFVMomImplicitPressureBC(const InputParameters &parameters)
static InputParameters validParams()