www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ReturnMappingModel Class Referenceabstract

Base class for models that perform return mapping iterations to compute stress. More...

#include <ReturnMappingModel.h>

Inheritance diagram for ReturnMappingModel:
[legend]

Public Member Functions

 ReturnMappingModel (const InputParameters &parameters, const std::string inelastic_strain_name="")
 
virtual ~ReturnMappingModel ()
 
virtual void initQpStatefulProperties () override
 
virtual void computeStress (const Elem &current_elem, const SymmElasticityTensor &elasticityTensor, const SymmTensor &stress_old, SymmTensor &strain_increment, SymmTensor &stress_new) override
 
void computeStress (const Elem &current_elem, const SymmElasticityTensor &elasticityTensor, const SymmTensor &stress_old, SymmTensor &strain_increment, SymmTensor &stress_new, SymmTensor &inelastic_strain_increment)
 Compute stress by performing return mapping iterations. More...
 
virtual Real computeReferenceResidual (const Real effective_trial_stress, const Real scalar) override
 Compute a reference quantity to be used for checking relative convergence. More...
 
Real computeTimeStepLimit ()
 Compute the limiting value of the time step for this material. More...
 
void setQp (unsigned int qp)
 Sets the value of the variable _qp for inheriting classes. More...
 
virtual bool modifyStrainIncrement (const Elem &, SymmTensor &strain_increment, SymmTensor &d_strain_dT)
 
virtual bool updateElasticityTensor (SymmElasticityTensor &)
 
virtual bool applyThermalStrain (SymmTensor &strain_increment, SymmTensor &d_strain_dT)
 
void setMaxIts (unsigned int max_its)
 Functions for setting old default tolerances with legacy_return_mapping: More...
 
void setRelativeTolerance (Real relative_tolerance)
 
void setAbsoluteTolerance (Real absolute_tolerance)
 

Protected Member Functions

virtual void computeStressInitialize (Real, const SymmElasticityTensor &)
 Perform any necessary initialization before return mapping iterations. More...
 
virtual void computeStressFinalize (const SymmTensor &)
 Perform any necessary steps to finalize state after return mapping iterations. More...
 
void returnMappingSolve (const Real effective_trial_stress, Real &scalar, const ConsoleStream &console)
 Perform the return mapping iterations. More...
 
virtual Real maximumPermissibleValue (const Real effective_trial_stress) const
 Compute the maximum permissible value of the scalar. More...
 
virtual Real computeResidual (const Real effective_trial_stress, const Real scalar)=0
 Compute the residual for a predicted value of the scalar. More...
 
virtual Real computeDerivative (const Real effective_trial_stress, const Real scalar)=0
 Compute the derivative of the residual as a function of the scalar variable. More...
 
virtual void iterationFinalize (Real)
 Finalize internal state variables for a model for a given iteration. More...
 

Protected Attributes

Real _effective_strain_increment
 
Real _three_shear_modulus
 3 * shear modulus More...
 
MaterialProperty< Real > & _effective_inelastic_strain
 
const MaterialProperty< Real > & _effective_inelastic_strain_old
 
Real _max_inelastic_increment
 
const bool _has_temp
 
const VariableValue & _temperature
 
const VariableValue & _temperature_old
 
const Real _alpha
 
Function * _alpha_function
 
bool _has_stress_free_temp
 
Real _stress_free_temp
 
bool _mean_alpha_function
 
Real _ref_temp
 
bool _legacy_return_mapping
 Whether to use the legacy return mapping algorithm and compute residuals in the legacy manner. More...
 
bool _check_range
 Whether to check to see whether iterative solution is within admissible range, and set within that range if outside. More...
 
bool & _step_zero_cm
 Restartable data to check for the zeroth and first time steps. More...
 
bool & _step_one_cm
 

Detailed Description

Base class for models that perform return mapping iterations to compute stress.

This is for a single model to compute inelastic behavior. This class can be used directly as a standalone model for a single source of inelasticity. It can also be called from another model that combines together multiple inelastic models using Picard iterations.

Definition at line 20 of file ReturnMappingModel.h.

