https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
ComputeMultipleCrystalPlasticityStress Class Reference

ComputeMultipleCrystalPlasticityStress (used together with CrystalPlasticityStressUpdateBase) uses the multiplicative decomposition of the deformation gradient and solves the PK2 stress residual equation at the intermediate configuration to evolve the material state. More...

#include <ComputeMultipleCrystalPlasticityStress.h>

Inheritance diagram for ComputeMultipleCrystalPlasticityStress:
[legend]

Public Types

typedef DerivativeMaterialPropertyNameInterface::SymbolName SymbolName
 

Public Member Functions

 ComputeMultipleCrystalPlasticityStress (const InputParameters &parameters)
 
virtual void initialSetup () override
 
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialProperty (const std::string &name)
 
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialPropertyByName (const std::string &name)
 
void validateDerivativeMaterialPropertyBase (const std::string &base)
 
const MaterialPropertyName derivativePropertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName derivativePropertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName derivativePropertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName derivativePropertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, unsigned int v2, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, unsigned int v1, unsigned int v2=libMesh::invalid_uint, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, unsigned int v2, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, unsigned int v1, unsigned int v2=libMesh::invalid_uint, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
void validateCoupling (const MaterialPropertyName &base, const std::vector< VariableName > &c, bool validate_aux=true)
 
void validateCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateCoupling (const MaterialPropertyName &base, const std::vector< VariableName > &c, bool validate_aux=true)
 
void validateCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateNonlinearCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateNonlinearCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Types

enum class  TangentModuliType { EXACT , NONE }
 Type of tangent moduli calculation. More...
 
enum class  LineSearchMethod { CutHalf , Bisection }
 strain formulation More...
 

Protected Member Functions

virtual void computeQpStress () override
 Compute the stress and store it in the _stress material property for the current quadrature point.
 
virtual void updateStress (RankTwoTensor &cauchy_stress, RankFourTensor &jacobian_mult)
 Updates the stress (PK2) at a quadrature point by calling constiutive relationship as defined in a child class Solves stress residual equation using Newton - Raphson: Updates slip system resistances iteratively.
 
virtual void initQpStatefulProperties () override
 initializes the stateful properties such as PK2 stress, resolved shear stress, plastic deformation gradient, slip system resistances, etc.
 
void calculateResidualAndJacobian ()
 Calls the residual and jacobian functions used in the stress update algorithm.
 
void preSolveQp ()
 Reset the PK2 stress and the inverse deformation gradient to old values and provide an interface for inheriting classes to reset material properties.
 
