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

This class applies a displacement time history on a given boundary in a given direction. More...

#include <PresetDisplacement.h>

Inheritance diagram for PresetDisplacement:
[legend]

Public Member Functions

 PresetDisplacement (const InputParameters &parameters)
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Member Functions

virtual Real computeQpValue ()
 

Protected Attributes

const VariableValue & _u_old
 
const Real _scale_factor
 
const Function & _function
 
const VariableValue & _vel_old
 
const VariableValue & _accel_old
 
const Real _beta
 

Detailed Description

This class applies a displacement time history on a given boundary in a given direction.

The displacement is converted to acceleration using backward euler differentiation and then integrated using newmark time integration scheme to get the displacement. This modified displacement is then applied to the boundary.

Definition at line 22 of file PresetDisplacement.h.

Constructor & Destructor Documentation

◆ PresetDisplacement()

PresetDisplacement::PresetDisplacement ( const InputParameters &  parameters)

Definition at line 37 of file PresetDisplacement.C.

38  : DirichletBCBase(parameters),
39  _u_old(valueOld()),
40  _scale_factor(parameters.get<Real>("scale_factor")),
41  _function(getFunction("function")),
42  _vel_old(coupledValueOld("velocity")),
43  _accel_old(coupledValueOld("acceleration")),
44  _beta(getParam<Real>("beta"))
45 {
46 }

Member Function Documentation

◆ computeQpValue()

Real PresetDisplacement::computeQpValue ( )
protectedvirtual

Definition at line 49 of file PresetDisplacement.C.

50 {
51  Point p;
52  Real vel = _function.timeDerivative(_t, p);
53  Real vel_old = _function.timeDerivative(_t - _dt, p);
54  Real accel = (vel - vel_old) / _dt;
55 
56  return _u_old[_qp] + _dt * _vel_old[_qp] +
57  ((0.5 - _beta) * _accel_old[_qp] + _beta * accel) * _dt * _dt;
58 }

◆ validParams()

InputParameters PresetDisplacement::validParams ( )
static

Definition at line 18 of file PresetDisplacement.C.

19 {
20  InputParameters params = DirichletBCBase::validParams();
21  params.addClassDescription(
22  "Prescribe the displacement on a given boundary in a given direction.");
23 
24  params.addParam<Real>("scale_factor", 1, "Scale factor if function is given.");
25  params.addParam<FunctionName>("function", "1", "Function describing the displacement.");
26  params.addRequiredCoupledVar("velocity", "The velocity variable.");
27  params.addRequiredCoupledVar("acceleration", "The acceleration variable.");
28  params.addRequiredParam<Real>("beta", "beta parameter for Newmark time integration.");
29 
30  // Forcefully preset the BC
31  params.set<bool>("preset") = true;
32  params.suppressParameter<bool>("preset");
33 
34  return params;
35 }

Member Data Documentation

◆ _accel_old

const VariableValue& PresetDisplacement::_accel_old
protected

Definition at line 36 of file PresetDisplacement.h.

Referenced by computeQpValue().

◆ _beta

const Real PresetDisplacement::_beta
protected

Definition at line 37 of file PresetDisplacement.h.

Referenced by computeQpValue().

◆ _function

const Function& PresetDisplacement::_function
protected

Definition at line 34 of file PresetDisplacement.h.

Referenced by computeQpValue().

◆ _scale_factor

const Real PresetDisplacement::_scale_factor
protected

Definition at line 33 of file PresetDisplacement.h.

◆ _u_old

const VariableValue& PresetDisplacement::_u_old
protected

Definition at line 32 of file PresetDisplacement.h.

Referenced by computeQpValue().

◆ _vel_old

const VariableValue& PresetDisplacement::_vel_old
protected

Definition at line 35 of file PresetDisplacement.h.

Referenced by computeQpValue().


The documentation for this class was generated from the following files:
PresetDisplacement::_beta
const Real _beta
Definition: PresetDisplacement.h:37
validParams
InputParameters validParams()
PresetDisplacement::_function
const Function & _function
Definition: PresetDisplacement.h:34
PresetDisplacement::_u_old
const VariableValue & _u_old
Definition: PresetDisplacement.h:32
PresetDisplacement::_scale_factor
const Real _scale_factor
Definition: PresetDisplacement.h:33
PresetDisplacement::_accel_old
const VariableValue & _accel_old
Definition: PresetDisplacement.h:36
PresetDisplacement::_vel_old
const VariableValue & _vel_old
Definition: PresetDisplacement.h:35