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 "INSFVTimeKernel.h" 11 : #include "SystemBase.h" 12 : #include "MooseVariableFE.h" 13 : #include "Assembly.h" 14 : #include "SubProblem.h" 15 : 16 : InputParameters 17 3173 : INSFVTimeKernel::validParams() 18 : { 19 3173 : auto params = FVFunctorTimeKernel::validParams(); 20 3173 : params += INSFVMomentumResidualObject::validParams(); 21 6346 : params.addParam<bool>( 22 : "contribute_to_rc", 23 6346 : true, 24 : "Whether the time derivative term should contribute to Rhie-Chow coefficients"); 25 6346 : params.addParamNamesToGroup("contribute_to_rc", "Advanced"); 26 3173 : return params; 27 0 : } 28 : 29 1896 : INSFVTimeKernel::INSFVTimeKernel(const InputParameters & params) 30 : : FVFunctorTimeKernel(params), 31 : INSFVMomentumResidualObject(*this), 32 3792 : _contribute_to_rc_coeffs(getParam<bool>("contribute_to_rc")) 33 : { 34 1896 : } 35 : 36 : void 37 10460708 : INSFVTimeKernel::addResidualAndJacobian(const ADReal & residual, const dof_id_type dof_index) 38 : { 39 10460708 : addResidualsAndJacobian(_assembly, 40 20921416 : std::array<ADReal, 1>{{residual}}, 41 10460708 : std::array<dof_id_type, 1>{{dof_index}}, 42 10460708 : _var.scalingFactor()); 43 10460708 : }