www.mooseframework.org
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...
 

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 21 of file CrystalPlasticitySlipRateGSS.h.

Constructor & Destructor Documentation

CrystalPlasticitySlipRateGSS::CrystalPlasticitySlipRateGSS ( const InputParameters &  parameters)

Definition at line 25 of file CrystalPlasticitySlipRateGSS.C.

26  : CrystalPlasticitySlipRate(parameters),
28  getMaterialProperty<std::vector<Real>>(parameters.get<std::string>("uo_state_var_name"))),
29  _pk2(getMaterialPropertyByName<RankTwoTensor>("pk2")),
32  _flow_direction(getMaterialProperty<std::vector<RankTwoTensor>>(_name + "_flow_direction"))
33 {
34  if (_slip_sys_flow_prop_file_name.length() != 0)
36  else
38 }
std::string _slip_sys_flow_prop_file_name
File should contain values of the flow rate equation parameters.
const MaterialProperty< std::vector< RankTwoTensor > > & _flow_direction
CrystalPlasticitySlipRate(const InputParameters &parameters)
const MaterialProperty< RankTwoTensor > & _pk2
const MaterialProperty< std::vector< Real > > & _mat_prop_state_var

Member Function Documentation

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

Implements CrystalPlasticitySlipRate.

Definition at line 127 of file CrystalPlasticitySlipRateGSS.C.

129 {
130  DenseVector<Real> mo(LIBMESH_DIM * _variable_size), no(LIBMESH_DIM * _variable_size);
131 
132  // Update slip direction and normal with crystal orientation
133  for (unsigned int i = 0; i < _variable_size; ++i)
134  {
135  for (unsigned int j = 0; j < LIBMESH_DIM; ++j)
136  {
137  mo(i * LIBMESH_DIM + j) = 0.0;
138  for (unsigned int k = 0; k < LIBMESH_DIM; ++k)
139  mo(i * LIBMESH_DIM + j) =
140  mo(i * LIBMESH_DIM + j) + _crysrot[qp](j, k) * _mo(i * LIBMESH_DIM + k);
141  }
142 
143  for (unsigned int j = 0; j < LIBMESH_DIM; ++j)
144  {
145  no(i * LIBMESH_DIM + j) = 0.0;
146  for (unsigned int k = 0; k < LIBMESH_DIM; ++k)
147  no(i * LIBMESH_DIM + j) =
148  no(i * LIBMESH_DIM + j) + _crysrot[qp](j, k) * _no(i * LIBMESH_DIM + k);
149  }
150  }
151 
152  // Calculate Schmid tensor and resolved shear stresses
153  for (unsigned int i = 0; i < _variable_size; ++i)
154  for (unsigned int j = 0; j < LIBMESH_DIM; ++j)
155  for (unsigned int k = 0; k < LIBMESH_DIM; ++k)
156  flow_direction[i](j, k) = mo(i * LIBMESH_DIM + j) * no(i * LIBMESH_DIM + k);
157 }
const MaterialProperty< RankTwoTensor > & _crysrot
Crystal rotation.
bool CrystalPlasticitySlipRateGSS::calcSlipRate ( unsigned int  qp,
Real  dt,
std::vector< Real > &  val 
) const
virtual

Definition at line 160 of file CrystalPlasticitySlipRateGSS.C.

161 {
162  DenseVector<Real> tau(_variable_size);
163 
164  for (unsigned int i = 0; i < _variable_size; ++i)
165  tau(i) = _pk2[qp].doubleContraction(_flow_direction[qp][i]);
166 
167  for (unsigned int i = 0; i < _variable_size; ++i)
168  {
169  val[i] = _a0(i) * std::pow(std::abs(tau(i) / _mat_prop_state_var[qp][i]), 1.0 / _xm(i)) *
170  copysign(1.0, tau(i));
171  if (std::abs(val[i] * dt) > _slip_incr_tol)
172  {
173 #ifdef DEBUG
174  mooseWarning("Maximum allowable slip increment exceeded ", std::abs(val[i]) * dt);
175 #endif
176  return false;
177  }
178  }
179 
180  return true;
181 }
Real _slip_incr_tol
Slip increment tolerance.
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const MaterialProperty< std::vector< RankTwoTensor > > & _flow_direction
const MaterialProperty< RankTwoTensor > & _pk2
const MaterialProperty< std::vector< Real > > & _mat_prop_state_var
virtual bool CrystalPlasticitySlipRate::calcSlipRate ( unsigned  qp,
Real  dt,
std::vector< Real > &  val 
) const
pure virtualinherited
bool CrystalPlasticitySlipRateGSS::calcSlipRateDerivative ( unsigned int  qp,
Real  ,
std::vector< Real > &  val 
) const
virtual

Definition at line 184 of file CrystalPlasticitySlipRateGSS.C.

