www.mooseframework.org
ComputeVariableIsotropicElasticityTensor.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 an isotropic elasticity tensor for elastic constants that "
15  "change as a function of material properties");
16  params.addRequiredParam<MaterialPropertyName>("youngs_modulus",
17  "Name of material defining the Young's Modulus");
18  params.addRequiredParam<MaterialPropertyName>("poissons_ratio",
19  "Name of material defining the Poisson's Ratio");
20  params.addRequiredCoupledVar(
21  "args", "Variable dependence for the Young's Modulus and Poisson's Ratio materials");
22  return params;
23 }
24 
26  const InputParameters & parameters)
27  : ComputeElasticityTensorBase(parameters),
28  _youngs_modulus(getMaterialProperty<Real>("youngs_modulus")),
29  _poissons_ratio(getMaterialProperty<Real>("poissons_ratio")),
30  _num_args(coupledComponents("args")),
31  _dyoungs_modulus(_num_args),
32  _d2youngs_modulus(_num_args),
33  _dpoissons_ratio(_num_args),
34  _d2poissons_ratio(_num_args),
35  _delasticity_tensor(_num_args),
36  _d2elasticity_tensor(_num_args),
37  _isotropic_elastic_constants(2)
38 {
39  // all tensors created by this class are always isotropic
41 
42  // fetch prerequisite derivatives and build elasticity tensor derivatives and cross-derivatives
43  for (unsigned int i = 0; i < _num_args; ++i)
44  {
45  const VariableName & iname = getVar("args", i)->name();
46  _dyoungs_modulus[i] = &getMaterialPropertyDerivative<Real>("youngs_modulus", iname);
47  _dpoissons_ratio[i] = &getMaterialPropertyDerivative<Real>("poissons_ratio", iname);
48 
50  &declarePropertyDerivative<RankFourTensor>(_elasticity_tensor_name, iname);
51 
52  _d2youngs_modulus[i].resize(_num_args);
53  _d2poissons_ratio[i].resize(_num_args);
54  _d2elasticity_tensor[i].resize(_num_args);
55 
56  for (unsigned int j = i; j < _num_args; ++j)
57  {
58  const VariableName & jname = getVar("args", j)->name();
59  _d2youngs_modulus[i][j] =
60  &getMaterialPropertyDerivative<Real>("youngs_modulus", iname, jname);
61  _d2poissons_ratio[i][j] =
62  &getMaterialPropertyDerivative<Real>("poissons_ratio", iname, jname);
63  _d2elasticity_tensor[i][j] =
64  &declarePropertyDerivative<RankFourTensor>(_elasticity_tensor_name, iname, jname);
65  }
66  }
67 }
68 
69 void
71 {
72  validateCoupling<Real>("youngs_modulus");
73  validateCoupling<Real>("poissons_ratio");
74  for (unsigned int i = 0; i < _num_args; ++i)
75  {
76  const VariableName & iname = getVar("args", i)->name();
77 
78  if (!_fe_problem.isMatPropRequested(propertyNameFirst(_elasticity_tensor_name, iname)))
79  _delasticity_tensor[i] = nullptr;
80 
81  for (unsigned int j = 0; j < _num_args; ++j)
82  {
83  const VariableName & jname = getVar("args", j)->name();
84  if (!_fe_problem.isMatPropRequested(
85  propertyNameSecond(_elasticity_tensor_name, iname, jname)))
86  _d2elasticity_tensor[i][j] = nullptr;
87  }
88  }
89 }
90 
91 void
93 {
94 }
95 
96 void
98 {
99  const Real E = _youngs_modulus[_qp];
100  const Real nu = _poissons_ratio[_qp];
101 
102  _elasticity_tensor[_qp].fillSymmetricIsotropicEandNu(E, nu);
103 
104  // Define derivatives of the elasticity tensor
105  for (unsigned int i = 0; i < _num_args; ++i)
106  {
107  if (_delasticity_tensor[i])
108  {
109  const Real dE = (*_dyoungs_modulus[i])[_qp];
110  const Real dnu = (*_dpoissons_ratio[i])[_qp];
111 
112  const Real dlambda = (E * dnu + dE * nu) / ((1.0 + nu) * (1.0 - 2.0 * nu)) -
113  E * nu * dnu / ((1.0 + nu) * (1.0 + nu) * (1.0 - 2.0 * nu)) +
114  2.0 * E * nu * dnu / ((1.0 + nu) * (1.0 - 2.0 * nu) * (1.0 - 2.0 * nu));
115  const Real dG = dE / (2.0 * (1.0 + nu)) - 2.0 * E * dnu / (4.0 * (1.0 + nu) * (1.0 + nu));
116 
117  (*_delasticity_tensor[i])[_qp].fillGeneralIsotropic(dlambda, dG, 0.0);
118  }
119 
120  for (unsigned int j = i; j < _num_args; ++j)
121  if (_d2elasticity_tensor[i][j])
122  {
123  const Real dEi = (*_dyoungs_modulus[i])[_qp];
124  const Real dnui = (*_dpoissons_ratio[i])[_qp];
125 
126  const Real dEj = (*_dyoungs_modulus[j])[_qp];
127  const Real dnuj = (*_dpoissons_ratio[j])[_qp];
128 
129  const Real d2E = (*_d2youngs_modulus[i][j])[_qp];
130  const Real d2nu = (*_d2poissons_ratio[i][j])[_qp];
131 
132  const Real d2lambda =
133  1.0 / ((1.0 + nu) * (2.0 * nu - 1.0)) *
134  (-E * d2nu - nu * d2E - dEi * dnuj - dEj * dnui +
135  (2.0 * E * d2nu * nu + 4.0 * dnui * dnuj * E + 2.0 * dEi * dnuj * nu +
136  2.0 * dEj * dnui * nu) /
137  (2.0 * nu - 1.0) -
138  8.0 * dnui * dnuj * E * nu / ((2.0 * nu - 1.0) * (2.0 * nu - 1.0)) +
139  (E * d2nu * nu + 2.0 * E * dnui * dnuj + dEi * dnuj * nu + dEj * dnui * nu) /
140  (nu + 1.0) -
141  4.0 * E * nu * dnui * dnuj / ((1.0 + nu) * (2.0 * nu - 1.0)) -
142  2.0 * E * dnui * dnuj * nu / ((nu + 1.0) * (nu + 1.0)));
143  const Real d2G = 1.0 / (nu + 1.0) *
144  (0.5 * d2E - (E * d2nu + dEi * dnuj + dEj * dnui) / (2.0 * nu + 2.0) +
145  dnui * dnuj * E / ((nu + 1.0) * (nu + 1.0)));
146 
147  (*_d2elasticity_tensor[i][j])[_qp].fillGeneralIsotropic(d2lambda, d2G, 0.0);
148  }
149  }
150 }
const MaterialProperty< Real > & _youngs_modulus
Material defininig the Young&#39;s Modulus.
std::vector< std::vector< const MaterialProperty< Real > * > > _d2poissons_ratio
second derivatives of the Poisson&#39;s Ratio with respect to the args
const MaterialProperty< Real > & _poissons_ratio
Material defininig the Poisson&#39;s Ratio.
ComputeElasticityTensorBase the base class for computing elasticity tensors.
void issueGuarantee(const MaterialPropertyName &prop_name, Guarantee guarantee)
InputParameters validParams< ComputeVariableIsotropicElasticityTensor >()
std::vector< std::vector< MaterialProperty< RankFourTensor > * > > _d2elasticity_tensor
second derivatives of the elasticity tensor with respect to the args
const unsigned int _num_args
number of variables the moduli depend on
std::vector< const MaterialProperty< Real > * > _dpoissons_ratio
first derivatives of the Poisson&#39;s Ratio with respect to the args
ComputeVariableIsotropicElasticityTensor(const InputParameters &parameters)
InputParameters validParams< ComputeElasticityTensorBase >()
std::vector< MaterialProperty< RankFourTensor > * > _delasticity_tensor
first derivatives of the elasticity tensor with respect to the args
std::vector< std::vector< const MaterialProperty< Real > * > > _d2youngs_modulus
second derivatives of the Young&#39;s Modulus with respect to the args
std::vector< const MaterialProperty< Real > * > _dyoungs_modulus
first derivatives of the Young&#39;s Modulus with respect to the args
MaterialProperty< RankFourTensor > & _elasticity_tensor