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 "FVFunctorNeumannBC.h" 11 : #include "Function.h" 12 : 13 : registerMooseObject("MooseApp", FVFunctorNeumannBC); 14 : 15 : InputParameters 16 14411 : FVFunctorNeumannBC::validParams() 17 : { 18 14411 : InputParameters params = FVFluxBC::validParams(); 19 14411 : params.addClassDescription("Neumann boundary condition for the finite volume method."); 20 43233 : params.addParam<MooseFunctorName>("factor", 21 28822 : 1., 22 : "A factor in the form of a functor for multiplying the " 23 : "function. This could be useful for flipping " 24 : "the sign of the function for example based off the normal"); 25 14411 : params.addRequiredParam<MooseFunctorName>("functor", 26 : "The value of the flux crossing the boundary."); 27 14411 : return params; 28 0 : } 29 : 30 76 : FVFunctorNeumannBC::FVFunctorNeumannBC(const InputParameters & parameters) 31 : : FVFluxBC(parameters), 32 76 : _functor(getFunctor<ADReal>("functor")), 33 152 : _factor(getFunctor<ADReal>("factor")) 34 : { 35 76 : } 36 : 37 : ADReal 38 4553 : FVFunctorNeumannBC::computeQpResidual() 39 : { 40 9106 : return -_factor(singleSidedFaceArg(), determineState()) * 41 13659 : _functor(singleSidedFaceArg(), determineState()); 42 : }