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

Phenomenological constitutive model slip rate userobject class. More...

#include <CrystalPlasticitySlipRateGSS.h>

Inheritance diagram for CrystalPlasticitySlipRateGSS:
[legend]

Public Member Functions

 CrystalPlasticitySlipRateGSS (const InputParameters &parameters)
 
virtual bool calcSlipRate (unsigned int qp, Real dt, std::vector< Real > &val) const
 
virtual bool calcSlipRateDerivative (unsigned int qp, Real, std::vector< Real > &val) const
 
virtual void calcFlowDirection (unsigned int qp, std::vector< RankTwoTensor > &flow_direction) const
 
virtual bool calcSlipRate (unsigned qp, Real dt, std::vector< Real > &val) const =0
 
virtual bool calcSlipRateDerivative (unsigned qp, Real dt, std::vector< Real > &val) const =0
 
virtual unsigned int variableSize () const
 Returns the size of variable. More...
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Member Functions

virtual void readFileFlowRateParams ()
 
virtual void getFlowRateParams ()
 
virtual void getSlipSystems ()
 

Protected Attributes

const MaterialProperty< std::vector< Real > > & _mat_prop_state_var
 
const MaterialProperty< RankTwoTensor > & _pk2
 
DenseVector< Real > _a0
 
DenseVector< Real > _xm
 
const MaterialProperty< std::vector< RankTwoTensor > > & _flow_direction
 
unsigned int _num_slip_sys_props
 Number of slip system specific properties provided in the file containing slip system normals and directions. More...
 
std::vector< Real > _flowprops
 
std::string _slip_sys_file_name
 File should contain slip plane normal and direction. More...
 
std::string _slip_sys_flow_prop_file_name
 File should contain values of the flow rate equation parameters. More...
 
unsigned int _num_slip_sys_flowrate_props
 Number of slip system flow rate parameters. More...
 
Real _slip_incr_tol
 Slip increment tolerance. More...
 
DenseVector< Real > _mo
 
DenseVector< Real > _no
 
const MaterialProperty< RankTwoTensor > & _crysrot
 Crystal rotation. More...
 
unsigned int _variable_size
 

Detailed Description

Phenomenological constitutive model slip rate userobject class.

Definition at line 23 of file CrystalPlasticitySlipRateGSS.h.

Constructor & Destructor Documentation

◆ CrystalPlasticitySlipRateGSS()

CrystalPlasticitySlipRateGSS::CrystalPlasticitySlipRateGSS ( const InputParameters &  parameters)

Definition at line 31 of file CrystalPlasticitySlipRateGSS.C.

32  : CrystalPlasticitySlipRate(parameters),
34  getMaterialProperty<std::vector<Real>>(parameters.get<std::string>("uo_state_var_name"))),
35  _pk2(getMaterialPropertyByName<RankTwoTensor>("pk2")),
38  _flow_direction(getMaterialProperty<std::vector<RankTwoTensor>>(_name + "_flow_direction"))
39 {
40  if (_slip_sys_flow_prop_file_name.length() != 0)
42  else
44 }

Member Function Documentation

◆ calcFlowDirection()

void CrystalPlasticitySlipRateGSS::calcFlowDirection ( unsigned int  qp,
std::vector< RankTwoTensor > &  flow_direction 
) const
virtual

Implements CrystalPlasticitySlipRate.

Definition at line 133 of file CrystalPlasticitySlipRateGSS.C.

135 {
136  DenseVector<Real> mo(LIBMESH_DIM * _variable_size), no(LIBMESH_DIM * _variable_size);
137 
138  // Update slip direction and normal with crystal orientation
139  for (unsigned int i = 0; i < _variable_size; ++i)
140  {
141  for (unsigned int j = 0; j < LIBMESH_DIM; ++j)
142  {
143  mo(i * LIBMESH_DIM + j) = 0.0;
144  for (unsigned int k = 0; k < LIBMESH_DIM; ++k)
145  mo(i * LIBMESH_DIM + j) =
146  mo(i * LIBMESH_DIM + j) + _crysrot[qp](j, k) * _mo(i * LIBMESH_DIM + k);
147  }
148 
149  for (unsigned int j = 0; j < LIBMESH_DIM; ++j)
150  {
151  no(i * LIBMESH_DIM + j) = 0.0;
152  for (unsigned int k = 0; k < LIBMESH_DIM; ++k)
153  no(i * LIBMESH_DIM + j) =
154  no(i * LIBMESH_DIM + j) + _crysrot[qp](j, k) * _no(i * LIBMESH_DIM + k);
155  }
156  }
157 
158  // Calculate Schmid tensor and resolved shear stresses
159  for (unsigned int i = 0; i < _variable_size; ++i)
160  for (unsigned int j = 0; j < LIBMESH_DIM; ++j)
161  for (unsigned int k = 0; k < LIBMESH_DIM; ++k)
162  flow_direction[i](j, k) = mo(i * LIBMESH_DIM + j) * no(i * LIBMESH_DIM + k);
163 }

