https://mooseframework.inl.gov
IsotropicCauchyStressTest.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
11 
12 registerMooseObject("SolidMechanicsTestApp", IsotropicCauchyStressTest);
13 
16 {
18  params.addClassDescription("Test-only hypoelastic isotropic Cauchy stress with analytic "
19  "dsigma/d(spatial_deformation_gradient_increment), used to exercise "
20  "ComputeLagrangianCauchyCustomStress with the Jacobian tester.");
21  params.addRequiredParam<Real>("lambda", "First Lame parameter.");
22  params.addRequiredParam<Real>("mu", "Shear modulus.");
23  params.addParam<MaterialPropertyName>(
24  "sigma_name", "test_cauchy", "Name to publish the Cauchy stress as.");
25  params.addParam<MaterialPropertyName>(
26  "dsigma_d_dL_name",
27  "test_dcauchy_d_dL",
28  "Name to publish dsigma/d(spatial_deformation_gradient_increment) as.");
29  params.addParam<MaterialPropertyName>("spatial_deformation_gradient_increment",
30  "spatial_deformation_gradient_increment",
31  "Strain-calc's spatial velocity gradient increment.");
32  return params;
33 }
34 
36  : Material(parameters),
37  _lambda(getParam<Real>("lambda")),
38  _mu(getParam<Real>("mu")),
39  _dL(getMaterialProperty<RankTwoTensor>("spatial_deformation_gradient_increment")),
40  _sigma(declareProperty<RankTwoTensor>(getParam<MaterialPropertyName>("sigma_name"))),
41  _sigma_old(getMaterialPropertyOld<RankTwoTensor>(getParam<MaterialPropertyName>("sigma_name"))),
42  _dsigma_d_dL(
43  declareProperty<RankFourTensor>(getParam<MaterialPropertyName>("dsigma_d_dL_name")))
44 {
45 }
46 
47 void
49 {
50  _sigma[_qp].zero();
51 }
52 
53 void
55 {
57 
58  // dd = sym(dL) (the symmetric part of the spatial-velocity-gradient increment).
59  const RankTwoTensor dd = 0.5 * (_dL[_qp] + _dL[_qp].transpose());
60  // Linear isotropic elastic stress update on dd. (Hypoelastic; ignores rotation for the
61  // purposes of this Jacobian test.)
62  _sigma[_qp] = _sigma_old[_qp] + 2.0 * _mu * dd + _lambda * dd.trace() * I;
63 
64  // dsigma_ij/d(dL)_pq:
65  // dsigma/d(dd) = 2 mu I^{sym} + lambda I (x) I (isotropic elastic tangent)
66  // d(dd)/d(dL) = 0.5 (delta_ip delta_jq + delta_iq delta_jp)
67  // so dsigma_ij/d(dL)_pq = mu (delta_ip delta_jq + delta_iq delta_jp)
68  // + lambda delta_ij delta_pq.
70  dS.zero();
71  for (unsigned int i = 0; i < 3; ++i)
72  for (unsigned int j = 0; j < 3; ++j)
73  for (unsigned int p = 0; p < 3; ++p)
74  for (unsigned int q = 0; q < 3; ++q)
75  {
76  Real v = (i == j && p == q) ? _lambda : 0.0;
77  if (i == p && j == q)
78  v += _mu;
79  if (i == q && j == p)
80  v += _mu;
81  dS(i, j, p, q) = v;
82  }
83 }
MaterialProperty< RankTwoTensor > & _sigma
registerMooseObject("SolidMechanicsTestApp", IsotropicCauchyStressTest)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
Publishes a simple hypoelastic Cauchy stress and dsigma/d(dL) analytically, where sigma_n+1 = sigma_n...
IsotropicCauchyStressTest(const InputParameters &parameters)
const double v
static RankTwoTensorTempl Identity()
void addRequiredParam(const std::string &name, const std::string &doc_string)
unsigned int _qp
static InputParameters validParams()
static InputParameters validParams()
const MaterialProperty< RankTwoTensor > & _dL
Strain calc&#39;s _deformation_gradient_increment (= sym + skew of dL).
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Real p
void addClassDescription(const std::string &doc_string)
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
MaterialProperty< RankFourTensor > & _dsigma_d_dL
const MaterialProperty< RankTwoTensor > & _sigma_old