https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ADKernelSUPG.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 "ADKernelSUPG.h"
11#include "MathUtils.h"
12#include "Assembly.h"
13
14// libmesh includes
15#include "libmesh/threads.h"
16
17template <typename T>
20{
22 params.addParam<MaterialPropertyName>(
23 "tau_name", "tau", "The name of the stabilization parameter tau.");
24 params.addCoupledVar("velocity", "The velocity variable.");
25 params.addParam<MaterialPropertyName>("material_velocity",
26 "A material property describing the velocity");
27 return params;
28}
29
30template <typename T>
32 : ADKernelStabilizedTempl<T>(parameters),
33 _tau(this->template getADMaterialProperty<Real>("tau_name")),
34 _velocity(
35 this->isParamValid("velocity")
36 ? this->adCoupledVectorValue("velocity")
37 : this->template getADMaterialProperty<RealVectorValue>("material_velocity").get())
38{
39}
40
41template <typename T>
44{
45 return _velocity[_qp] * _tau[_qp];
46}
47
48template class ADKernelSUPGTempl<Real>;
static InputParameters validParams()
ADKernelSUPGTempl(const InputParameters &parameters)
ADRealVectorValue computeQpStabilization() override
static InputParameters validParams()
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object.
void addCoupledVar(const std::string &name, const std::string &doc_string)
This method adds a coupled variable name pair.