www.mooseframework.org
Public Member Functions | Static 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 The initial stress is defined in terms of Functions, which may be multiplied by optional AuxVariables. More...

#include <ComputeEigenstrainFromInitialStress.h>

Inheritance diagram for ComputeEigenstrainFromInitialStress:
[legend]

Public Member Functions

 ComputeEigenstrainFromInitialStress (const InputParameters &parameters)
 

Static Public Member Functions

static InputParameters validParams ()
 

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...
 
const bool _ini_aux_provided
 Whether the user has supplied AuxVariables representing the initial stress. More...
 
std::vector< const Function * > _initial_stress_fcn
 initial stress components More...
 
std::vector< const VariableValue * > _ini_aux
 AuxVariables defining the initial stress. 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 The initial stress is defined in terms of Functions, which may be multiplied by optional AuxVariables.

Definition at line 25 of file ComputeEigenstrainFromInitialStress.h.

Constructor & Destructor Documentation

◆ ComputeEigenstrainFromInitialStress()

ComputeEigenstrainFromInitialStress::ComputeEigenstrainFromInitialStress ( const InputParameters &  parameters)

Definition at line 42 of file ComputeEigenstrainFromInitialStress.C.

44  : ComputeEigenstrainBase(parameters),
45  _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
46  _elasticity_tensor(getMaterialPropertyByName<RankFourTensor>(_base_name + "elasticity_tensor")),
47  _eigenstrain_old(getMaterialPropertyOld<RankTwoTensor>(_eigenstrain_name)),
48  _ini_aux_provided(isParamValid("initial_stress_aux"))
49 {
50  const std::vector<FunctionName> & fcn_names(
51  getParam<std::vector<FunctionName>>("initial_stress"));
52  const std::size_t num = fcn_names.size();
53 
54  if (num != LIBMESH_DIM * LIBMESH_DIM)
55  paramError(
56  "initial_stress",
57  "ComputeEigenstrainFromInitialStress: " + Moose::stringify(LIBMESH_DIM * LIBMESH_DIM) +
58  " initial stress functions must be provided. You supplied " + Moose::stringify(num) +
59  "\n");
60 
61  _initial_stress_fcn.resize(num);
62  for (unsigned i = 0; i < num; ++i)
63  _initial_stress_fcn[i] = &getFunctionByName(fcn_names[i]);
64 
66  {
67  const std::size_t aux_size = coupledComponents("initial_stress_aux");
68  if (aux_size != LIBMESH_DIM * LIBMESH_DIM)
69  paramError("initial_stress_aux",
70  "ComputeEigenstrainFromInitialStress: If you supply initial_stress_aux, " +
71  Moose::stringify(LIBMESH_DIM * LIBMESH_DIM) +
72  " values must be given. You supplied " + Moose::stringify(aux_size) + "\n");
73  _ini_aux.resize(0);
74  for (unsigned i = 0; i < aux_size; ++i)
75  _ini_aux.push_back(&coupledValue("initial_stress_aux", i));
76  }
77 }

Member Function Documentation

◆ computeQpEigenstrain()

void ComputeEigenstrainFromInitialStress::computeQpEigenstrain ( )
overrideprotectedvirtual

Compute the eigenstrain and store in _eigenstrain.

Implements ComputeEigenstrainBase.

Definition at line 80 of file ComputeEigenstrainFromInitialStress.C.

81 {
82  if (_t_step == 1)
83  {
84  RankTwoTensor initial_stress;
85  for (unsigned i = 0; i < LIBMESH_DIM; ++i)
86  for (unsigned j = 0; j < LIBMESH_DIM; ++j)
87  {
88  initial_stress(i, j) = _initial_stress_fcn[i * LIBMESH_DIM + j]->value(_t, _q_point[_qp]);
90  initial_stress(i, j) *= (*_ini_aux[i * LIBMESH_DIM + j])[_qp];
91  }
92 
93  _eigenstrain[_qp] = -_elasticity_tensor[_qp].invSymm() * initial_stress;
94  }
95  else
96  _eigenstrain[_qp] = _eigenstrain_old[_qp];
97 }

◆ computeQpProperties()

void ComputeEigenstrainBase::computeQpProperties ( )
protectedvirtualinherited

Definition at line 49 of file ComputeEigenstrainBase.C.

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 }

◆ 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 62 of file ComputeEigenstrainBase.C.

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 }

◆ initQpStatefulProperties()

void ComputeEigenstrainBase::initQpStatefulProperties ( )
protectedvirtualinherited

Reimplemented in ComputeReducedOrderEigenstrain.

Definition at line 41 of file ComputeEigenstrainBase.C.

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 }

◆ validParams()

InputParameters ComputeEigenstrainFromInitialStress::validParams ( )
static

Definition at line 20 of file ComputeEigenstrainFromInitialStress.C.

