https://mooseframework.inl.gov
ComputeCrystalPlasticityThermalEigenstrain.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("SolidMechanicsApp", ComputeCrystalPlasticityThermalEigenstrain);
13 
16 {
18  params.addClassDescription("Computes the deformation gradient associated with the linear thermal "
19  "expansion in a crystal plasticity simulation");
20  params.addCoupledVar("temperature", "Coupled temperature variable");
21 
22  // Let's check the range of the parameter here
23  params.addRequiredRangeCheckedParam<std::vector<Real>>(
24  "thermal_expansion_coefficients",
25  "thermal_expansion_coefficients_size=1 | thermal_expansion_coefficients_size=3 | "
26  "thermal_expansion_coefficients_size=6 | thermal_expansion_coefficients_size=9",
27  "Vector of values defining the constant second order thermal expansion coefficients, "
28  "depending on the degree of anisotropy, this should be of size 1, 3, 6 or 9");
29 
30  return params;
31 }
32 
33 ComputeCrystalPlasticityThermalEigenstrain::ComputeCrystalPlasticityThermalEigenstrain(
34  const InputParameters & parameters)
36  _temperature(coupledValue("temperature")),
37  _temperature_old(coupledValueOld("temperature")),
38  _ddeformation_gradient_dT(isCoupledConstant("temperature")
39  ? nullptr
40  : &declarePropertyDerivative<RankTwoTensor>(
41  _deformation_gradient_name, coupledName("temperature", 0))),
42  _thermal_expansion_coefficients(getParam<std::vector<Real>>("thermal_expansion_coefficients")),
43  _lattice_thermal_expansion_coefficients(declareProperty<RankTwoTensor>(
44  _eigenstrain_name +
45  "_lattice_thermal_expansion_coefficients")) // avoid duplicated material name by including
46  // the eigenstrain name this coeff corresponds
47  // to
48 {
49 }
50 
51 void
52 ComputeCrystalPlasticityThermalEigenstrain::computeQpDeformationGradient()
53 {
54  // rotate the thermal deformation gradient for crystals based on Euler angles
55  _lattice_thermal_expansion_coefficients[_qp] =
56  _thermal_expansion_coefficients.rotated(_crysrot[_qp]);
57 
58  // compute the deformation gradient due to thermal expansion
59  Real dtheta = (_temperature[_qp] - _temperature_old[_qp]) * _substep_dt / _dt;
60  RankTwoTensor residual_equivalent_thermal_expansion_increment =
61  RankTwoTensor::Identity() - dtheta * _lattice_thermal_expansion_coefficients[_qp];
62  _deformation_gradient[_qp] =
63  residual_equivalent_thermal_expansion_increment.inverse() * _deformation_gradient_old[_qp];
64 
65  // compute the derivative of deformation gradient w.r.t temperature
66  if (_ddeformation_gradient_dT)
67  (*_ddeformation_gradient_dT)[_qp] =
68  _lattice_thermal_expansion_coefficients[_qp] * _deformation_gradient[_qp];
69 }
RankTwoTensorTempl< Real > inverse() const
void addRequiredRangeCheckedParam(const std::string &name, const std::string &parsed_function, const std::string &doc_string)
ComputeCrystalPlasticityEigenstrainBase is the base class for computing eigenstrain tensors in crysta...
static RankTwoTensorTempl Identity()
InputParameters validParams()
void addCoupledVar(const std::string &name, const std::string &doc_string)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
registerMooseObject("SolidMechanicsApp", ComputeCrystalPlasticityThermalEigenstrain)