Constructor & Destructor Documentation

ReturnMappingModel::ReturnMappingModel ( const InputParameters &  parameters,
const std::string  inelastic_strain_name = "" 
)

Definition at line 24 of file ReturnMappingModel.C.

26  : ConstitutiveModel(parameters),
30  declareProperty<Real>("effective_" + inelastic_strain_name + "_strain")),
32  getMaterialPropertyOld<Real>("effective_" + inelastic_strain_name + "_strain")),
33  _max_inelastic_increment(parameters.get<Real>("max_inelastic_increment"))
34 {
35 }
SingleVariableReturnMappingSolution(const InputParameters &parameters)
MaterialProperty< Real > & _effective_inelastic_strain
ConstitutiveModel(const InputParameters &parameters)
const MaterialProperty< Real > & _effective_inelastic_strain_old
virtual ReturnMappingModel::~ReturnMappingModel ( )
inlinevirtual

Definition at line 25 of file ReturnMappingModel.h.

25 {}

Member Function Documentation

bool ConstitutiveModel::applyThermalStrain ( SymmTensor strain_increment,
SymmTensor d_strain_dT 
)
virtualinherited

Definition at line 103 of file ConstitutiveModel.C.

Referenced by ConstitutiveModel::modifyStrainIncrement(), and ConstitutiveModel::updateElasticityTensor().

104 {
105  if (_t_step >= 1)
106  _step_zero_cm = false;
107 
108  if (_t_step >= 2)
109  _step_one_cm = false;
110 
111  if (_has_temp && !_step_zero_cm)
112  {
113  Real inc_thermal_strain;
114  Real d_thermal_strain_d_temp;
115 
116  Real old_temp;
118  old_temp = _stress_free_temp;
119  else
120  old_temp = _temperature_old[_qp];
121 
122  Real current_temp = _temperature[_qp];
123 
124  Real delta_t = current_temp - old_temp;
125 
126  Real alpha = _alpha;
127 
128  if (_alpha_function)
129  {
130  Point p;
131  Real alpha_current_temp = _alpha_function->value(current_temp, p);
132  Real alpha_old_temp = _alpha_function->value(old_temp, p);
133  Real alpha_stress_free_temperature = _alpha_function->value(_stress_free_temp, p);
134 
136  {
137  Real small(1e-6);
138 
139  Real numerator = alpha_current_temp * (current_temp - _ref_temp) -
140  alpha_old_temp * (old_temp - _ref_temp);
141  Real denominator = 1.0 + alpha_stress_free_temperature * (_stress_free_temp - _ref_temp);
142  if (denominator < small)
143  mooseError("Denominator too small in thermal strain calculation");
144  inc_thermal_strain = numerator / denominator;
145  d_thermal_strain_d_temp = alpha_current_temp * (current_temp - _ref_temp);
146  }
147  else
148  {
149  inc_thermal_strain = delta_t * 0.5 * (alpha_current_temp + alpha_old_temp);
150  d_thermal_strain_d_temp = alpha_current_temp;
151  }
152  }
153  else
154  {
155  inc_thermal_strain = delta_t * alpha;
156  d_thermal_strain_d_temp = alpha;
157  }
158 
159  strain_increment.addDiag(-inc_thermal_strain);
160  d_strain_dT.addDiag(-d_thermal_strain_d_temp);
161  }
162 
163  bool modified = true;
164  return modified;
165 }
const VariableValue & _temperature
Function * _alpha_function
bool & _step_zero_cm
Restartable data to check for the zeroth and first time steps.
void addDiag(Real value)
Definition: SymmTensor.h:279
const VariableValue & _temperature_old
virtual Real SingleVariableReturnMappingSolution::computeDerivative ( const Real  effective_trial_stress,
const Real  scalar 
)
protectedpure virtualinherited

Compute the derivative of the residual as a function of the scalar variable.

The residual should be in strain increment units for all models for consistency.

Parameters
effective_trial_stressEffective trial stress
scalarInelastic strain increment magnitude being solved for

Implemented in IsotropicPlasticityStressUpdate, PowerLawCreepStressUpdate, IsotropicPlasticity, CLSHPlasticModel, and PowerLawCreepModel.

