Line data Source code
1 : //* This file is part of the MOOSE framework 2 : //* https://www.mooseframework.org 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 "MassFluxPenaltyBC.h" 11 : #include "MassFluxPenaltyIPHDGAssemblyHelper.h" 12 : 13 : registerMooseObject("NavierStokesApp", MassFluxPenaltyBC); 14 : 15 : InputParameters 16 376 : MassFluxPenaltyBC::validParams() 17 : { 18 376 : InputParameters params = IPHDGBC::validParams(); 19 376 : params += MassFluxPenaltyIPHDGAssemblyHelper::validParams(); 20 376 : params.addClassDescription("introduces a jump correction on exterior faces for grad-div " 21 : "stabilization for discontinuous Galerkin methods."); 22 752 : params.addRequiredParam<bool>("dirichlet_boundary", 23 : "Whether this is a Dirichlet boundary for the velocity. If it is, " 24 : "then we will not compute the trace residuals"); 25 376 : return params; 26 0 : } 27 : 28 196 : MassFluxPenaltyBC::MassFluxPenaltyBC(const InputParameters & params) 29 : : IPHDGBC(params), 30 392 : _iphdg_helper(std::make_unique<MassFluxPenaltyIPHDGAssemblyHelper>( 31 196 : this, this, this, _mesh, _sys, _assembly, _tid, std::set<SubdomainID>{}, boundaryIDs())), 32 588 : _dirichlet_boundary(getParam<bool>("dirichlet_boundary")) 33 : { 34 196 : } 35 : 36 : void 37 36432 : MassFluxPenaltyBC::compute() 38 : { 39 36432 : auto & iphdg_helper = iphdgHelper(); 40 36432 : iphdg_helper.resizeResiduals(); 41 : 42 : // u, lm_u 43 36432 : iphdg_helper.scalarFace(); 44 36432 : if (!_dirichlet_boundary) 45 216 : iphdg_helper.lmFace(); 46 36432 : } 47 : 48 : IPHDGAssemblyHelper & 49 84304 : MassFluxPenaltyBC::iphdgHelper() 50 : { 51 84304 : return *_iphdg_helper; 52 : }