www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ComputeEigenstrainFromInitialStress Class Reference

ComputeEigenstrain computes an Eigenstrain that results from an initial stress. More...

#include <ComputeEigenstrainFromInitialStress.h>

Inheritance diagram for ComputeEigenstrainFromInitialStress:
[legend]

Public Member Functions

 ComputeEigenstrainFromInitialStress (const InputParameters &parameters)
 

Protected Member Functions

virtual void computeQpEigenstrain () override
 Compute the eigenstrain and store in _eigenstrain. More...
 
virtual void initQpStatefulProperties ()
 
virtual void computeQpProperties ()
 
Real computeVolumetricStrainComponent (const Real volumetric_strain) const
 Helper function for models that compute the eigenstrain based on a volumetric strain. More...
 

Protected Attributes

const std::string _base_name
 base_name for elasticity tensor to use to convert stress to strain More...
 
const MaterialProperty< RankFourTensor > & _elasticity_tensor
 elasticity tensor used to convert stress to strain More...
 
const MaterialProperty< RankTwoTensor > & _eigenstrain_old
 Stores the total eigenstrain in the previous step. More...
 
std::vector< Function * > _initial_stress_fcn
 initial stress components More...
 
std::string _eigenstrain_name
 Material property name for the eigenstrain tensor. More...
 
MaterialProperty< RankTwoTensor > & _eigenstrain
 Stores the current total eigenstrain. More...
 
bool & _step_zero
 Restartable data to check for the zeroth and first time steps for thermal calculations. More...
 

Detailed Description

ComputeEigenstrain computes an Eigenstrain that results from an initial stress.

Definition at line 24 of file ComputeEigenstrainFromInitialStress.h.

Constructor & Destructor Documentation

◆ ComputeEigenstrainFromInitialStress()

ComputeEigenstrainFromInitialStress::ComputeEigenstrainFromInitialStress ( const InputParameters &  parameters)

Definition at line 36 of file ComputeEigenstrainFromInitialStress.C.

38  : ComputeEigenstrainBase(parameters),
39  _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
40  _elasticity_tensor(getMaterialPropertyByName<RankFourTensor>(_base_name + "elasticity_tensor")),
41  _eigenstrain_old(getMaterialPropertyOld<RankTwoTensor>(_eigenstrain_name))
42 {
43  const std::vector<FunctionName> & fcn_names(
44  getParam<std::vector<FunctionName>>("initial_stress"));
45  const unsigned num = fcn_names.size();
46 
47  if (num != LIBMESH_DIM * LIBMESH_DIM)
48  mooseError("ComputeEigenstrainFromInitialStress: ",
49  LIBMESH_DIM * LIBMESH_DIM,
50  " initial stress functions must be provided. You supplied ",
51  num,
52  "\n");
53 
54  _initial_stress_fcn.resize(num);
55  for (unsigned i = 0; i < num; ++i)
56  _initial_stress_fcn[i] = &getFunctionByName(fcn_names[i]);
57 }
std::vector< Function * > _initial_stress_fcn
initial stress components
std::string _eigenstrain_name
Material property name for the eigenstrain tensor.
const std::string _base_name
base_name for elasticity tensor to use to convert stress to strain
ComputeEigenstrainBase(const InputParameters &parameters)
const MaterialProperty< RankTwoTensor > & _eigenstrain_old
Stores the total eigenstrain in the previous step.
const MaterialProperty< RankFourTensor > & _elasticity_tensor
elasticity tensor used to convert stress to strain

Member Function Documentation

◆ computeQpEigenstrain()

void ComputeEigenstrainFromInitialStress::computeQpEigenstrain ( )
overrideprotectedvirtual

Compute the eigenstrain and store in _eigenstrain.

Implements ComputeEigenstrainBase.

Definition at line 60 of file ComputeEigenstrainFromInitialStress.C.

61 {
62  if (_t_step == 1)
63  {
64  RankTwoTensor initial_stress;
65  for (unsigned i = 0; i < LIBMESH_DIM; ++i)
66  for (unsigned j = 0; j < LIBMESH_DIM; ++j)
67  initial_stress(i, j) = _initial_stress_fcn[i * LIBMESH_DIM + j]->value(_t, _q_point[_qp]);
68 
69  _eigenstrain[_qp] = -_elasticity_tensor[_qp].invSymm() * initial_stress;
70  }
71  else
72  _eigenstrain[_qp] = _eigenstrain_old[_qp];
73 }
std::vector< Function * > _initial_stress_fcn
initial stress components
MaterialProperty< RankTwoTensor > & _eigenstrain
Stores the current total eigenstrain.
const MaterialProperty< RankTwoTensor > & _eigenstrain_old
Stores the total eigenstrain in the previous step.
const MaterialProperty< RankFourTensor > & _elasticity_tensor
elasticity tensor used to convert stress to strain

