www.mooseframework.org
ComputeIsotropicElasticityTensor.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
8 
9 template <>
10 InputParameters
12 {
13  InputParameters params = validParams<ComputeElasticityTensorBase>();
14  params.addClassDescription("Compute a constant isotropic elasticity tensor.");
15  params.addParam<Real>("bulk_modulus", "The bulk modulus for the material.");
16  params.addParam<Real>("lambda", "Lame's first constant for the material.");
17  params.addParam<Real>("poissons_ratio", "Poisson's ratio for the material.");
18  params.addParam<Real>("shear_modulus", "The shear modulus of the material.");
19  params.addParam<Real>("youngs_modulus", "Young's modulus of the material.");
20  return params;
21 }
22 
24  const InputParameters & parameters)
25  : ComputeElasticityTensorBase(parameters),
26  _bulk_modulus_set(parameters.isParamValid("bulk_modulus")),
27  _lambda_set(parameters.isParamValid("lambda")),
28  _poissons_ratio_set(parameters.isParamValid("poissons_ratio")),
29  _shear_modulus_set(parameters.isParamValid("shear_modulus")),
30  _youngs_modulus_set(parameters.isParamValid("youngs_modulus")),
31  _bulk_modulus(_bulk_modulus_set ? getParam<Real>("bulk_modulus") : -1),
32  _lambda(_lambda_set ? getParam<Real>("lambda") : -1),
33  _poissons_ratio(_poissons_ratio_set ? getParam<Real>("poissons_ratio") : -1),
34  _shear_modulus(_shear_modulus_set ? getParam<Real>("shear_modulus") : -1),
35  _youngs_modulus(_youngs_modulus_set ? getParam<Real>("youngs_modulus") : -1)
36 {
37  unsigned int num_elastic_constants = _bulk_modulus_set + _lambda_set + _poissons_ratio_set +
39  if (num_elastic_constants != 2)
40  mooseError("Exactly two elastic constants must be defined for material '" + name() + "'.");
41 
42  // all tensors created by this class are always isotropic
44  if (!isParamValid("elasticity_tensor_prefactor"))
46 
47  if (_bulk_modulus_set && _bulk_modulus <= 0.0)
48  mooseError("Bulk modulus must be positive in material '" + name() + "'.");
49 
50  if (_poissons_ratio_set && (_poissons_ratio <= -1.0 || _poissons_ratio >= 0.5))
51  mooseError("Poissons ratio must be greater than -1 and less than 0.5 in "
52  "material '" +
53  name() + "'.");
54 
56  mooseError("Shear modulus must not be negative in material '" + name() + "'.");
57 
58  if (_youngs_modulus_set && _youngs_modulus <= 0.0)
59  mooseError("Youngs modulus must be positive in material '" + name() + "'.");
60 
61  if (_youngs_modulus_set && _poissons_ratio_set)
62  {
63  _Cijkl.fillSymmetricIsotropicEandNu(_youngs_modulus, _poissons_ratio);
64  return;
65  }
66 
67  std::vector<Real> iso_const(2);
68 
70  {
71  iso_const[0] = _lambda;
72  iso_const[1] = _shear_modulus;
73  }
75  {
76  iso_const[0] = _bulk_modulus - 2.0 / 3.0 * _shear_modulus;
77  iso_const[1] = _shear_modulus;
78  }
80  {
81  iso_const[0] = 3.0 * _bulk_modulus * _poissons_ratio / (1.0 + _poissons_ratio);
82  iso_const[1] =
83  3.0 * _bulk_modulus * (1.0 - 2.0 * _poissons_ratio) / (2.0 * (1.0 + _poissons_ratio));
84  }
85  else if (_lambda_set && _bulk_modulus_set)
86  {
87  iso_const[0] = _lambda;
88  iso_const[1] = 3.0 * (_bulk_modulus - _lambda) / 2.0;
89  }
90  else if (_shear_modulus_set && _youngs_modulus_set)
91  {
92  iso_const[0] = _shear_modulus * (_youngs_modulus - 2.0 * _shear_modulus) /
94  iso_const[1] = _shear_modulus;
95  }
97  {
98  iso_const[0] = 2.0 * _shear_modulus * _poissons_ratio / (1.0 - 2.0 * _poissons_ratio);
99  iso_const[1] = _shear_modulus;
100  }
101  else if (_youngs_modulus_set && _bulk_modulus_set)
102  {
103  iso_const[0] = 3.0 * _bulk_modulus * (3.0 * _bulk_modulus - _youngs_modulus) /
104  (9.0 * _bulk_modulus - _youngs_modulus);
105  iso_const[1] = 3.0 * _bulk_modulus * _youngs_modulus / (9.0 * _bulk_modulus - _youngs_modulus);
106  }
107  else if (_lambda_set && _poissons_ratio_set)
108  {
109  iso_const[0] = _lambda;
110  iso_const[1] = _lambda * (1.0 - 2.0 * _poissons_ratio) / (2.0 * _poissons_ratio);
111  }
112  else if (_lambda_set && _youngs_modulus_set)
113  {
114  iso_const[0] = _lambda;
115  iso_const[1] = (_youngs_modulus - 3.0 * _lambda +
116  std::sqrt(_youngs_modulus * _youngs_modulus + 9.0 * _lambda * _lambda +
117  2.0 * _youngs_modulus * _lambda)) /
118  4.0;
119  }
120  else
121  mooseError("Incorrect combination of elastic properties in ComputeIsotropicElasticityTensor.");
122 
123  // Fill elasticity tensor
124  _Cijkl.fillFromInputVector(iso_const, RankFourTensor::symmetric_isotropic);
125 }
126 
127 void
129 {
130  // Assign elasticity tensor at a given quad point
131  _elasticity_tensor[_qp] = _Cijkl;
132 }
ComputeElasticityTensorBase the base class for computing elasticity tensors.
void issueGuarantee(const MaterialPropertyName &prop_name, Guarantee guarantee)
InputParameters validParams< ComputeIsotropicElasticityTensor >()
RankFourTensor _Cijkl
Individual elasticity tensor.
InputParameters validParams< ComputeElasticityTensorBase >()
ComputeIsotropicElasticityTensor(const InputParameters &parameters)
MaterialProperty< RankFourTensor > & _elasticity_tensor