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

DynamicStressDivergenceTensors derives from StressDivergenceTensors and adds stress related Rayleigh and HHT time integration terms. More...

#include <DynamicStressDivergenceTensors.h>

Inheritance diagram for DynamicStressDivergenceTensors:
[legend]

Public Member Functions

 DynamicStressDivergenceTensors (const InputParameters &parameters)
 
virtual void computeJacobian () override
 
virtual void computeOffDiagJacobian (MooseVariableFEBase &jvar) override
 

Protected Member Functions

virtual Real computeQpResidual ()
 
virtual Real computeQpJacobian ()
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar)
 
virtual void initialSetup () override
 
virtual void computeResidual () override
 
virtual void computeFiniteDeformJacobian ()
 
virtual void computeAverageGradientTest ()
 
virtual void computeAverageGradientPhi ()
 

Protected Attributes

const MaterialProperty< RankTwoTensor > & _stress_older
 
const MaterialProperty< RankTwoTensor > & _stress_old
 
const MaterialProperty< Real > & _zeta
 
const Real _alpha
 
const bool _static_initialization
 
std::string _base_name
 
bool _use_finite_deform_jacobian
 
const MaterialProperty< RankTwoTensor > & _stress
 
const MaterialProperty< RankFourTensor > & _Jacobian_mult
 
std::vector< RankFourTensor > _finite_deform_Jacobian_mult
 
const MaterialProperty< RankTwoTensor > * _deformation_gradient
 
const MaterialProperty< RankTwoTensor > * _deformation_gradient_old
 
const MaterialProperty< RankTwoTensor > * _rotation_increment
 
const unsigned int _component
 
unsigned int _ndisp
 Coupled displacement variables. More...
 
std::vector< unsigned int > _disp_var
 
const bool _temp_coupled
 
const unsigned int _temp_var
 
const MaterialProperty< RankTwoTensor > *const _deigenstrain_dT
 d(strain)/d(temperature), if computed by ComputeThermalExpansionEigenstrain More...
 
const bool _out_of_plane_strain_coupled
 
const unsigned int _out_of_plane_strain_var
 
const unsigned int _out_of_plane_direction
 
std::vector< std::vector< Real > > _avg_grad_test
 Gradient of test function averaged over the element. Used in volumetric locking correction calculation. More...
 
std::vector< std::vector< Real > > _avg_grad_phi
 Gradient of phi function averaged over the element. Used in volumetric locking correction calculation. More...
 
bool _volumetric_locking_correction
 Flag for volumetric locking correction. More...
 
Assembly & _assembly_undisplaced
 undisplaced problem More...
 
MooseVariable & _var_undisplaced
 Reference to this Kernel's undisplaced MooseVariable object. More...
 
const VariablePhiGradient & _grad_phi_undisplaced
 Shape and test functions on the undisplaced mesh. More...
 
const VariableTestGradient & _grad_test_undisplaced
 

Detailed Description

DynamicStressDivergenceTensors derives from StressDivergenceTensors and adds stress related Rayleigh and HHT time integration terms.

Definition at line 24 of file DynamicStressDivergenceTensors.h.

Constructor & Destructor Documentation

◆ DynamicStressDivergenceTensors()

DynamicStressDivergenceTensors::DynamicStressDivergenceTensors ( const InputParameters &  parameters)

Definition at line 37 of file DynamicStressDivergenceTensors.C.

38  : StressDivergenceTensors(parameters),
39  _stress_older(getMaterialPropertyOlderByName<RankTwoTensor>(_base_name + "stress")),
40  _stress_old(getMaterialPropertyOldByName<RankTwoTensor>(_base_name + "stress")),
41  _zeta(getMaterialProperty<Real>("zeta")),
42  _alpha(getParam<Real>("alpha")),
43  _static_initialization(getParam<bool>("static_initialization"))
44 {
45 }
const MaterialProperty< Real > & _zeta
const MaterialProperty< RankTwoTensor > & _stress_old
StressDivergenceTensors(const InputParameters &parameters)
const MaterialProperty< RankTwoTensor > & _stress_older

Member Function Documentation

◆ computeAverageGradientPhi()

void StressDivergenceTensors::computeAverageGradientPhi ( )
protectedvirtualinherited

Reimplemented in StressDivergenceRZTensors.

Definition at line 402 of file StressDivergenceTensors.C.

Referenced by StressDivergenceTensors::computeJacobian(), and StressDivergenceTensors::computeOffDiagJacobian().

