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 "ADVolumeJunctionAdvectionScalarKernel.h" 11 : #include "ADVolumeJunctionBaseUserObject.h" 12 : 13 : registerMooseObject("ThermalHydraulicsApp", ADVolumeJunctionAdvectionKernel); 14 : registerMooseObject("ThermalHydraulicsApp", ADVolumeJunctionAdvectionScalarKernel); 15 : 16 : template <typename T> 17 : InputParameters 18 11860 : ADVolumeJunctionAdvectionKernelTempl<T>::validParams() 19 : { 20 11860 : InputParameters params = T::validParams(); 21 : 22 23720 : params.addRequiredParam<unsigned int>("equation_index", "Equation index"); 23 23720 : params.addRequiredParam<UserObjectName>("volume_junction_uo", "Volume junction user object name"); 24 : 25 11860 : params.addClassDescription( 26 : "Adds advective fluxes for the junction variables for a volume junction"); 27 : 28 11860 : return params; 29 0 : } 30 : 31 : template <> 32 6490 : ADVolumeJunctionAdvectionKernelTempl<ADKernel>::ADVolumeJunctionAdvectionKernelTempl( 33 6490 : const InputParameters & params) 34 : : ADKernel(params), 35 6490 : _equation_index(getParam<unsigned int>("equation_index")), 36 12980 : _volume_junction_uo(getUserObject<ADVolumeJunctionBaseUserObject>("volume_junction_uo")) 37 : { 38 6490 : } 39 : 40 : template <> 41 0 : ADVolumeJunctionAdvectionKernelTempl<ADScalarKernel>::ADVolumeJunctionAdvectionKernelTempl( 42 0 : const InputParameters & params) 43 : : ADScalarKernel(params), 44 0 : _equation_index(getParam<unsigned int>("equation_index")), 45 0 : _volume_junction_uo(getUserObject<ADVolumeJunctionBaseUserObject>("volume_junction_uo")) 46 : { 47 0 : if (_var.order() > 1) 48 0 : mooseError(name(), ": This scalar kernel can be used only with first-order scalar variables."); 49 0 : } 50 : 51 : template <typename T> 52 : ADReal 53 298205 : ADVolumeJunctionAdvectionKernelTempl<T>::computeQpResidual() 54 : { 55 298205 : return _volume_junction_uo.getResidual()[_equation_index]; 56 : }