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 "ConvectiveFluxBC.h" 11 : 12 : registerMooseObject("MooseApp", ConvectiveFluxBC); 13 : 14 : InputParameters 15 14292 : ConvectiveFluxBC::validParams() 16 : { 17 14292 : InputParameters params = IntegratedBC::validParams(); 18 14292 : params.set<Real>("rate") = 7500; 19 14292 : params.set<Real>("initial") = 500; 20 14292 : params.set<Real>("final") = 500; 21 14292 : params.set<Real>("duration") = 0.0; 22 14292 : params.addClassDescription( 23 : "Determines boundary values via the initial and final values, flux, and exposure duration"); 24 14292 : return params; 25 0 : } 26 : 27 14 : ConvectiveFluxBC::ConvectiveFluxBC(const InputParameters & parameters) 28 : : IntegratedBC(parameters), 29 14 : _initial(getParam<Real>("initial")), 30 14 : _final(getParam<Real>("final")), 31 14 : _rate(getParam<Real>("rate")), 32 28 : _duration(getParam<Real>("duration")) 33 : { 34 14 : } 35 : 36 : Real 37 178560 : ConvectiveFluxBC::computeQpResidual() 38 : { 39 : Real value; 40 : 41 178560 : if (_t < _duration) 42 160880 : value = _initial + (_final - _initial) * std::sin((0.5 / _duration) * libMesh::pi * _t); 43 : else 44 17680 : value = _final; 45 : 46 178560 : return -(_test[_i][_qp] * _rate * (value - _u[_qp])); 47 : } 48 : 49 : Real 50 58240 : ConvectiveFluxBC::computeQpJacobian() 51 : { 52 58240 : return -(_test[_i][_qp] * _rate * (-_phi[_j][_qp])); 53 : }