www.mooseframework.org
CrystalPlasticityStateVarRateComponentVoce.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
11 #include "MooseError.h"
12 
14 
16 
17 InputParameters
19 {
20 
21  InputParameters params = CrystalPlasticityStateVarRateComponent::validParams();
22  params.addParam<std::string>(
23  "uo_slip_rate_name",
24  "Name of slip rate property: Same as slip rate user object specified in input file.");
25  params.addParam<std::string>("uo_state_var_name",
26  "Name of state variable property: Same as "
27  "state variable user object specified in input "
28  "file.");
29  params.addParam<MooseEnum>(
30  "crystal_lattice_type",
32  "Type of crystal lattyce structure output");
33  params.addParam<std::vector<unsigned int>>("groups",
34  "To group the initial values on different "
35  "slip systems 'format: [start end)', i.e.'0 "
36  "12 24 48' groups 0-11, 12-23 and 24-48 ");
37  params.addParam<std::vector<Real>>("h0_group_values",
38  "h0 hardening constant for each group "
39  " i.e. '0.0 1.0 2.0' means 0-11 = 0.0, "
40  "12-23 = 1.0 and 24-48 = 2.0 ");
41  params.addParam<std::vector<Real>>("tau0_group_values",
42  "The initial critical resolved shear stress"
43  "corresponding to each group"
44  " i.e. '100.0 110.0 120.0' means 0-11 = 100.0, "
45  "12-23 = 110.0 and 24-48 = 120.0 ");
46  params.addParam<std::vector<Real>>("tauSat_group_values",
47  "The saturation resolved shear stress"
48  "corresponding to each group"
49  " i.e. '150.0 170.0 180.0' means 0-11 = 150.0, "
50  "12-23 = 170.0 and 24-48 = 180.0 ");
51  params.addParam<std::vector<Real>>("hardeningExponent_group_values",
52  "The hardening exponent m"
53  "corresponding to each group"
54  " i.e. '1.0 2.0 3.0' means 0-11 = 1.0, "
55  "12-23 = 2.0 and 24-48 = 3.0 ");
56  params.addParam<std::vector<Real>>("selfHardening_group_values",
57  "The self hardening coefficient q_aa"
58  "corresponding to each group"
59  " i.e. '1.0 2.0 3.0' means 0-11 = 1.0, "
60  "12-23 = 2.0 and 24-48 = 3.0 "
61  " usually these are all 1.");
62  params.addParam<std::vector<Real>>("coplanarHardening_group_values",
63  "The coplanar latent hardening coefficient q_ab"
64  "corresponding to each group"
65  " i.e. '1.0 2.0 3.0' means 0-11 = 1.0, "
66  "12-23 = 2.0 and 24-48 = 3.0 ");
67  params.addParam<std::vector<Real>>("GroupGroup_Hardening_group_values",
68  "The group-to-group latent hardening coefficient q_ab"
69  "This is a NxN vector"
70  " i.e. '1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0' "
71  "means non-coplanar slip systems in gr_11,22,33= "
72  "1.0, 5.0 and 9.0 respectively."
73  "latent hardening between for gr_12,13 = 2.0 3.0"
74  " respectively");
75  params.addClassDescription("Phenomenological Voce constitutive model state variable evolution "
76  "rate component base class.");
77  return params;
78 }
79 
81  const InputParameters & parameters)
83  _mat_prop_slip_rate(
84  getMaterialProperty<std::vector<Real>>(parameters.get<std::string>("uo_slip_rate_name"))),
85  _mat_prop_state_var(
86  getMaterialProperty<std::vector<Real>>(parameters.get<std::string>("uo_state_var_name"))),
87  _crystal_lattice_type(getParam<MooseEnum>("crystal_lattice_type")),
88  _groups(getParam<std::vector<unsigned int>>("groups")),
89  _h0_group_values(getParam<std::vector<Real>>("h0_group_values")),
90  _tau0_group_values(getParam<std::vector<Real>>("tau0_group_values")),
91  _tauSat_group_values(getParam<std::vector<Real>>("tauSat_group_values")),
92  _hardeningExponent_group_values(getParam<std::vector<Real>>("hardeningExponent_group_values")),
93  _selfHardening_group_values(getParam<std::vector<Real>>("selfHardening_group_values")),
94  _coplanarHardening_group_values(getParam<std::vector<Real>>("coplanarHardening_group_values")),
95  _GroupGroup_Hardening_group_values(
96  getParam<std::vector<Real>>("GroupGroup_Hardening_group_values")),
97  _n_groups(_groups.size())
98 {
99  // perform input checks
100  if (_n_groups < 2)
101  paramError("groups",
102  "the number of slip system groups provided is not "
103  "correct. At least two values are expected");
104 
105  // check the size of all the user provided parameters
106  if (_h0_group_values.size() != _n_groups - 1)
107  paramError("h0_group_values",
108  "the number of supplied parameters does not"
109  " match the number of ip system groups");
110 
111  if (_tau0_group_values.size() != _n_groups - 1)
112  paramError("tau0_group_values",
113  "the number of supplied parameters does "
114  "not match the number of slip system groups");
115 
116  if (_tauSat_group_values.size() != _n_groups - 1)
117  paramError("tauSat_group_values",
118  "the number of supplied parameters does "
119  "not match the number of slip system groups");
120 
121  if (_hardeningExponent_group_values.size() != _n_groups - 1)
122  paramError("hardeningExponent_group_values",
123  "the number of supplied "
124  "parameters does not match the number of slip system groups");
125 
126  if (_selfHardening_group_values.size() != _n_groups - 1)
127  paramError("selfHardening_group_values",
128  "the number of supplied parameters "
129  "does not match the number of slip system groups");
130 
131  if (_coplanarHardening_group_values.size() != _n_groups - 1)
132  paramError("coplanarHardening_group_values",
133  "the number of supplied "
134  "parameters does not match the number of slip system groups");
135 
136  if (_GroupGroup_Hardening_group_values.size() != (_n_groups - 1) * (_n_groups - 1))
137  paramError("GroupGroup_Hardening_group_values",
138  "the number of supplied "
139  "parameters does not match the number of slip system groups");
140 
141  // initialize useful variables;
144 }
145 
146 bool
148  unsigned int qp, std::vector<Real> & val) const
149 {
150  val.assign(_variable_size, 0.0);
151 
152  unsigned int group_i;
153  Real h0;
154  Real tau_0;
155  Real tau_sat;
156  Real hardening_exponenet;
157  Real delta_tau;
158 
159  DenseVector<Real> hb(_variable_size);
160 
161  for (unsigned int i = 0; i < _variable_size; ++i)
162  {
163  group_i = _slipSystem_GroupID[i];
164  h0 = _h0_group_values[group_i];
165  tau_0 = _tau0_group_values[group_i];
166  tau_sat = _tauSat_group_values[group_i];
167  hardening_exponenet = _hardeningExponent_group_values[group_i];
168 
169  delta_tau = tau_sat - tau_0;
170 
171  hb(i) = h0 *
172  std::pow(std::abs(1.0 - (_mat_prop_state_var[qp][i] - tau_0) / delta_tau),
173  hardening_exponenet) *
174  std::copysign(1.0, 1.0 - (_mat_prop_state_var[qp][i] - tau_0) / delta_tau);
175  }
176 
177  for (unsigned int i = 0; i < _variable_size; ++i)
178  for (unsigned int j = 0; j < _variable_size; ++j)
179  {
180  const Real q_ab = getHardeningCoefficient(i, j);
181  val[i] += std::abs(_mat_prop_slip_rate[qp][j]) * q_ab * hb(j);
182  }
183 
184  return true;
185 }
186 
187 MooseEnum
189 {
190  return MooseEnum("FCC BCC", "FCC");
191 }
192 
193 void
195  std::vector<unsigned int> & _slipSystem_PlaneID) const
196 {
198 
199  for (unsigned int slipSystemIndex = 0; slipSystemIndex < _variable_size; ++slipSystemIndex)
200  switch (_crystal_lattice_type)
201  {
202  case 0: // FCC
203  if (slipSystemIndex < 12)
204  _slipSystem_PlaneID[slipSystemIndex] = slipSystemIndex / 3;
205  else
206  mooseError("FCC with more than 12 slip planes is not implemented ");
207 
208  break;
209 
210  case 1: // BCC
211  if (slipSystemIndex < 12)
212  _slipSystem_PlaneID[slipSystemIndex] = slipSystemIndex / 2;
213 
214  else if (slipSystemIndex >= 12 && slipSystemIndex < 48)
215  _slipSystem_PlaneID[slipSystemIndex] = (slipSystemIndex - 6);
216 
217  else
218  mooseError("BCC with more than 48 slip systems is not implemented ");
219 
220  break;
221 
222  default:
223  mooseError("VoceHardeningError: Pass valid crustal_structure_type ");
224  }
225 }
226 
227 void
229  std::vector<unsigned int> & _slipSystem_GroupID) const
230 {
232 
233  for (unsigned int slipSystemIndex = 0; slipSystemIndex < _variable_size; ++slipSystemIndex)
234  for (unsigned int i = 0; i < _n_groups - 1; ++i)
235  if (slipSystemIndex >= _groups[i] && slipSystemIndex < _groups[i + 1])
236  {
237  _slipSystem_GroupID[slipSystemIndex] = i;
238  break;
239  }
240 }
241 
242 Real
244  unsigned int slipSystemIndex_i, unsigned int slipSystemIndex_j) const
245 {
246  // collect slip system plane and group
247  const unsigned int group_i = _slipSystem_GroupID[slipSystemIndex_i];
248  const unsigned int group_j = _slipSystem_GroupID[slipSystemIndex_j];
249  const unsigned int plane_i = _slipSystem_PlaneID[slipSystemIndex_i];
250  const unsigned int plane_j = _slipSystem_PlaneID[slipSystemIndex_j];
251 
252  // create check for clarity
253  const bool same_slipSystem = slipSystemIndex_i == slipSystemIndex_j;
254  const bool same_group = group_i == group_j;
255  const bool same_plane = plane_i == plane_j;
256 
257  // retrieve appropriate coefficient
258  Real q_ab;
259  if (same_slipSystem)
260  q_ab = _selfHardening_group_values[group_i];
261  else if (same_plane)
262  q_ab = _coplanarHardening_group_values[group_i];
263  else if (same_group) // here for debugging purposes this if could be removed
264  q_ab = _GroupGroup_Hardening_group_values[group_i * (_n_groups - 1) + group_i];
265  else if (!same_group)
266  q_ab = _GroupGroup_Hardening_group_values[group_i * (_n_groups - 1) + group_j];
267  else // here for debugging purposes
268  mooseError("VoceHardeningError:getHardeningCoefficient: case not listed, abort ");
269 
270  return q_ab;
271 }
CrystalPlasticityStateVarRateComponentVoce::_n_groups
const unsigned int _n_groups
the number of slip system groups
Definition: CrystalPlasticityStateVarRateComponentVoce.h:56
CrystalPlasticityStateVarRateComponentVoce::_slipSystem_GroupID
std::vector< unsigned int > _slipSystem_GroupID
the vector associating a slip system to its groud ID
Definition: CrystalPlasticityStateVarRateComponentVoce.h:61
registerMooseObject
registerMooseObject("TensorMechanicsApp", CrystalPlasticityStateVarRateComponentVoce)
CrystalPlasticityStateVarRateComponentVoce::_h0_group_values
std::vector< Real > _h0_group_values
Definition: CrystalPlasticityStateVarRateComponentVoce.h:46
CrystalPlasticityStateVarRateComponentVoce::initSlipSystemPlaneID
virtual void initSlipSystemPlaneID(std::vector< unsigned int > &_slipSystem_PlaneID) const
method associating slip system to their group by generating a vector containing the association betwe...
Definition: CrystalPlasticityStateVarRateComponentVoce.C:194
CrystalPlasticityStateVarRateComponentVoce
Phenomenological constitutive model state variable evolution rate component userobject class.
Definition: CrystalPlasticityStateVarRateComponentVoce.h:23
pow
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
Definition: ExpressionBuilder.h:673
CrystalPlasticityStateVarRateComponentVoce::_coplanarHardening_group_values
std::vector< Real > _coplanarHardening_group_values
Definition: CrystalPlasticityStateVarRateComponentVoce.h:51
CrystalPlasticityStateVarRateComponentVoce::_mat_prop_slip_rate
const MaterialProperty< std::vector< Real > > & _mat_prop_slip_rate
Definition: CrystalPlasticityStateVarRateComponentVoce.h:38
CrystalPlasticityStateVarRateComponentVoce::_groups
std::vector< unsigned int > _groups
the vectors of the input paramters
Definition: CrystalPlasticityStateVarRateComponentVoce.h:45
defineLegacyParams
defineLegacyParams(CrystalPlasticityStateVarRateComponentVoce)
CrystalPlasticityStateVarRateComponentVoce::_selfHardening_group_values
std::vector< Real > _selfHardening_group_values
Definition: CrystalPlasticityStateVarRateComponentVoce.h:50
CrystalPlasticityStateVarRateComponentVoce::_hardeningExponent_group_values
std::vector< Real > _hardeningExponent_group_values
Definition: CrystalPlasticityStateVarRateComponentVoce.h:49
CrystalPlasticityStateVarRateComponentVoce::validParams
static InputParameters validParams()
Definition: CrystalPlasticityStateVarRateComponentVoce.C:18
CrystalPlasticityStateVarRateComponentVoce::_crystal_lattice_type
MooseEnum _crystal_lattice_type
the variable to switch crystal lattice type (i.e. FCC or BCC)
Definition: CrystalPlasticityStateVarRateComponentVoce.h:42
CrystalPlasticityStateVarRateComponentVoce::initSlipSystemGroupID
virtual void initSlipSystemGroupID(std::vector< unsigned int > &_slipSystem_GroupID) const
method associating slip system to their slip plane by generating a vector containing the association ...
Definition: CrystalPlasticityStateVarRateComponentVoce.C:228
CrystalPlasticityStateVarRateComponentVoce.h
CrystalPlasticityUOBase::_variable_size
unsigned int _variable_size
Definition: CrystalPlasticityUOBase.h:33
CrystalPlasticityStateVarRateComponent::validParams
static InputParameters validParams()
Definition: CrystalPlasticityStateVarRateComponent.C:15
CrystalPlasticityStateVarRateComponentVoce::CrystalPlasticityStateVarRateComponentVoce
CrystalPlasticityStateVarRateComponentVoce(const InputParameters &parameters)
Definition: CrystalPlasticityStateVarRateComponentVoce.C:80
CrystalPlasticityStateVarRateComponentVoce::_tau0_group_values
std::vector< Real > _tau0_group_values
Definition: CrystalPlasticityStateVarRateComponentVoce.h:47
CrystalPlasticityStateVarRateComponentVoce::calcStateVariableEvolutionRateComponent
virtual bool calcStateVariableEvolutionRateComponent(unsigned int qp, std::vector< Real > &val) const
computing the slip system hardening rate
Definition: CrystalPlasticityStateVarRateComponentVoce.C:147
CrystalPlasticityStateVarRateComponentVoce::_slipSystem_PlaneID
std::vector< unsigned int > _slipSystem_PlaneID
the vector associating a slip system to its slip plane ID
Definition: CrystalPlasticityStateVarRateComponentVoce.h:59
CrystalPlasticityStateVarRateComponentVoce::crystalLatticeTypeOptions
static MooseEnum crystalLatticeTypeOptions()
class for switching between different crystal lattice types
Definition: CrystalPlasticityStateVarRateComponentVoce.C:188
CrystalPlasticityStateVarRateComponentVoce::_mat_prop_state_var
const MaterialProperty< std::vector< Real > > & _mat_prop_state_var
Definition: CrystalPlasticityStateVarRateComponentVoce.h:39
CrystalPlasticityStateVarRateComponentVoce::_tauSat_group_values
std::vector< Real > _tauSat_group_values
Definition: CrystalPlasticityStateVarRateComponentVoce.h:48
CrystalPlasticityStateVarRateComponentVoce::getHardeningCoefficient
virtual Real getHardeningCoefficient(unsigned int slipSystemIndex_i, unsigned int slipSystemIndex_j) const
method retriving the appropiate self/latent hardening coefficient
Definition: CrystalPlasticityStateVarRateComponentVoce.C:243
CrystalPlasticityStateVarRateComponentVoce::_GroupGroup_Hardening_group_values
std::vector< Real > _GroupGroup_Hardening_group_values
Definition: CrystalPlasticityStateVarRateComponentVoce.h:52
CrystalPlasticityStateVarRateComponent
Crystal plasticity state variable evolution rate component userobject base class.
Definition: CrystalPlasticityStateVarRateComponent.h:24