void solveQp ()
 Solve the stress and internal state variables (e.g.
 
void postSolveQp (RankTwoTensor &stress_new, RankFourTensor &jacobian_mult)
 Save the final stress and internal variable values after the iterative solve.
 
void solveStateVariables ()
 Solves the internal variables stress as a function of the slip specified by the constitutive model defined in the inheriting class.
 
void solveStress ()
 solves for stress, updates plastic deformation gradient.
 
void calculateResidual ()
 Calculate stress residual as the difference between the stored material property PK2 stress and the elastic PK2 stress calculated from the constitutively defined equivalent_slip_increment.
 
void calculateJacobian ()
 Calculates the jacobian as $\mathbf{J} = \mathbf{I} - \mathbf{C} \frac{d\mathbf{E}^e}{d\mathbf{F}^e} \frac{d\mathbf{F}^e}{d\mathbf{F}^P^{-1}} \frac{d\mathbf{F}^P^{-1}}{d\mathbf{PK2}}$.
 
bool lineSearchUpdate (const Real &rnorm_prev, const RankTwoTensor &dpk2)
 performs the line search update
 
void calculateEigenstrainDeformationGrad ()
 Calculates the deformation gradient due to eigenstrain.
 
virtual void computeQpProperties () override
 
bool hasGuaranteedMaterialProperty (const MaterialPropertyName &prop, Guarantee guarantee)
 
void calcTangentModuli (RankFourTensor &jacobian_mult)
 Calculates the tangent moduli for use as a preconditioner, using the elastic or elastic-plastic option as specified by the user.
 
void elasticTangentModuli (RankFourTensor &jacobian_mult)
 
void elastoPlasticTangentModuli (RankFourTensor &jacobian_mult)
 

Protected Attributes

const unsigned _num_models
 number of plastic models
 
std::vector< CrystalPlasticityStressUpdateBase * > _models
 The user supplied cyrstal plasticity consititutive models.
 
const unsigned _num_eigenstrains
 number of eigenstrains
 
std::vector< ComputeCrystalPlasticityEigenstrainBase * > _eigenstrains
 The user supplied cyrstal plasticity eigenstrains.
 
const std::string _base_name
 optional parameter to define several mechanical systems on the same block, e.g. multiple phases
 
const MaterialProperty< RankFourTensor > & _elasticity_tensor
 Elasticity tensor as defined by a separate class.
 
Real _rtol
 Stress residual equation relative tolerance.
 
Real _abs_tol
 Stress residual equation absolute tolerance.
 
RankTwoTensor _residual_tensor
 Residual tensor.
 
RankFourTensor _jacobian
 Jacobian tensor.
 
unsigned int _maxiter
 Maximum number of iterations for stress update.
 
unsigned int _maxiterg
 Maximum number of iterations for internal variable update.
 
enum ComputeMultipleCrystalPlasticityStress::TangentModuliType _tan_mod_type
 
unsigned int _max_substep_iter
 Maximum number of substep iterations.
 
Real _substep_dt
 time step size during substepping
 
bool _use_line_search
 Flag to activate line serach.
 
Real _min_line_search_step_size
 Minimum line search step size.
 
Real _line_search_tolerance
 Line search bisection method tolerance.
 
unsigned int _line_search_max_iterations
 Line search bisection method maximum iteration number.
 
enum ComputeMultipleCrystalPlasticityStress::LineSearchMethod _line_search_method
 
MaterialProperty< RankTwoTensor > & _total_lagrangian_strain
 Lagrangian total strain measure for the entire crystal.
 
MaterialProperty< RankTwoTensor > & _updated_rotation
 Tracks the rotation of the crystal during deformation Note: this rotation tensor is not applied to the crystal lattice.
 
const MaterialProperty< RankTwoTensor > & _updated_rotation_old
 
MaterialProperty< Real > & _misorientation
 Misorientation angle of the crystal during deformation.
 
const MaterialProperty< RankTwoTensor > & _crysrot
 Crystal rotation in the original, or reference, configuration as defined by Euler angle arguments in the ComputeElasticityTensor classes.
 
const bool _print_convergence_message
 Flag to print to console warning messages on stress, constitutive model convergence.
 
bool _convergence_failed
 Flag to check whether convergence is achieved or if substepping is needed.
 
Real _dfgrd_scale_factor
 Scales the substepping increment to obtain deformation gradient at a substep iteration.
 
const std::string _elasticity_tensor_name
 Name of the elasticity tensor material property.
 
MaterialProperty< RankTwoTensor > & _rotation_total
 Rotation up to current step "n" to compute anisotropic elasticity tensor.
 
const MaterialProperty< RankTwoTensor > & _rotation_total_old
 Rotation up to "n - 1" (previous) step to compute anisotropic elasticity tensor.
 
const MaterialProperty< RankTwoTensor > & _strain_increment
 Strain increment material property.
 
const MaterialProperty< RankTwoTensor > & _rotation_increment
 Rotation increment material property.
 
const MaterialProperty< RankTwoTensor > & _stress_old
 Old state of the stress tensor material property.
 
const MaterialProperty< RankTwoTensor > & _elastic_strain_old
 The old elastic strain is used to calculate the old stress in the case of variable elasticity tensors.
 
const MaterialProperty< RankTwoTensor > & _mechanical_strain
 Mechanical strain material property.
 
MaterialProperty< RankTwoTensor > & _stress
 Stress material property.
 
MaterialProperty< RankTwoTensor > & _elastic_strain
 Elastic strain material property.
 
const MaterialProperty< RankTwoTensor > & _extra_stress
 Extra stress tensor.
 
std::vector< const Function * > _initial_stress_fcn
 initial stress components
 
MaterialProperty< RankFourTensor > & _Jacobian_mult
 derivative of stress w.r.t. strain (_dstress_dstrain)
 
MaterialProperty< RankTwoTensor > & _plastic_deformation_gradient
 Plastic deformation gradient RankTwoTensor for the crystal.
 
const MaterialProperty< RankTwoTensor > & _plastic_deformation_gradient_old
 
MaterialProperty< RankTwoTensor > * _eigenstrain_deformation_gradient
 Generalized eigenstrain deformation gradient RankTwoTensor for the crystal.
 
const MaterialProperty< RankTwoTensor > * _eigenstrain_deformation_gradient_old
 
const MaterialProperty< RankTwoTensor > & _deformation_gradient
 Total deformation gradient RankTwoTensor for the crystal.
 
const MaterialProperty< RankTwoTensor > & _deformation_gradient_old
 
MaterialProperty< RankTwoTensor > & _pk2
 Second Piola-Kirchoff stress measure.
 
const MaterialProperty< RankTwoTensor > & _pk2_old
 
RankTwoTensor _temporary_deformation_gradient
 Helper deformation gradient tensor variables used in iterative solve.
 
RankTwoTensor _elastic_deformation_gradient
 
RankTwoTensor _inverse_plastic_deformation_grad
 
RankTwoTensor _inverse_plastic_deformation_grad_old
 
RankTwoTensor _inverse_eigenstrain_deformation_grad
 
RankTwoTensor _delta_deformation_gradient
 Used for substepping; Uniformly divides the increment in deformation gradient.
 
RankTwoTensor _temporary_deformation_gradient_old
 

Private Member Functions

bool haveMaterialProperty (const std::string &prop_name)
 
std::vector< VariableName > buildVariableVector (const VariableName &c1, const VariableName &c2, const VariableName &c3)
 
void validateCouplingHelper (const MaterialPropertyName &base, const std::vector< VariableName > &c, const System &system, std::vector< VariableName > &missing)
 
bool isNotObjectVariable (const VariableName &name)
 

Private Attributes

FEProblemBase_dmi_fe_problem
 
const InputParameters_gc_params
 Parameters of the object with this interface.
 
FEProblemBase *const _gc_feproblem
 Reference to the FEProblemBase class.
 
BlockRestrictable *const _gc_block_restrict
 Access block restrictions of the object with this interface.
 

Detailed Description

ComputeMultipleCrystalPlasticityStress (used together with CrystalPlasticityStressUpdateBase) uses the multiplicative decomposition of the deformation gradient and solves the PK2 stress residual equation at the intermediate configuration to evolve the material state.

The internal variables are updated using an iterative predictor-corrector algorithm. Backward Euler integration rule is used for the rate equations.

This material that is not called by MOOSE because of the compute=false flag set in the parameter list.

Definition at line 30 of file ComputeMultipleCrystalPlasticityStress.h.

Member Enumeration Documentation

◆ LineSearchMethod

strain formulation

Enumerator
CutHalf 
Bisection 

Definition at line 175 of file ComputeMultipleCrystalPlasticityStress.h.

◆ TangentModuliType

Type of tangent moduli calculation.

Enumerator
EXACT 
NONE 

Definition at line 154 of file ComputeMultipleCrystalPlasticityStress.h.

Constructor & Destructor Documentation

◆ ComputeMultipleCrystalPlasticityStress()

ComputeMultipleCrystalPlasticityStress::ComputeMultipleCrystalPlasticityStress ( const InputParameters parameters)

Definition at line 64 of file ComputeMultipleCrystalPlasticityStress.C.

67 _num_models(getParam<std::vector<MaterialName>>("crystal_plasticity_models").size()),
68 _num_eigenstrains(getParam<std::vector<MaterialName>>("eigenstrain_names").size()),
69 _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
70 _elasticity_tensor(getMaterialPropertyByName<RankFourTensor>(_base_name + "elasticity_tensor")),
71 _rtol(getParam<Real>("rtol")),
72 _abs_tol(getParam<Real>("abs_tol")),
73 _maxiter(getParam<unsigned int>("maxiter")),
74 _maxiterg(getParam<unsigned int>("maxiter_state_variable")),
75 _tan_mod_type(getParam<MooseEnum>("tan_mod_type").getEnum<TangentModuliType>()),
76 _max_substep_iter(getParam<unsigned int>("maximum_substep_iteration")),
77 _use_line_search(getParam<bool>("use_line_search")),
78 _min_line_search_step_size(getParam<Real>("min_line_search_step_size")),
79 _line_search_tolerance(getParam<Real>("line_search_tol")),
80 _line_search_max_iterations(getParam<unsigned int>("line_search_maxiter")),
81 _line_search_method(getParam<MooseEnum>("line_search_method").getEnum<LineSearchMethod>()),
82 _plastic_deformation_gradient(declareProperty<RankTwoTensor>("plastic_deformation_gradient")),
84 getMaterialPropertyOld<RankTwoTensor>("plastic_deformation_gradient")),
86 _num_eigenstrains ? &declareProperty<RankTwoTensor>("eigenstrain_deformation_gradient")
87 : nullptr),
90 ? &getMaterialPropertyOld<RankTwoTensor>("eigenstrain_deformation_gradient")
91 : nullptr),
92 _deformation_gradient(getMaterialProperty<RankTwoTensor>(_base_name + "deformation_gradient")),
94 getMaterialPropertyOld<RankTwoTensor>(_base_name + "deformation_gradient")),
95 _pk2(declareProperty<RankTwoTensor>("second_piola_kirchhoff_stress")),
96 _pk2_old(getMaterialPropertyOld<RankTwoTensor>("second_piola_kirchhoff_stress")),
98 declareProperty<RankTwoTensor>("total_lagrangian_strain")), // Lagrangian strain
99 _updated_rotation(declareProperty<RankTwoTensor>("updated_rotation")),
100 _updated_rotation_old(getMaterialPropertyOld<RankTwoTensor>("updated_rotation")),
101 _misorientation(declareProperty<Real>("misorientation")),
102 _crysrot(getMaterialProperty<RankTwoTensor>(
103 _base_name + "crysrot")), // defined in the elasticity tensor classes for crystal plasticity
104 _print_convergence_message(getParam<bool>("print_state_variable_convergence_error_messages"))
105{
106 _convergence_failed = false;
107}
void ErrorVector unsigned int
ComputeFiniteStrainElasticStress computes the stress following elasticity theory for finite strains.
const MaterialProperty< RankTwoTensor > & _crysrot
Crystal rotation in the original, or reference, configuration as defined by Euler angle arguments in ...
const MaterialProperty< RankTwoTensor > & _deformation_gradient
Total deformation gradient RankTwoTensor for the crystal.
Real _abs_tol
Stress residual equation absolute tolerance.
unsigned int _maxiter
Maximum number of iterations for stress update.
MaterialProperty< RankTwoTensor > & _plastic_deformation_gradient
Plastic deformation gradient RankTwoTensor for the crystal.
bool _convergence_failed
Flag to check whether convergence is achieved or if substepping is needed.
Real _rtol
Stress residual equation relative tolerance.
const MaterialProperty< RankFourTensor > & _elasticity_tensor
Elasticity tensor as defined by a separate class.
const bool _print_convergence_message
Flag to print to console warning messages on stress, constitutive model convergence.
MaterialProperty< RankTwoTensor > & _updated_rotation
Tracks the rotation of the crystal during deformation Note: this rotation tensor is not applied to th...
MaterialProperty< RankTwoTensor > & _total_lagrangian_strain
Lagrangian total strain measure for the entire crystal.
const std::string _base_name
optional parameter to define several mechanical systems on the same block, e.g. multiple phases
const MaterialProperty< RankTwoTensor > * _eigenstrain_deformation_gradient_old
MaterialProperty< Real > & _misorientation
Misorientation angle of the crystal during deformation.
unsigned int _line_search_max_iterations
Line search bisection method maximum iteration number.
Real _line_search_tolerance
Line search bisection method tolerance.
const MaterialProperty< RankTwoTensor > & _updated_rotation_old
unsigned int _maxiterg
Maximum number of iterations for internal variable update.
MaterialProperty< RankTwoTensor > * _eigenstrain_deformation_gradient
Generalized eigenstrain deformation gradient RankTwoTensor for the crystal.
const MaterialProperty< RankTwoTensor > & _deformation_gradient_old
MaterialProperty< RankTwoTensor > & _pk2
Second Piola-Kirchoff stress measure.
unsigned int _max_substep_iter
Maximum number of substep iterations.
const MaterialProperty< RankTwoTensor > & _plastic_deformation_gradient_old
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

