www.mooseframework.org
SinNeumannBC.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 "SinNeumannBC.h"
11 
13 
16 {
18  params.addParam<Real>("initial", 0.0, "The initial value of the gradient on the boundary");
19  params.addParam<Real>("final", 0.0, "The final value of the gradient on the boundary");
20  params.addParam<Real>("duration", 0.0, "The duration of the ramp");
21  params.addClassDescription("Imposes a time-varying flux boundary condition $\\frac{\\partial "
22  "u}{\\partial n}=g(t)$, where $g(t)$ "
23  "varies from an given initial value at time $t=0$ to a given final "
24  "value over a specified duration.");
25  return params;
26 }
27 
29  : IntegratedBC(parameters),
30  _initial(getParam<Real>("initial")),
31  _final(getParam<Real>("final")),
32  _duration(getParam<Real>("duration"))
33 {
34 }
35 
36 Real
38 {
39  Real value;
40 
41  if (_t < _duration)
43  else
44  value = _final;
45 
46  return -_test[_i][_qp] * value;
47 }
registerMooseObject("MooseApp", SinNeumannBC)
const VariableTestValue & _test
test function values (in QPs)
Definition: IntegratedBC.h:97
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template * sin(_arg) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(tan
virtual Real computeQpResidual() override
Method for computing the residual at quadrature points.
Definition: SinNeumannBC.C:37
static InputParameters validParams()
Definition: IntegratedBC.C:22
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
unsigned int _i
i-th, j-th index for enumerating test and shape functions
unsigned int _qp
quadrature point index
static InputParameters validParams()
Definition: SinNeumannBC.C:15
SinNeumannBC(const InputParameters &parameters)
Definition: SinNeumannBC.C:28
Base class for deriving any boundary condition of a integrated type.
Definition: IntegratedBC.h:18
virtual const OutputTools< Real >::VariableValue & value()
The value of the variable this object is operating on.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Implements a spatially-constant, time-varying flux boundary condition grad(u).n = g(t)...
Definition: SinNeumannBC.h:26
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump...
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an option parameter and a documentation string to the InputParameters object...
const Real pi