403 {
404  // Calculate volume average derivatives for phi
405  _avg_grad_phi.resize(_phi.size());
406  for (_i = 0; _i < _phi.size(); ++_i)
407  {
408  _avg_grad_phi[_i].resize(3);
409  for (unsigned int component = 0; component < _mesh.dimension(); ++component)
410  {
411  _avg_grad_phi[_i][component] = 0.0;
412  for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
413  _avg_grad_phi[_i][component] += _grad_phi[_i][_qp](component) * _JxW[_qp] * _coord[_qp];
414 
415  _avg_grad_phi[_i][component] /= _current_elem_volume;
416  }
417  }
418 }
std::vector< std::vector< Real > > _avg_grad_phi
Gradient of phi function averaged over the element. Used in volumetric locking correction calculation...
Real component(const SymmTensor &symm_tensor, unsigned int index)

◆ computeAverageGradientTest()

void StressDivergenceTensors::computeAverageGradientTest ( )
protectedvirtualinherited

Reimplemented in StressDivergenceRZTensors.

Definition at line 386 of file StressDivergenceTensors.C.

Referenced by StressDivergenceTensors::computeJacobian(), StressDivergenceTensors::computeOffDiagJacobian(), and StressDivergenceTensors::computeResidual().

387 {
388  // Calculate volume averaged value of shape function derivative
389  _avg_grad_test.resize(_test.size());
390  for (_i = 0; _i < _test.size(); ++_i)
391  {
392  _avg_grad_test[_i].resize(3);
393  _avg_grad_test[_i][_component] = 0.0;
394  for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
395  _avg_grad_test[_i][_component] += _grad_test[_i][_qp](_component) * _JxW[_qp] * _coord[_qp];
396 
397  _avg_grad_test[_i][_component] /= _current_elem_volume;
398  }
399 }
std::vector< std::vector< Real > > _avg_grad_test
Gradient of test function averaged over the element. Used in volumetric locking correction calculatio...

◆ computeFiniteDeformJacobian()

void StressDivergenceTensors::computeFiniteDeformJacobian ( )
protectedvirtualinherited

Definition at line 329 of file StressDivergenceTensors.C.

Referenced by StressDivergenceTensors::computeJacobian(), and StressDivergenceTensors::computeOffDiagJacobian().

330 {
331  const RankTwoTensor I(RankTwoTensor::initIdentity);
332  const RankFourTensor II_ijkl = I.mixedProductIkJl(I);
333 
334  // Bring back to unrotated config
335  const RankTwoTensor unrotated_stress =
336  (*_rotation_increment)[_qp].transpose() * _stress[_qp] * (*_rotation_increment)[_qp];
337 
338  // Incremental deformation gradient Fhat
339  const RankTwoTensor Fhat =
340  (*_deformation_gradient)[_qp] * (*_deformation_gradient_old)[_qp].inverse();
341  const RankTwoTensor Fhatinv = Fhat.inverse();
342 
343  const RankTwoTensor rot_times_stress = (*_rotation_increment)[_qp] * unrotated_stress;
344  const RankFourTensor dstress_drot =
345  I.mixedProductIkJl(rot_times_stress) + I.mixedProductJkIl(rot_times_stress);
346  const RankFourTensor rot_rank_four =
347  (*_rotation_increment)[_qp].mixedProductIkJl((*_rotation_increment)[_qp]);
348  const RankFourTensor drot_dUhatinv = Fhat.mixedProductIkJl(I);
349 
350  const RankTwoTensor A = I - Fhatinv;
351 
352  // Ctilde = Chat^-1 - I
353  const RankTwoTensor Ctilde = A * A.transpose() - A - A.transpose();
354  const RankFourTensor dCtilde_dFhatinv =
355  -I.mixedProductIkJl(A) - I.mixedProductJkIl(A) + II_ijkl + I.mixedProductJkIl(I);
356 
357  // Second order approximation of Uhat - consistent with strain increment definition
358  // const RankTwoTensor Uhat = I - 0.5 * Ctilde - 3.0/8.0 * Ctilde * Ctilde;
359 
360  RankFourTensor dUhatinv_dCtilde =
361  0.5 * II_ijkl - 1.0 / 8.0 * (I.mixedProductIkJl(Ctilde) + Ctilde.mixedProductIkJl(I));
362  RankFourTensor drot_dFhatinv = drot_dUhatinv * dUhatinv_dCtilde * dCtilde_dFhatinv;
363 
364  drot_dFhatinv -= Fhat.mixedProductIkJl((*_rotation_increment)[_qp].transpose());
365  _finite_deform_Jacobian_mult[_qp] = dstress_drot * drot_dFhatinv;
366 
367  const RankFourTensor dstrain_increment_dCtilde =
368  -0.5 * II_ijkl + 0.25 * (I.mixedProductIkJl(Ctilde) + Ctilde.mixedProductIkJl(I));
370  rot_rank_four * _Jacobian_mult[_qp] * dstrain_increment_dCtilde * dCtilde_dFhatinv;
371  _finite_deform_Jacobian_mult[_qp] += Fhat.mixedProductJkIl(_stress[_qp]);
372 
373  const RankFourTensor dFhat_dFhatinv = -Fhat.mixedProductIkJl(Fhat.transpose());
374  const RankTwoTensor dJ_dFhatinv = dFhat_dFhatinv.innerProductTranspose(Fhat.ddet());
375 
376  // Component from Jacobian derivative
377  _finite_deform_Jacobian_mult[_qp] += _stress[_qp].outerProduct(dJ_dFhatinv);
378 
379  // Derivative of Fhatinv w.r.t. undisplaced coordinates
380  const RankTwoTensor Finv = (*_deformation_gradient)[_qp].inverse();
381  const RankFourTensor dFhatinv_dGradu = -Fhatinv.mixedProductIkJl(Finv.transpose());
382  _finite_deform_Jacobian_mult[_qp] = _finite_deform_Jacobian_mult[_qp] * dFhatinv_dGradu;
383 }
const MaterialProperty< RankTwoTensor > * _rotation_increment
std::vector< RankFourTensor > _finite_deform_Jacobian_mult
const MaterialProperty< RankFourTensor > & _Jacobian_mult
const MaterialProperty< RankTwoTensor > & _stress

