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

Crystal plasticity slip rate userobject class The virtual functions written below must be over-ridden in derived classes to provide actual values. More...

#include <CrystalPlasticitySlipRate.h>

Inheritance diagram for CrystalPlasticitySlipRate:
[legend]

Public Member Functions

 CrystalPlasticitySlipRate (const InputParameters &parameters)
 
virtual void calcFlowDirection (unsigned int qp, std::vector< RankTwoTensor > &flow_direction) const =0
 
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 getSlipSystems ()
 
virtual void readFileFlowRateParams ()
 
virtual void getFlowRateParams ()
 

Protected Attributes

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

Crystal plasticity slip rate userobject class The virtual functions written below must be over-ridden in derived classes to provide actual values.

Definition at line 23 of file CrystalPlasticitySlipRate.h.

Constructor & Destructor Documentation

CrystalPlasticitySlipRate::CrystalPlasticitySlipRate ( const InputParameters &  parameters)

Definition at line 38 of file CrystalPlasticitySlipRate.C.

39  : CrystalPlasticityUOBase(parameters),
40  _num_slip_sys_props(getParam<unsigned int>("num_slip_sys_props")),
41  _flowprops(getParam<std::vector<Real>>("flowprops")),
42  _slip_sys_file_name(getParam<FileName>("slip_sys_file_name")),
43  _slip_sys_flow_prop_file_name(getParam<FileName>("slip_sys_flow_prop_file_name")),
44  _num_slip_sys_flowrate_props(getParam<unsigned int>("num_slip_sys_flowrate_props")),
45  _slip_incr_tol(getParam<Real>("slip_incr_tol")),
46  _mo(_variable_size * LIBMESH_DIM),
47  _no(_variable_size * LIBMESH_DIM),
48  _crysrot(getMaterialPropertyByName<RankTwoTensor>("crysrot"))
49 {
51 }
unsigned int _num_slip_sys_props
Number of slip system specific properties provided in the file containing slip system normals and dir...
CrystalPlasticityUOBase(const InputParameters &parameters)
std::string _slip_sys_flow_prop_file_name
File should contain values of the flow rate equation parameters.
Real _slip_incr_tol
Slip increment tolerance.
unsigned int _num_slip_sys_flowrate_props
Number of slip system flow rate parameters.
const MaterialProperty< RankTwoTensor > & _crysrot
Crystal rotation.
std::string _slip_sys_file_name
File should contain slip plane normal and direction.

Member Function Documentation

virtual void CrystalPlasticitySlipRate::calcFlowDirection ( unsigned int  qp,
std::vector< RankTwoTensor > &  flow_direction 
) const
pure virtual
virtual bool CrystalPlasticitySlipRate::calcSlipRate ( unsigned  qp,
Real  dt,
std::vector< Real > &  val 
) const
pure virtual
virtual bool CrystalPlasticitySlipRate::calcSlipRateDerivative ( unsigned  qp,
Real  dt,
std::vector< Real > &  val 
) const
pure virtual
void CrystalPlasticitySlipRate::getFlowRateParams ( )
protectedvirtual

Reimplemented in CrystalPlasticitySlipRateGSS.

Definition at line 59 of file CrystalPlasticitySlipRate.C.

60 {
61 }
void CrystalPlasticitySlipRate::getSlipSystems ( )
protectedvirtual

Definition at line 64 of file CrystalPlasticitySlipRate.C.

Referenced by 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 CrystalPlasticitySlipRate::readFileFlowRateParams ( )
protectedvirtual

Reimplemented in CrystalPlasticitySlipRateGSS.

Definition at line 54 of file CrystalPlasticitySlipRate.C.

55 {
56 }
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

const MaterialProperty<RankTwoTensor>& CrystalPlasticitySlipRate::_crysrot
protected

Crystal rotation.

Definition at line 66 of file CrystalPlasticitySlipRate.h.

Referenced by CrystalPlasticitySlipRateGSS::calcFlowDirection().

std::vector<Real> CrystalPlasticitySlipRate::_flowprops
protected
DenseVector<Real> CrystalPlasticitySlipRate::_mo
protected
DenseVector<Real> CrystalPlasticitySlipRate::_no
protected
unsigned int CrystalPlasticitySlipRate::_num_slip_sys_flowrate_props
protected

Number of slip system flow rate parameters.

Definition at line 57 of file CrystalPlasticitySlipRate.h.

Referenced by CrystalPlasticitySlipRateGSS::getFlowRateParams(), and CrystalPlasticitySlipRateGSS::readFileFlowRateParams().

unsigned int CrystalPlasticitySlipRate::_num_slip_sys_props
protected

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

Definition at line 41 of file CrystalPlasticitySlipRate.h.

Real CrystalPlasticitySlipRate::_slip_incr_tol
protected

Slip increment tolerance.

Definition at line 60 of file CrystalPlasticitySlipRate.h.

Referenced by CrystalPlasticitySlipRateGSS::calcSlipRate().

std::string CrystalPlasticitySlipRate::_slip_sys_file_name
protected

File should contain slip plane normal and direction.

Definition at line 46 of file CrystalPlasticitySlipRate.h.

Referenced by getSlipSystems().

std::string CrystalPlasticitySlipRate::_slip_sys_flow_prop_file_name
protected

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::CrystalPlasticitySlipRateGSS(), and CrystalPlasticitySlipRateGSS::readFileFlowRateParams().

unsigned int CrystalPlasticityUOBase::_variable_size
protectedinherited

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