21 {
22  InputParameters params = ComputeEigenstrainBase::validParams();
23  params.addClassDescription("Computes an eigenstrain from an initial stress");
24  params.addRequiredParam<std::vector<FunctionName>>(
25  "initial_stress",
26  "A list of functions describing the initial stress. There must be 9 of these, corresponding "
27  "to the xx, yx, zx, xy, yy, zy, xz, yz, zz components respectively. To compute the "
28  "eigenstrain correctly, your elasticity tensor should not be time-varying in the first "
29  "timestep");
30  params.addCoupledVar("initial_stress_aux",
31  "A list of 9 AuxVariables describing the initial stress. If provided, each "
32  "of these is multiplied by its corresponding initial_stress function to "
33  "obtain the relevant component of initial stress.");
34  params.addParam<std::string>("base_name",
35  "The base_name for the elasticity tensor that will be "
36  "used to compute strain from stress. Do not provide "
37  "any base_name if your elasticity tensor does not use "
38  "one.");
39  return params;
40 }

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 36 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 44 of file ComputeEigenstrainBase.h.

◆ _eigenstrain_old

const MaterialProperty<RankTwoTensor>& ComputeEigenstrainFromInitialStress::_eigenstrain_old
protected

Stores the total eigenstrain in the previous step.

Definition at line 42 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 39 of file ComputeEigenstrainFromInitialStress.h.

Referenced by computeQpEigenstrain().

◆ _ini_aux

std::vector<const VariableValue *> ComputeEigenstrainFromInitialStress::_ini_aux
protected

AuxVariables defining the initial stress.

Definition at line 51 of file ComputeEigenstrainFromInitialStress.h.

Referenced by ComputeEigenstrainFromInitialStress(), and computeQpEigenstrain().

◆ _ini_aux_provided

const bool ComputeEigenstrainFromInitialStress::_ini_aux_provided
protected

Whether the user has supplied AuxVariables representing the initial stress.

Definition at line 45 of file ComputeEigenstrainFromInitialStress.h.

Referenced by ComputeEigenstrainFromInitialStress(), and computeQpEigenstrain().

◆ _initial_stress_fcn

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

initial stress components

Definition at line 48 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 60 of file ComputeEigenstrainBase.h.

Referenced by ComputeEigenstrainBase::computeQpProperties().


The documentation for this class was generated from the following files:
ComputeEigenstrainFromInitialStress::_ini_aux_provided
const bool _ini_aux_provided
Whether the user has supplied AuxVariables representing the initial stress.
Definition: ComputeEigenstrainFromInitialStress.h:45
ComputeEigenstrainBase::validParams
static InputParameters validParams()
Definition: ComputeEigenstrainBase.C:17
ComputeEigenstrainBase::ComputeEigenstrainBase
ComputeEigenstrainBase(const InputParameters &parameters)
Definition: ComputeEigenstrainBase.C:31
ComputeEigenstrainFromInitialStress::_initial_stress_fcn
std::vector< const Function * > _initial_stress_fcn
initial stress components
Definition: ComputeEigenstrainFromInitialStress.h:48
ComputeEigenstrainBase::_step_zero
bool & _step_zero
Restartable data to check for the zeroth and first time steps for thermal calculations.
Definition: ComputeEigenstrainBase.h:60
ComputeEigenstrainFromInitialStress::_ini_aux
std::vector< const VariableValue * > _ini_aux
AuxVariables defining the initial stress.
Definition: ComputeEigenstrainFromInitialStress.h:51
ComputeEigenstrainBase::computeQpEigenstrain
virtual void computeQpEigenstrain()=0
Compute the eigenstrain and store in _eigenstrain.
ComputeEigenstrainFromInitialStress::_base_name
const std::string _base_name
base_name for elasticity tensor to use to convert stress to strain
Definition: ComputeEigenstrainFromInitialStress.h:36
ComputeEigenstrainFromInitialStress::_eigenstrain_old
const MaterialProperty< RankTwoTensor > & _eigenstrain_old
Stores the total eigenstrain in the previous step.
Definition: ComputeEigenstrainFromInitialStress.h:42
ComputeEigenstrainBase::_eigenstrain_name
std::string _eigenstrain_name
Material property name for the eigenstrain tensor.
Definition: ComputeEigenstrainBase.h:44
RankTwoTensorTempl< Real >
ComputeEigenstrainBase::_eigenstrain
MaterialProperty< RankTwoTensor > & _eigenstrain
Stores the current total eigenstrain.
Definition: ComputeEigenstrainBase.h:47
ComputeEigenstrainFromInitialStress::_elasticity_tensor
const MaterialProperty< RankFourTensor > & _elasticity_tensor
elasticity tensor used to convert stress to strain
Definition: ComputeEigenstrainFromInitialStress.h:39