https://mooseframework.inl.gov
ADOneD3EqnEnergyGravity.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", ADOneD3EqnEnergyGravity);
13 
16 {
18  params.addRequiredCoupledVar("A", "Cross-sectional area");
19  params.addRequiredParam<MaterialPropertyName>(
20  "direction", "The direction of the flow channel material property");
21  params.addRequiredParam<MaterialPropertyName>("rho", "Density property");
22  params.addRequiredParam<MaterialPropertyName>("vel", "Velocity property");
23  params.addRequiredParam<RealVectorValue>("gravity_vector", "Gravitational acceleration vector");
24  params.addClassDescription("Computes the gravity term for the energy equation in 1-phase flow");
25  return params;
26 }
27 
29  : ADKernel(parameters),
30  _A(adCoupledValue("A")),
31  _rho(getADMaterialProperty<Real>("rho")),
32  _vel(getADMaterialProperty<Real>("vel")),
33  _dir(getMaterialProperty<RealVectorValue>("direction")),
34  _gravity_vector(getParam<RealVectorValue>("gravity_vector"))
35 {
36 }
37 
38 ADReal
40 {
41  return -_rho[_qp] * _vel[_qp] * _A[_qp] * _gravity_vector * _dir[_qp] * _test[_i][_qp];
42 }
const ADMaterialProperty< Real > & _vel
const ADVariableValue & _A
const ADTemplateVariableTestValue< T > & _test
DualNumber< Real, DNDerivativeType, true > ADReal
Computes gravity term for the energy equation in 1-phase flow.
const RealVectorValue & _gravity_vector
Gravitational acceleration vector.
void addRequiredParam(const std::string &name, const std::string &doc_string)
ADOneD3EqnEnergyGravity(const InputParameters &parameters)
const ADMaterialProperty< Real > & _rho
unsigned int _i
static InputParameters validParams()
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
const MaterialProperty< RealVectorValue > & _dir
The direction of the flow channel.
static InputParameters validParams()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
registerMooseObject("ThermalHydraulicsApp", ADOneD3EqnEnergyGravity)
unsigned int _qp