https://mooseframework.inl.gov
ADOneD3EqnEnergyHeatSource.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 
11 
12 registerMooseObject("ThermalHydraulicsApp", ADOneD3EqnEnergyHeatSource);
13 
16 {
18  params.addRequiredParam<MooseFunctorName>("q", "Volumetric heat source");
19  params.addRequiredCoupledVar("A", "Cross sectional area");
20  params.addClassDescription("Computes a volumetric heat source for 1-phase flow channel");
21  return params;
22 }
23 
25  : ADKernel(parameters), _q(getFunctor<ADReal>("q")), _A(coupledValue("A"))
26 {
27 }
28 
29 ADReal
31 {
32  const Moose::ElemQpArg qp_arg = {_current_elem, _qp, _qrule, _q_point[_qp]};
33  return -_q(qp_arg, Moose::currentState()) * _A[_qp] * _test[_i][_qp];
34 }
Volumetric heat source for 1-phase flow channel.
const VariableValue & _A
Cross sectional area.
ADOneD3EqnEnergyHeatSource(const InputParameters &parameters)
registerMooseObject("ThermalHydraulicsApp", ADOneD3EqnEnergyHeatSource)
const ADTemplateVariableTestValue< T > & _test
DualNumber< Real, DNDerivativeType, true > ADReal
void addRequiredParam(const std::string &name, const std::string &doc_string)
static InputParameters validParams()
const QBase *const & _qrule
unsigned int _i
static InputParameters validParams()
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
const Elem *const & _current_elem
const Moose::Functor< ADReal > & _q
Heat source function.
StateArg currentState()
const MooseArray< Point > & _q_point
unsigned int _qp