Referenced by SingleVariableReturnMappingSolution::internalSolve(), SingleVariableReturnMappingSolution::internalSolveLegacy(), and SingleVariableReturnMappingSolution::setAbsoluteTolerance().

Real ReturnMappingModel::computeReferenceResidual ( const Real  effective_trial_stress,
const Real  scalar 
)
overridevirtual

Compute a reference quantity to be used for checking relative convergence.

This should be in strain increment units for all models for consistency.

Parameters
effective_trial_stressEffective trial stress
scalarInelastic strain increment magnitude being solved for

Implements SingleVariableReturnMappingSolution.

Definition at line 131 of file ReturnMappingModel.C.

Referenced by ~ReturnMappingModel().

132 {
133  return effective_trial_stress / _three_shear_modulus - scalar;
134 }
Real _three_shear_modulus
3 * shear modulus
virtual Real SingleVariableReturnMappingSolution::computeResidual ( const Real  effective_trial_stress,
const Real  scalar 
)
protectedpure virtualinherited

Compute the residual for a predicted value of the scalar.

This residual should be in strain increment units for all models for consistency.

Parameters
effective_trial_stressEffective trial stress
scalarInelastic strain increment magnitude being solved for

Implemented in IsotropicPlasticityStressUpdate, PowerLawCreepStressUpdate, IsotropicPlasticity, CLSHPlasticModel, and PowerLawCreepModel.

Referenced by SingleVariableReturnMappingSolution::internalSolve(), SingleVariableReturnMappingSolution::internalSolveLegacy(), and SingleVariableReturnMappingSolution::setAbsoluteTolerance().

void ReturnMappingModel::computeStress ( const Elem &  current_elem,
const SymmElasticityTensor elasticityTensor,
const SymmTensor stress_old,
SymmTensor strain_increment,
SymmTensor stress_new 
)
overridevirtual

Reimplemented from ConstitutiveModel.

Definition at line 44 of file ReturnMappingModel.C.

Referenced by ~ReturnMappingModel().

49 {
50  // Given the stretching, compute the stress increment and add it to the old stress. Also update
51  // the creep strain
52  // stress = stressOld + stressIncrement
53  if (_t_step == 0 && !_app.isRestarting())
54  return;
55 
56  stress_new = elasticityTensor * strain_increment;
57  stress_new += stress_old;
58 
59  SymmTensor inelastic_strain_increment;
60  computeStress(current_elem,
61  elasticityTensor,
62  stress_old,
63  strain_increment,
64  stress_new,
65  inelastic_strain_increment);
66 }
virtual void computeStress(const Elem &current_elem, const SymmElasticityTensor &elasticityTensor, const SymmTensor &stress_old, SymmTensor &strain_increment, SymmTensor &stress_new) override
void ReturnMappingModel::computeStress ( const Elem &  current_elem,
const SymmElasticityTensor elasticityTensor,
const SymmTensor stress_old,
SymmTensor strain_increment,
SymmTensor stress_new,
SymmTensor inelastic_strain_increment 
)

Compute stress by performing return mapping iterations.

This can be called either from within this model, or by an external model that combines multiple inelastic models.

Parameters
current_elemCurrent element
elasticityTensorElasticity tensor
stress_oldOld state of stress
strain_incrementStrain increment
stress_newNew state of stress
inelastic_strain_incrementInelastic strain increment

Definition at line 69 of file ReturnMappingModel.C.

