www.mooseframework.org
NewmarkAccelAux.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 "NewmarkAccelAux.h"
8 
9 template <>
10 InputParameters
12 {
13  InputParameters params = validParams<AuxKernel>();
14  params.addRequiredCoupledVar("displacement", "displacement variable");
15  params.addRequiredCoupledVar("velocity", "velocity variable");
16  params.addRequiredParam<Real>("beta", "beta parameter");
17  return params;
18 }
19 
20 NewmarkAccelAux::NewmarkAccelAux(const InputParameters & parameters)
21  : AuxKernel(parameters),
22  _disp_old(coupledValueOld("displacement")),
23  _disp(coupledValue("displacement")),
24  _vel_old(coupledValueOld("velocity")),
25  _beta(getParam<Real>("beta"))
26 {
27 }
28 
29 Real
31 {
32  if (!isNodal())
33  mooseError("must run on a nodal variable");
34 
35  Real accel_old = _u_old[_qp];
36  if (_dt == 0)
37  return accel_old;
38 
39  // Calculates acceeleration using Newmark time integration method
40  return 1.0 / _beta * ((_disp[_qp] - _disp_old[_qp]) / (_dt * _dt) - _vel_old[_qp] / _dt -
41  accel_old * (0.5 - _beta));
42 }
virtual Real computeValue()
InputParameters validParams< NewmarkAccelAux >()
const VariableValue & _disp
const VariableValue & _vel_old
NewmarkAccelAux(const InputParameters &parameters)
Computes Acceleration using Newmark Time integration scheme.
const VariableValue & _disp_old