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

Computes the inertial torque, which is density * displacement x acceleration (a cross-product is used). More...

#include <InertialTorque.h>

Inheritance diagram for InertialTorque:
[legend]

Public Member Functions

 InertialTorque (const InputParameters &parameters)
 

Protected Member Functions

virtual Real computeQpResidual () override
 
virtual Real computeQpJacobian () override
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar) override
 

Private Attributes

const MaterialProperty< Real > & _density
 density More...
 
const Real _beta
 Newmark beta parameter. More...
 
const Real _gamma
 Newmark gamma parameter. More...
 
const MaterialProperty< Real > & _eta
 Rayleigh-damping eta parameter. More...
 
const Real _alpha
 HHT alpha parameter. More...
 
const unsigned _component
 Component of the cross-product desired. More...
 
const unsigned _ndisp
 Number of displacement variables. This must be 3. More...
 
std::vector< unsigned > _disp_num
 MOOSE internal variable numbers corresponding to the displacments. More...
 
std::vector< const VariableValue * > _disp
 Displacements. More...
 
std::vector< const VariableValue * > _disp_old
 Old value of displacements. More...
 
std::vector< const VariableValue * > _vel_old
 Old value of velocities. More...
 
std::vector< const VariableValue * > _accel_old
 Old value of accelerations. More...
 
std::vector< Real > _accel
 Acceleration (instantiating this vector avoids re-creating a new vector every residual calculation) More...
 
std::vector< Real > _vel
 Velocity (instantiating this vector avoids re-creating a new vector every residual calculation) More...
 
std::vector< Real > _daccel
 Derivative of acceleration with respect to displacement. More...
 
std::vector< Real > _dvel
 Derivative of velocity with respect to displacement. More...
 

Detailed Description

Computes the inertial torque, which is density * displacement x acceleration (a cross-product is used).

Newmark time integration is used, and parameters are included that allow Rayleigh damping and HHT time integration

Definition at line 26 of file InertialTorque.h.

Constructor & Destructor Documentation

InertialTorque::InertialTorque ( const InputParameters &  parameters)

Definition at line 43 of file InertialTorque.C.

44  : TimeKernel(parameters),
45  _density(getMaterialProperty<Real>("density")),
46  _beta(getParam<Real>("beta")),
47  _gamma(getParam<Real>("gamma")),
48  _eta(getMaterialProperty<Real>("eta")),
49  _alpha(getParam<Real>("alpha")),
50  _component(getParam<unsigned int>("component")),
51  _ndisp(coupledComponents("displacements")),
53  _disp(_ndisp),
57  _accel(_ndisp),
58  _vel(_ndisp),
59  _daccel(_ndisp),
60  _dvel(_ndisp)
61 {
62  if (_ndisp != 3 || coupledComponents("velocities") != 3 ||
63  coupledComponents("accelerations") != 3)
64  mooseError(
65  "InertialTorque: This Kernel is only defined for 3-dimensional simulations so 3 "
66  "displacement variables, 3 velocity variables and 3 acceleration variables are needed");
67  for (unsigned i = 0; i < _ndisp; ++i)
68  {
69  _disp_num[i] = coupled("displacements", i);
70  _disp[i] = &coupledValue("displacements", i);
71  _disp_old[i] = &coupledValueOld("displacements", i);
72  _vel_old[i] = &coupledValueOld("velocities", i);
73  _accel_old[i] = &coupledValueOld("accelerations", i);
74  }
75 }
std::vector< Real > _dvel
Derivative of velocity with respect to displacement.
const MaterialProperty< Real > & _eta
Rayleigh-damping eta parameter.
std::vector< const VariableValue * > _disp_old
Old value of displacements.
const unsigned _ndisp
Number of displacement variables. This must be 3.
const Real _beta
Newmark beta parameter.
std::vector< Real > _accel
Acceleration (instantiating this vector avoids re-creating a new vector every residual calculation) ...
const Real _alpha
HHT alpha parameter.
std::vector< const VariableValue * > _accel_old
Old value of accelerations.
const unsigned _component
Component of the cross-product desired.
std::vector< Real > _daccel
Derivative of acceleration with respect to displacement.
const Real _gamma
Newmark gamma parameter.
const MaterialProperty< Real > & _density
density
std::vector< const VariableValue * > _disp
Displacements.
std::vector< unsigned > _disp_num
MOOSE internal variable numbers corresponding to the displacments.
std::vector< const VariableValue * > _vel_old
Old value of velocities.
std::vector< Real > _vel
Velocity (instantiating this vector avoids re-creating a new vector every residual calculation) ...

