https://mooseframework.inl.gov
Loading...
Searching...
No Matches
CrystalPlasticityStateVarRateComponentGSS.C
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
11#include <cmath>
12
14
17{
19 params.addParam<std::string>(
20 "uo_slip_rate_name",
21 "Name of slip rate property: Same as slip rate user object specified in input file.");
22 params.addParam<std::string>("uo_state_var_name",
23 "Name of state variable property: Same as "
24 "state variable user object specified in input "
25 "file.");
26 params.addParam<FileName>(
27 "slip_sys_hard_prop_file_name",
28 "",
29 "Name of the file containing the values of hardness evolution parameters");
30 params.addParam<std::vector<Real>>("hprops", "Hardening properties");
31 params.addClassDescription("Phenomenological constitutive model state variable evolution rate "
32 "component base class. Override the virtual functions in your class");
33 return params;
34}
35
37 const InputParameters & parameters)
39 _mat_prop_slip_rate(
40 getMaterialProperty<std::vector<Real>>(parameters.get<std::string>("uo_slip_rate_name"))),
41 _mat_prop_state_var(
42 getMaterialProperty<std::vector<Real>>(parameters.get<std::string>("uo_state_var_name"))),
43 _slip_sys_hard_prop_file_name(getParam<FileName>("slip_sys_hard_prop_file_name")),
44 _hprops(getParam<std::vector<Real>>("hprops"))
45{
46}
47
48bool
50 unsigned int qp, std::vector<Real> & val) const
51{
52 val.assign(_variable_size, 0.0);
53
54 Real r = _hprops[0];
55 Real h0 = _hprops[1];
56 Real tau_sat = _hprops[2];
57
58 DenseVector<Real> hb(_variable_size);
59 Real qab;
60 Real a = _hprops[3]; // Kalidindi
61
62 for (unsigned int i = 0; i < _variable_size; ++i)
63 hb(i) = h0 * std::pow(std::abs(1.0 - _mat_prop_state_var[qp][i] / tau_sat), a) *
64 std::copysign(1.0, 1.0 - _mat_prop_state_var[qp][i] / tau_sat);
65
66 for (unsigned int i = 0; i < _variable_size; ++i)
67 {
68 for (unsigned int j = 0; j < _variable_size; ++j)
69 {
70 unsigned int iplane, jplane;
71 iplane = i / 3;
72 jplane = j / 3;
73
74 if (iplane == jplane) // Kalidindi
75 qab = 1.0;
76 else
77 qab = r;
78
79 val[i] += std::abs(_mat_prop_slip_rate[qp][j]) * qab * hb(j);
80 }
81 }
82
83 return true;
84}
registerMooseObject("SolidMechanicsApp", CrystalPlasticityStateVarRateComponentGSS)
Phenomenological constitutive model state variable evolution rate component userobject class.
const MaterialProperty< std::vector< Real > > & _mat_prop_state_var
CrystalPlasticityStateVarRateComponentGSS(const InputParameters &parameters)
virtual bool calcStateVariableEvolutionRateComponent(unsigned int qp, std::vector< Real > &val) const
const MaterialProperty< std::vector< Real > > & _mat_prop_slip_rate
Crystal plasticity state variable evolution rate component userobject base class.
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)