Line data Source code
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 "CNSFVMomImplicitPressureBC.h" 11 : #include "NS.h" 12 : 13 : registerMooseObject("NavierStokesApp", CNSFVMomImplicitPressureBC); 14 : 15 : InputParameters 16 119 : CNSFVMomImplicitPressureBC::validParams() 17 : { 18 119 : InputParameters params = FVFluxBC::validParams(); 19 238 : MooseEnum momentum_component("x=0 y=1 z=2"); 20 238 : params.addRequiredParam<MooseEnum>( 21 : "momentum_component", 22 : momentum_component, 23 : "The component of the momentum equation that this BC applies to."); 24 238 : params.addParam<bool>( 25 238 : "include_porosity", false, "Whether to multiply the pressure times porosity"); 26 119 : params.addClassDescription("Adds an implicit pressure flux contribution on the boundary using " 27 : "interior cell information"); 28 119 : return params; 29 119 : } 30 : 31 63 : CNSFVMomImplicitPressureBC::CNSFVMomImplicitPressureBC(const InputParameters & parameters) 32 : : FVFluxBC(parameters), 33 63 : _eps(getParam<bool>("include_porosity") ? &getMaterialProperty<Real>(NS::porosity) : nullptr), 34 63 : _pressure(getADMaterialProperty<Real>(NS::pressure)), 35 189 : _index(getParam<MooseEnum>("momentum_component")) 36 : { 37 63 : } 38 : 39 : ADReal 40 84560 : CNSFVMomImplicitPressureBC::computeQpResidual() 41 : { 42 84560 : auto resid = _normal(_index) * _pressure[_qp]; 43 84560 : if (_eps) 44 0 : resid *= (*_eps)[_qp]; 45 84560 : return resid; 46 : }