◆ calcSlipRate() [1/2]

bool CrystalPlasticitySlipRateGSS::calcSlipRate ( unsigned int  qp,
Real  dt,
std::vector< Real > &  val 
) const
virtual

Definition at line 166 of file CrystalPlasticitySlipRateGSS.C.

167 {
168  DenseVector<Real> tau(_variable_size);
169 
170  for (unsigned int i = 0; i < _variable_size; ++i)
171  tau(i) = _pk2[qp].doubleContraction(_flow_direction[qp][i]);
172 
173  for (unsigned int i = 0; i < _variable_size; ++i)
174  {
175  val[i] = _a0(i) * std::pow(std::abs(tau(i) / _mat_prop_state_var[qp][i]), 1.0 / _xm(i)) *
176  std::copysign(1.0, tau(i));
177  if (std::abs(val[i] * dt) > _slip_incr_tol)
178  {
179 #ifdef DEBUG
180  mooseWarning("Maximum allowable slip increment exceeded ", std::abs(val[i]) * dt);
181 #endif
182  return false;
183  }
184  }
185 
186  return true;
187 }

◆ calcSlipRate() [2/2]

virtual bool CrystalPlasticitySlipRate::calcSlipRate ( unsigned  qp,
Real  dt,
std::vector< Real > &  val 
) const
pure virtualinherited

◆ calcSlipRateDerivative() [1/2]

bool CrystalPlasticitySlipRateGSS::calcSlipRateDerivative ( unsigned int  qp,
Real  ,
std::vector< Real > &  val 
) const
virtual

Definition at line 190 of file CrystalPlasticitySlipRateGSS.C.

193 {
194  DenseVector<Real> tau(_variable_size);
195 
196  for (unsigned int i = 0; i < _variable_size; ++i)
197  tau(i) = _pk2[qp].doubleContraction(_flow_direction[qp][i]);
198 
199  for (unsigned int i = 0; i < _variable_size; ++i)
200  val[i] = _a0(i) / _xm(i) *
201  std::pow(std::abs(tau(i) / _mat_prop_state_var[qp][i]), 1.0 / _xm(i) - 1.0) /
202  _mat_prop_state_var[qp][i];
203 
204  return true;
205 }

◆ calcSlipRateDerivative() [2/2]

virtual bool CrystalPlasticitySlipRate::calcSlipRateDerivative ( unsigned  qp,
Real  dt,
std::vector< Real > &  val 
) const
pure virtualinherited

◆ getFlowRateParams()

void CrystalPlasticitySlipRateGSS::getFlowRateParams ( )
protectedvirtual

Reimplemented from CrystalPlasticitySlipRate.

Definition at line 72 of file CrystalPlasticitySlipRateGSS.C.

