www.mooseframework.org
Public Member Functions | Static 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...
 

Static Public Member Functions

static InputParameters validParams ()
 

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

Constructor & Destructor Documentation

◆ CrystalPlasticitySlipRate()

CrystalPlasticitySlipRate::CrystalPlasticitySlipRate ( const InputParameters &  parameters)

Definition at line 42 of file CrystalPlasticitySlipRate.C.

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

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 63 of file CrystalPlasticitySlipRate.C.

64 {
65 }

◆ getSlipSystems()

void CrystalPlasticitySlipRate::getSlipSystems ( )
protectedvirtual

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().

◆ readFileFlowRateParams()

void CrystalPlasticitySlipRate::readFileFlowRateParams ( )
protectedvirtual

Reimplemented in CrystalPlasticitySlipRateGSS.

Definition at line 58 of file CrystalPlasticitySlipRate.C.

59 {
60 }

◆ validParams()

InputParameters CrystalPlasticitySlipRate::validParams ( )
static

Definition at line 18 of file CrystalPlasticitySlipRate.C.

19 {
20  InputParameters params = CrystalPlasticityUOBase::validParams();
21  params.addParam<unsigned int>("num_slip_sys_props",
22  0,
23  "Number of slip system specific properties provided in the file "
24  "containing slip system normals and directions");
25  params.addParam<std::vector<Real>>("flowprops", "Parameters used in slip rate equations");
26  params.addRequiredParam<FileName>("slip_sys_file_name",
27  "Name of the file containing the slip system");
28  params.addParam<FileName>(
29  "slip_sys_flow_prop_file_name",
30  "",
31  "Name of the file containing the values of slip rate equation parameters");
32  params.addParam<unsigned int>(
33  "num_slip_sys_flowrate_props",
34  2,
35  "Number of flow rate properties for a slip system"); // Used for reading flow rate parameters
36  params.addParam<Real>("slip_incr_tol", 2e-2, "Maximum allowable slip in an increment");
37  params.addClassDescription(
38  "Crystal plasticity slip rate class. Override the virtual functions in your class");
39  return params;
40 }

Referenced by CrystalPlasticitySlipRateGSS::validParams().

◆ 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

◆ _crysrot

const MaterialProperty<RankTwoTensor>& CrystalPlasticitySlipRate::_crysrot
protected

Crystal rotation.

Definition at line 70 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 61 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 45 of file CrystalPlasticitySlipRate.h.

◆ _slip_incr_tol

Real CrystalPlasticitySlipRate::_slip_incr_tol
protected

Slip increment tolerance.

Definition at line 64 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 50 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 58 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:
CrystalPlasticitySlipRate::_flowprops
std::vector< Real > _flowprops
Definition: CrystalPlasticitySlipRate.h:47
CrystalPlasticitySlipRate::_mo
DenseVector< Real > _mo
Definition: CrystalPlasticitySlipRate.h:66
CrystalPlasticityUOBase::validParams
static InputParameters validParams()
Definition: CrystalPlasticityUOBase.C:15
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
CrystalPlasticityUOBase::CrystalPlasticityUOBase
CrystalPlasticityUOBase(const InputParameters &parameters)
Definition: CrystalPlasticityUOBase.C:24
CrystalPlasticitySlipRate::getSlipSystems
virtual void getSlipSystems()
Definition: CrystalPlasticitySlipRate.C:68
CrystalPlasticityUOBase::_variable_size
unsigned int _variable_size
Definition: CrystalPlasticityUOBase.h:33
CrystalPlasticitySlipRate::_crysrot
const MaterialProperty< RankTwoTensor > & _crysrot
Crystal rotation.
Definition: CrystalPlasticitySlipRate.h:70
CrystalPlasticitySlipRate::_num_slip_sys_props
unsigned int _num_slip_sys_props
Number of slip system specific properties provided in the file containing slip system normals and dir...
Definition: CrystalPlasticitySlipRate.h:45
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