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