https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ADHeatStructureHeatSource.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
13
16{
18 params.addClassDescription("Adds a heat source term for the energy equation");
19 params.addRequiredParam<Real>("power_fraction", "The fraction of power used");
20 params.addRequiredCoupledVar("total_power", "Total reactor power");
21 params.addRequiredParam<Real>("num_units", "The number of units");
22 params.addRequiredParam<FunctionName>("power_shape_function",
23 "The name of the function that defines the power shape");
24 params.addRequiredParam<PostprocessorName>("power_shape_integral_pp",
25 "Power shape integral post-processor name");
26 params.addParam<Real>("scale", 1.0, "Scaling factor for residual");
27 params.declareControllable("power_fraction");
28 return params;
29}
30
32 : ADKernel(parameters),
33 _power_fraction(getParam<Real>("power_fraction")),
34 _total_power(coupledScalarValue("total_power")),
35 _power_shape_function(getFunction("power_shape_function")),
36 _power_shape_integral(getPostprocessorValue("power_shape_integral_pp")),
37 _scale(getParam<Real>("scale")),
38 _num_units(getParam<Real>("num_units"))
39{
40}
41
44{
45 const ADReal power = _power_fraction * _total_power[0];
46 const ADReal power_density =
48 return -_scale * power_density * _test[_i][_qp];
49}
registerMooseObject("ThermalHydraulicsApp", ADHeatStructureHeatSource)
DualNumber< Real, DNDerivativeType, true > ADReal
ADHeatStructureHeatSource(const InputParameters &parameters)
const PostprocessorValue & _power_shape_integral
static InputParameters validParams()
const ADTemplateVariableTestValue< T > & _test
static InputParameters validParams()
virtual Real value(Real t, const Point &p) const
void declareControllable(const std::string &name, std::set< ExecFlagType > execute_flags={})
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
unsigned int _qp
const MooseArray< Point > & _q_point
unsigned int _i