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 "INSFVFluxBC.h" 11 : #include "SystemBase.h" 12 : #include "Assembly.h" 13 : #include "MooseVariableBase.h" 14 : 15 : InputParameters 16 13032 : INSFVFluxBC::validParams() 17 : { 18 13032 : auto params = FVFluxBC::validParams(); 19 13032 : params += INSFVMomentumResidualObject::validParams(); 20 13032 : return params; 21 0 : } 22 : 23 7518 : INSFVFluxBC::INSFVFluxBC(const InputParameters & params) 24 7518 : : FVFluxBC(params), INSFVMomentumResidualObject(*this) 25 : { 26 7518 : } 27 : 28 : void 29 961542 : INSFVFluxBC::computeResidual(const FaceInfo & fi) 30 : { 31 961542 : if (_rc_uo.segregated()) 32 0 : FVFluxBC::computeResidual(fi); 33 961542 : } 34 : 35 : void 36 1303620 : INSFVFluxBC::computeJacobian(const FaceInfo & fi) 37 : { 38 1303620 : if (_rc_uo.segregated()) 39 622192 : FVFluxBC::computeJacobian(fi); 40 1303620 : } 41 : 42 : void 43 622192 : INSFVFluxBC::computeResidualAndJacobian(const FaceInfo & fi) 44 : { 45 622192 : if (_rc_uo.segregated()) 46 622192 : FVFluxBC::computeResidualAndJacobian(fi); 47 622192 : } 48 : 49 : ADReal 50 622192 : INSFVFluxBC::computeQpResidual() 51 : { 52 : mooseAssert(_rc_uo.segregated(), "We should not get here if we are not segregated!"); 53 622192 : return computeSegregatedContribution(); 54 : } 55 : 56 : void 57 1029860 : INSFVFluxBC::addResidualAndJacobian(const ADReal & residual) 58 : { 59 1029860 : const auto * const elem = (_face_type == FaceInfo::VarFaceNeighbors::ELEM) 60 1029860 : ? &_face_info->elem() 61 0 : : _face_info->neighborPtr(); 62 1029860 : const auto dof_index = elem->dof_number(_sys.number(), _var.number(), 0); 63 : 64 1029860 : addResidualsAndJacobian(_assembly, 65 2059720 : std::array<ADReal, 1>{{residual}}, 66 1029860 : std::array<dof_id_type, 1>{{dof_index}}, 67 1029860 : _var.scalingFactor()); 68 1029860 : }