187 {
188  DenseVector<Real> tau(_variable_size);
189 
190  for (unsigned int i = 0; i < _variable_size; ++i)
191  tau(i) = _pk2[qp].doubleContraction(_flow_direction[qp][i]);
192 
193  for (unsigned int i = 0; i < _variable_size; ++i)
194  val[i] = _a0(i) / _xm(i) *
195  std::pow(std::abs(tau(i) / _mat_prop_state_var[qp][i]), 1.0 / _xm(i) - 1.0) /
196  _mat_prop_state_var[qp][i];
197 
198  return true;
199 }
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const MaterialProperty< std::vector< RankTwoTensor > > & _flow_direction
const MaterialProperty< RankTwoTensor > & _pk2
const MaterialProperty< std::vector< Real > > & _mat_prop_state_var
virtual bool CrystalPlasticitySlipRate::calcSlipRateDerivative ( unsigned  qp,
Real  dt,
std::vector< Real > &  val 
) const
pure virtualinherited
void CrystalPlasticitySlipRateGSS::getFlowRateParams ( )
protectedvirtual

Reimplemented from CrystalPlasticitySlipRate.

Definition at line 66 of file CrystalPlasticitySlipRateGSS.C.

Referenced by CrystalPlasticitySlipRateGSS().

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

Definition at line 64 of file CrystalPlasticitySlipRate.C.

Referenced by CrystalPlasticitySlipRate::CrystalPlasticitySlipRate().

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

Reimplemented from CrystalPlasticitySlipRate.

Definition at line 41 of file CrystalPlasticitySlipRateGSS.C.

Referenced by CrystalPlasticitySlipRateGSS().

42 {
43  MooseUtils::checkFileReadable(_slip_sys_flow_prop_file_name);
44 
45  std::ifstream file;
46  file.open(_slip_sys_flow_prop_file_name.c_str());
47 
48  std::vector<Real> vec;
49  vec.resize(_num_slip_sys_flowrate_props);
50 
51  for (unsigned int i = 0; i < _variable_size; ++i)
52  {
53  for (unsigned int j = 0; j < _num_slip_sys_flowrate_props; ++j)
54  if (!(file >> vec[j]))
55  mooseError(
56  "Error CrystalPlasticitySlipRateGSS: Premature end of slip_sys_flow_rate_param file");
57 
58  _a0(i) = vec[0];
59  _xm(i) = vec[1];
60  }
61 
62  file.close();
63 }
std::string _slip_sys_flow_prop_file_name
File should contain values of the flow rate equation parameters.
unsigned int _num_slip_sys_flowrate_props
Number of slip system flow rate parameters.
unsigned int CrystalPlasticityUOBase::variableSize ( ) const
virtualinherited

Returns the size of variable.

Definition at line 26 of file CrystalPlasticityUOBase.C.

27 {
28  return _variable_size;
29 }

Member Data Documentation

DenseVector<Real> CrystalPlasticitySlipRateGSS::_a0
protected
const MaterialProperty<RankTwoTensor>& CrystalPlasticitySlipRate::_crysrot
protectedinherited

Crystal rotation.

Definition at line 66 of file CrystalPlasticitySlipRate.h.

Referenced by calcFlowDirection().

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

Definition at line 42 of file CrystalPlasticitySlipRateGSS.h.

Referenced by calcSlipRate(), and calcSlipRateDerivative().

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

Definition at line 43 of file CrystalPlasticitySlipRate.h.

Referenced by getFlowRateParams().

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

Definition at line 35 of file CrystalPlasticitySlipRateGSS.h.

Referenced by calcSlipRate(), and calcSlipRateDerivative().

DenseVector<Real> CrystalPlasticitySlipRate::_mo
protectedinherited
DenseVector<Real> CrystalPlasticitySlipRate::_no
protectedinherited
unsigned int CrystalPlasticitySlipRate::_num_slip_sys_flowrate_props
protectedinherited

Number of slip system flow rate parameters.

Definition at line 57 of file CrystalPlasticitySlipRate.h.

Referenced by getFlowRateParams(), and readFileFlowRateParams().

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 41 of file CrystalPlasticitySlipRate.h.

const MaterialProperty<RankTwoTensor>& CrystalPlasticitySlipRateGSS::_pk2
protected

Definition at line 37 of file CrystalPlasticitySlipRateGSS.h.

Referenced by calcSlipRate(), and calcSlipRateDerivative().

Real CrystalPlasticitySlipRate::_slip_incr_tol
protectedinherited

Slip increment tolerance.

Definition at line 60 of file CrystalPlasticitySlipRate.h.

Referenced by calcSlipRate().

std::string CrystalPlasticitySlipRate::_slip_sys_file_name
protectedinherited

File should contain slip plane normal and direction.

Definition at line 46 of file CrystalPlasticitySlipRate.h.

Referenced by CrystalPlasticitySlipRate::getSlipSystems().

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 54 of file CrystalPlasticitySlipRate.h.

Referenced by CrystalPlasticitySlipRateGSS(), and readFileFlowRateParams().

unsigned int CrystalPlasticityUOBase::_variable_size
protectedinherited
DenseVector<Real> CrystalPlasticitySlipRateGSS::_xm
protected

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