www.mooseframework.org
NewmarkAccelAux.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #include "NewmarkAccelAux.h"
11 
12 registerMooseObject("SolidMechanicsApp", NewmarkAccelAux);
13 
16 {
18  params.addClassDescription("Computes the current acceleration using the Newmark method.");
19  params.addRequiredCoupledVar("displacement", "displacement variable");
20  params.addRequiredCoupledVar("velocity", "velocity variable");
21  params.addRequiredParam<Real>("beta", "beta parameter for Newmark method");
22  return params;
23 }
24 
26  : AuxKernel(parameters),
27  _disp_old(coupledValueOld("displacement")),
28  _disp(coupledValue("displacement")),
29  _vel_old(coupledValueOld("velocity")),
30  _u_old(uOld()),
31  _beta(getParam<Real>("beta"))
32 {
33 }
34 
35 Real
37 {
38  if (!isNodal())
39  mooseError("must run on a nodal variable");
40 
41  Real accel_old = _u_old[_qp];
42  if (_dt == 0)
43  return accel_old;
44 
45  // Calculates acceeleration using Newmark time integration method
46  return 1.0 / _beta *
47  ((_disp[_qp] - _disp_old[_qp]) / (_dt * _dt) - _vel_old[_qp] / _dt -
48  accel_old * (0.5 - _beta));
49 }
virtual Real computeValue()
registerMooseObject("SolidMechanicsApp", NewmarkAccelAux)
const VariableValue & _u_old
void addRequiredParam(const std::string &name, const std::string &doc_string)
const VariableValue & _disp
const VariableValue & _vel_old
NewmarkAccelAux(const InputParameters &parameters)
Computes Acceleration using Newmark Time integration scheme.
const VariableValue & _disp_old
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
static InputParameters validParams()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void mooseError(Args &&... args) const
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()