Member Function Documentation

◆ calcTangentModuli()

void ComputeMultipleCrystalPlasticityStress::calcTangentModuli ( RankFourTensor jacobian_mult)
protected

Calculates the tangent moduli for use as a preconditioner, using the elastic or elastic-plastic option as specified by the user.

Definition at line 589 of file ComputeMultipleCrystalPlasticityStress.C.

590{
591 switch (_tan_mod_type)
592 {
594 elastoPlasticTangentModuli(jacobian_mult);
595 break;
596 default:
597 elasticTangentModuli(jacobian_mult);
598 }
599}

Referenced by postSolveQp().

◆ calculateEigenstrainDeformationGrad()

void ComputeMultipleCrystalPlasticityStress::calculateEigenstrainDeformationGrad ( )
protected

Calculates the deformation gradient due to eigenstrain.

Definition at line 730 of file ComputeMultipleCrystalPlasticityStress.C.

731{
734
735 for (unsigned int i = 0; i < _num_eigenstrains; ++i)
736 {
737 _eigenstrains[i]->setSubstepDt(_substep_dt);
738 _eigenstrains[i]->computeQpProperties();
739 _inverse_eigenstrain_deformation_grad *= _eigenstrains[i]->getDeformationGradientInverse();
740 }
741 (*_eigenstrain_deformation_gradient)[_qp] = _inverse_eigenstrain_deformation_grad.inverse();
742}
std::vector< ComputeCrystalPlasticityEigenstrainBase * > _eigenstrains
The user supplied cyrstal plasticity eigenstrains.
void addIa(const T &a)
RankTwoTensorTempl< T > inverse() const

Referenced by updateStress().

◆ calculateJacobian()

void ComputeMultipleCrystalPlasticityStress::calculateJacobian ( )
protected

Calculates the jacobian as $\mathbf{J} = \mathbf{I} - \mathbf{C} \frac{d\mathbf{E}^e}{d\mathbf{F}^e} \frac{d\mathbf{F}^e}{d\mathbf{F}^P^{-1}} \frac{d\mathbf{F}^P^{-1}}{d\mathbf{PK2}}$.

Definition at line 554 of file ComputeMultipleCrystalPlasticityStress.C.

