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 "RichardsExcav.h" 11 : #include "Function.h" 12 : 13 : #include <iostream> 14 : 15 : registerMooseObject("RichardsApp", RichardsExcav); 16 : 17 : InputParameters 18 1 : RichardsExcav::validParams() 19 : { 20 1 : InputParameters params = NodalBC::validParams(); 21 2 : params.addRequiredParam<Real>( 22 : "p_excav", 23 : "Value of the variable at the surface of the excavation. Eg atmospheric pressure"); 24 2 : params.addRequiredParam<FunctionName>( 25 : "excav_geom_function", 26 : "The function describing the excavation geometry (type RichardsExcavGeom)"); 27 1 : params.addClassDescription("Allows the user to set variable values at the face of an excavation. " 28 : " You must have defined the excavation start time, start position, " 29 : "etc, through the excav_geom_function"); 30 1 : return params; 31 0 : } 32 : 33 0 : RichardsExcav::RichardsExcav(const InputParameters & parameters) 34 : : NodalBC(parameters), 35 0 : _p_excav(getParam<Real>("p_excav")), 36 0 : _func(getFunction("excav_geom_function")) 37 : { 38 0 : } 39 : 40 : bool 41 0 : RichardsExcav::shouldApply() const 42 : { 43 0 : if (_func.value(_t, *_current_node) == 0.0) 44 : return false; 45 : else 46 0 : return true; 47 : } 48 : 49 : Real 50 0 : RichardsExcav::computeQpResidual() 51 : { 52 0 : return _u[_qp] - _p_excav; 53 : }