https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
41{
42 auto resid = _normal(_index) * _pressure[_qp];
43 if (_eps)
44 resid *= (*_eps)[_qp];
45 return resid;
46}
DualNumber< Real, DNDerivativeType, true > ADReal
registerMooseObject("NavierStokesApp", CNSFVMomImplicitPressureBC)
Implicit boundary conditions for the boundary pressure term from the momentum equation.
const MaterialProperty< Real > *const _eps
porosity
virtual ADReal computeQpResidual() override
static InputParameters validParams()
CNSFVMomImplicitPressureBC(const InputParameters &parameters)
const ADMaterialProperty< Real > & _pressure
The pressure on the elem.
ADRealVectorValue _normal
const unsigned int _qp
static InputParameters validParams()
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)