555{
556 // may not need to cache the dfpinvdpk2 here. need to double check
557 RankFourTensor dfedfpinv, deedfe, dfpinvdpk2, dfpinvdpk2_per_model;
558
560
561 for (const auto i : make_range(Moose::dim))
562 for (const auto j : make_range(Moose::dim))
563 for (const auto k : make_range(Moose::dim))
564 dfedfpinv(i, j, k, j) = ffeiginv(i, k);
565
566 for (const auto i : make_range(Moose::dim))
567 for (const auto j : make_range(Moose::dim))
568 for (const auto k : make_range(Moose::dim))
569 {
570 deedfe(i, j, k, i) = deedfe(i, j, k, i) + _elastic_deformation_gradient(k, j) * 0.5;
571 deedfe(i, j, k, j) = deedfe(i, j, k, j) + _elastic_deformation_gradient(k, i) * 0.5;
572 }
573
574 for (unsigned int i = 0; i < _num_models; ++i)
575 {
576 _models[i]->calculateTotalPlasticDeformationGradientDerivative(
577 dfpinvdpk2_per_model,
581 dfpinvdpk2 += dfpinvdpk2_per_model;
582 }
583
584 _jacobian =
585 RankFourTensor::IdentityFour() - (_elasticity_tensor[_qp] * deedfe * dfedfpinv * dfpinvdpk2);
586}
for(PetscInt i=0;i< nvars;++i)
unsigned int dim
RankTwoTensor _temporary_deformation_gradient
Helper deformation gradient tensor variables used in iterative solve.
std::vector< CrystalPlasticityStressUpdateBase * > _models
The user supplied cyrstal plasticity consititutive models.
static RankFourTensorTempl< T > IdentityFour()
IntRange< T > make_range(T beg, T end)

Referenced by calculateResidualAndJacobian().

◆ calculateResidual()

void ComputeMultipleCrystalPlasticityStress::calculateResidual ( )
protected

Calculate stress residual as the difference between the stored material property PK2 stress and the elastic PK2 stress calculated from the constitutively defined equivalent_slip_increment.

The equivalent_slip_increment is passed in as an input arguement.

Definition at line 510 of file ComputeMultipleCrystalPlasticityStress.C.

511{
512 RankTwoTensor ce, elastic_strain, ce_pk2, equivalent_slip_increment_per_model,
513 equivalent_slip_increment, pk2_new;
514
515 equivalent_slip_increment.zero();
516
517 // calculate slip rate in order to compute F^{p-1}
518 for (unsigned int i = 0; i < _num_models; ++i)
519 {
520 equivalent_slip_increment_per_model.zero();
521
522 // calculate shear stress with consideration of contribution from other physics
523 _models[i]->calculateShearStress(
525
526 _convergence_failed = !_models[i]->calculateSlipRate();
527
529 return;
530
531 _models[i]->calculateEquivalentSlipIncrement(equivalent_slip_increment_per_model);
532 equivalent_slip_increment += equivalent_slip_increment_per_model;
533 }
534
535 RankTwoTensor residual_equivalent_slip_increment =
536 RankTwoTensor::Identity() - equivalent_slip_increment;
538 _inverse_plastic_deformation_grad_old * residual_equivalent_slip_increment;
539
543
545
546 elastic_strain = ce - RankTwoTensor::Identity();
547 elastic_strain *= 0.5;
548
549 pk2_new = _elasticity_tensor[_qp] * elastic_strain;
550 _residual_tensor = _pk2[_qp] - pk2_new;
551}
RankTwoTensorTempl< T > transpose() const
static RankTwoTensorTempl Identity()

Referenced by calculateResidualAndJacobian(), and lineSearchUpdate().

◆ calculateResidualAndJacobian()

void ComputeMultipleCrystalPlasticityStress::calculateResidualAndJacobian ( )
protected

Calls the residual and jacobian functions used in the stress update algorithm.

Definition at line 501 of file ComputeMultipleCrystalPlasticityStress.C.

502{
505 return;
507}
void calculateResidual()
Calculate stress residual as the difference between the stored material property PK2 stress and the e...
void calculateJacobian()
Calculates the jacobian as $\mathbf{J} = \mathbf{I} - \mathbf{C} \frac{d\mathbf{E}^e}{d\mathbf{F}^e} ...

Referenced by solveStress().

◆ computeQpProperties()

void ComputeGeneralStressBase::computeQpProperties ( )
overrideprotectedvirtualinherited

Definition at line 44 of file ComputeGeneralStressBase.C.

45{
47
48 // Add in extra stress
49 _stress[_qp] += _extra_stress[_qp];
50}
const MaterialProperty< RankTwoTensor > & _extra_stress
Extra stress tensor.
virtual void computeQpStress()=0
Compute the stress and store it in the _stress material property for the current quadrature point.
MaterialProperty< RankTwoTensor > & _stress
Stress material property.

◆ computeQpStress()

void ComputeMultipleCrystalPlasticityStress::computeQpStress ( )
overrideprotectedvirtual

Compute the stress and store it in the _stress material property for the current quadrature point.

Reimplemented from ComputeFiniteStrainElasticStress.

Definition at line 188 of file ComputeMultipleCrystalPlasticityStress.C.

189{
190 for (unsigned int i = 0; i < _num_models; ++i)
191 {
192 _models[i]->setQp(_qp);
193 _models[i]->setMaterialVectorSize();
194 }
195
196 for (unsigned int i = 0; i < _num_eigenstrains; ++i)
197 _eigenstrains[i]->setQp(_qp);
198
199 updateStress(_stress[_qp], _Jacobian_mult[_qp]); // This is NOT the exact jacobian
200}
MaterialProperty< RankFourTensor > & _Jacobian_mult
derivative of stress w.r.t. strain (_dstress_dstrain)
virtual void updateStress(RankTwoTensor &cauchy_stress, RankFourTensor &jacobian_mult)
Updates the stress (PK2) at a quadrature point by calling constiutive relationship as defined in a ch...

◆ elasticTangentModuli()

void ComputeMultipleCrystalPlasticityStress::elasticTangentModuli ( RankFourTensor jacobian_mult)
protected

Definition at line 648 of file ComputeMultipleCrystalPlasticityStress.C.

649{
650 // update jacobian_mult
651 jacobian_mult = _elasticity_tensor[_qp];
652}

Referenced by calcTangentModuli().

◆ elastoPlasticTangentModuli()

void ComputeMultipleCrystalPlasticityStress::elastoPlasticTangentModuli ( RankFourTensor jacobian_mult)
protected

Definition at line 602 of file ComputeMultipleCrystalPlasticityStress.C.

603{
604 RankFourTensor tan_mod;
605 RankTwoTensor pk2fet, fepk2, feiginvfpinv;
606 RankFourTensor deedfe, dsigdpk2dfe, dfedf;
607
608 // Fill in the matrix stiffness material property
609 for (const auto i : make_range(Moose::dim))
610 for (const auto j : make_range(Moose::dim))
611 for (const auto k : make_range(Moose::dim))
612 {
613 deedfe(i, j, k, i) = deedfe(i, j, k, i) + _elastic_deformation_gradient(k, j) * 0.5;
614 deedfe(i, j, k, j) = deedfe(i, j, k, j) + _elastic_deformation_gradient(k, i) * 0.5;
615 }
616
617 usingTensorIndices(i_, j_, k_, l_);
619 _elasticity_tensor[_qp] * deedfe;
620
622 fepk2 = _elastic_deformation_gradient * _pk2[_qp];
623
624 for (const auto i : make_range(Moose::dim))
625 for (const auto j : make_range(Moose::dim))
626 for (const auto l : make_range(Moose::dim))
627 {
628 tan_mod(i, j, i, l) += pk2fet(l, j);
629 tan_mod(i, j, j, l) += fepk2(i, l);
630 }
631
632 tan_mod += dsigdpk2dfe;
633
634 const auto je = _elastic_deformation_gradient.det();
635 if (je > 0.0)
636 tan_mod /= je;
637
639 for (const auto i : make_range(Moose::dim))
640 for (const auto j : make_range(Moose::dim))
641 for (const auto l : make_range(Moose::dim))
642 dfedf(i, j, i, l) = feiginvfpinv(l, j);
643
644 jacobian_mult = tan_mod * dfedf;
645}
RankFourTensorTempl< T > times(const RankTwoTensorTempl< T > &b) const

Referenced by calcTangentModuli().

◆ hasGuaranteedMaterialProperty()

bool GuaranteeConsumer::hasGuaranteedMaterialProperty ( const MaterialPropertyName &  prop,
Guarantee  guarantee 
)
protectedinherited

Definition at line 28 of file GuaranteeConsumer.C.

30{
32 mooseError("hasGuaranteedMaterialProperty() needs to be called in initialSetup()");
33
34 // Reference to MaterialWarehouse for testing and retrieving block ids
35 const auto & warehouse = _gc_feproblem->getMaterialWarehouse();
36
37 // Complete set of ids that this object is active
41
42 // Loop over each id for this object
43 for (const auto & id : ids)
44 {
45 // If block materials exist, look if any issue the required guarantee
46 if (warehouse.hasActiveBlockObjects(id))
47 {
48 const std::vector<std::shared_ptr<MaterialBase>> & mats = warehouse.getActiveBlockObjects(id);
49 for (const auto & mat : mats)
50 {
51 const auto & mat_props = mat->getSuppliedItems();
52 if (mat_props.count(prop_name))
53 {
54 auto guarantee_mat = dynamic_cast<GuaranteeProvider *>(mat.get());
55 if (guarantee_mat && !guarantee_mat->hasGuarantee(prop_name, guarantee))
56 {
57 // we found at least one material on the set of block we operate on
58 // that does _not_ provide the requested guarantee
59 return false;
60 }
61 }
62 }
63 }
64 }
65
66 return true;
67}
void mooseError(Args &&... args)
virtual const std::set< SubdomainID > & blockIDs() const
virtual bool blockRestricted() const
const MaterialWarehouse & getMaterialWarehouse() const
virtual MooseMesh & mesh() override
virtual bool startedInitialSetup()
BlockRestrictable *const _gc_block_restrict
Access block restrictions of the object with this interface.
FEProblemBase *const _gc_feproblem
Reference to the FEProblemBase class.
Add-on class that provides the functionality to issue guarantees for declared material properties.
const std::set< SubdomainID > & meshSubdomains() const

Referenced by ComputeFiniteStrainElasticStress::computeQpStress(), LagrangianStressDivergenceBase::initialSetup(), ADComputeMultipleInelasticStress::initialSetup(), ADComputeSmearedCrackingStress::initialSetup(), ComputeLinearElasticPFFractureStress::initialSetup(), ComputeMultipleInelasticStressBase::initialSetup(), ComputeSmearedCrackingStress::initialSetup(), ComputeLagrangianStressBase::initialSetup(), ComputeStVenantKirchhoffStress::initialSetup(), and CriticalTimeStep::initialSetup().

◆ initialSetup()

void ComputeMultipleCrystalPlasticityStress::initialSetup ( )
overridevirtual

Definition at line 148 of file ComputeMultipleCrystalPlasticityStress.C.

149{
150 // get crystal plasticity models
151 std::vector<MaterialName> model_names =
152 getParam<std::vector<MaterialName>>("crystal_plasticity_models");
153
154 for (unsigned int i = 0; i < _num_models; ++i)
155 {
157 dynamic_cast<CrystalPlasticityStressUpdateBase *>(&getMaterialByName(model_names[i]));
158
159 if (model)
160 {
161 _models.push_back(model);
162 // TODO: check to make sure that the material model is compatible with this class
163 }
164 else
165 mooseError("Model " + model_names[i] +
166 " is not compatible with ComputeMultipleCrystalPlasticityStress");
167 }
168
169 // get crystal plasticity eigenstrains
170 std::vector<MaterialName> eigenstrain_names =
171 getParam<std::vector<MaterialName>>("eigenstrain_names");
172
173 for (unsigned int i = 0; i < _num_eigenstrains; ++i)
174 {
177 &getMaterialByName(eigenstrain_names[i]));
178
179 if (eigenstrain)
180 _eigenstrains.push_back(eigenstrain);
181 else
182 mooseError("Eigenstrain" + eigenstrain_names[i] +
183 " is not compatible with ComputeMultipleCrystalPlasticityStress");
184 }
185}
const PertinentGeochemicalSystem model(database, {"H2O", "H+", "HCO3-", "O2(aq)", "Ca++", ">(s)FeOH", "radius_neg1", "radius_neg1.5"}, {"Calcite"}, {}, {"Calcite_asdf"}, {"CH4(aq)"}, {">(s)FeOCa+"}, "O2(aq)", "e-")
ComputeCrystalPlasticityEigenstrainBase is the base class for computing eigenstrain tensors in crysta...

◆ initQpStatefulProperties()

void ComputeMultipleCrystalPlasticityStress::initQpStatefulProperties ( )
overrideprotectedvirtual

initializes the stateful properties such as PK2 stress, resolved shear stress, plastic deformation gradient, slip system resistances, etc.

This class is often overwritten by inherting classes.

Reimplemented from ComputeFiniteStrainElasticStress.

Definition at line 110 of file ComputeMultipleCrystalPlasticityStress.C.

111{
113 _plastic_deformation_gradient[_qp].addIa(1.0);
114
116 {
117 (*_eigenstrain_deformation_gradient)[_qp].zero();
118 (*_eigenstrain_deformation_gradient)[_qp].addIa(1.0);
119 }
120 else
121 {
122 // set to identity if no eigenstrain is added
125 }
126
127 _pk2[_qp].zero();
128
129 _total_lagrangian_strain[_qp].zero();
130
131 _updated_rotation[_qp].zero();
132 _updated_rotation[_qp].addIa(1.0);
133
134 for (unsigned int i = 0; i < _num_models; ++i)
135 {
136 _models[i]->setQp(_qp);
137 _models[i]->initQpStatefulProperties();
138 }
139
140 for (unsigned int i = 0; i < _num_eigenstrains; ++i)
141 {
142 _eigenstrains[i]->setQp(_qp);
143 _eigenstrains[i]->initQpStatefulProperties();
144 }
145}

◆ lineSearchUpdate()

bool ComputeMultipleCrystalPlasticityStress::lineSearchUpdate ( const Real &  rnorm_prev,
const RankTwoTensor dpk2 
)
protected

performs the line search update

Definition at line 655 of file ComputeMultipleCrystalPlasticityStress.C.

657{
659 {
660 Real rnorm;
661 Real step = 1.0;
662
663 do
664 {
665 _pk2[_qp] = _pk2[_qp] - step * dpk2;
666 step /= 2.0;
667 _pk2[_qp] = _pk2[_qp] + step * dpk2;
668
670 rnorm = _residual_tensor.L2norm();
671 } while (rnorm > rnorm_prev && step > _min_line_search_step_size);
672
673 // has norm improved or is the step still above minumum search step size?
674 return (rnorm <= rnorm_prev || step > _min_line_search_step_size);
675 }
677 {
678 unsigned int count = 0;
679 Real step_a = 0.0;
680 Real step_b = 1.0;
681 Real step = 1.0;
682 Real s_m = 1000.0;
683 Real rnorm = 1000.0;
684
686 auto s_b = _residual_tensor.doubleContraction(dpk2);
687 const auto rnorm1 = _residual_tensor.L2norm();
688 _pk2[_qp] = _pk2[_qp] - dpk2;
690 auto s_a = _residual_tensor.doubleContraction(dpk2);
691 const auto rnorm0 = _residual_tensor.L2norm();
692 _pk2[_qp] = _pk2[_qp] + dpk2;
693
694 if ((rnorm1 / rnorm0) < _line_search_tolerance || s_a * s_b > 0)
695 {
697 return true;
698 }
699
700 while ((rnorm / rnorm0) > _line_search_tolerance && count < _line_search_max_iterations)
701 {
702 _pk2[_qp] = _pk2[_qp] - step * dpk2;
703 step = 0.5 * (step_b + step_a);
704 _pk2[_qp] = _pk2[_qp] + step * dpk2;
707 rnorm = _residual_tensor.L2norm();
708
709 if (s_m * s_a < 0.0)
710 {
711 step_b = step;
712 s_b = s_m;
713 }
714 if (s_m * s_b < 0.0)
715 {
716 step_a = step;
717 s_a = s_m;
718 }
719 count++;
720 }
721
722 // below tolerance and max iterations?
723 return ((rnorm / rnorm0) < _line_search_tolerance && count < _line_search_max_iterations);
724 }
725 else
726 mooseError("Line search method is not provided.");
727}
unsigned int count
T doubleContraction(const RankTwoTensorTempl< T > &a) const

Referenced by solveStress().

◆ postSolveQp()

void ComputeMultipleCrystalPlasticityStress::postSolveQp ( RankTwoTensor stress_new,
RankFourTensor jacobian_mult 
)
protected

Save the final stress and internal variable values after the iterative solve.

Definition at line 303 of file ComputeMultipleCrystalPlasticityStress.C.

305{
306 cauchy_stress = _elastic_deformation_gradient * _pk2[_qp] *
308
309 calcTangentModuli(jacobian_mult);
310
312 _deformation_gradient[_qp].transpose() * _deformation_gradient[_qp] -
315
316 // Calculate crystal rotation to track separately
317 RankTwoTensor rot;
319 _updated_rotation[_qp] = rot * _crysrot[_qp];
320
321 // Calculate the misorientation
322 auto _delta_misorientation_mat = _updated_rotation[_qp] * _updated_rotation_old[_qp].inverse();
323 auto cos_val = (_delta_misorientation_mat.trace() - 1.0) / 2.0;
324 // Mathematically, the values should lie in the range of [-1, 1]. However, there maybe numerical
325 // errors during calculation. Let's guard small numerical errors here and throw an error when the
326 // numerical error is too big, which indicates other issues.
327 if (cos_val > 1.0 || cos_val < -1.0)
328 {
329 if (MooseUtils::absoluteFuzzyEqual(cos_val, -1.0))
330 cos_val = -1.0;
331 else if (MooseUtils::absoluteFuzzyEqual(cos_val, 1.0))
332 cos_val = 1.0;
333 else
334 mooseError("Misorientation value is undefined. This should not happen.");
335 }
336 _misorientation[_qp] = std::acos(cos_val);
337}
void calcTangentModuli(RankFourTensor &jacobian_mult)
Calculates the tangent moduli for use as a preconditioner, using the elastic or elastic-plastic optio...
void getRUDecompositionRotation(RankTwoTensorTempl< T > &rot) const

Referenced by updateStress().

◆ preSolveQp()

void ComputeMultipleCrystalPlasticityStress::preSolveQp ( )
protected

Reset the PK2 stress and the inverse deformation gradient to old values and provide an interface for inheriting classes to reset material properties.

Definition at line 271 of file ComputeMultipleCrystalPlasticityStress.C.

272{
273 for (unsigned int i = 0; i < _num_models; ++i)
274 _models[i]->setInitialConstitutiveVariableValues();
275
276 _pk2[_qp] = _pk2_old[_qp];
278}

Referenced by updateStress().

◆ solveQp()

void ComputeMultipleCrystalPlasticityStress::solveQp ( )
protected

Solve the stress and internal state variables (e.g.

slip increment, slip system resistance) at each qp points

Definition at line 281 of file ComputeMultipleCrystalPlasticityStress.C.

282{
283 for (unsigned int i = 0; i < _num_models; ++i)
284 {
285 _models[i]->setSubstepConstitutiveVariableValues();
286 _models[i]->calculateSlipResistance();
287 }
288
290
293 return; // pop back up and take a smaller substep
294
295 for (unsigned int i = 0; i < _num_models; ++i)
296 _models[i]->updateSubstepConstitutiveVariableValues();
297
298 // save off the old F^{p} inverse now that have converged on the stress and state variables
300}
void solveStateVariables()
Solves the internal variables stress as a function of the slip specified by the constitutive model de...

Referenced by updateStress().

◆ solveStateVariables()

void ComputeMultipleCrystalPlasticityStress::solveStateVariables ( )
protected

Solves the internal variables stress as a function of the slip specified by the constitutive model defined in the inheriting class.

Definition at line 340 of file ComputeMultipleCrystalPlasticityStress.C.

341{
342 unsigned int iteration;
343 bool iter_flag = true;
344
345 iteration = 0;
346 // Check for slip system resistance update tolerance
347 do
348 {
349 solveStress();
351 return;
352
354 _inverse_plastic_deformation_grad.inverse(); // the postSoveStress
355
356 // Update slip system resistance and state variable after the stress has been finalized
357 // We loop through all the models for each calculation
358 // in order to make sure that when coupling appears, the state variables are updated based on
359 // the same components
360 for (unsigned int i = 0; i < _num_models; ++i)
361 _models[i]->cacheStateVariablesBeforeUpdate();
362
363 for (unsigned int i = 0; i < _num_models; ++i)
364 _models[i]->calculateStateVariableEvolutionRateComponent();
365
366 for (unsigned int i = 0; i < _num_models; ++i)
367 if (!_models[i]->updateStateVariables())
368 _convergence_failed = true;
369
370 for (unsigned int i = 0; i < _num_models; ++i)
371 _models[i]->calculateSlipResistance();
372
374 return;
375
376 for (unsigned int i = 0; i < _num_models; ++i)
377 {
378 // iter_flag = false, stop iteration if all values are converged and good to go
379 // iter_flag = true, continue iteration if any value is not converged
380 if (!_models[i]->areConstitutiveStateVariablesConverged())
381 {
382 iter_flag = true;
383 break;
384 }
385 else
386 iter_flag = false; // iter_flag = false, stop iteration only when all models returns true
387 }
388
389 if (iter_flag)
390 {
392 mooseWarning("ComputeMultipleCrystalPlasticityStress: State variables (or the system "
393 "resistance) did not converge at element ",
394 _current_elem->id(),
395 " and qp ",
396 _qp,
397 "\n");
398 }
399 iteration++;
400 } while (iter_flag && iteration < _maxiterg);
401
402 if (iteration == _maxiterg)
403 {
406 "ComputeMultipleCrystalPlasticityStress: Hardness Integration error. Reached the "
407 "maximum number of iterations to solve for the state variables at element ",
408 _current_elem->id(),
409 " and qp ",
410 _qp,
411 "\n");
412
413 _convergence_failed = true;
414 }
415}
void mooseWarning(Args &&... args)
void solveStress()
solves for stress, updates plastic deformation gradient.