◆ computeJacobian()

void StressDivergenceTensors::computeJacobian ( )
overridevirtualinherited

Reimplemented from ALEKernel.

Definition at line 154 of file StressDivergenceTensors.C.

155 {
157  {
160  }
161 
163  {
164  _finite_deform_Jacobian_mult.resize(_qrule->n_points());
165 
166  for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
168 
170  }
171  else
172  Kernel::computeJacobian();
173 }
bool _volumetric_locking_correction
Flag for volumetric locking correction.
std::vector< RankFourTensor > _finite_deform_Jacobian_mult
virtual void computeFiniteDeformJacobian()
virtual void computeJacobian() override
Definition: ALEKernel.C:35

◆ computeOffDiagJacobian()

void StressDivergenceTensors::computeOffDiagJacobian ( MooseVariableFEBase &  jvar)
overridevirtualinherited

Reimplemented from ALEKernel.

Definition at line 176 of file StressDivergenceTensors.C.

177 {
179  {
182  }
183 
185  {
186  _finite_deform_Jacobian_mult.resize(_qrule->n_points());
187 
188  for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
190 
192  }
193  else
194  Kernel::computeOffDiagJacobian(jvar);
195 }
bool _volumetric_locking_correction
Flag for volumetric locking correction.
virtual void computeOffDiagJacobian(MooseVariableFEBase &jvar) override
Definition: ALEKernel.C:42
std::vector< RankFourTensor > _finite_deform_Jacobian_mult
virtual void computeFiniteDeformJacobian()

◆ computeQpJacobian()

Real DynamicStressDivergenceTensors::computeQpJacobian ( )
protectedvirtual

Reimplemented from StressDivergenceTensors.

Definition at line 95 of file DynamicStressDivergenceTensors.C.

96 {
97  if (_static_initialization && _t == _dt)
99  else if (_dt > 0)
101  (1.0 + _alpha + (1.0 + _alpha) * _zeta[_qp] / _dt);
102  else
103  return 0.0;
104 }
const MaterialProperty< Real > & _zeta
virtual Real computeQpJacobian() override

◆ computeQpOffDiagJacobian()

Real DynamicStressDivergenceTensors::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

Reimplemented from StressDivergenceTensors.

Definition at line 107 of file DynamicStressDivergenceTensors.C.

108 {
109  bool active = true;
110 
111  for (unsigned int i = 0; i < _ndisp; ++i)
112  if (jvar == _disp_var[i])
113  active = true;
114 
115  if (active)
116  {
117  if (_static_initialization && _t == _dt)
119  else if (_dt > 0)
121  (1.0 + _alpha + (1.0 + _alpha) * _zeta[_qp] / _dt);
122  else
123  return 0.0;
124  }
125  if (_temp_coupled && jvar == _temp_var)
126  return 0.0;
127 
128  return 0;
129 }
unsigned int _ndisp
Coupled displacement variables.
const MaterialProperty< Real > & _zeta
std::vector< unsigned int > _disp_var
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override

