www.mooseframework.org
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
StickyBC Class Reference

Sticky-type boundary condition, where if the old variable value exceeds the bounds provided u is fixed (ala Dirichlet) to the old value. More...

#include <StickyBC.h>

Inheritance diagram for StickyBC:
[legend]

Public Member Functions

 StickyBC (const InputParameters &parameters)
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Member Functions

virtual bool shouldApply () override
 
virtual Real computeQpResidual () override
 

Protected Attributes

const VariableValue & _u_old
 
const Real _min_value
 The minimum bound. More...
 
const Real _max_value
 The maximum bound. More...
 

Detailed Description

Sticky-type boundary condition, where if the old variable value exceeds the bounds provided u is fixed (ala Dirichlet) to the old value.

Definition at line 24 of file StickyBC.h.

Constructor & Destructor Documentation

◆ StickyBC()

StickyBC::StickyBC ( const InputParameters &  parameters)

Definition at line 34 of file StickyBC.C.

35  : NodalBC(parameters),
36  _u_old(_var.dofValuesOld()),
37  _min_value(getParam<Real>("min_value")),
38  _max_value(getParam<Real>("max_value"))
39 {
40  if (_min_value > _max_value)
41  mooseError("StickyBC: min_value must not be greater than max_value");
42 }

Member Function Documentation

◆ computeQpResidual()

Real StickyBC::computeQpResidual ( )
overrideprotectedvirtual

Definition at line 52 of file StickyBC.C.

53 {
54  return _u[_qp] - _u_old[_qp];
55 }

◆ shouldApply()

bool StickyBC::shouldApply ( )
overrideprotectedvirtual

Definition at line 45 of file StickyBC.C.

46 {
47  const unsigned qp = 0; // this is a NodalBC: all qp = 0
48  return (_u_old[qp] <= _min_value || _u_old[qp] >= _max_value);
49 }

◆ validParams()

InputParameters StickyBC::validParams ( )
static

Definition at line 18 of file StickyBC.C.

19 {
20  InputParameters params = NodalBC::validParams();
21  params.addParam<Real>(
22  "min_value",
23  std::numeric_limits<Real>::lowest(),
24  "If the old variable value <= min_value, the variable is fixed at its old value");
25  params.addParam<Real>(
26  "max_value",
27  std::numeric_limits<Real>::max(),
28  "If the old variable value >= max_value, the variable is fixed at its old value");
29  params.addClassDescription(
30  "Imposes the boundary condition $u = u_{old}$ if $u_{old}$ exceeds the bounds provided");
31  return params;
32 }

Member Data Documentation

◆ _max_value

const Real StickyBC::_max_value
protected

The maximum bound.

Definition at line 40 of file StickyBC.h.

Referenced by shouldApply(), and StickyBC().

◆ _min_value

const Real StickyBC::_min_value
protected

The minimum bound.

Definition at line 38 of file StickyBC.h.

Referenced by shouldApply(), and StickyBC().

◆ _u_old

const VariableValue& StickyBC::_u_old
protected

Definition at line 36 of file StickyBC.h.

Referenced by computeQpResidual(), and shouldApply().


The documentation for this class was generated from the following files:
StickyBC::_max_value
const Real _max_value
The maximum bound.
Definition: StickyBC.h:40
StickyBC::_min_value
const Real _min_value
The minimum bound.
Definition: StickyBC.h:38
StickyBC::_u_old
const VariableValue & _u_old
Definition: StickyBC.h:36
validParams
InputParameters validParams()