Referenced by solveQp().

◆ solveStress()

void ComputeMultipleCrystalPlasticityStress::solveStress ( )
protected

solves for stress, updates plastic deformation gradient.

Definition at line 418 of file ComputeMultipleCrystalPlasticityStress.C.

419{
420 unsigned int iteration = 0;
421 RankTwoTensor dpk2;
422 Real rnorm, rnorm0, rnorm_prev;
423
424 // Calculate stress residual
427 {
429 mooseWarning("ComputeMultipleCrystalPlasticityStress: the slip increment exceeds tolerance "
430 "at element ",
431 _current_elem->id(),
432 " and Gauss point ",
433 _qp);
434
435 return;
436 }
437
438 rnorm = _residual_tensor.L2norm();
439 rnorm0 = rnorm;
440
441 // Check for stress residual tolerance; different from user object version which
442 // compares the absolute tolerance of only the original rnorm value
443 while (rnorm > _rtol * rnorm0 && rnorm > _abs_tol && iteration < _maxiter)
444 {
445 // Calculate stress increment
447 _pk2[_qp] = _pk2[_qp] + dpk2;
448
450
452 {
454 mooseWarning("ComputeMultipleCrystalPlasticityStress: the slip increment exceeds tolerance "
455 "at element ",
456 _current_elem->id(),
457 " and Gauss point ",
458 _qp);
459
460 return;
461 }
462
463 rnorm_prev = rnorm;
464 rnorm = _residual_tensor.L2norm();
465
466 if (_use_line_search && rnorm > rnorm_prev && !lineSearchUpdate(rnorm_prev, dpk2))
467 {
469 mooseWarning("ComputeMultipleCrystalPlasticityStress: Failed with line search");
470
471 _convergence_failed = true;
472 return;
473 }
474
476 rnorm = _residual_tensor.L2norm();
477
478 iteration++;
479 }
480
481 if (iteration >= _maxiter)
482 {
484 mooseWarning("ComputeMultipleCrystalPlasticityStress: Stress Integration error rmax = ",
485 rnorm,
486 " and the tolerance is ",
487 _rtol * rnorm0,
488 " when the rnorm0 value is ",
489 rnorm0,
490 " for element ",
491 _current_elem->id(),
492 " and qp ",
493 _qp);
494
495 _convergence_failed = true;
496 }
497}
bool lineSearchUpdate(const Real &rnorm_prev, const RankTwoTensor &dpk2)
performs the line search update
void calculateResidualAndJacobian()
Calls the residual and jacobian functions used in the stress update algorithm.
RankFourTensorTempl< T > invSymm() const

