www.mooseframework.org
ADComputeEigenstrainBase.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 
12 #include "RankTwoTensor.h"
13 
15 
16 template <ComputeStage compute_stage>
17 InputParameters
19 {
20  InputParameters params = ADMaterial<compute_stage>::validParams();
21  params.addParam<std::string>("base_name",
22  "Optional parameter that allows the user to define "
23  "multiple mechanics material systems on the same "
24  "block, i.e. for multiple phases");
25  params.addRequiredParam<std::string>("eigenstrain_name",
26  "Material property name for the eigenstrain tensor computed "
27  "by this model. IMPORTANT: The name of this property must "
28  "also be provided to the strain calculator.");
29  params.addDeprecatedParam<bool>(
30  "incremental_form",
31  false,
32  "Should the eigenstrain be in incremental form (for incremental models)?",
33  "This parameter no longer has any effect. Simply remove it.");
34  return params;
35 }
36 
37 template <ComputeStage compute_stage>
39  const InputParameters & parameters)
40  : ADMaterial<compute_stage>(parameters),
41  _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
42  _eigenstrain_name(_base_name + getParam<std::string>("eigenstrain_name")),
43  _eigenstrain(declareADProperty<RankTwoTensor>(_eigenstrain_name)),
44  _step_zero(declareRestartableData<bool>("step_zero", true))
45 {
46 }
47 
48 template <ComputeStage compute_stage>
49 void
51 {
52  // This property can be promoted to be stateful by other models that use it,
53  // so it needs to be initalized.
54  _eigenstrain[_qp].zero();
55 }
56 
57 template <ComputeStage compute_stage>
58 void
60 {
61  if (_t_step >= 1)
62  _step_zero = false;
63 
64  // Skip the eigenstrain calculation in step zero because no solution is computed during
65  // the zeroth step, hence computing the eigenstrain in the zeroth step would result in
66  // an incorrect calculation of mechanical_strain, which is stateful.
67  if (!_step_zero)
68  computeQpEigenstrain();
69 }
70 
71 template <ComputeStage compute_stage>
72 ADReal
74  const ADReal volumetric_strain) const
75 {
76  // The engineering strain in a given direction is:
77  // epsilon_eng = cbrt(volumetric_strain + 1.0) - 1.0
78  //
79  // We need to provide this as a logarithmic strain to be consistent with the strain measure
80  // used for finite strain:
81  // epsilon_log = log(1.0 + epsilon_eng)
82  //
83  // This can be simplified down to a more direct form:
84  // epsilon_log = log(cbrt(volumetric_strain + 1.0))
85  // or:
86  // epsilon_log = (1/3) log(volumetric_strain + 1.0)
87 
88  return std::log(volumetric_strain + 1.0) / 3.0;
89 }
90 
ADComputeEigenstrainBase
ADComputeEigenstrainBase is the base class for eigenstrain tensors.
Definition: ADComputeEigenstrainBase.h:21
ADComputeEigenstrainBase::computeVolumetricStrainComponent
ADReal computeVolumetricStrainComponent(const ADReal volumetric_strain) const
Helper function for models that compute the eigenstrain based on a volumetric strain.
Definition: ADComputeEigenstrainBase.C:73
ADComputeEigenstrainBase::initQpStatefulProperties
virtual void initQpStatefulProperties() override
Definition: ADComputeEigenstrainBase.C:50
ADComputeEigenstrainBase::validParams
static InputParameters validParams()
Definition: ADComputeEigenstrainBase.C:18
validParams
InputParameters validParams()
ADComputeEigenstrainBase::ADComputeEigenstrainBase
ADComputeEigenstrainBase(const InputParameters &parameters)
Definition: ADComputeEigenstrainBase.C:38
defineADLegacyParams
defineADLegacyParams(ADComputeEigenstrainBase)
ADComputeEigenstrainBase.h
adBaseClass
adBaseClass(ADComputeEigenstrainBase)
RankTwoTensorTempl< Real >
ADComputeEigenstrainBase::computeQpProperties
virtual void computeQpProperties() override
Definition: ADComputeEigenstrainBase.C:59