Member Function Documentation

Real InertialTorque::computeQpJacobian ( )
overrideprotectedvirtual

Definition at line 99 of file InertialTorque.C.

100 {
101  return InertialTorque::computeQpOffDiagJacobian(_var.number());
102 }
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
Real InertialTorque::computeQpOffDiagJacobian ( unsigned int  jvar)
overrideprotectedvirtual

Definition at line 105 of file InertialTorque.C.

Referenced by computeQpJacobian().

106 {
107  for (unsigned int j = 0; j < _ndisp; ++j)
108  {
109  _accel[j] = 1.0 / _beta * ((((*_disp[j])[_qp] - (*_disp_old[j])[_qp]) / (_dt * _dt)) -
110  (*_vel_old[j])[_qp] / _dt - (*_accel_old[j])[_qp] * (0.5 - _beta));
111  _daccel[j] = 1.0 / _beta / _dt / _dt;
112  _vel[j] = (*_vel_old[j])[_qp] + (_dt * (1 - _gamma)) * (*_accel_old[j])[_qp] +
113  _gamma * _dt * _accel[j];
114  _dvel[j] = _gamma * _dt * _daccel[j];
115  _accel[j] =
116  _accel[j] + _vel[j] * _eta[_qp] * (1 + _alpha) - _alpha * _eta[_qp] * (*_vel_old[j])[_qp];
117  _daccel[j] = _daccel[j] + _dvel[j] * _eta[_qp] * (1 + _alpha);
118  }
119 
120  for (unsigned v = 0; v < _ndisp; ++v)
121  {
122  if (v == _component)
123  continue; // PermutationTensor will kill this
124  if (jvar == _disp_num[v])
125  {
126  Real the_sum = 0.0;
127  for (unsigned int k = 0; k < _ndisp; ++k)
128  the_sum += PermutationTensor::eps(_component, v, k) * _accel[k];
129  for (unsigned int j = 0; j < _ndisp; ++j)
130  the_sum += PermutationTensor::eps(_component, j, v) * (*_disp[j])[_qp] * _daccel[v];
131  return _test[_i][_qp] * _density[_qp] * the_sum * _phi[_j][_qp];
132  }
133  }
134  return 0.0;
135 }
std::vector< Real > _dvel
Derivative of velocity with respect to displacement.
const MaterialProperty< Real > & _eta
Rayleigh-damping eta parameter.
std::vector< const VariableValue * > _disp_old
Old value of displacements.
const unsigned _ndisp
Number of displacement variables. This must be 3.
const Real _beta
Newmark beta parameter.
std::vector< Real > _accel
Acceleration (instantiating this vector avoids re-creating a new vector every residual calculation) ...
const Real _alpha
HHT alpha parameter.
std::vector< const VariableValue * > _accel_old
Old value of accelerations.
const unsigned _component
Component of the cross-product desired.
std::vector< Real > _daccel
Derivative of acceleration with respect to displacement.
const Real _gamma
Newmark gamma parameter.
const MaterialProperty< Real > & _density
density
std::vector< const VariableValue * > _disp
Displacements.
std::vector< unsigned > _disp_num
MOOSE internal variable numbers corresponding to the displacments.
std::vector< const VariableValue * > _vel_old
Old value of velocities.
std::vector< Real > _vel
Velocity (instantiating this vector avoids re-creating a new vector every residual calculation) ...
Real InertialTorque::computeQpResidual ( )
overrideprotectedvirtual

Definition at line 78 of file InertialTorque.C.