◆ computeQpProperties()

void ComputeEigenstrainBase::computeQpProperties ( )
protectedvirtualinherited

Definition at line 53 of file ComputeEigenstrainBase.C.

54 {
55  if (_t_step >= 1)
56  _step_zero = false;
57 
58  // Skip the eigenstrain calculation in step zero because no solution is computed during
59  // the zeroth step, hence computing the eigenstrain in the zeroth step would result in
60  // an incorrect calculation of mechanical_strain, which is stateful.
61  if (!_step_zero)
63 }
virtual void computeQpEigenstrain()=0
Compute the eigenstrain and store in _eigenstrain.
bool & _step_zero
Restartable data to check for the zeroth and first time steps for thermal calculations.

◆ computeVolumetricStrainComponent()

Real ComputeEigenstrainBase::computeVolumetricStrainComponent ( const Real  volumetric_strain) const
protectedinherited

Helper function for models that compute the eigenstrain based on a volumetric strain.

This function computes the diagonal components of the eigenstrain tensor as logarithmic strains.

Parameters
volumetric_strainThe current volumetric strain to be applied
Returns
Current strain in one direction due to volumetric strain, expressed as a logarithmic strain

Definition at line 66 of file ComputeEigenstrainBase.C.

67 {
68  // The engineering strain in a given direction is:
69  // epsilon_eng = cbrt(volumetric_strain + 1.0) - 1.0
70  //
71  // We need to provide this as a logarithmic strain to be consistent with the strain measure
72  // used for finite strain:
73  // epsilon_log = log(1.0 + epsilon_eng)
74  //
75  // This can be simplified down to a more direct form:
76  // epsilon_log = log(cbrt(volumetric_strain + 1.0))
77  // or:
78  // epsilon_log = (1/3) log(volumetric_strain + 1.0)
79 
80  return std::log(volumetric_strain + 1.0) / 3.0;
81 }

◆ initQpStatefulProperties()

void ComputeEigenstrainBase::initQpStatefulProperties ( )
protectedvirtualinherited

Reimplemented in ComputeReducedOrderEigenstrain.

Definition at line 45 of file ComputeEigenstrainBase.C.

46 {
47  // This property can be promoted to be stateful by other models that use it,
48  // so it needs to be initalized.
49  _eigenstrain[_qp].zero();
50 }
MaterialProperty< RankTwoTensor > & _eigenstrain
Stores the current total eigenstrain.

Member Data Documentation

◆ _base_name

const std::string ComputeEigenstrainFromInitialStress::_base_name
protected

base_name for elasticity tensor to use to convert stress to strain

Definition at line 33 of file ComputeEigenstrainFromInitialStress.h.

◆ _eigenstrain

MaterialProperty<RankTwoTensor>& ComputeEigenstrainBase::_eigenstrain
protectedinherited

◆ _eigenstrain_name

std::string ComputeEigenstrainBase::_eigenstrain_name
protectedinherited

Material property name for the eigenstrain tensor.

Definition at line 41 of file ComputeEigenstrainBase.h.

◆ _eigenstrain_old

const MaterialProperty<RankTwoTensor>& ComputeEigenstrainFromInitialStress::_eigenstrain_old
protected

Stores the total eigenstrain in the previous step.

Definition at line 39 of file ComputeEigenstrainFromInitialStress.h.

Referenced by computeQpEigenstrain().

◆ _elasticity_tensor

const MaterialProperty<RankFourTensor>& ComputeEigenstrainFromInitialStress::_elasticity_tensor
protected

elasticity tensor used to convert stress to strain

Definition at line 36 of file ComputeEigenstrainFromInitialStress.h.

Referenced by computeQpEigenstrain().

◆ _initial_stress_fcn

std::vector<Function *> ComputeEigenstrainFromInitialStress::_initial_stress_fcn
protected

initial stress components

Definition at line 42 of file ComputeEigenstrainFromInitialStress.h.

Referenced by ComputeEigenstrainFromInitialStress(), and computeQpEigenstrain().

◆ _step_zero

bool& ComputeEigenstrainBase::_step_zero
protectedinherited

Restartable data to check for the zeroth and first time steps for thermal calculations.

Definition at line 57 of file ComputeEigenstrainBase.h.

Referenced by ComputeEigenstrainBase::computeQpProperties().


The documentation for this class was generated from the following files: