https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ADPhaseFieldForcingFunctionSUPG.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#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() /
37 (2 * (_velocity[_qp] + RealVectorValue(libMesh::TOLERANCE * libMesh::TOLERANCE)).norm());
38 return -tau * _velocity[_qp] * _function.value(_t, _q_point[_qp]);
39}
registerMooseObject("PhaseFieldApp", ADPhaseFieldForcingFunctionSUPG)
DualNumber< Real, DNDerivativeType, true > ADReal
static InputParameters validParams()
SUPG stabilization term for a forcing function.
const Function & _function
Function value.
virtual ADRealVectorValue precomputeQpResidual() override
ADPhaseFieldForcingFunctionSUPG(const InputParameters &parameters)
const ADVectorVariableValue & _velocity
Velocity vector variable.
virtual Real value(Real t, const Point &p) const
void addRequiredCoupledVar(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)
void addClassDescription(const std::string &doc_string)
unsigned int _qp
const MooseArray< Point > & _q_point
const Elem *const & _current_elem
static constexpr Real TOLERANCE