75 {
76  // compute deviatoric trial stress
77  SymmTensor dev_trial_stress(stress_new);
78  dev_trial_stress.addDiag(-dev_trial_stress.trace() / 3.0);
79 
80  // compute effective trial stress
81  Real dts_squared = dev_trial_stress.doubleContraction(dev_trial_stress);
82  Real effective_trial_stress = std::sqrt(1.5 * dts_squared);
83 
84  // compute effective strain increment
85  SymmTensor dev_strain_increment(strain_increment);
86  dev_strain_increment.addDiag(-strain_increment.trace() / 3.0);
87  _effective_strain_increment = dev_strain_increment.doubleContraction(dev_strain_increment);
89 
90  const SymmIsotropicElasticityTensor * iso_e_t =
91  dynamic_cast<const SymmIsotropicElasticityTensor *>(&elasticityTensor);
92  if (!iso_e_t)
93  mooseError("Models derived from ReturnMappingModel require a SymmIsotropicElasticityTensor");
94  _three_shear_modulus = 3.0 * iso_e_t->shearModulus();
95 
96  computeStressInitialize(effective_trial_stress, elasticityTensor);
97 
98  Real scalar;
99  returnMappingSolve(effective_trial_stress, scalar, _console);
100 
101  // compute inelastic and elastic strain increments
103  {
104  if (effective_trial_stress < 0.01)
105  effective_trial_stress = 0.01;
106 
107  inelastic_strain_increment = dev_trial_stress;
108  inelastic_strain_increment *= (1.5 * scalar / effective_trial_stress);
109  }
110  else
111  {
112  if (scalar != 0.0)
113  inelastic_strain_increment = dev_trial_stress * (1.5 * scalar / effective_trial_stress);
114  else
115  inelastic_strain_increment = 0.0;
116  }
117 
118  strain_increment -= inelastic_strain_increment;
120 
121  // compute stress increment
122  stress_new = elasticityTensor * strain_increment;
123 
124  // update stress
125  stress_new += stress_old;
126 
127  computeStressFinalize(inelastic_strain_increment);
128 }
MaterialProperty< Real > & _effective_inelastic_strain
bool _legacy_return_mapping
Whether to use the legacy return mapping algorithm and compute residuals in the legacy manner...
Real _three_shear_modulus
3 * shear modulus
void returnMappingSolve(const Real effective_trial_stress, Real &scalar, const ConsoleStream &console)
Perform the return mapping iterations.
Real trace() const
Definition: SymmTensor.h:95
virtual void computeStressInitialize(Real, const SymmElasticityTensor &)
Perform any necessary initialization before return mapping iterations.
const MaterialProperty< Real > & _effective_inelastic_strain_old
virtual void computeStressFinalize(const SymmTensor &)
Perform any necessary steps to finalize state after return mapping iterations.
Real shearModulus() const
Return the shear modulus...
Defines an Isotropic Elasticity Tensor.
virtual void ReturnMappingModel::computeStressFinalize ( const SymmTensor )
inlineprotectedvirtual

Perform any necessary steps to finalize state after return mapping iterations.

Parameters
inelasticStrainIncrementInelastic strain increment

Reimplemented in CLSHPlasticModel, IsotropicPlasticity, and PowerLawCreepModel.

Definition at line 76 of file ReturnMappingModel.h.

Referenced by computeStress().

76 {}
virtual void ReturnMappingModel::computeStressInitialize ( Real  ,
const SymmElasticityTensor  
)
inlineprotectedvirtual

Perform any necessary initialization before return mapping iterations.

Parameters
effectiveTrialStressEffective trial stress
elasticityTensorElasticity tensor

Reimplemented in IsotropicPlasticity, IsotropicPowerLawHardening, CLSHPlasticModel, IsotropicTempDepHardening, and PowerLawCreepModel.

Definition at line 67 of file ReturnMappingModel.h.

Referenced by computeStress().

69  {
70  }
Real ReturnMappingModel::computeTimeStepLimit ( )

Compute the limiting value of the time step for this material.

Returns
Limiting time step

Definition at line 137 of file ReturnMappingModel.C.

Referenced by ~ReturnMappingModel().

138 {
139  Real scalar_inelastic_strain_incr;
140 
141  scalar_inelastic_strain_incr =
143  if (MooseUtils::absoluteFuzzyEqual(scalar_inelastic_strain_incr, 0.0))
144  return std::numeric_limits<Real>::max();
145 
146  return _dt * _max_inelastic_increment / scalar_inelastic_strain_incr;
147 }
MaterialProperty< Real > & _effective_inelastic_strain
const MaterialProperty< Real > & _effective_inelastic_strain_old
void ReturnMappingModel::initQpStatefulProperties ( )
overridevirtual
virtual void SingleVariableReturnMappingSolution::iterationFinalize ( Real  )
inlineprotectedvirtualinherited