73 {
74  if (_flowprops.size() <= 0)
75  mooseError("CrystalPlasticitySlipRateGSS: Error in reading flow rate properties: Specify "
76  "input in .i file or a slip_sys_flow_prop_file_name");
77 
78  _a0.resize(_variable_size);
79  _xm.resize(_variable_size);
80 
81  unsigned int num_data_grp = 2 + _num_slip_sys_flowrate_props; // Number of data per group e.g.
82  // start_slip_sys, end_slip_sys,
83  // value1, value2, ..
84 
85  for (unsigned int i = 0; i < _flowprops.size() / num_data_grp; ++i)
86  {
87  Real vs, ve;
88  unsigned int is, ie;
89 
90  vs = _flowprops[i * num_data_grp];
91  ve = _flowprops[i * num_data_grp + 1];
92 
93  if (vs <= 0 || ve <= 0)
94  mooseError("CrystalPlasticitySlipRateGSS: Indices in flow rate parameter read must be "
95  "positive integers: is = ",
96  vs,
97  " ie = ",
98  ve);
99 
100  if (vs != std::floor(vs) || ve != std::floor(ve))
101  mooseError("CrystalPlasticitySlipRateGSS: Error in reading flow props: Values specifying "
102  "start and end number of slip system groups should be integer");
103 
104  is = static_cast<unsigned int>(vs);
105  ie = static_cast<unsigned int>(ve);
106 
107  if (is > ie)
108  mooseError("CrystalPlasticitySlipRateGSS: Start index is = ",
109  is,
110  " should be greater than end index ie = ",
111  ie,
112  " in flow rate parameter read");
113 
114  for (unsigned int j = is; j <= ie; ++j)
115  {
116  _a0(j - 1) = _flowprops[i * num_data_grp + 2];
117  _xm(j - 1) = _flowprops[i * num_data_grp + 3];
118  }
119  }
120 
121  for (unsigned int i = 0; i < _variable_size; ++i)
122  {
123  if (!(_a0(i) > 0.0 && _xm(i) > 0.0))
124  {
125  mooseWarning(
126  "CrystalPlasticitySlipRateGSS: Non-positive flow rate parameters ", _a0(i), ",", _xm(i));
127  break;
128  }
129  }
130 }

Referenced by CrystalPlasticitySlipRateGSS().

◆ getSlipSystems()

void CrystalPlasticitySlipRate::getSlipSystems ( )
protectedvirtualinherited

Definition at line 68 of file CrystalPlasticitySlipRate.C.

69 {
70  Real vec[LIBMESH_DIM];
71  std::ifstream fileslipsys;
72 
73  MooseUtils::checkFileReadable(_slip_sys_file_name);
74 
75  fileslipsys.open(_slip_sys_file_name.c_str());
76 
77  for (unsigned int i = 0; i < _variable_size; ++i)
78  {
79  // Read the slip normal
80  for (unsigned int j = 0; j < LIBMESH_DIM; ++j)
81  if (!(fileslipsys >> vec[j]))
82  mooseError(
83  "CrystalPlasticitySlipRate Error: Premature end of file reading slip system file \n");
84 
85  // Normalize the vectors
86  Real mag;
87  mag = Utility::pow<2>(vec[0]) + Utility::pow<2>(vec[1]) + Utility::pow<2>(vec[2]);
88  mag = std::sqrt(mag);
89 
90  for (unsigned j = 0; j < LIBMESH_DIM; ++j)
91  _no(i * LIBMESH_DIM + j) = vec[j] / mag;
92 
93  // Read the slip direction
94  for (unsigned int j = 0; j < LIBMESH_DIM; ++j)
95  if (!(fileslipsys >> vec[j]))
96  mooseError(
97  "CrystalPlasticitySlipRate Error: Premature end of file reading slip system file \n");
98 
99  // Normalize the vectors
100  mag = Utility::pow<2>(vec[0]) + Utility::pow<2>(vec[1]) + Utility::pow<2>(vec[2]);
101  mag = std::sqrt(mag);
102 
103  for (unsigned int j = 0; j < LIBMESH_DIM; ++j)
104  _mo(i * LIBMESH_DIM + j) = vec[j] / mag;
105 
106  mag = 0.0;
107  for (unsigned int j = 0; j < LIBMESH_DIM; ++j)
108  mag += _mo(i * LIBMESH_DIM + j) * _no(i * LIBMESH_DIM + j);
109 
110  if (std::abs(mag) > 1e-8)
111  mooseError("CrystalPlasticitySlipRate Error: Slip direction and normal not orthonormal, "
112  "System number = ",
113  i,
114  "\n");
115  }
116 
117  fileslipsys.close();
118 }

Referenced by CrystalPlasticitySlipRate::CrystalPlasticitySlipRate().

◆ readFileFlowRateParams()

void CrystalPlasticitySlipRateGSS::readFileFlowRateParams ( )
protectedvirtual

Reimplemented from CrystalPlasticitySlipRate.

