www.mooseframework.org
SinDirichletBC.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 "SinDirichletBC.h"
11 
13 
16 {
18  params.set<Real>("initial") = 0.0;
19  params.set<Real>("final") = 0.0;
20  params.set<Real>("duration") = 0.0;
21  params.addClassDescription(
22  "Imposes a time-varying essential boundary condition $u=g(t)$, where $g(t)$ "
23  "varies from an given initial value at time $t=0$ to a given final value over a specified "
24  "duration.");
25  return params;
26 }
27 
29  : NodalBC(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 _u[_qp] - value;
47 }
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template * sin(_arg) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(tan
A spatially-constant, time-varying NodalBC whose imposed value g(t) varies sinusoidally with time acc...
virtual Real computeQpResidual() override
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
registerMooseObject("MooseApp", SinDirichletBC)
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
Base class for deriving any boundary condition that works at nodes.
Definition: NodalBC.h:20
const unsigned int _qp
Pseudo-"quadrature point" index (Always zero for the current node)
Definition: NodalBC.h:44
SinDirichletBC(const InputParameters &parameters)
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
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...
static InputParameters validParams()
static InputParameters validParams()
Definition: NodalBC.C:18
const VariableValue & _u
Value of the unknown variable this BC is acting on.
Definition: NodalBC.h:47
const Real pi