https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ADMomentumViscousRZ.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
10#include "ADMomentumViscousRZ.h"
11
13
16{
18 params.addParam<MaterialPropertyName>(
19 "mu_name", "mu", "The name of the viscosity material property");
20 params.addRequiredParam<unsigned short>("component", "The momentum component this object is for");
21 return params;
22}
23
25 : ADKernel(parameters),
26 _mu(getADMaterialProperty<Real>("mu_name")),
27 _coord_sys(_assembly.coordSystem()),
28 _rz_radial_coord(_mesh.getAxisymmetricRadialCoord()),
29 _component(getParam<unsigned short>("component"))
30{
31}
32
35{
36 mooseAssert(_coord_sys == Moose::COORD_RZ, "this object is only meant for RZ coordinate systems");
37
39 {
40 const auto r = _ad_q_point[_qp](_rz_radial_coord);
41 return _mu[_qp] * _u[_qp] / (r * r) * _test[_i][_qp];
42 }
43 else
44 return 0;
45}
registerMooseObject("NavierStokesTestApp", ADMomentumViscousRZ)
DualNumber< Real, DNDerivativeType, true > ADReal
const MooseArray< ADPoint > & _ad_q_point
const ADTemplateVariableValue< T > & _u
const ADTemplateVariableTestValue< T > & _test
static InputParameters validParams()
ADMomentumViscousRZ(const InputParameters &parameters)
static InputParameters validParams()
const ADMaterialProperty< Real > & _mu
virtual ADReal computeQpResidual() override
const unsigned int _rz_radial_coord
const Moose::CoordinateSystemType & _coord_sys
const unsigned short _component
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)
unsigned int _qp
unsigned int _i