Definition at line 47 of file CrystalPlasticitySlipRateGSS.C.

48 {
49  MooseUtils::checkFileReadable(_slip_sys_flow_prop_file_name);
50 
51  std::ifstream file;
52  file.open(_slip_sys_flow_prop_file_name.c_str());
53 
54  std::vector<Real> vec;
55  vec.resize(_num_slip_sys_flowrate_props);
56 
57  for (unsigned int i = 0; i < _variable_size; ++i)
58  {
59  for (unsigned int j = 0; j < _num_slip_sys_flowrate_props; ++j)
60  if (!(file >> vec[j]))
61  mooseError(
62  "Error CrystalPlasticitySlipRateGSS: Premature end of slip_sys_flow_rate_param file");
63 
64  _a0(i) = vec[0];
65  _xm(i) = vec[1];
66  }
67 
68  file.close();
69 }

Referenced by CrystalPlasticitySlipRateGSS().

◆ validParams()

InputParameters CrystalPlasticitySlipRateGSS::validParams ( )
static

Definition at line 19 of file CrystalPlasticitySlipRateGSS.C.

20 {
21  InputParameters params = CrystalPlasticitySlipRate::validParams();
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.addClassDescription("Phenomenological constitutive model slip rate class. Override the "
27  "virtual functions in your class");
28  return params;
29 }

◆ variableSize()

unsigned int CrystalPlasticityUOBase::variableSize ( ) const
virtualinherited

Returns the size of variable.

Definition at line 30 of file CrystalPlasticityUOBase.C.

31 {
32  return _variable_size;
33 }

Member Data Documentation

◆ _a0

DenseVector<Real> CrystalPlasticitySlipRateGSS::_a0
protected

◆ _crysrot

const MaterialProperty<RankTwoTensor>& CrystalPlasticitySlipRate::_crysrot
protectedinherited

Crystal rotation.

Definition at line 70 of file CrystalPlasticitySlipRate.h.

Referenced by calcFlowDirection().

◆ _flow_direction

const MaterialProperty<std::vector<RankTwoTensor> >& CrystalPlasticitySlipRateGSS::_flow_direction
protected

Definition at line 46 of file CrystalPlasticitySlipRateGSS.h.

Referenced by calcSlipRate(), and calcSlipRateDerivative().

◆ _flowprops

std::vector<Real> CrystalPlasticitySlipRate::_flowprops
protectedinherited

Definition at line 47 of file CrystalPlasticitySlipRate.h.

Referenced by getFlowRateParams().

◆ _mat_prop_state_var

const MaterialProperty<std::vector<Real> >& CrystalPlasticitySlipRateGSS::_mat_prop_state_var
protected

Definition at line 39 of file CrystalPlasticitySlipRateGSS.h.

Referenced by calcSlipRate(), and calcSlipRateDerivative().

◆ _mo

DenseVector<Real> CrystalPlasticitySlipRate::_mo
protectedinherited

◆ _no

DenseVector<Real> CrystalPlasticitySlipRate::_no
protectedinherited

◆ _num_slip_sys_flowrate_props

unsigned int CrystalPlasticitySlipRate::_num_slip_sys_flowrate_props
protectedinherited

Number of slip system flow rate parameters.

Definition at line 61 of file CrystalPlasticitySlipRate.h.

Referenced by getFlowRateParams(), and readFileFlowRateParams().

◆ _num_slip_sys_props

unsigned int CrystalPlasticitySlipRate::_num_slip_sys_props
protectedinherited

Number of slip system specific properties provided in the file containing slip system normals and directions.

Definition at line 45 of file CrystalPlasticitySlipRate.h.

◆ _pk2

const MaterialProperty<RankTwoTensor>& CrystalPlasticitySlipRateGSS::_pk2
protected

Definition at line 41 of file CrystalPlasticitySlipRateGSS.h.

Referenced by calcSlipRate(), and calcSlipRateDerivative().

◆ _slip_incr_tol

Real CrystalPlasticitySlipRate::_slip_incr_tol
protectedinherited

Slip increment tolerance.

Definition at line 64 of file CrystalPlasticitySlipRate.h.

Referenced by calcSlipRate().

◆ _slip_sys_file_name