◆ computeQpResidual()

Real DynamicStressDivergenceTensors::computeQpResidual ( )
protectedvirtual


This kernel needs to be used only if either Rayleigh damping or numerical damping through HHT time integration scheme needs to be added to the problem thorugh the stiffness dependent damping parameter _zeta or HHT parameter _alpha, respectively.

The residual of _zeta*K*[(1+_alpha)vel-_alpha vel_old]+ alpha K [ u - uold] + K u is required = _zeta*[(1+_alpha)d/dt (Div sigma)-alpha d/dt(Div sigma_old)] +alpha [Div sigma - Div sigma_old]+ Div sigma = _zeta*[(1+alpha)(Div sigma - Div sigma_old)/dt - alpha (Div sigma_old - Div sigma_older)/dt]

  • alpha [Div sigma - Div sigma_old] +Div sigma = [(1+_alpha)*_zeta/dt +_alpha+1]* Div sigma - [(1+2_alpha)*_zeta/dt + _alpha] Div sigma_old + _alpha*_zeta/dt Div sigma_older

Reimplemented from StressDivergenceTensors.

Definition at line 48 of file DynamicStressDivergenceTensors.C.

49 {
64  Real residual = 0.0;
65  if (_static_initialization && _t == _dt)
66  {
67  // If static inialization is true, then in the first step residual is only Ku which is
68  // stress.grad(test).
69  residual += _stress[_qp].row(_component) * _grad_test[_i][_qp];
70 
72  residual += _stress[_qp].trace() / 3.0 *
73  (_avg_grad_test[_i][_component] - _grad_test[_i][_qp](_component));
74  }
75  else if (_dt > 0)
76  {
77  residual +=
78  _stress[_qp].row(_component) * _grad_test[_i][_qp] *
79  (1.0 + _alpha + (1.0 + _alpha) * _zeta[_qp] / _dt) -
80  (_alpha + (1.0 + 2.0 * _alpha) * _zeta[_qp] / _dt) * _stress_old[_qp].row(_component) *
81  _grad_test[_i][_qp] +
82  (_alpha * _zeta[_qp] / _dt) * _stress_older[_qp].row(_component) * _grad_test[_i][_qp];
83 
85  residual += (_stress[_qp].trace() * (1.0 + _alpha + (1.0 + _alpha) * _zeta[_qp] / _dt) -
86  (_alpha + (1.0 + 2.0 * _alpha) * _zeta[_qp] / _dt) * _stress_old[_qp].trace() +
87  (_alpha * _zeta[_qp] / _dt) * _stress_older[_qp].trace()) /
88  3.0 * (_avg_grad_test[_i][_component] - _grad_test[_i][_qp](_component));
89  }
90 
91  return residual;
92 }
bool _volumetric_locking_correction
Flag for volumetric locking correction.
std::vector< std::vector< Real > > _avg_grad_test
Gradient of test function averaged over the element. Used in volumetric locking correction calculatio...
const MaterialProperty< Real > & _zeta
const MaterialProperty< RankTwoTensor > & _stress_old
const MaterialProperty< RankTwoTensor > & _stress_older
const MaterialProperty< RankTwoTensor > & _stress

◆ computeResidual()

void StressDivergenceTensors::computeResidual ( )
overrideprotectedvirtualinherited

Definition at line 117 of file StressDivergenceTensors.C.

118 {
119  DenseVector<Number> & re = _assembly.residualBlock(_var.number());
120  _local_re.resize(re.size());
121  _local_re.zero();
122 
125 
126  precalculateResidual();
127  for (_i = 0; _i < _test.size(); ++_i)
128  for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
129  _local_re(_i) += _JxW[_qp] * _coord[_qp] * computeQpResidual();
130 
131  re += _local_re;
132 
133  if (_has_save_in)
134  {
135  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
136  for (const auto & var : _save_in)
137  var->sys().solution().add_vector(_local_re, var->dofIndices());
138  }
139 }
bool _volumetric_locking_correction
Flag for volumetric locking correction.
virtual Real computeQpResidual() override

◆ initialSetup()

void StressDivergenceTensors::initialSetup ( )
overrideprotectedvirtualinherited

Reimplemented in StressDivergenceRSphericalTensors, and StressDivergenceRZTensors.

Definition at line 109 of file StressDivergenceTensors.C.

