www.mooseframework.org
LevelSetForcingFunctionSUPG.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 #include "Function.h"
12 
14 
17 {
19  params.addClassDescription("The SUPG stablization term for a forcing function.");
20  params.addParam<FunctionName>("function", "1", "A function that describes the body force");
21  params.addRequiredCoupledVar("velocity", "Velocity vector variable.");
22  return params;
23 }
24 
26  : ADKernelGrad(parameters),
27  _function(getFunction("function")),
28  _velocity(adCoupledVectorValue("velocity"))
29 {
30 }
31 
34 {
35  ADReal tau =
36  _current_elem->hmin() /
38  return -tau * _velocity[_qp] * _function.value(_t, _q_point[_qp]);
39 }
const Function & _function
Function value.
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
static InputParameters validParams()
static constexpr Real TOLERANCE
LevelSetForcingFunctionSUPG(const InputParameters &parameters)
SUPG stabilization term for a forcing function.
DualReal ADReal
auto norm(const T &a) -> decltype(std::abs(a))
static InputParameters validParams()
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
const ADVectorVariableValue & _velocity
Velocity vector variable.
virtual ADRealVectorValue precomputeQpResidual() override
void addClassDescription(const std::string &doc_string)
const Elem *const & _current_elem
virtual Real value(Real t, const Point &p) const
registerMooseObject("LevelSetApp", LevelSetForcingFunctionSUPG)
const MooseArray< Point > & _q_point
unsigned int _qp