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