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

#include <PresetVelocity.h>

Inheritance diagram for PresetVelocity:
[legend]

Public Member Functions

 PresetVelocity (const InputParameters &parameters)
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Member Functions

virtual Real computeQpValue ()
 

Protected Attributes

const VariableValue & _u_old
 
const Real _velocity
 
const Function & _function
 

Detailed Description

Definition at line 14 of file PresetVelocity.h.

Constructor & Destructor Documentation

◆ PresetVelocity()

PresetVelocity::PresetVelocity ( const InputParameters &  parameters)

Definition at line 33 of file PresetVelocity.C.

34  : DirichletBCBase(parameters),
35  _u_old(valueOld()),
36  _velocity(parameters.get<Real>("velocity")),
37  _function(getFunction("function"))
38 {
39 }

Member Function Documentation

◆ computeQpValue()

Real PresetVelocity::computeQpValue ( )
protectedvirtual

Definition at line 42 of file PresetVelocity.C.

43 {
44  Real v2 = _function.value(_t, *_current_node);
45  Real v1 = _function.value(_t - _dt, *_current_node);
46  Real vel = _velocity * 0.5 * (v1 + v2);
47 
48  return _u_old[_qp] + _dt * vel;
49 }

◆ validParams()

InputParameters PresetVelocity::validParams ( )
static

Definition at line 18 of file PresetVelocity.C.

19 {
20  InputParameters params = DirichletBCBase::validParams();
21 
22  params.addParam<Real>(
23  "velocity", 1, "Value of the velocity. Used as scale factor if function is given.");
24  params.addParam<FunctionName>("function", "1", "Function describing the velocity.");
25 
26  // Forcefully preset the BC
27  params.set<bool>("preset") = true;
28  params.suppressParameter<bool>("preset");
29 
30  return params;
31 }

Member Data Documentation

◆ _function

const Function& PresetVelocity::_function
protected

Definition at line 26 of file PresetVelocity.h.

Referenced by computeQpValue().

◆ _u_old

const VariableValue& PresetVelocity::_u_old
protected

Definition at line 24 of file PresetVelocity.h.

Referenced by computeQpValue().

◆ _velocity

const Real PresetVelocity::_velocity
protected

Definition at line 25 of file PresetVelocity.h.

Referenced by computeQpValue().


The documentation for this class was generated from the following files:
validParams
InputParameters validParams()
PresetVelocity::_u_old
const VariableValue & _u_old
Definition: PresetVelocity.h:24
PresetVelocity::_velocity
const Real _velocity
Definition: PresetVelocity.h:25
PresetVelocity::_function
const Function & _function
Definition: PresetVelocity.h:26