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