79 {
80  for (unsigned int j = 0; j < _ndisp; ++j)
81  {
82  // Newmark and damping
83  _accel[j] = 1.0 / _beta * ((((*_disp[j])[_qp] - (*_disp_old[j])[_qp]) / (_dt * _dt)) -
84  (*_vel_old[j])[_qp] / _dt - (*_accel_old[j])[_qp] * (0.5 - _beta));
85  _vel[j] = (*_vel_old[j])[_qp] + (_dt * (1 - _gamma)) * (*_accel_old[j])[_qp] +
86  _gamma * _dt * _accel[j];
87  _accel[j] =
88  _accel[j] + _vel[j] * _eta[_qp] * (1 + _alpha) - _alpha * _eta[_qp] * (*_vel_old[j])[_qp];
89  }
90 
91  Real the_sum = 0.0;
92  for (unsigned int j = 0; j < _ndisp; ++j)
93  for (unsigned int k = 0; k < _ndisp; ++k)
94  the_sum += PermutationTensor::eps(_component, j, k) * (*_disp[j])[_qp] * _accel[k];
95  return _test[_i][_qp] * _density[_qp] * the_sum;
96 }
const MaterialProperty< Real > & _eta
Rayleigh-damping eta parameter.
std::vector< const VariableValue * > _disp_old
Old value of displacements.
const unsigned _ndisp
Number of displacement variables. This must be 3.
const Real _beta
Newmark beta parameter.
std::vector< Real > _accel
Acceleration (instantiating this vector avoids re-creating a new vector every residual calculation) ...
const Real _alpha
HHT alpha parameter.
std::vector< const VariableValue * > _accel_old
Old value of accelerations.
const unsigned _component
Component of the cross-product desired.
const Real _gamma
Newmark gamma parameter.
const MaterialProperty< Real > & _density
density
std::vector< const VariableValue * > _disp
Displacements.
std::vector< const VariableValue * > _vel_old
Old value of velocities.
std::vector< Real > _vel
Velocity (instantiating this vector avoids re-creating a new vector every residual calculation) ...

Member Data Documentation

std::vector<Real> InertialTorque::_accel
private

Acceleration (instantiating this vector avoids re-creating a new vector every residual calculation)

Definition at line 78 of file InertialTorque.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().

std::vector<const VariableValue *> InertialTorque::_accel_old
private

Old value of accelerations.

Definition at line 75 of file InertialTorque.h.

Referenced by computeQpOffDiagJacobian(), computeQpResidual(), and InertialTorque().

const Real InertialTorque::_alpha
private

HHT alpha parameter.

Definition at line 50 of file InertialTorque.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().

const Real InertialTorque::_beta
private

Newmark beta parameter.

Definition at line 41 of file InertialTorque.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().

const unsigned InertialTorque::_component
private

Component of the cross-product desired.

This kernel will calculate the _component component of density * displacement x acceleration

Definition at line 57 of file InertialTorque.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().

std::vector<Real> InertialTorque::_daccel
private

Derivative of acceleration with respect to displacement.

Definition at line 84 of file InertialTorque.h.

Referenced by computeQpOffDiagJacobian().

const MaterialProperty<Real>& InertialTorque::_density
private

density

Definition at line 38 of file InertialTorque.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().

std::vector<const VariableValue *> InertialTorque::_disp
private

Displacements.

Definition at line 66 of file InertialTorque.h.

Referenced by computeQpOffDiagJacobian(), computeQpResidual(), and InertialTorque().

std::vector<unsigned> InertialTorque::_disp_num
private

MOOSE internal variable numbers corresponding to the displacments.

Definition at line 63 of file InertialTorque.h.

Referenced by computeQpOffDiagJacobian(), and InertialTorque().

std::vector<const VariableValue *> InertialTorque::_disp_old
private

Old value of displacements.

Definition at line 69 of file InertialTorque.h.

Referenced by computeQpOffDiagJacobian(), computeQpResidual(), and InertialTorque().

std::vector<Real> InertialTorque::_dvel
private

Derivative of velocity with respect to displacement.

Definition at line 87 of file InertialTorque.h.

Referenced by computeQpOffDiagJacobian().

const MaterialProperty<Real>& InertialTorque::_eta
private

Rayleigh-damping eta parameter.

Definition at line 47 of file InertialTorque.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().

const Real InertialTorque::_gamma
private

Newmark gamma parameter.

Definition at line 44 of file InertialTorque.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().

const unsigned InertialTorque::_ndisp
private

Number of displacement variables. This must be 3.

Definition at line 60 of file InertialTorque.h.

Referenced by computeQpOffDiagJacobian(), computeQpResidual(), and InertialTorque().

std::vector<Real> InertialTorque::_vel
private

Velocity (instantiating this vector avoids re-creating a new vector every residual calculation)

Definition at line 81 of file InertialTorque.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().

std::vector<const VariableValue *> InertialTorque::_vel_old
private

Old value of velocities.

Definition at line 72 of file InertialTorque.h.

Referenced by computeQpOffDiagJacobian(), computeQpResidual(), and InertialTorque().


The documentation for this class was generated from the following files: