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 "ADVectorFunctionNeumannBC.h" 11 : #include "Function.h" 12 : #include "MooseTypes.h" 13 : 14 : registerMooseObject("MooseApp", ADVectorFunctionNeumannBC); 15 : 16 : InputParameters 17 14311 : ADVectorFunctionNeumannBC::validParams() 18 : { 19 14311 : InputParameters params = ADVectorIntegratedBC::validParams(); 20 14311 : params.addParam<FunctionName>("function_x", 0, "The function for the x component"); 21 14311 : params.addParam<FunctionName>("function_y", 0, "The function for the y component"); 22 14311 : params.addParam<FunctionName>("function_z", 0, "The function for the z component"); 23 14311 : params.addClassDescription( 24 : "Imposes the integrated boundary condition " 25 : "$\\frac{\\partial \\vec{u}}{\\partial n} = \\vec{h}$, " 26 : "where $\\vec{h}$ is a (possibly) time and space-dependent MOOSE Function."); 27 14311 : return params; 28 0 : } 29 : 30 24 : ADVectorFunctionNeumannBC::ADVectorFunctionNeumannBC(const InputParameters & parameters) 31 : : ADVectorIntegratedBC(parameters), 32 24 : _function_x(getFunction("function_x")), 33 24 : _function_y(getFunction("function_y")), 34 48 : _function_z(getFunction("function_z")) 35 : { 36 24 : } 37 : 38 : ADReal 39 283040 : ADVectorFunctionNeumannBC::computeQpResidual() 40 : { 41 283040 : ADRealVectorValue func_u = {_function_x.value(_t, _q_point[_qp]), 42 283040 : _function_y.value(_t, _q_point[_qp]), 43 566080 : _function_z.value(_t, _q_point[_qp])}; 44 : 45 566080 : return -_test[_i][_qp] * func_u; 46 283040 : }