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