https://mooseframework.inl.gov
CrystalPlasticityStressUpdateBase.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
12 #include "Material.h"
13 #include "RankTwoTensor.h"
14 #include "RankFourTensor.h"
15 #include "DelimitedFileReader.h"
16 
18 {
19 public:
21 
23 
25  void setQp(const unsigned int & qp);
26 
28  void setSubstepDt(const Real & substep_dt);
29 
31  virtual void resetQpProperties() final {}
32  virtual void resetProperties() final {}
34 
40  virtual void initQpStatefulProperties() override;
41  virtual void setMaterialVectorSize();
42 
48  virtual void getSlipSystems();
49 
56 
61  void calculateFlowDirection(const RankTwoTensor & crysrot);
62 
66  void calculateShearStress(const RankTwoTensor & pk2,
67  const RankTwoTensor & inverse_eigenstrain_deformation_grad,
68  const unsigned int & num_eigenstrains);
69 
77  RankFourTensor & dfpinvdpk2,
78  const RankTwoTensor & inverse_plastic_deformation_grad_old,
79  const RankTwoTensor & inverse_eigenstrain_deformation_grad_old,
80  const unsigned int & num_eigenstrains);
81 
87  void calculateSchmidTensor(const unsigned int & number_dislocation_systems,
88  const std::vector<RealVectorValue> & plane_normal_vector,
89  const std::vector<RealVectorValue> & direction_vector,
90  std::vector<RankTwoTensor> & schmid_tensor,
91  const RankTwoTensor & crysrot);
92 
104  void sortCrossSlipFamilies();
105 
112  unsigned int identifyCrossSlipFamily(const unsigned int index);
113 
120 
129 
138 
144  virtual bool calculateSlipRate() = 0;
145 
146  virtual void calculateEquivalentSlipIncrement(RankTwoTensor & /*equivalent_slip_increment*/);
147 
154  virtual void calculateConstitutiveSlipDerivative(std::vector<Real> & /*dslip_dtau*/) = 0;
155 
162 
164 
169  virtual bool updateStateVariables() = 0;
170 
171  virtual void calculateSlipResistance() {}
172 
176  virtual bool areConstitutiveStateVariablesConverged() { return true; }
177 
182  virtual bool isConstitutiveStateVariableConverged(const std::vector<Real> & current_var,
183  const std::vector<Real> & var_before_update,
184  const std::vector<Real> & previous_substep_var,
185  const Real & tolerance);
186 
187 protected:
190  const std::string _base_name;
191 
193 
194  const std::vector<Real> _unit_cell_dimension;
195 
197  const unsigned int _number_slip_systems;
198 
200  std::string _slip_sys_file_name;
201 
206 
215 
220 
223 
225  std::vector<RealVectorValue> _slip_direction;
226  std::vector<RealVectorValue> _slip_plane_normal;
229 
232 
235 
238 
240  std::vector<std::vector<unsigned int>> _cross_slip_familes;
241 
244 };
void setQp(const unsigned int &qp)
Sets the value of the global variable _qp for inheriting classes.
virtual bool areConstitutiveStateVariablesConverged()
Determines if all the state variables have converged.
std::string _slip_sys_file_name
File should contain slip plane normal and direction.
CrystalPlasticityStressUpdateBase(const InputParameters &parameters)
virtual void calculateTotalPlasticDeformationGradientDerivative(RankFourTensor &dfpinvdpk2, const RankTwoTensor &inverse_plastic_deformation_grad_old, const RankTwoTensor &inverse_eigenstrain_deformation_grad_old, const unsigned int &num_eigenstrains)
Calculates the total value of ${d{F}^P^{-1}}{d{PK2}}$ and is intended to be an overwritten helper met...
void transformHexagonalMillerBravaisSlipSystems(const MooseUtils::DelimitedFileReader &reader)
A helper method to transform the Miller-Bravais 4-index notation for HCP crystals into a a 3-index Ca...
std::vector< std::vector< unsigned int > > _cross_slip_familes
Sorted slip system indices into cross slip family groups.
virtual void initQpStatefulProperties() override
initializes the stateful properties such as PK2 stress, resolved shear stress, plastic deformation gr...
virtual void calculateEquivalentSlipIncrement(RankTwoTensor &)
MaterialProperty< std::vector< Real > > & _slip_increment
Current slip increment material property.
virtual void cacheStateVariablesBeforeUpdate()
Finalizes the values of the state variables and slip system resistance for the current timestep after...
const std::string _base_name
Base name prepended to all material property names to allow for multi-material systems.
MaterialProperty< std::vector< Real > > & _slip_resistance
Slip system resistance.
enum CrystalPlasticityStressUpdateBase::CrystalLatticeType _crystal_lattice_type
virtual void setSubstepConstitutiveVariableValues()
This virtual method is called to set the current constitutive internal state variable value to that o...
Real _substep_dt
Substepping time step value used within the inheriting constitutive models.
const unsigned int _number_slip_systems
Maximum number of active slip systems for the crystalline material being modeled. ...
Real _zero_tol
Residual tolerance when variable value is zero. Default 1e-12.
const MaterialProperty< std::vector< Real > > & _slip_resistance_old
bool _calculate_cross_slip
Flag to run the cross slip calculations if cross slip numbers are specified.
void sortCrossSlipFamilies()
A helper method to sort the slip systems of a crystal into cross slip families based on common slip d...
virtual void calculateConstitutiveSlipDerivative(std::vector< Real > &)=0
This virtual method is called to find the derivative of the slip increment with respect to the applie...
MaterialProperty< std::vector< RankTwoTensor > > & _flow_direction
Real _rel_state_var_tol
Internal variable update equation tolerance.
virtual void setInitialConstitutiveVariableValues()
This virtual method is called to set the constitutive internal state variables current value and the ...
const Real _number_cross_slip_directions
Parameters to characterize the cross slip behavior of the crystal.
virtual void updateSubstepConstitutiveVariableValues()
Stores the current value of the constitutive internal state variables into a separate material proper...
virtual void getSlipSystems()
A helper method to read in plane normal and direction vectors from a file and to normalize the vector...
void calculateSchmidTensor(const unsigned int &number_dislocation_systems, const std::vector< RealVectorValue > &plane_normal_vector, const std::vector< RealVectorValue > &direction_vector, std::vector< RankTwoTensor > &schmid_tensor, const RankTwoTensor &crysrot)
A helper method to rotate the a direction and plane normal system set into the local crystal llatice ...
virtual bool calculateSlipRate()=0
This virtual method is called to calculate the slip system slip increment based on the constitutive m...
virtual void resetQpProperties() final
Retained as empty methods to avoid a warning from Material.C in framework. These methods are unused i...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual bool updateStateVariables()=0
Finalizes the values of the state variables and slip system resistance for the current timestep after...
void calculateShearStress(const RankTwoTensor &pk2, const RankTwoTensor &inverse_eigenstrain_deformation_grad, const unsigned int &num_eigenstrains)
Computes the shear stess for each slip system.
void calculateFlowDirection(const RankTwoTensor &crysrot)
Computes the Schmid tensor (m x n) for the original (reference) crystal lattice orientation for each ...
MaterialProperty< std::vector< Real > > & _tau
Resolved shear stress on each slip system.
virtual bool isConstitutiveStateVariableConverged(const std::vector< Real > &current_var, const std::vector< Real > &var_before_update, const std::vector< Real > &previous_substep_var, const Real &tolerance)
Check if a typical state variable, e.g.
const bool _print_convergence_message
Flag to print to console warning messages on stress, constitutive model convergence.
const InputParameters & parameters() const
Real _resistance_tol
Tolerance for change in slip system resistance over an increment.
void setSubstepDt(const Real &substep_dt)
Sets the value of the _substep_dt for inheriting classes.
std::vector< RealVectorValue > _slip_direction
Slip system direction and normal and associated Schmid tensors.
unsigned int identifyCrossSlipFamily(const unsigned int index)
A helper method for inherting classes to identify to which cross slip family vector a particular slip...