https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
16template <typename T>
19{
20 InputParameters params = T::validParams();
21
22 params.addRequiredParam<unsigned int>("equation_index", "Equation index");
23 params.addRequiredParam<UserObjectName>("volume_junction_uo", "Volume junction user object name");
24
26 "Adds advective fluxes for the junction variables for a volume junction");
27
28 return params;
29}
30
31template <>
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
40template <>
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
51template <typename T>
54{
55 return _volume_junction_uo.getResidual()[_equation_index];
56}
DualNumber< Real, DNDerivativeType, true > ADReal
registerMooseObject("ThermalHydraulicsApp", ADVolumeJunctionAdvectionKernel)
void mooseError(Args &&... args)
const std::string name
Definition Setup.h:21
void ErrorVector unsigned int
Adds advective fluxes for the junction variables for a volume junction.
ADVolumeJunctionAdvectionKernelTempl(const InputParameters &params)
Base class for computing and caching flux and residual vectors for a volume junction.
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)