110 {
111  if (getBlockCoordSystem() != Moose::COORD_XYZ)
112  mooseError(
113  "The coordinate system in the Problem block must be set to XYZ for cartesian geometries.");
114 }

Member Data Documentation

◆ _alpha

const Real DynamicStressDivergenceTensors::_alpha
protected

◆ _assembly_undisplaced

Assembly& ALEKernel::_assembly_undisplaced
protectedinherited

undisplaced problem

Definition at line 33 of file ALEKernel.h.

◆ _avg_grad_phi

std::vector<std::vector<Real> > StressDivergenceTensors::_avg_grad_phi
protectedinherited

◆ _avg_grad_test

std::vector<std::vector<Real> > StressDivergenceTensors::_avg_grad_test
protectedinherited

◆ _base_name

std::string StressDivergenceTensors::_base_name
protectedinherited

◆ _component

const unsigned int StressDivergenceTensors::_component
protectedinherited

◆ _deformation_gradient

const MaterialProperty<RankTwoTensor>* StressDivergenceTensors::_deformation_gradient
protectedinherited

◆ _deformation_gradient_old

const MaterialProperty<RankTwoTensor>* StressDivergenceTensors::_deformation_gradient_old
protectedinherited

◆ _deigenstrain_dT

const MaterialProperty<RankTwoTensor>* const StressDivergenceTensors::_deigenstrain_dT
protectedinherited

d(strain)/d(temperature), if computed by ComputeThermalExpansionEigenstrain

Definition at line 73 of file StressDivergenceTensors.h.

◆ _disp_var

std::vector<unsigned int> StressDivergenceTensors::_disp_var
protectedinherited

◆ _finite_deform_Jacobian_mult

std::vector<RankFourTensor> StressDivergenceTensors::_finite_deform_Jacobian_mult
protectedinherited

◆ _grad_phi_undisplaced

const VariablePhiGradient& ALEKernel::_grad_phi_undisplaced
protectedinherited

Shape and test functions on the undisplaced mesh.

Definition at line 39 of file ALEKernel.h.

Referenced by StressDivergenceTensors::computeQpJacobian(), and StressDivergenceTensors::computeQpOffDiagJacobian().

◆ _grad_test_undisplaced

const VariableTestGradient& ALEKernel::_grad_test_undisplaced
protectedinherited

Definition at line 40 of file ALEKernel.h.

◆ _Jacobian_mult

const MaterialProperty<RankFourTensor>& StressDivergenceTensors::_Jacobian_mult
protectedinherited

◆ _ndisp

unsigned int StressDivergenceTensors::_ndisp
protectedinherited

◆ _out_of_plane_direction

const unsigned int StressDivergenceTensors::_out_of_plane_direction
protectedinherited

◆ _out_of_plane_strain_coupled

const bool StressDivergenceTensors::_out_of_plane_strain_coupled
protectedinherited

◆ _out_of_plane_strain_var

const unsigned int StressDivergenceTensors::_out_of_plane_strain_var
protectedinherited

◆ _rotation_increment

const MaterialProperty<RankTwoTensor>* StressDivergenceTensors::_rotation_increment
protectedinherited

◆ _static_initialization

const bool DynamicStressDivergenceTensors::_static_initialization
protected

◆ _stress

const MaterialProperty<RankTwoTensor>& StressDivergenceTensors::_stress
protectedinherited

◆ _stress_old

const MaterialProperty<RankTwoTensor>& DynamicStressDivergenceTensors::_stress_old
protected

Definition at line 35 of file DynamicStressDivergenceTensors.h.

Referenced by computeQpResidual().

◆ _stress_older

const MaterialProperty<RankTwoTensor>& DynamicStressDivergenceTensors::_stress_older
protected

Definition at line 34 of file DynamicStressDivergenceTensors.h.

Referenced by computeQpResidual().

◆ _temp_coupled

const bool StressDivergenceTensors::_temp_coupled
protectedinherited

◆ _temp_var

const unsigned int StressDivergenceTensors::_temp_var
protectedinherited

◆ _use_finite_deform_jacobian

bool StressDivergenceTensors::_use_finite_deform_jacobian
protectedinherited

◆ _var_undisplaced

MooseVariable& ALEKernel::_var_undisplaced
protectedinherited

Reference to this Kernel's undisplaced MooseVariable object.

Definition at line 36 of file ALEKernel.h.

◆ _volumetric_locking_correction

bool StressDivergenceTensors::_volumetric_locking_correction
protectedinherited

◆ _zeta

const MaterialProperty<Real>& DynamicStressDivergenceTensors::_zeta
protected

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