www.mooseframework.org
NewmarkVelAux.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 #include "NewmarkVelAux.h"
8 
9 template <>
10 InputParameters
12 {
13  InputParameters params = validParams<AuxKernel>();
14  params.addRequiredCoupledVar("acceleration", "acceleration variable");
15  params.addRequiredParam<Real>("gamma", "gamma parameter");
16  return params;
17 }
18 
19 NewmarkVelAux::NewmarkVelAux(const InputParameters & parameters)
20  : AuxKernel(parameters),
21  _accel_old(coupledValueOld("acceleration")),
22  _accel(coupledValue("acceleration")),
23  _gamma(getParam<Real>("gamma"))
24 {
25 }
26 
27 Real
29 {
30  Real vel_old = _u_old[_qp];
31  if (!isNodal())
32  mooseError("must run on a nodal variable");
33  // Calculates Velocity using Newmark time integration scheme
34  return vel_old + (_dt * (1 - _gamma)) * _accel_old[_qp] + _gamma * _dt * _accel[_qp];
35 }
InputParameters validParams< NewmarkVelAux >()
Definition: NewmarkVelAux.C:11
NewmarkVelAux(const InputParameters &parameters)
Calcualtes velocity using Newmark time integration scheme.
Definition: NewmarkVelAux.C:19
const VariableValue & _accel_old
Definition: NewmarkVelAux.h:30
virtual Real computeValue()
Definition: NewmarkVelAux.C:28
const VariableValue & _accel
Definition: NewmarkVelAux.h:31