Finalize internal state variables for a model for a given iteration.

Parameters
scalarInelastic strain increment magnitude being solved for

Reimplemented in IsotropicPlasticityStressUpdate, IsotropicPlasticity, and CLSHPlasticModel.

Definition at line 79 of file SingleVariableReturnMappingSolution.h.

Referenced by SingleVariableReturnMappingSolution::internalSolve(), and SingleVariableReturnMappingSolution::internalSolveLegacy().

79 {}
Real SingleVariableReturnMappingSolution::maximumPermissibleValue ( const Real  effective_trial_stress) const
protectedvirtualinherited

Compute the maximum permissible value of the scalar.

For some models, the magnitude of this may be known.

Parameters
effective_trial_stressEffective trial stress

Reimplemented in RadialReturnStressUpdate.

Definition at line 84 of file SingleVariableReturnMappingSolution.C.

Referenced by SingleVariableReturnMappingSolution::internalSolve(), and SingleVariableReturnMappingSolution::setAbsoluteTolerance().

86 {
87  return std::numeric_limits<Real>::max();
88 }
virtual bool ConstitutiveModel::modifyStrainIncrement ( const Elem &  ,
SymmTensor strain_increment,
SymmTensor d_strain_dT 
)
inlinevirtualinherited

Reimplemented in CombinedCreepPlasticity.

Definition at line 34 of file ConstitutiveModel.h.

37  {
38  return applyThermalStrain(strain_increment, d_strain_dT);
39  }
virtual bool applyThermalStrain(SymmTensor &strain_increment, SymmTensor &d_strain_dT)
void SingleVariableReturnMappingSolution::returnMappingSolve ( const Real  effective_trial_stress,
Real &  scalar,
const ConsoleStream &  console 
)
protectedinherited

Perform the return mapping iterations.

Parameters
effective_trial_stressEffective trial stress
scalarInelastic strain increment magnitude being solved for
consoleConsole output

Definition at line 91 of file SingleVariableReturnMappingSolution.C.

Referenced by computeStress(), SingleVariableReturnMappingSolution::setAbsoluteTolerance(), and RadialReturnStressUpdate::updateState().

94 {
95  std::stringstream iter_output;
96  std::stringstream * iter_output_ptr = (_output_iteration_info ? &iter_output : nullptr);
97 
99  {
100  if (!internalSolve(effective_trial_stress, scalar, iter_output_ptr))
101  {
102  if (iter_output_ptr)
103  mooseError(iter_output_ptr->str());
104  else
105  {
106  internalSolve(effective_trial_stress, scalar, &iter_output);
107  mooseError(iter_output.str());
108  }
109  }
110  else if (iter_output_ptr)
111  console << iter_output_ptr->str();
112  }
113  else
114  {
115  if (!internalSolveLegacy(effective_trial_stress, scalar, iter_output_ptr))
116  {
117  if (iter_output_ptr)
118  mooseError(iter_output_ptr->str());
119  else
120  {
121  internalSolveLegacy(effective_trial_stress, scalar, &iter_output);
122  mooseError(iter_output.str());
123  }
124  }
125  else if (iter_output_ptr)
126  console << iter_output_ptr->str();
127  }
128 }
bool internalSolveLegacy(const Real effective_trial_stress, Real &scalar, std::stringstream *iter_output)
Method called from within this class to perform the actual return mappping iterations.
bool internalSolve(const Real effective_trial_stress, Real &scalar, std::stringstream *iter_output)
Method called from within this class to perform the actual return mappping iterations.
bool _legacy_return_mapping
Whether to use the legacy return mapping algorithm and compute residuals in the legacy manner...
const bool _output_iteration_info
Whether to output iteration information all the time (regardless of whether iterations converge) ...
void SingleVariableReturnMappingSolution::setAbsoluteTolerance ( Real  absolute_tolerance)
inlineinherited

Definition at line 31 of file SingleVariableReturnMappingSolution.h.

