https://mooseframework.inl.gov
ADVolumeJunctionAdvectionScalarKernel.C
Go to the documentation of this file.
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 
12 
15 
16 template <typename T>
19 {
21 
22  params.addRequiredParam<unsigned int>("equation_index", "Equation index");
23  params.addRequiredParam<UserObjectName>("volume_junction_uo", "Volume junction user object name");
24 
25  params.addClassDescription(
26  "Adds advective fluxes for the junction variables for a volume junction");
27 
28  return params;
29 }
30 
31 template <>
33  const InputParameters & params)
34  : ADKernel(params),
35  _equation_index(getParam<unsigned int>("equation_index")),
36  _volume_junction_uo(getUserObject<ADVolumeJunctionBaseUserObject>("volume_junction_uo"))
37 {
38 }
39 
40 template <>
42  const InputParameters & params)
43  : ADScalarKernel(params),
44  _equation_index(getParam<unsigned int>("equation_index")),
45  _volume_junction_uo(getUserObject<ADVolumeJunctionBaseUserObject>("volume_junction_uo"))
46 {
47  if (_var.order() > 1)
48  mooseError(name(), ": This scalar kernel can be used only with first-order scalar variables.");
49 }
50 
51 template <typename T>
52 ADReal
54 {
55  return _volume_junction_uo.getResidual()[_equation_index];
56 }
void mooseError(Args &&... args)
DualNumber< Real, DNDerivativeType, true > ADReal
void addRequiredParam(const std::string &name, const std::string &doc_string)
InputParameters validParams()
const std::string name
Definition: Setup.h:20
Base class for computing and caching flux and residual vectors for a volume junction.
Adds advective fluxes for the junction variables for a volume junction.
void addClassDescription(const std::string &doc_string)
ADVolumeJunctionAdvectionKernelTempl(const InputParameters &params)
registerMooseObject("ThermalHydraulicsApp", ADVolumeJunctionAdvectionKernel)
void ErrorVector unsigned int