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 721710 : INSFVFluxBC::computeResidual(const FaceInfo & fi) 30 : { 31 721710 : if (_rc_uo.segregated()) 32 0 : FVFluxBC::computeResidual(fi); 33 721710 : } 34 : 35 : void 36 1030548 : INSFVFluxBC::computeJacobian(const FaceInfo & fi) 37 : { 38 1030548 : if (_rc_uo.segregated()) 39 518856 : FVFluxBC::computeJacobian(fi); 40 1030548 : } 41 : 42 : void 43 518856 : INSFVFluxBC::computeResidualAndJacobian(const FaceInfo & fi) 44 : { 45 518856 : if (_rc_uo.segregated()) 46 518856 : FVFluxBC::computeResidualAndJacobian(fi); 47 518856 : } 48 : 49 : ADReal 50 518856 : INSFVFluxBC::computeQpResidual() 51 : { 52 : mooseAssert(_rc_uo.segregated(), "We should not get here if we are not segregated!"); 53 518856 : return computeSegregatedContribution(); 54 : } 55 : 56 : void 57 816354 : INSFVFluxBC::addResidualAndJacobian(const ADReal & residual) 58 : { 59 816354 : const auto * const elem = (_face_type == FaceInfo::VarFaceNeighbors::ELEM) 60 816354 : ? &_face_info->elem() 61 0 : : _face_info->neighborPtr(); 62 816354 : const auto dof_index = elem->dof_number(_sys.number(), _var.number(), 0); 63 : 64 816354 : addResidualsAndJacobian(_assembly, 65 1632708 : std::array<ADReal, 1>{{residual}}, 66 816354 : std::array<dof_id_type, 1>{{dof_index}}, 67 816354 : _var.scalingFactor()); 68 816354 : }