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 29 of file InertialTorque.h.

Constructor & Destructor Documentation

◆ InertialTorque()

InertialTorque::InertialTorque ( const InputParameters &  parameters)

Definition at line 48 of file InertialTorque.C.

49  : TimeKernel(parameters),
50  _density(getMaterialProperty<Real>("density")),
51  _beta(getParam<Real>("beta")),
52  _gamma(getParam<Real>("gamma")),
53  _eta(getMaterialProperty<Real>("eta")),
54  _alpha(getParam<Real>("alpha")),
55  _component(getParam<unsigned int>("component")),
56  _ndisp(coupledComponents("displacements")),
58  _disp(_ndisp),
62  _accel(_ndisp),
63  _vel(_ndisp),
64  _daccel(_ndisp),
65  _dvel(_ndisp)
66 {
67  if (_ndisp != 3 || coupledComponents("velocities") != 3 ||
68  coupledComponents("accelerations") != 3)
69  mooseError(
70  "InertialTorque: This Kernel is only defined for 3-dimensional simulations so 3 "
71  "displacement variables, 3 velocity variables and 3 acceleration variables are needed");
72  for (unsigned i = 0; i < _ndisp; ++i)
73  {
74  _disp_num[i] = coupled("displacements", i);
75  _disp[i] = &coupledValue("displacements", i);
76  _disp_old[i] = &coupledValueOld("displacements", i);
77  _vel_old[i] = &coupledValueOld("velocities", i);
78  _accel_old[i] = &coupledValueOld("accelerations", i);
79  }
80 }
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

◆ computeQpJacobian()

Real InertialTorque::computeQpJacobian ( )
overrideprotectedvirtual

Definition at line 104 of file InertialTorque.C.

105 {
106  return InertialTorque::computeQpOffDiagJacobian(_var.number());
107 }
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override

◆ computeQpOffDiagJacobian()

Real InertialTorque::computeQpOffDiagJacobian ( unsigned int  jvar)
overrideprotectedvirtual

Definition at line 110 of file InertialTorque.C.

Referenced by computeQpJacobian().

111 {
112  for (unsigned int j = 0; j < _ndisp; ++j)
113  {
114  _accel[j] = 1.0 / _beta * ((((*_disp[j])[_qp] - (*_disp_old[j])[_qp]) / (_dt * _dt)) -
115  (*_vel_old[j])[_qp] / _dt - (*_accel_old[j])[_qp] * (0.5 - _beta));
116  _daccel[j] = 1.0 / _beta / _dt / _dt;
117  _vel[j] = (*_vel_old[j])[_qp] + (_dt * (1 - _gamma)) * (*_accel_old[j])[_qp] +
118  _gamma * _dt * _accel[j];
119  _dvel[j] = _gamma * _dt * _daccel[j];
120  _accel[j] =
121  _accel[j] + _vel[j] * _eta[_qp] * (1 + _alpha) - _alpha * _eta[_qp] * (*_vel_old[j])[_qp];
122  _daccel[j] = _daccel[j] + _dvel[j] * _eta[_qp] * (1 + _alpha);
123  }
124 
125  for (unsigned v = 0; v < _ndisp; ++v)
126  {
127  if (v == _component)
128  continue; // PermutationTensor will kill this
129  if (jvar == _disp_num[v])
130  {
131  Real the_sum = 0.0;
132  for (unsigned int k = 0; k < _ndisp; ++k)
133  the_sum += PermutationTensor::eps(_component, v, k) * _accel[k];
134  for (unsigned int j = 0; j < _ndisp; ++j)
135  the_sum += PermutationTensor::eps(_component, j, v) * (*_disp[j])[_qp] * _daccel[v];
136  return _test[_i][_qp] * _density[_qp] * the_sum * _phi[_j][_qp];
137  }
138  }
139  return 0.0;
140 }
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) ...

◆ computeQpResidual()

Real InertialTorque::computeQpResidual ( )
overrideprotectedvirtual

Definition at line 83 of file InertialTorque.C.

84 {
85  for (unsigned int j = 0; j < _ndisp; ++j)
86  {
87  // Newmark and damping
88  _accel[j] = 1.0 / _beta * ((((*_disp[j])[_qp] - (*_disp_old[j])[_qp]) / (_dt * _dt)) -
89  (*_vel_old[j])[_qp] / _dt - (*_accel_old[j])[_qp] * (0.5 - _beta));
90  _vel[j] = (*_vel_old[j])[_qp] + (_dt * (1 - _gamma)) * (*_accel_old[j])[_qp] +
91  _gamma * _dt * _accel[j];
92  _accel[j] =
93  _accel[j] + _vel[j] * _eta[_qp] * (1 + _alpha) - _alpha * _eta[_qp] * (*_vel_old[j])[_qp];
94  }
95 
96  Real the_sum = 0.0;
97  for (unsigned int j = 0; j < _ndisp; ++j)
98  for (unsigned int k = 0; k < _ndisp; ++k)
99  the_sum += PermutationTensor::eps(_component, j, k) * (*_disp[j])[_qp] * _accel[k];
100  return _test[_i][_qp] * _density[_qp] * the_sum;
101 }
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

◆ _accel

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

Acceleration (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().

◆ _accel_old

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

Old value of accelerations.

Definition at line 78 of file InertialTorque.h.

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

◆ _alpha

const Real InertialTorque::_alpha
private

HHT alpha parameter.

Definition at line 53 of file InertialTorque.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().

◆ _beta

const Real InertialTorque::_beta
private

Newmark beta parameter.

Definition at line 44 of file InertialTorque.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().

◆ _component

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 60 of file InertialTorque.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().

◆ _daccel

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

Derivative of acceleration with respect to displacement.

Definition at line 87 of file InertialTorque.h.

Referenced by computeQpOffDiagJacobian().

◆ _density

const MaterialProperty<Real>& InertialTorque::_density
private

density

Definition at line 41 of file InertialTorque.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().

◆ _disp

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

Displacements.

Definition at line 69 of file InertialTorque.h.

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

◆ _disp_num

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

MOOSE internal variable numbers corresponding to the displacments.

Definition at line 66 of file InertialTorque.h.

Referenced by computeQpOffDiagJacobian(), and InertialTorque().

◆ _disp_old

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

Old value of displacements.

Definition at line 72 of file InertialTorque.h.

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

◆ _dvel

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

Derivative of velocity with respect to displacement.

Definition at line 90 of file InertialTorque.h.

Referenced by computeQpOffDiagJacobian().

◆ _eta

const MaterialProperty<Real>& InertialTorque::_eta
private

Rayleigh-damping eta parameter.

Definition at line 50 of file InertialTorque.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().

◆ _gamma

const Real InertialTorque::_gamma
private

Newmark gamma parameter.

Definition at line 47 of file InertialTorque.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().

◆ _ndisp

const unsigned InertialTorque::_ndisp
private

Number of displacement variables. This must be 3.

Definition at line 63 of file InertialTorque.h.

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

◆ _vel

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

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

Definition at line 84 of file InertialTorque.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().

◆ _vel_old

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

Old value of velocities.

Definition at line 75 of file InertialTorque.h.

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


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