31 { _absolute_tolerance = absolute_tolerance; }
Real _absolute_tolerance
Absolute convergence tolerance.
void SingleVariableReturnMappingSolution::setMaxIts ( unsigned int  max_its)
inlineinherited

Functions for setting old default tolerances with legacy_return_mapping:

Definition at line 29 of file SingleVariableReturnMappingSolution.h.

29 { _max_its = max_its; }
unsigned int _max_its
Maximum number of return mapping iterations (used only in legacy return mapping)
void ConstitutiveModel::setQp ( unsigned int  qp)
inherited

Sets the value of the variable _qp for inheriting classes.

Definition at line 86 of file ConstitutiveModel.C.

Referenced by CombinedCreepPlasticity::computeStress(), and ConstitutiveModel::~ConstitutiveModel().

87 {
88  _qp = qp;
89 }
void SingleVariableReturnMappingSolution::setRelativeTolerance ( Real  relative_tolerance)
inlineinherited

Definition at line 30 of file SingleVariableReturnMappingSolution.h.

30 { _relative_tolerance = relative_tolerance; }
Real _relative_tolerance
Relative convergence tolerance.
virtual bool ConstitutiveModel::updateElasticityTensor ( SymmElasticityTensor )
inlinevirtualinherited

Definition at line 40 of file ConstitutiveModel.h.

40 { return false; }

Member Data Documentation

const Real ConstitutiveModel::_alpha
protectedinherited

Definition at line 48 of file ConstitutiveModel.h.

Referenced by ConstitutiveModel::applyThermalStrain().

Function* ConstitutiveModel::_alpha_function
protectedinherited
bool SingleVariableReturnMappingSolution::_check_range
protectedinherited

Whether to check to see whether iterative solution is within admissible range, and set within that range if outside.

Definition at line 86 of file SingleVariableReturnMappingSolution.h.

Referenced by SingleVariableReturnMappingSolution::internalSolve(), and SingleVariableReturnMappingSolution::SingleVariableReturnMappingSolution().

MaterialProperty<Real>& ReturnMappingModel::_effective_inelastic_strain
protected
const MaterialProperty<Real>& ReturnMappingModel::_effective_inelastic_strain_old
protected
Real ReturnMappingModel::_effective_strain_increment
protected

Definition at line 78 of file ReturnMappingModel.h.

Referenced by computeStress().

bool ConstitutiveModel::_has_stress_free_temp
protectedinherited

Definition at line 50 of file ConstitutiveModel.h.

Referenced by ConstitutiveModel::applyThermalStrain().

const bool ConstitutiveModel::_has_temp
protectedinherited
bool SingleVariableReturnMappingSolution::_legacy_return_mapping
protectedinherited
Real ReturnMappingModel::_max_inelastic_increment
protected

Definition at line 85 of file ReturnMappingModel.h.

Referenced by computeTimeStepLimit().

bool ConstitutiveModel::_mean_alpha_function
protectedinherited
Real ConstitutiveModel::_ref_temp
protectedinherited
bool& ConstitutiveModel::_step_one_cm
protectedinherited

Definition at line 57 of file ConstitutiveModel.h.

Referenced by ConstitutiveModel::applyThermalStrain().

bool& ConstitutiveModel::_step_zero_cm
protectedinherited

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

Definition at line 56 of file ConstitutiveModel.h.

Referenced by ConstitutiveModel::applyThermalStrain().

Real ConstitutiveModel::_stress_free_temp
protectedinherited

Definition at line 51 of file ConstitutiveModel.h.

Referenced by ConstitutiveModel::applyThermalStrain().

const VariableValue& ConstitutiveModel::_temperature
protectedinherited
const VariableValue& ConstitutiveModel::_temperature_old
protectedinherited

Definition at line 47 of file ConstitutiveModel.h.

Referenced by ConstitutiveModel::applyThermalStrain().

Real ReturnMappingModel::_three_shear_modulus
protected

3 * shear modulus

Definition at line 81 of file ReturnMappingModel.h.

Referenced by computeReferenceResidual(), and computeStress().


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