std::string CrystalPlasticitySlipRate::_slip_sys_file_name
protectedinherited

File should contain slip plane normal and direction.

Definition at line 50 of file CrystalPlasticitySlipRate.h.

Referenced by CrystalPlasticitySlipRate::getSlipSystems().

◆ _slip_sys_flow_prop_file_name

std::string CrystalPlasticitySlipRate::_slip_sys_flow_prop_file_name
protectedinherited

File should contain values of the flow rate equation parameters.

Values for every slip system must be provided. Should have the same order of slip systens as in slip_sys_file. The option of reading all the properties from .i is still present.

Definition at line 58 of file CrystalPlasticitySlipRate.h.

Referenced by CrystalPlasticitySlipRateGSS(), and readFileFlowRateParams().

◆ _variable_size

unsigned int CrystalPlasticityUOBase::_variable_size
protectedinherited

◆ _xm

DenseVector<Real> CrystalPlasticitySlipRateGSS::_xm
protected

The documentation for this class was generated from the following files:
CrystalPlasticitySlipRate::_flowprops
std::vector< Real > _flowprops
Definition: CrystalPlasticitySlipRate.h:47
CrystalPlasticitySlipRateGSS::getFlowRateParams
virtual void getFlowRateParams()
Definition: CrystalPlasticitySlipRateGSS.C:72
CrystalPlasticitySlipRateGSS::_flow_direction
const MaterialProperty< std::vector< RankTwoTensor > > & _flow_direction
Definition: CrystalPlasticitySlipRateGSS.h:46
pow
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
Definition: ExpressionBuilder.h:673
CrystalPlasticitySlipRate::_mo
DenseVector< Real > _mo
Definition: CrystalPlasticitySlipRate.h:66
CrystalPlasticitySlipRateGSS::_pk2
const MaterialProperty< RankTwoTensor > & _pk2
Definition: CrystalPlasticitySlipRateGSS.h:41
CrystalPlasticitySlipRate::_no
DenseVector< Real > _no
Definition: CrystalPlasticitySlipRate.h:67
CrystalPlasticitySlipRate::_slip_sys_flow_prop_file_name
std::string _slip_sys_flow_prop_file_name
File should contain values of the flow rate equation parameters.
Definition: CrystalPlasticitySlipRate.h:58
CrystalPlasticitySlipRate::validParams
static InputParameters validParams()
Definition: CrystalPlasticitySlipRate.C:18
CrystalPlasticitySlipRateGSS::readFileFlowRateParams
virtual void readFileFlowRateParams()
Definition: CrystalPlasticitySlipRateGSS.C:47
CrystalPlasticitySlipRateGSS::_xm
DenseVector< Real > _xm
Definition: CrystalPlasticitySlipRateGSS.h:44
CrystalPlasticitySlipRateGSS::_mat_prop_state_var
const MaterialProperty< std::vector< Real > > & _mat_prop_state_var
Definition: CrystalPlasticitySlipRateGSS.h:39
CrystalPlasticityUOBase::_variable_size
unsigned int _variable_size
Definition: CrystalPlasticityUOBase.h:33
CrystalPlasticitySlipRate::_crysrot
const MaterialProperty< RankTwoTensor > & _crysrot
Crystal rotation.
Definition: CrystalPlasticitySlipRate.h:70
CrystalPlasticitySlipRate::CrystalPlasticitySlipRate
CrystalPlasticitySlipRate(const InputParameters &parameters)
Definition: CrystalPlasticitySlipRate.C:42
CrystalPlasticitySlipRate::_slip_incr_tol
Real _slip_incr_tol
Slip increment tolerance.
Definition: CrystalPlasticitySlipRate.h:64
CrystalPlasticitySlipRate::_slip_sys_file_name
std::string _slip_sys_file_name
File should contain slip plane normal and direction.
Definition: CrystalPlasticitySlipRate.h:50
CrystalPlasticitySlipRate::_num_slip_sys_flowrate_props
unsigned int _num_slip_sys_flowrate_props
Number of slip system flow rate parameters.
Definition: CrystalPlasticitySlipRate.h:61
CrystalPlasticitySlipRateGSS::_a0
DenseVector< Real > _a0
Definition: CrystalPlasticitySlipRateGSS.h:43