Referenced by solveStateVariables().

◆ updateStress()

void ComputeMultipleCrystalPlasticityStress::updateStress ( RankTwoTensor cauchy_stress,
RankFourTensor jacobian_mult 
)
protectedvirtual

Updates the stress (PK2) at a quadrature point by calling constiutive relationship as defined in a child class Solves stress residual equation using Newton - Raphson: Updates slip system resistances iteratively.

Definition at line 203 of file ComputeMultipleCrystalPlasticityStress.C.

205{
206 // Does not support face/boundary material property calculation
207 if (isBoundaryMaterial())
208 return;
209
210 // Initialize substepping variables
211 unsigned int substep_iter = 1;
212 unsigned int num_substep = 1;
213
217
219
220 // Loop through all models and calculate the schmid tensor for the current state of the crystal
221 // lattice
222 // Not sure if we should pass in the updated or the original rotation here
223 // If not, then we should not need to compute the flow direction every iteration here
224 for (unsigned int i = 0; i < _num_models; ++i)
225 _models[i]->calculateFlowDirection(_crysrot[_qp]);
226
227 do
228 {
229 _convergence_failed = false;
230 preSolveQp();
231
232 _substep_dt = _dt / num_substep;
233 for (unsigned int i = 0; i < _num_models; ++i)
234 _models[i]->setSubstepDt(_substep_dt);
235
236 // calculate F^{eigen} only when we have eigenstrain
241
242 for (unsigned int istep = 0; istep < num_substep; ++istep)
243 {
245 (static_cast<Real>(istep) + 1) / num_substep * _delta_deformation_gradient;
247
248 solveQp();
249
251 {
254 "The crystal plasticity constitutive model has failed to converge. Increasing "
255 "the number of substeps.");
256
257 substep_iter++;
258 num_substep *= 2;
259 break;
260 }
261 }
262
263 if (substep_iter > _max_substep_iter && _convergence_failed)
264 mooseException("ComputeMultipleCrystalPlasticityStress: Constitutive failure");
265 } while (_convergence_failed);
266
267 postSolveQp(cauchy_stress, jacobian_mult);
268}
void preSolveQp()
Reset the PK2 stress and the inverse deformation gradient to old values and provide an interface for ...
void postSolveQp(RankTwoTensor &stress_new, RankFourTensor &jacobian_mult)
Save the final stress and internal variable values after the iterative solve.
void solveQp()
Solve the stress and internal state variables (e.g.
void calculateEigenstrainDeformationGrad()
Calculates the deformation gradient due to eigenstrain.
RankTwoTensor _delta_deformation_gradient
Used for substepping; Uniformly divides the increment in deformation gradient.

Referenced by computeQpStress().

◆ validParams()

InputParameters ComputeMultipleCrystalPlasticityStress::validParams ( )
static

Definition at line 20 of file ComputeMultipleCrystalPlasticityStress.C.

21{
23
25 "Crystal Plasticity base class: handles the Newton iteration over the stress residual and "
26 "calculates the Jacobian based on constitutive laws from multiple material classes "
27 "that are inherited from CrystalPlasticityStressUpdateBase");
28 params.addParam<std::string>(
29 "base_name",
30 "Optional parameter that allows the user to define multiple mechanics material systems on "
31 "the same block, i.e. for multiple phases");
32
33 params.addRequiredParam<std::vector<MaterialName>>(
34 "crystal_plasticity_models",
35 "The material objects to use to calculate crystal plasticity stress and strains.");
36 params.addParam<std::vector<MaterialName>>(
37 "eigenstrain_names", {}, "The material objects to calculate eigenstrains.");
38 params.addParam<MooseEnum>("tan_mod_type",
39 MooseEnum("exact none", "none"),
40 "Type of tangent moduli for preconditioner: default elastic");
41 params.addParam<Real>("rtol", 1e-6, "Constitutive stress residual relative tolerance");
42 params.addParam<Real>("abs_tol", 1e-6, "Constitutive stress residual absolute tolerance");
43 params.addParam<unsigned int>("maxiter", 100, "Maximum number of iterations for stress update");
44 params.addParam<unsigned int>(
45 "maxiter_state_variable", 100, "Maximum number of iterations for state variable update");
46 params.addParam<unsigned int>(
47 "maximum_substep_iteration", 1, "Maximum number of substep iteration");
48 params.addParam<bool>("use_line_search", false, "Use line search in constitutive update");
49 params.addParam<Real>("min_line_search_step_size", 0.01, "Minimum line search step size");
50 params.addParam<Real>("line_search_tol", 0.5, "Line search bisection method tolerance");
51 params.addParam<unsigned int>(
52 "line_search_maxiter", 20, "Line search bisection method maximum number of iteration");
53 params.addParam<MooseEnum>("line_search_method",
54 MooseEnum("CUT_HALF BISECTION", "CUT_HALF"),
55 "The method used in line search");
56 params.addParam<bool>(
57 "print_state_variable_convergence_error_messages",
58 false,
59 "Whether or not to print warning messages from the crystal plasticity specific convergence "
60 "checks on the stress measure and general constitutive model quantinties.");
61 return params;
62}
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)

Member Data Documentation

◆ _abs_tol

Real ComputeMultipleCrystalPlasticityStress::_abs_tol
protected

Stress residual equation absolute tolerance.

Definition at line 141 of file ComputeMultipleCrystalPlasticityStress.h.

Referenced by solveStress().

◆ _base_name

const std::string ComputeMultipleCrystalPlasticityStress::_base_name
protected

optional parameter to define several mechanical systems on the same block, e.g. multiple phases

Definition at line 133 of file ComputeMultipleCrystalPlasticityStress.h.

◆ _convergence_failed

bool ComputeMultipleCrystalPlasticityStress::_convergence_failed
protected

Flag to check whether convergence is achieved or if substepping is needed.

Definition at line 230 of file ComputeMultipleCrystalPlasticityStress.h.

Referenced by calculateResidual(), calculateResidualAndJacobian(), ComputeMultipleCrystalPlasticityStress(), solveQp(), solveStateVariables(), solveStress(), and updateStress().

