www.mooseframework.org
Public Types | Public Member Functions | Static 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 Types

typedef std::vector< intJvarMap
 

Public Member Functions

 DynamicStressDivergenceTensors (const InputParameters &parameters)
 
virtual void computeJacobian () override
 
virtual void computeOffDiagJacobian (unsigned int jvar) override
 
unsigned int mapJvarToCvar (unsigned int jvar)
 
int mapJvarToCvar (unsigned int jvar, const JvarMap &jvar_map)
 
bool mapJvarToCvar (unsigned int jvar, unsigned int &cvar)
 
const JvarMapgetJvarMap ()
 
const JvarMapgetParameterJvarMap (std::string parameter_name)
 

Static Public Member Functions

static InputParameters validParams ()
 

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
 {@ The old and older states of the stress tensor that the divergence operator operates on More...
 
const MaterialProperty< RankTwoTensor > & _stress_old
 
const MaterialProperty< Real > & _zeta
 
const Real _alpha
 
const bool _static_initialization
 
const std::string _base_name
 Base name of the material system that this kernel applies to. More...
 
bool _use_finite_deform_jacobian
 
const MaterialProperty< RankTwoTensor > & _stress
 The stress tensor that the divergence operator operates on. More...
 
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
 An integer corresponding to the direction this kernel acts in. More...
 
unsigned int _ndisp
 Coupled displacement variables. More...
 
std::vector< unsigned int_disp_var
 Displacement variables IDs. More...
 
std::vector< std::vector< const MaterialProperty< RankTwoTensor > * > > _deigenstrain_dargs
 eigen strain derivatives wrt coupled variables More...
 
const bool _out_of_plane_strain_coupled
 
const VariableValue *const _out_of_plane_strain
 
const unsigned int _out_of_plane_strain_var
 
const unsigned int _out_of_plane_direction
 
const bool _use_displaced_mesh
 Whether this object is acting on the displaced mesh. More...
 
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...
 
const unsigned int _n_args
 

Detailed Description

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

Definition at line 18 of file DynamicStressDivergenceTensors.h.

Constructor & Destructor Documentation

◆ DynamicStressDivergenceTensors()

DynamicStressDivergenceTensors::DynamicStressDivergenceTensors ( const InputParameters parameters)

Definition at line 36 of file DynamicStressDivergenceTensors.C.

37  : StressDivergenceTensors(parameters),
38  _stress_older(getMaterialPropertyOlderByName<RankTwoTensor>(_base_name + "stress")),
39  _stress_old(getMaterialPropertyOldByName<RankTwoTensor>(_base_name + "stress")),
40  _zeta(getMaterialProperty<Real>("zeta")),
41  _alpha(getParam<Real>("alpha")),
42  _static_initialization(getParam<bool>("static_initialization"))
43 {
44 }
const std::string _base_name
Base name of the material system that this kernel applies to.
const MaterialProperty< Real > & _zeta
const MaterialProperty< RankTwoTensor > & _stress_old
StressDivergenceTensors(const InputParameters &parameters)
const MaterialProperty< RankTwoTensor > & _stress_older
{@ The old and older states of the stress tensor that the divergence operator operates on ...

Member Function Documentation

◆ computeAverageGradientPhi()

void StressDivergenceTensors::computeAverageGradientPhi ( )
protectedvirtualinherited

Reimplemented in StressDivergenceRZTensors.

Definition at line 443 of file StressDivergenceTensors.C.

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

444 {
445  // Calculate volume average derivatives for phi
446  _avg_grad_phi.resize(_phi.size());
447  for (_i = 0; _i < _phi.size(); ++_i)
448  {
449  _avg_grad_phi[_i].resize(3);
450  for (unsigned int component = 0; component < _mesh.dimension(); ++component)
451  {
452  _avg_grad_phi[_i][component] = 0.0;
453  for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
454  _avg_grad_phi[_i][component] += _grad_phi[_i][_qp](component) * _JxW[_qp] * _coord[_qp];
455 
456  _avg_grad_phi[_i][component] /= _current_elem_volume;
457  }
458  }
459 }
std::vector< std::vector< Real > > _avg_grad_phi
Gradient of phi function averaged over the element. Used in volumetric locking correction calculation...
static const std::string component
Definition: NS.h:138

◆ computeAverageGradientTest()

void StressDivergenceTensors::computeAverageGradientTest ( )
protectedvirtualinherited

Reimplemented in StressDivergenceRZTensors.

Definition at line 427 of file StressDivergenceTensors.C.

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

428 {
429  // Calculate volume averaged value of shape function derivative
430  _avg_grad_test.resize(_test.size());
431  for (_i = 0; _i < _test.size(); ++_i)
432  {
433  _avg_grad_test[_i].resize(3);
434  _avg_grad_test[_i][_component] = 0.0;
435  for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
436  _avg_grad_test[_i][_component] += _grad_test[_i][_qp](_component) * _JxW[_qp] * _coord[_qp];
437 
438  _avg_grad_test[_i][_component] /= _current_elem_volume;
439  }
440 }
std::vector< std::vector< Real > > _avg_grad_test
Gradient of test function averaged over the element. Used in volumetric locking correction calculatio...
const unsigned int _component
An integer corresponding to the direction this kernel acts in.

◆ computeFiniteDeformJacobian()

void StressDivergenceTensors::computeFiniteDeformJacobian ( )
protectedvirtualinherited

Definition at line 369 of file StressDivergenceTensors.C.

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

370 {
371  usingTensorIndices(i_, j_, k_, l_);
372  const auto I = RankTwoTensor::Identity();
373  const RankFourTensor I2 = I.times<i_, k_, j_, l_>(I);
374 
375  // Bring back to unrotated config
376  const RankTwoTensor unrotated_stress =
377  (*_rotation_increment)[_qp].transpose() * _stress[_qp] * (*_rotation_increment)[_qp];
378 
379  // Incremental deformation gradient Fhat
380  const RankTwoTensor Fhat =
381  (*_deformation_gradient)[_qp] * (*_deformation_gradient_old)[_qp].inverse();
382  const RankTwoTensor Fhatinv = Fhat.inverse();
383 
384  const RankTwoTensor rot_times_stress = (*_rotation_increment)[_qp] * unrotated_stress;
385  const RankFourTensor dstress_drot =
386  I.times<i_, k_, j_, l_>(rot_times_stress) + I.times<j_, k_, i_, l_>(rot_times_stress);
387  const RankFourTensor rot_rank_four =
388  (*_rotation_increment)[_qp].times<i_, k_, j_, l_>((*_rotation_increment)[_qp]);
389  const RankFourTensor drot_dUhatinv = Fhat.times<i_, k_, j_, l_>(I);
390 
391  const RankTwoTensor A = I - Fhatinv;
392 
393  // Ctilde = Chat^-1 - I
394  const RankTwoTensor Ctilde = A * A.transpose() - A - A.transpose();
395  const RankFourTensor dCtilde_dFhatinv =
396  -I.times<i_, k_, j_, l_>(A) - I.times<j_, k_, i_, l_>(A) + I2 + I.times<j_, k_, i_, l_>(I);
397 
398  // Second order approximation of Uhat - consistent with strain increment definition
399  // const RankTwoTensor Uhat = I - 0.5 * Ctilde - 3.0/8.0 * Ctilde * Ctilde;
400 
401  RankFourTensor dUhatinv_dCtilde =
402  0.5 * I2 - 1.0 / 8.0 * (I.times<i_, k_, j_, l_>(Ctilde) + Ctilde.times<i_, k_, j_, l_>(I));
403  RankFourTensor drot_dFhatinv = drot_dUhatinv * dUhatinv_dCtilde * dCtilde_dFhatinv;
404 
405  drot_dFhatinv -= Fhat.times<i_, k_, j_, l_>((*_rotation_increment)[_qp].transpose());
406  _finite_deform_Jacobian_mult[_qp] = dstress_drot * drot_dFhatinv;
407 
408  const RankFourTensor dstrain_increment_dCtilde =
409  -0.5 * I2 + 0.25 * (I.times<i_, k_, j_, l_>(Ctilde) + Ctilde.times<i_, k_, j_, l_>(I));
411  rot_rank_four * _Jacobian_mult[_qp] * dstrain_increment_dCtilde * dCtilde_dFhatinv;
412  _finite_deform_Jacobian_mult[_qp] += Fhat.times<j_, k_, i_, l_>(_stress[_qp]);
413 
414  const RankFourTensor dFhat_dFhatinv = -Fhat.times<i_, k_, j_, l_>(Fhat.transpose());
415  const RankTwoTensor dJ_dFhatinv = dFhat_dFhatinv.innerProductTranspose(Fhat.ddet());
416 
417  // Component from Jacobian derivative
418  _finite_deform_Jacobian_mult[_qp] += _stress[_qp].times<i_, j_, k_, l_>(dJ_dFhatinv);
419 
420  // Derivative of Fhatinv w.r.t. undisplaced coordinates
421  const RankTwoTensor Finv = (*_deformation_gradient)[_qp].inverse();
422  const RankFourTensor dFhatinv_dGradu = -Fhatinv.times<i_, k_, j_, l_>(Finv.transpose());
423  _finite_deform_Jacobian_mult[_qp] = _finite_deform_Jacobian_mult[_qp] * dFhatinv_dGradu;
424 }
RankTwoTensorTempl< Real > inverse() const
static RankTwoTensorTempl Identity()
std::vector< RankFourTensor > _finite_deform_Jacobian_mult
const MaterialProperty< RankFourTensor > & _Jacobian_mult
RankTwoTensorTempl< Real > transpose() const
RankFourTensorTempl< Real > times(const RankTwoTensorTempl< Real > &b) const
RankTwoTensorTempl< Real > ddet() const
const MaterialProperty< RankTwoTensor > & _stress
The stress tensor that the divergence operator operates on.

◆ computeJacobian()

void StressDivergenceTensors::computeJacobian ( )
overridevirtualinherited

Definition at line 178 of file StressDivergenceTensors.C.

179 {
181  {
184  }
185 
187  {
188  _finite_deform_Jacobian_mult.resize(_qrule->n_points());
189 
190  for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
192 
194  }
195  else
197 }
bool _volumetric_locking_correction
Flag for volumetric locking correction.
std::vector< RankFourTensor > _finite_deform_Jacobian_mult
virtual void computeJacobian() override
virtual void computeFiniteDeformJacobian()
virtual void computeJacobian() override
Definition: ALEKernel.C:34

◆ computeOffDiagJacobian()

void StressDivergenceTensors::computeOffDiagJacobian ( unsigned int  jvar)
overridevirtualinherited

Reimplemented from JvarMapKernelInterface< ALEKernel >.

Definition at line 200 of file StressDivergenceTensors.C.

201 {
203  {
206  }
207 
209  {
210  _finite_deform_Jacobian_mult.resize(_qrule->n_points());
211 
212  for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
214 
216  }
217  else
219 }
bool _volumetric_locking_correction
Flag for volumetric locking correction.
std::vector< RankFourTensor > _finite_deform_Jacobian_mult
virtual void computeOffDiagJacobian(unsigned int jvar) override
Definition: ALEKernel.C:41
virtual void computeFiniteDeformJacobian()
virtual void computeOffDiagJacobian(unsigned int jvar) override

◆ computeQpJacobian()

Real DynamicStressDivergenceTensors::computeQpJacobian ( )
protectedvirtual

Reimplemented from StressDivergenceTensors.

Definition at line 94 of file DynamicStressDivergenceTensors.C.

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

◆ computeQpOffDiagJacobian()

Real DynamicStressDivergenceTensors::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

Reimplemented from StressDivergenceTensors.

Definition at line 106 of file DynamicStressDivergenceTensors.C.

107 {
108  bool active = true;
109 
110  for (unsigned int i = 0; i < _ndisp; ++i)
111  if (jvar == _disp_var[i])
112  active = true;
113 
114  if (active)
115  {
116  if (_static_initialization && _t == _dt)
118  else if (_dt > 0)
120  (1.0 + _alpha + (1.0 + _alpha) * _zeta[_qp] / _dt);
121  else
122  return 0.0;
123  }
124 
125  return 0;
126 }
unsigned int _ndisp
Coupled displacement variables.
const MaterialProperty< Real > & _zeta
std::vector< unsigned int > _disp_var
Displacement variables IDs.
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 through 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 47 of file DynamicStressDivergenceTensors.C.

48 {
63  Real residual = 0.0;
64  if (_static_initialization && _t == _dt)
65  {
66  // If static initialization is true, then in the first step residual is only Ku which is
67  // stress.grad(test).
68  residual += _stress[_qp].row(_component) * _grad_test[_i][_qp];
69 
71  residual += _stress[_qp].trace() / 3.0 *
72  (_avg_grad_test[_i][_component] - _grad_test[_i][_qp](_component));
73  }
74  else if (_dt > 0)
75  {
76  residual +=
77  _stress[_qp].row(_component) * _grad_test[_i][_qp] *
78  (1.0 + _alpha + (1.0 + _alpha) * _zeta[_qp] / _dt) -
79  (_alpha + (1.0 + 2.0 * _alpha) * _zeta[_qp] / _dt) * _stress_old[_qp].row(_component) *
80  _grad_test[_i][_qp] +
81  (_alpha * _zeta[_qp] / _dt) * _stress_older[_qp].row(_component) * _grad_test[_i][_qp];
82 
84  residual += (_stress[_qp].trace() * (1.0 + _alpha + (1.0 + _alpha) * _zeta[_qp] / _dt) -
85  (_alpha + (1.0 + 2.0 * _alpha) * _zeta[_qp] / _dt) * _stress_old[_qp].trace() +
86  (_alpha * _zeta[_qp] / _dt) * _stress_older[_qp].trace()) /
87  3.0 * (_avg_grad_test[_i][_component] - _grad_test[_i][_qp](_component));
88  }
89 
90  return residual;
91 }
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 unsigned int _component
An integer corresponding to the direction this kernel acts in.
const MaterialProperty< Real > & _zeta
const MaterialProperty< RankTwoTensor > & _stress_old
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const MaterialProperty< RankTwoTensor > & _stress_older
{@ The old and older states of the stress tensor that the divergence operator operates on ...
const MaterialProperty< RankTwoTensor > & _stress
The stress tensor that the divergence operator operates on.

◆ computeResidual()

void StressDivergenceTensors::computeResidual ( )
overrideprotectedvirtualinherited

Definition at line 137 of file StressDivergenceTensors.C.

138 {
139  prepareVectorTag(_assembly, _var.number());
140 
143 
144  precalculateResidual();
145  for (_i = 0; _i < _test.size(); ++_i)
146  for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
147  _local_re(_i) += _JxW[_qp] * _coord[_qp] * computeQpResidual();
148 
149  accumulateTaggedLocalResidual();
150 
151  if (_has_save_in)
152  {
153  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
154  for (const auto & var : _save_in)
155  var->sys().solution().add_vector(_local_re, var->dofIndices());
156  }
157 }
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 124 of file StressDivergenceTensors.C.

125 {
126  // check if any of the eigenstrains provide derivatives wrt variables that are not coupled
127  for (auto eigenstrain_name : getParam<std::vector<MaterialPropertyName>>("eigenstrain_names"))
128  validateNonlinearCoupling<RankTwoTensor>(eigenstrain_name);
129 
130  // make sure the coordinate system is cartesioan
131  if (getBlockCoordSystem() != Moose::COORD_XYZ)
132  mooseError("The coordinate system in the Problem block must be set to XYZ for cartesian "
133  "geometries.");
134 }
void mooseError(Args &&... args)

◆ validParams()

InputParameters DynamicStressDivergenceTensors::validParams ( )
static

Definition at line 16 of file DynamicStressDivergenceTensors.C.

17 {
19  params.addClassDescription(
20  "Residual due to stress related Rayleigh damping and HHT time integration terms ");
21  params.addParam<MaterialPropertyName>("zeta",
22  0.0,
23  "Name of material property or a constant real "
24  "number defining the zeta parameter for the "
25  "Rayleigh damping.");
26  params.addParam<Real>("alpha", 0, "alpha parameter for HHT time integration");
27  params.addParam<bool>("static_initialization",
28  false,
29  "Set to true to get the system to "
30  "equilibrium under gravity by running a "
31  "quasi-static analysis (by solving Ku = F) "
32  "in the first time step");
33  return params;
34 }
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static InputParameters validParams()
void addClassDescription(const std::string &doc_string)

Member Data Documentation

◆ _alpha

const Real DynamicStressDivergenceTensors::_alpha
protected

◆ _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

const std::string StressDivergenceTensors::_base_name
protectedinherited

Base name of the material system that this kernel applies to.

Definition at line 47 of file StressDivergenceTensors.h.

Referenced by StressDivergenceTensors::StressDivergenceTensors().

◆ _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_dargs

std::vector<std::vector<const MaterialProperty<RankTwoTensor> *> > StressDivergenceTensors::_deigenstrain_dargs
protectedinherited

◆ _disp_var

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

◆ _finite_deform_Jacobian_mult

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

◆ _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

const VariableValue* const StressDivergenceTensors::_out_of_plane_strain
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 32 of file DynamicStressDivergenceTensors.h.

Referenced by computeQpResidual().

◆ _stress_older

const MaterialProperty<RankTwoTensor>& DynamicStressDivergenceTensors::_stress_older
protected

{@ The old and older states of the stress tensor that the divergence operator operates on

Definition at line 31 of file DynamicStressDivergenceTensors.h.

Referenced by computeQpResidual().

◆ _use_displaced_mesh

const bool StressDivergenceTensors::_use_displaced_mesh
protectedinherited

Whether this object is acting on the displaced mesh.

Definition at line 79 of file StressDivergenceTensors.h.

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

◆ _use_finite_deform_jacobian

bool StressDivergenceTensors::_use_finite_deform_jacobian
protectedinherited

◆ _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: