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 15599 : FVFunctionNeumannBC::validParams() 17 : { 18 15599 : InputParameters params = FVFluxBC::validParams(); 19 15599 : params.addClassDescription("Neumann boundary condition for finite volume method."); 20 46797 : params.addParam<Real>("factor", 21 31198 : 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 15599 : params.addRequiredParam<FunctionName>("function", "The value of the flux crossing the boundary."); 25 15599 : return params; 26 0 : } 27 : 28 672 : FVFunctionNeumannBC::FVFunctionNeumannBC(const InputParameters & parameters) 29 672 : : FVFluxBC(parameters), _function(getFunction("function")), _factor(getParam<Real>("factor")) 30 : { 31 672 : } 32 : 33 : ADReal 34 5254 : FVFunctionNeumannBC::computeQpResidual() 35 : { 36 10508 : return -_factor * _function.value(_t, _face_info->faceCentroid()); 37 : }