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 "PorousFlowPointSourceFromPostprocessor.h" 11 : 12 : registerMooseObject("PorousFlowApp", PorousFlowPointSourceFromPostprocessor); 13 : 14 : InputParameters 15 1558 : PorousFlowPointSourceFromPostprocessor::validParams() 16 : { 17 1558 : InputParameters params = DiracKernel::validParams(); 18 3116 : params.addRequiredParam<PostprocessorName>( 19 : "mass_flux", 20 : "The postprocessor name holding the mass flux at this point in kg/s (positive is flux in, " 21 : "negative is flux out)"); 22 3116 : params.addRequiredParam<Point>("point", "The x,y,z coordinates of the point source (or sink)"); 23 1558 : params.addClassDescription( 24 : "Point source (or sink) that adds (or removes) fluid at a mass flux rate " 25 : "specified by a postprocessor."); 26 1558 : return params; 27 0 : } 28 : 29 836 : PorousFlowPointSourceFromPostprocessor::PorousFlowPointSourceFromPostprocessor( 30 836 : const InputParameters & parameters) 31 : : DiracKernel(parameters), 32 836 : _mass_flux(getPostprocessorValue("mass_flux")), 33 2508 : _p(getParam<Point>("point")) 34 : { 35 836 : } 36 : 37 : void 38 93131 : PorousFlowPointSourceFromPostprocessor::addPoints() 39 : { 40 93131 : addPoint(_p, 0); 41 93131 : } 42 : 43 : Real 44 65002 : PorousFlowPointSourceFromPostprocessor::computeQpResidual() 45 : { 46 : // Negative sign to make a positive mass_flux in the input file a source 47 65002 : return -_test[_i][_qp] * _mass_flux; 48 : }