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

Constructor & Destructor Documentation

◆ CrystalPlasticitySlipRate()

CrystalPlasticitySlipRate::CrystalPlasticitySlipRate ( const InputParameters &  parameters)

Definition at line 41 of file CrystalPlasticitySlipRate.C.

42  : CrystalPlasticityUOBase(parameters),
43  _num_slip_sys_props(getParam<unsigned int>("num_slip_sys_props")),
44  _flowprops(getParam<std::vector<Real>>("flowprops")),
45  _slip_sys_file_name(getParam<FileName>("slip_sys_file_name")),
46  _slip_sys_flow_prop_file_name(getParam<FileName>("slip_sys_flow_prop_file_name")),
47  _num_slip_sys_flowrate_props(getParam<unsigned int>("num_slip_sys_flowrate_props")),
48  _slip_incr_tol(getParam<Real>("slip_incr_tol")),
49  _mo(_variable_size * LIBMESH_DIM),
50  _no(_variable_size * LIBMESH_DIM),
51  _crysrot(getMaterialPropertyByName<RankTwoTensor>("crysrot"))
52 {
54 }
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

◆ calcFlowDirection()

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

◆ calcSlipRate()

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

◆ calcSlipRateDerivative()

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

◆ getFlowRateParams()

void CrystalPlasticitySlipRate::getFlowRateParams ( )
protectedvirtual

Reimplemented in CrystalPlasticitySlipRateGSS.

Definition at line 62 of file CrystalPlasticitySlipRate.C.

63 {
64 }

◆ getSlipSystems()

void CrystalPlasticitySlipRate::getSlipSystems ( )
protectedvirtual

Definition at line 67 of file CrystalPlasticitySlipRate.C.

Referenced by CrystalPlasticitySlipRate().

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

◆ readFileFlowRateParams()

void CrystalPlasticitySlipRate::readFileFlowRateParams ( )
protectedvirtual

Reimplemented in CrystalPlasticitySlipRateGSS.

Definition at line 57 of file CrystalPlasticitySlipRate.C.

58 {
59 }

◆ variableSize()

unsigned int CrystalPlasticityUOBase::variableSize ( ) const
virtualinherited

Returns the size of variable.

Definition at line 29 of file CrystalPlasticityUOBase.C.

30 {
31  return _variable_size;
32 }

Member Data Documentation

◆ _crysrot

const MaterialProperty<RankTwoTensor>& CrystalPlasticitySlipRate::_crysrot
protected

Crystal rotation.

Definition at line 69 of file CrystalPlasticitySlipRate.h.

Referenced by CrystalPlasticitySlipRateGSS::calcFlowDirection().

◆ _flowprops

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

◆ _mo

DenseVector<Real> CrystalPlasticitySlipRate::_mo
protected

◆ _no

DenseVector<Real> CrystalPlasticitySlipRate::_no
protected

◆ _num_slip_sys_flowrate_props

unsigned int CrystalPlasticitySlipRate::_num_slip_sys_flowrate_props
protected

Number of slip system flow rate parameters.

Definition at line 60 of file CrystalPlasticitySlipRate.h.

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

◆ _num_slip_sys_props

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

◆ _slip_incr_tol

Real CrystalPlasticitySlipRate::_slip_incr_tol
protected

Slip increment tolerance.

Definition at line 63 of file CrystalPlasticitySlipRate.h.

Referenced by CrystalPlasticitySlipRateGSS::calcSlipRate().

◆ _slip_sys_file_name

std::string CrystalPlasticitySlipRate::_slip_sys_file_name
protected

File should contain slip plane normal and direction.

Definition at line 49 of file CrystalPlasticitySlipRate.h.

Referenced by getSlipSystems().

◆ _slip_sys_flow_prop_file_name

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

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

◆ _variable_size

unsigned int CrystalPlasticityUOBase::_variable_size
protectedinherited

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