https://mooseframework.inl.gov
StVenantKirchhoffPK2Test.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", StVenantKirchhoffPK2Test);
13 
16 {
18  params.addClassDescription("Test-only Saint-Venant-Kirchhoff PK2 stress with analytic dPK2/dF, "
19  "used to exercise ComputeLagrangianStressCustomPK2 with the Jacobian "
20  "tester.");
21  params.addRequiredParam<Real>("lambda", "First Lame parameter.");
22  params.addRequiredParam<Real>("mu", "Shear modulus.");
23  params.addParam<MaterialPropertyName>(
24  "pk2_name", "test_pk2", "Name to publish the PK2 stress as.");
25  params.addParam<MaterialPropertyName>(
26  "dpk2_dF_name", "test_dpk2_dF", "Name to publish dPK2/dF as.");
27  params.addParam<MaterialPropertyName>(
28  "deformation_gradient",
29  "deformation_gradient",
30  "Strain-calc's deformation gradient (F-bar-stabilized when F-bar is on).");
31  return params;
32 }
33 
35  : Material(parameters),
36  _lambda(getParam<Real>("lambda")),
37  _mu(getParam<Real>("mu")),
38  _F(getMaterialProperty<RankTwoTensor>("deformation_gradient")),
39  _pk2(declareProperty<RankTwoTensor>(getParam<MaterialPropertyName>("pk2_name"))),
40  _dpk2_dF(declareProperty<RankFourTensor>(getParam<MaterialPropertyName>("dpk2_dF_name")))
41 {
42 }
43 
44 void
46 {
48  const RankTwoTensor & F = _F[_qp];
49 
50  // E_kl = 0.5 (F_mk F_ml - delta_kl).
51  const RankTwoTensor E = 0.5 * (F.transpose() * F - I);
52  // PK2 = 2 mu E + lambda tr(E) I.
53  _pk2[_qp] = 2.0 * _mu * E + _lambda * E.trace() * I;
54 
55  // dPK2_ij/dF_pq = mu (delta_iq F_pj + F_pi delta_jq) + lambda delta_ij F_pq.
56  RankFourTensor & dS = _dpk2_dF[_qp];
57  dS.zero();
58  for (unsigned int i = 0; i < 3; ++i)
59  for (unsigned int j = 0; j < 3; ++j)
60  for (unsigned int p = 0; p < 3; ++p)
61  for (unsigned int q = 0; q < 3; ++q)
62  {
63  Real v = _lambda * (i == j ? 1.0 : 0.0) * F(p, q);
64  if (i == q)
65  v += _mu * F(p, j);
66  if (j == q)
67  v += _mu * F(p, i);
68  dS(i, j, p, q) = v;
69  }
70 }
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
const double v
static RankTwoTensorTempl Identity()
void addRequiredParam(const std::string &name, const std::string &doc_string)
static const std::string F
Definition: NS.h:169
const MaterialProperty< RankTwoTensor > & _F
Strain-calc-published F (= F-bar-stabilized when F-bar is on; equal to F_ust otherwise).
unsigned int _qp
MaterialProperty< RankFourTensor > & _dpk2_dF
static InputParameters validParams()
MaterialProperty< RankTwoTensor > & _pk2
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")
StVenantKirchhoffPK2Test(const InputParameters &parameters)
Publishes an isotropic Saint-Venant-Kirchhoff PK2 stress and dPK2/dF analytically.
registerMooseObject("SolidMechanicsTestApp", StVenantKirchhoffPK2Test)
static InputParameters validParams()