◆ _crysrot

const MaterialProperty<RankTwoTensor>& ComputeMultipleCrystalPlasticityStress::_crysrot
protected

Crystal rotation in the original, or reference, configuration as defined by Euler angle arguments in the ComputeElasticityTensor classes.

Definition at line 216 of file ComputeMultipleCrystalPlasticityStress.h.

Referenced by postSolveQp(), and updateStress().

◆ _deformation_gradient

const MaterialProperty<RankTwoTensor>& ComputeMultipleCrystalPlasticityStress::_deformation_gradient
protected

Total deformation gradient RankTwoTensor for the crystal.

Definition at line 188 of file ComputeMultipleCrystalPlasticityStress.h.

Referenced by postSolveQp(), and updateStress().

◆ _deformation_gradient_old

const MaterialProperty<RankTwoTensor>& ComputeMultipleCrystalPlasticityStress::_deformation_gradient_old
protected

Definition at line 189 of file ComputeMultipleCrystalPlasticityStress.h.

Referenced by updateStress().

◆ _delta_deformation_gradient

RankTwoTensor ComputeMultipleCrystalPlasticityStress::_delta_deformation_gradient
protected

Used for substepping; Uniformly divides the increment in deformation gradient.

Definition at line 233 of file ComputeMultipleCrystalPlasticityStress.h.

Referenced by updateStress().

◆ _dfgrd_scale_factor

Real ComputeMultipleCrystalPlasticityStress::_dfgrd_scale_factor
protected

Scales the substepping increment to obtain deformation gradient at a substep iteration.

Definition at line 238 of file ComputeMultipleCrystalPlasticityStress.h.

◆ _eigenstrain_deformation_gradient

MaterialProperty<RankTwoTensor>* ComputeMultipleCrystalPlasticityStress::_eigenstrain_deformation_gradient
protected

Generalized eigenstrain deformation gradient RankTwoTensor for the crystal.

Definition at line 183 of file ComputeMultipleCrystalPlasticityStress.h.

◆ _eigenstrain_deformation_gradient_old

const MaterialProperty<RankTwoTensor>* ComputeMultipleCrystalPlasticityStress::_eigenstrain_deformation_gradient_old
protected

Definition at line 184 of file ComputeMultipleCrystalPlasticityStress.h.

◆ _eigenstrains

std::vector<ComputeCrystalPlasticityEigenstrainBase *> ComputeMultipleCrystalPlasticityStress::_eigenstrains
protected

The user supplied cyrstal plasticity eigenstrains.

Definition at line 130 of file ComputeMultipleCrystalPlasticityStress.h.

Referenced by calculateEigenstrainDeformationGrad(), computeQpStress(), initialSetup(), and initQpStatefulProperties().

◆ _elastic_deformation_gradient

RankTwoTensor ComputeMultipleCrystalPlasticityStress::_elastic_deformation_gradient
protected

◆ _elastic_strain

MaterialProperty<RankTwoTensor>& ComputeGeneralStressBase::_elastic_strain
protectedinherited

◆ _elastic_strain_old

const MaterialProperty<RankTwoTensor>& ComputeFiniteStrainElasticStress::_elastic_strain_old
protectedinherited

The old elastic strain is used to calculate the old stress in the case of variable elasticity tensors.

Definition at line 51 of file ComputeFiniteStrainElasticStress.h.

Referenced by ComputeFiniteStrainElasticStress::computeQpStress().

◆ _elasticity_tensor

const MaterialProperty<RankFourTensor>& ComputeMultipleCrystalPlasticityStress::_elasticity_tensor
protected

Elasticity tensor as defined by a separate class.

Definition at line 136 of file ComputeMultipleCrystalPlasticityStress.h.

Referenced by calculateJacobian(), calculateResidual(), elasticTangentModuli(), and elastoPlasticTangentModuli().

◆ _elasticity_tensor_name

const std::string ComputeFiniteStrainElasticStress::_elasticity_tensor_name
protectedinherited

◆ _extra_stress

const MaterialProperty<RankTwoTensor>& ComputeGeneralStressBase::_extra_stress
protectedinherited

Extra stress tensor.

Definition at line 53 of file ComputeGeneralStressBase.h.

Referenced by ComputeGeneralStressBase::computeQpProperties().

◆ _gc_block_restrict

BlockRestrictable* const GuaranteeConsumer::_gc_block_restrict
privateinherited

Access block restrictions of the object with this interface.

Definition at line 41 of file GuaranteeConsumer.h.

Referenced by GuaranteeConsumer::hasGuaranteedMaterialProperty().

◆ _gc_feproblem

FEProblemBase* const GuaranteeConsumer::_gc_feproblem
privateinherited

Reference to the FEProblemBase class.

Definition at line 38 of file GuaranteeConsumer.h.

Referenced by GuaranteeConsumer::hasGuaranteedMaterialProperty().

◆ _gc_params

const InputParameters& GuaranteeConsumer::_gc_params
privateinherited

Parameters of the object with this interface.

Definition at line 35 of file GuaranteeConsumer.h.

◆ _initial_stress_fcn

std::vector<const Function *> ComputeGeneralStressBase::_initial_stress_fcn
protectedinherited

initial stress components

Definition at line 56 of file ComputeGeneralStressBase.h.

◆ _inverse_eigenstrain_deformation_grad

RankTwoTensor ComputeMultipleCrystalPlasticityStress::_inverse_eigenstrain_deformation_grad
protected

◆ _inverse_plastic_deformation_grad

RankTwoTensor ComputeMultipleCrystalPlasticityStress::_inverse_plastic_deformation_grad
protected

◆ _inverse_plastic_deformation_grad_old

RankTwoTensor ComputeMultipleCrystalPlasticityStress::_inverse_plastic_deformation_grad_old
protected

◆ _jacobian

RankFourTensor ComputeMultipleCrystalPlasticityStress::_jacobian
protected

Jacobian tensor.

Definition at line 146 of file ComputeMultipleCrystalPlasticityStress.h.

Referenced by calculateJacobian(), and solveStress().

◆ _Jacobian_mult

MaterialProperty<RankFourTensor>& ComputeGeneralStressBase::_Jacobian_mult
protectedinherited

◆ _line_search_max_iterations

unsigned int ComputeMultipleCrystalPlasticityStress::_line_search_max_iterations
protected

Line search bisection method maximum iteration number.

Definition at line 172 of file ComputeMultipleCrystalPlasticityStress.h.

Referenced by lineSearchUpdate().

◆ _line_search_method

enum ComputeMultipleCrystalPlasticityStress::LineSearchMethod ComputeMultipleCrystalPlasticityStress::_line_search_method
protected

Referenced by lineSearchUpdate().

◆ _line_search_tolerance

Real ComputeMultipleCrystalPlasticityStress::_line_search_tolerance
protected

Line search bisection method tolerance.

Definition at line 169 of file ComputeMultipleCrystalPlasticityStress.h.

Referenced by lineSearchUpdate().

◆ _max_substep_iter

unsigned int ComputeMultipleCrystalPlasticityStress::_max_substep_iter
protected

Maximum number of substep iterations.

Definition at line 157 of file ComputeMultipleCrystalPlasticityStress.h.

Referenced by updateStress().

◆ _maxiter

unsigned int ComputeMultipleCrystalPlasticityStress::_maxiter
protected

Maximum number of iterations for stress update.

Definition at line 149 of file ComputeMultipleCrystalPlasticityStress.h.

Referenced by solveStress().

◆ _maxiterg

unsigned int ComputeMultipleCrystalPlasticityStress::_maxiterg
protected

Maximum number of iterations for internal variable update.

Definition at line 151 of file ComputeMultipleCrystalPlasticityStress.h.

Referenced by solveStateVariables().

◆ _mechanical_strain

const MaterialProperty<RankTwoTensor>& ComputeGeneralStressBase::_mechanical_strain
protectedinherited

◆ _min_line_search_step_size

Real ComputeMultipleCrystalPlasticityStress::_min_line_search_step_size
protected

Minimum line search step size.

Definition at line 166 of file ComputeMultipleCrystalPlasticityStress.h.

Referenced by lineSearchUpdate().

◆ _misorientation

MaterialProperty<Real>& ComputeMultipleCrystalPlasticityStress::_misorientation
protected

Misorientation angle of the crystal during deformation.

