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

StressDivergenceRSphericalTensors is a modification of StressDivergenceTensors for 1D spherically symmetric problems. More...

#include <StressDivergenceRSphericalTensors.h>

Inheritance diagram for StressDivergenceRSphericalTensors:
[legend]

Public Types

typedef std::vector< intJvarMap
 

Public Member Functions

 StressDivergenceRSphericalTensors (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 void initialSetup () override
 
virtual Real computeQpResidual () override
 
virtual Real computeQpJacobian () override
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar) override
 
Real calculateJacobian (unsigned int ivar, unsigned int jvar)
 
virtual void computeResidual () override
 
virtual void computeFiniteDeformJacobian ()
 
virtual void computeAverageGradientTest ()
 
virtual void computeAverageGradientPhi ()
 

Protected Attributes

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

StressDivergenceRSphericalTensors is a modification of StressDivergenceTensors for 1D spherically symmetric problems.

The main modifications from the original StressDivergenceTensors code are requirements from the dependence of stress in the polar and azimuthal stresses on displacement and position in the radial direction. This kernel is for symmetrical loading only. If solving an anisotropic material problem, recall that the orientation of the basis vectors ({e}_r) change with position, so the components of the elasticity tensor are functions of position. Reference: Bower, A.F. Applied Mechanics of Solids (2012). Chapter 4. Available online at solidmechanics.org Within this kernel, '_disp_x' refers to displacement in the radial direction. The COORD_TYPE in the Problem block must be set to RSpherical.

Definition at line 30 of file StressDivergenceRSphericalTensors.h.

Constructor & Destructor Documentation

◆ StressDivergenceRSphericalTensors()

StressDivergenceRSphericalTensors::StressDivergenceRSphericalTensors ( const InputParameters parameters)

Definition at line 28 of file StressDivergenceRSphericalTensors.C.

30  : StressDivergenceTensors(parameters)
31 {
32  if (_component != 0)
33  mooseError("Invalid component for this 1D RSpherical problem.");
34 }
void mooseError(Args &&... args)
const unsigned int _component
An integer corresponding to the direction this kernel acts in.
StressDivergenceTensors(const InputParameters &parameters)

Member Function Documentation

◆ calculateJacobian()

Real StressDivergenceRSphericalTensors::calculateJacobian ( unsigned int  ivar,
unsigned int  jvar 
)
protected

Definition at line 69 of file StressDivergenceRSphericalTensors.C.

Referenced by computeQpJacobian(), and computeQpOffDiagJacobian().

71 {
72  mooseAssert(ivar == 0 && jvar == 0,
73  "Invalid component in Jacobian Calculation"); // Only nonzero case for a 1D simulation
74 
75  const Real test = _grad_test[_i][_qp](0);
76  const Real test_r1 = _test[_i][_qp] / _q_point[_qp](0);
77  // const Real test_r2 = test_r1;
78 
79  const Real phi = _grad_phi[_j][_qp](0);
80  const Real phi_r1 = _phi[_j][_qp] / _q_point[_qp](0);
81  const Real phi_r2 = phi_r1;
82 
83  const Real term1 = test * _Jacobian_mult[_qp](0, 0, 0, 0) * phi;
84  const Real term2 = test * _Jacobian_mult[_qp](0, 0, 1, 1) * phi_r1; // same as term3
85  // const Real term3 = test * _Jacobian_mult[_qp](0, 0, 2, 2) * phi_r2;
86 
87  const Real term4 = test_r1 * _Jacobian_mult[_qp](1, 1, 0, 0) * phi; // same as term7
88  const Real term5 = test_r1 * _Jacobian_mult[_qp](1, 1, 1, 1) * phi_r1; // same as term9
89  const Real term6 = test_r1 * _Jacobian_mult[_qp](1, 1, 2, 2) * phi_r2; // same as term8
90 
91  // const Real term7 = test_r2 * _Jacobian_mult[_qp](2, 2, 0, 0) * phi;
92  // const Real term8 = test_r2 * _Jacobian_mult[_qp](2, 2, 1, 1) * phi_r1;
93  // const Real term9 = test_r2 * _Jacobian_mult[_qp](2, 2, 2, 2) * phi_r2;
94 
95  return term1 + 2 * (term2 + term4 + term5 + term6);
96 }
const MaterialProperty< RankFourTensor > & _Jacobian_mult
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ 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 StressDivergenceRSphericalTensors::computeQpJacobian ( )
overrideprotectedvirtual

Reimplemented from StressDivergenceTensors.

Definition at line 53 of file StressDivergenceRSphericalTensors.C.

54 {
56 }
const unsigned int _component
An integer corresponding to the direction this kernel acts in.
Real calculateJacobian(unsigned int ivar, unsigned int jvar)

◆ computeQpOffDiagJacobian()

Real StressDivergenceRSphericalTensors::computeQpOffDiagJacobian ( unsigned int  jvar)
overrideprotectedvirtual

Reimplemented from StressDivergenceTensors.

Definition at line 59 of file StressDivergenceRSphericalTensors.C.

60 {
61  for (unsigned int i = 0; i < _ndisp; ++i)
62  if (jvar == _disp_var[i])
63  return calculateJacobian(_component, i);
64 
65  return 0.0;
66 }
unsigned int _ndisp
Coupled displacement variables.
const unsigned int _component
An integer corresponding to the direction this kernel acts in.
std::vector< unsigned int > _disp_var
Displacement variables IDs.
Real calculateJacobian(unsigned int ivar, unsigned int jvar)

◆ computeQpResidual()

Real StressDivergenceRSphericalTensors::computeQpResidual ( )
overrideprotectedvirtual

Reimplemented from StressDivergenceTensors.

Definition at line 45 of file StressDivergenceRSphericalTensors.C.

46 {
47  return _grad_test[_i][_qp](0) * _stress[_qp](0, 0) + // stress_{rr} part 1
48  +(_test[_i][_qp] / _q_point[_qp](0)) * _stress[_qp](1, 1) + // stress_{\theta \theta}
49  +(_test[_i][_qp] / _q_point[_qp](0)) * _stress[_qp](2, 2); // stress_{\phi \phi}
50 }
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 StressDivergenceRSphericalTensors::initialSetup ( )
overrideprotectedvirtual

Reimplemented from StressDivergenceTensors.

Definition at line 37 of file StressDivergenceRSphericalTensors.C.

38 {
39  if (getBlockCoordSystem() != Moose::COORD_RSPHERICAL)
40  mooseError("The coordinate system in the Problem block must be set to RSPHERICAL for 1D "
41  "spherically symmetric geometries.");
42 }
void mooseError(Args &&... args)
COORD_RSPHERICAL

◆ validParams()

InputParameters StressDivergenceRSphericalTensors::validParams ( )
static

Definition at line 18 of file StressDivergenceRSphericalTensors.C.

19 {
21  params.addClassDescription(
22  "Calculate stress divergence for a spherically symmetric 1D problem in polar coordinates.");
23  params.set<unsigned int>("component") = 0;
24  params.set<bool>("use_displaced_mesh") = true;
25  return params;
26 }
T & set(const std::string &name, bool quiet_mode=false)
static InputParameters validParams()
void addClassDescription(const std::string &doc_string)

Member Data Documentation

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

◆ _stress

const MaterialProperty<RankTwoTensor>& StressDivergenceTensors::_stress
protectedinherited

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

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