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 420 : MassFluxPenaltyBC::validParams() 17 : { 18 420 : InputParameters params = IPHDGBC::validParams(); 19 420 : params += MassFluxPenaltyIPHDGAssemblyHelper::validParams(); 20 420 : params.addClassDescription("introduces a jump correction on exterior faces for grad-div " 21 : "stabilization for discontinuous Galerkin methods."); 22 840 : 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 420 : return params; 26 0 : } 27 : 28 216 : MassFluxPenaltyBC::MassFluxPenaltyBC(const InputParameters & params) 29 : : IPHDGBC(params), 30 432 : _iphdg_helper(std::make_unique<MassFluxPenaltyIPHDGAssemblyHelper>( 31 216 : this, this, this, _mesh, _sys, _assembly, _tid, std::set<SubdomainID>{}, boundaryIDs())), 32 648 : _dirichlet_boundary(getParam<bool>("dirichlet_boundary")) 33 : { 34 216 : } 35 : 36 : void 37 57228 : MassFluxPenaltyBC::compute() 38 : { 39 57228 : auto & iphdg_helper = iphdgHelper(); 40 57228 : iphdg_helper.resizeResiduals(); 41 : 42 : // u, lm_u 43 57228 : iphdg_helper.scalarFace(); 44 57228 : if (!_dirichlet_boundary) 45 1428 : iphdg_helper.lmFace(); 46 57228 : } 47 : 48 : IPHDGAssemblyHelper & 49 125736 : MassFluxPenaltyBC::iphdgHelper() 50 : { 51 125736 : return *_iphdg_helper; 52 : }