Definition at line 210 of file ComputeMultipleCrystalPlasticityStress.h.

Referenced by postSolveQp().

◆ _models

std::vector<CrystalPlasticityStressUpdateBase *> ComputeMultipleCrystalPlasticityStress::_models
protected

◆ _num_eigenstrains

const unsigned ComputeMultipleCrystalPlasticityStress::_num_eigenstrains
protected

◆ _num_models

const unsigned ComputeMultipleCrystalPlasticityStress::_num_models
protected

◆ _pk2

MaterialProperty<RankTwoTensor>& ComputeMultipleCrystalPlasticityStress::_pk2
protected

◆ _pk2_old

const MaterialProperty<RankTwoTensor>& ComputeMultipleCrystalPlasticityStress::_pk2_old
protected

Definition at line 194 of file ComputeMultipleCrystalPlasticityStress.h.

Referenced by preSolveQp().

◆ _plastic_deformation_gradient

MaterialProperty<RankTwoTensor>& ComputeMultipleCrystalPlasticityStress::_plastic_deformation_gradient
protected

Plastic deformation gradient RankTwoTensor for the crystal.

Definition at line 178 of file ComputeMultipleCrystalPlasticityStress.h.

Referenced by initQpStatefulProperties(), and solveStateVariables().

◆ _plastic_deformation_gradient_old

const MaterialProperty<RankTwoTensor>& ComputeMultipleCrystalPlasticityStress::_plastic_deformation_gradient_old
protected

Definition at line 179 of file ComputeMultipleCrystalPlasticityStress.h.

Referenced by preSolveQp().

◆ _print_convergence_message

const bool ComputeMultipleCrystalPlasticityStress::_print_convergence_message
protected

Flag to print to console warning messages on stress, constitutive model convergence.

Definition at line 227 of file ComputeMultipleCrystalPlasticityStress.h.

Referenced by solveStateVariables(), solveStress(), and updateStress().

◆ _residual_tensor

RankTwoTensor ComputeMultipleCrystalPlasticityStress::_residual_tensor
protected

◆ _rotation_increment

const MaterialProperty<RankTwoTensor>& ComputeFiniteStrainElasticStress::_rotation_increment
protectedinherited

◆ _rotation_total

MaterialProperty<RankTwoTensor>& ComputeFiniteStrainElasticStress::_rotation_total
protectedinherited

Rotation up to current step "n" to compute anisotropic elasticity tensor.

Definition at line 37 of file ComputeFiniteStrainElasticStress.h.

Referenced by ComputeFiniteStrainElasticStress::computeQpStress(), and ComputeFiniteStrainElasticStress::initQpStatefulProperties().

◆ _rotation_total_old

const MaterialProperty<RankTwoTensor>& ComputeFiniteStrainElasticStress::_rotation_total_old
protectedinherited

Rotation up to "n - 1" (previous) step to compute anisotropic elasticity tensor.

Definition at line 39 of file ComputeFiniteStrainElasticStress.h.

Referenced by ComputeFiniteStrainElasticStress::computeQpStress().

◆ _rtol

Real ComputeMultipleCrystalPlasticityStress::_rtol
protected

Stress residual equation relative tolerance.

Definition at line 139 of file ComputeMultipleCrystalPlasticityStress.h.

Referenced by solveStress().

◆ _strain_increment

const MaterialProperty<RankTwoTensor>& ComputeFiniteStrainElasticStress::_strain_increment
protectedinherited

Strain increment material property.

Definition at line 41 of file ComputeFiniteStrainElasticStress.h.

Referenced by ComputeFiniteStrainElasticStress::computeQpStress().

◆ _stress

MaterialProperty<RankTwoTensor>& ComputeGeneralStressBase::_stress
protectedinherited

Stress material property.

Definition at line 48 of file ComputeGeneralStressBase.h.

Referenced by ComputeMultipleInelasticStressBase::computeAdmissibleState(), ComputeMultipleInelasticCosseratStress::computeAdmissibleState(), ComputeGeneralStressBase::computeQpProperties(), ComputeMultiPlasticityStress::computeQpStress(), ComputeStrainIncrementBasedStress::computeQpStress(), FiniteStrainPlasticMaterial::computeQpStress(), AbaqusUMATStress::computeQpStress(), ComputeCosseratLinearElasticStress::computeQpStress(), ComputeFiniteStrainElasticStress::computeQpStress(), ComputeLinearElasticPFFractureStress::computeQpStress(), ComputeLinearElasticStress::computeQpStress(), ComputeLinearViscoelasticStress::computeQpStress(), ComputeMultipleInelasticStressBase::computeQpStress(), ComputeSmearedCrackingStress::computeQpStress(), computeQpStress(), ComputeMultipleInelasticStressBase::computeQpStressIntermediateConfiguration(), ComputeLinearElasticPFFractureStress::computeStrainSpectral(), ComputeLinearElasticPFFractureStress::computeStrainVolDev(), ComputeLinearElasticPFFractureStress::computeStressSpectral(), ComputeCreepPlasticityStress::computeTangentOperators(), ComputeMultipleInelasticStressBase::finiteStrainRotation(), FiniteStrainCrystalPlasticity::initQpStatefulProperties(), FiniteStrainUObasedCP::initQpStatefulProperties(), FiniteStrainHyperElasticViscoPlastic::initQpStatefulProperties(), ComputeGeneralStressBase::initQpStatefulProperties(), ComputeMultiPlasticityStress::postReturnMap(), FiniteStrainCrystalPlasticity::postSolveQp(), FiniteStrainUObasedCP::postSolveQp(), FiniteStrainHyperElasticViscoPlastic::postSolveQp(), ComputeSmearedCrackingStress::updateCrackingStateAndStress(), ComputeCreepPlasticityStress::updateQpState(), ComputeMultipleInelasticStress::updateQpState(), and ComputeMultipleInelasticStressBase::updateQpStateSingleModel().

◆ _stress_old

const MaterialProperty<RankTwoTensor>& ComputeFiniteStrainElasticStress::_stress_old
protectedinherited

◆ _substep_dt

Real ComputeMultipleCrystalPlasticityStress::_substep_dt
protected

time step size during substepping

Definition at line 160 of file ComputeMultipleCrystalPlasticityStress.h.

Referenced by calculateEigenstrainDeformationGrad(), and updateStress().

◆ _tan_mod_type

enum ComputeMultipleCrystalPlasticityStress::TangentModuliType ComputeMultipleCrystalPlasticityStress::_tan_mod_type
protected

Referenced by calcTangentModuli().

◆ _temporary_deformation_gradient

RankTwoTensor ComputeMultipleCrystalPlasticityStress::_temporary_deformation_gradient
protected

Helper deformation gradient tensor variables used in iterative solve.

Definition at line 219 of file ComputeMultipleCrystalPlasticityStress.h.

Referenced by calculateJacobian(), calculateResidual(), and updateStress().

◆ _temporary_deformation_gradient_old

RankTwoTensor ComputeMultipleCrystalPlasticityStress::_temporary_deformation_gradient_old
protected

Definition at line 234 of file ComputeMultipleCrystalPlasticityStress.h.

Referenced by updateStress().

◆ _total_lagrangian_strain

MaterialProperty<RankTwoTensor>& ComputeMultipleCrystalPlasticityStress::_total_lagrangian_strain
protected

Lagrangian total strain measure for the entire crystal.

Definition at line 198 of file ComputeMultipleCrystalPlasticityStress.h.

Referenced by initQpStatefulProperties(), and postSolveQp().

◆ _updated_rotation

MaterialProperty<RankTwoTensor>& ComputeMultipleCrystalPlasticityStress::_updated_rotation
protected

Tracks the rotation of the crystal during deformation Note: this rotation tensor is not applied to the crystal lattice.

Definition at line 204 of file ComputeMultipleCrystalPlasticityStress.h.

Referenced by initQpStatefulProperties(), and postSolveQp().

◆ _updated_rotation_old

const MaterialProperty<RankTwoTensor>& ComputeMultipleCrystalPlasticityStress::_updated_rotation_old
protected

Definition at line 205 of file ComputeMultipleCrystalPlasticityStress.h.

Referenced by postSolveQp().

◆ _use_line_search

bool ComputeMultipleCrystalPlasticityStress::_use_line_search
protected

Flag to activate line serach.

Definition at line 163 of file ComputeMultipleCrystalPlasticityStress.h.

Referenced by solveStress().


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