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