https://mooseframework.inl.gov
ADOneD3EqnMomentumAreaGradient.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.addRequiredCoupledVar("A", "Cross-sectional area");
19  params.addRequiredParam<MaterialPropertyName>(
20  "direction", "The direction of the flow channel material property");
21  params.addRequiredParam<MaterialPropertyName>("p", "Pressure");
22  params.addClassDescription(
23  "Computes the area gradient term in the momentum equation for single phase flow.");
24  return params;
25 }
26 
28  : ADKernel(parameters),
29  _area_grad(coupledGradient("A")),
30  _dir(getMaterialProperty<RealVectorValue>("direction")),
31  _pressure(getADMaterialProperty<Real>("p"))
32 {
33 }
34 
35 ADReal
37 {
38  return -_pressure[_qp] * _area_grad[_qp] * _dir[_qp] * _test[_i][_qp];
39 }
const ADTemplateVariableTestValue< T > & _test
DualNumber< Real, DNDerivativeType, true > ADReal
void addRequiredParam(const std::string &name, const std::string &doc_string)
registerMooseObject("ThermalHydraulicsApp", ADOneD3EqnMomentumAreaGradient)
ADOneD3EqnMomentumAreaGradient(const InputParameters &parameters)
unsigned int _i
static InputParameters validParams()
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const MaterialProperty< RealVectorValue > & _dir
The direction of the flow channel.
const ADMaterialProperty< Real > & _pressure
Computes the area gradient term in the momentum equation.
void addClassDescription(const std::string &doc_string)
unsigned int _qp