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 "FVFunctionNeumannBC.h" 11 : #include "Function.h" 12 : 13 : registerMooseObject("MooseApp", FVFunctionNeumannBC); 14 : 15 : InputParameters 16 3767 : FVFunctionNeumannBC::validParams() 17 : { 18 3767 : InputParameters params = FVFluxBC::validParams(); 19 7534 : params.addClassDescription("Neumann boundary condition for finite volume method."); 20 11301 : params.addParam<Real>("factor", 21 7534 : 1., 22 : "A factor for multiplying the function. This could be useful for flipping " 23 : "the sign of the function for example based off the normal"); 24 11301 : params.addRequiredParam<FunctionName>("function", "The value of the flux crossing the boundary."); 25 3767 : return params; 26 0 : } 27 : 28 358 : FVFunctionNeumannBC::FVFunctionNeumannBC(const InputParameters & parameters) 29 1432 : : FVFluxBC(parameters), _function(getFunction("function")), _factor(getParam<Real>("factor")) 30 : { 31 358 : } 32 : 33 : ADReal 34 3069 : FVFunctionNeumannBC::computeQpResidual() 35 : { 36 3069 : return -_factor * _function.value(_t, _face_info->faceCentroid()); 37 : }