Line data Source code
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 "ADPhaseFieldForcingFunctionSUPG.h" 11 : #include "Function.h" 12 : 13 : registerMooseObject("PhaseFieldApp", ADPhaseFieldForcingFunctionSUPG); 14 : 15 : InputParameters 16 115 : ADPhaseFieldForcingFunctionSUPG::validParams() 17 : { 18 115 : InputParameters params = ADKernelGrad::validParams(); 19 115 : params.addClassDescription("The SUPG stablization term for a forcing function."); 20 230 : params.addParam<FunctionName>("function", "1", "A function that describes the body force"); 21 230 : params.addRequiredCoupledVar("velocity", "Velocity vector variable."); 22 115 : return params; 23 0 : } 24 : 25 60 : ADPhaseFieldForcingFunctionSUPG::ADPhaseFieldForcingFunctionSUPG(const InputParameters & parameters) 26 : : ADKernelGrad(parameters), 27 60 : _function(getFunction("function")), 28 120 : _velocity(adCoupledVectorValue("velocity")) 29 : { 30 60 : } 31 : 32 : ADRealVectorValue 33 6290048 : ADPhaseFieldForcingFunctionSUPG::precomputeQpResidual() 34 : { 35 : ADReal tau = 36 12580096 : _current_elem->hmin() / 37 12580096 : (2 * (_velocity[_qp] + RealVectorValue(libMesh::TOLERANCE * libMesh::TOLERANCE)).norm()); 38 18870144 : return -tau * _velocity[_qp] * _function.value(_t, _q_point[_qp]); 39 : }