https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
ComputePolycrystalElasticityTensor Class Reference

Compute an evolving elasticity tensor coupled to a grain growth phase field model. More...

#include <ComputePolycrystalElasticityTensor.h>

Inheritance diagram for ComputePolycrystalElasticityTensor:
[legend]

Public Types

typedef DerivativeMaterialPropertyNameInterface::SymbolName SymbolName
 

Public Member Functions

 ComputePolycrystalElasticityTensor (const InputParameters &parameters)
 
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialProperty (const std::string &name)
 
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialPropertyByName (const std::string &name)
 
void validateDerivativeMaterialPropertyBase (const std::string &base)
 
const MaterialPropertyName derivativePropertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName derivativePropertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName derivativePropertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName derivativePropertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, unsigned int v2, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, unsigned int v1, unsigned int v2=libMesh::invalid_uint, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, unsigned int v2, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, unsigned int v1, unsigned int v2=libMesh::invalid_uint, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
void validateCoupling (const MaterialPropertyName &base, const std::vector< VariableName > &c, bool validate_aux=true)
 
void validateCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateCoupling (const MaterialPropertyName &base, const std::vector< VariableName > &c, bool validate_aux=true)
 
void validateCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateNonlinearCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateNonlinearCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 
bool hasGuarantee (const MaterialPropertyName &prop_name, Guarantee guarantee)
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Member Functions

virtual void computeQpElasticityTensor ()
 
virtual void computeQpProperties ()
 
void issueGuarantee (const MaterialPropertyName &prop_name, Guarantee guarantee)
 
void revokeGuarantee (const MaterialPropertyName &prop_name, Guarantee guarantee)
 

Protected Attributes

Real _length_scale
 
Real _pressure_scale
 
const GrainDataTracker< RankFourTensor > & _grain_tracker
 Grain tracker object.
 
const unsigned int _op_num
 Number of order parameters.
 
const std::vector< const VariableValue * > _vals
 Order parameters.
 
const EulerAngleProvider *const _euler
 object providing the Euler angles
 
MaterialProperty< RankTwoTensor > * _crysrot
 Crystal Rotation Matrix used to rotate the slip system direction and normal.
 
std::vector< MaterialProperty< RankFourTensor > * > _D_elastic_tensor
 vector of elasticity tensor material properties
 
const Real _JtoeV
 Conversion factor from J to eV.
 
const std::string _base_name
 Base name of the material system.
 
std::string _elasticity_tensor_name
 
GenericMaterialProperty< T, is_ad > & _elasticity_tensor
 
GenericMaterialProperty< Real, is_ad > & _effective_stiffness
 
const Function *const _prefactor_function
 prefactor function to multiply the elasticity tensor with
 

Private Member Functions

bool haveMaterialProperty (const std::string &prop_name)
 
std::vector< VariableName > buildVariableVector (const VariableName &c1, const VariableName &c2, const VariableName &c3)
 
void validateCouplingHelper (const MaterialPropertyName &base, const std::vector< VariableName > &c, const System &system, std::vector< VariableName > &missing)
 
bool isNotObjectVariable (const VariableName &name)
 

Private Attributes

FEProblemBase_dmi_fe_problem
 
std::map< MaterialPropertyName, std::set< Guarantee > > _guarantees
 

Detailed Description

Compute an evolving elasticity tensor coupled to a grain growth phase field model.

Definition at line 22 of file ComputePolycrystalElasticityTensor.h.

Constructor & Destructor Documentation

◆ ComputePolycrystalElasticityTensor()

ComputePolycrystalElasticityTensor::ComputePolycrystalElasticityTensor ( const InputParameters parameters)

Definition at line 33 of file ComputePolycrystalElasticityTensor.C.

35 : ComputeElasticityTensorBase(parameters),
36 _length_scale(getParam<Real>("length_scale")),
37 _pressure_scale(getParam<Real>("pressure_scale")),
38 _grain_tracker(getUserObject<GrainDataTracker<RankFourTensor>>("grain_tracker")),
39 _op_num(coupledComponents("v")),
40 _vals(coupledValues("v")),
41 _euler(isParamValid("euler_angle_provider")
42 ? &getUserObject<EulerAngleProvider>("euler_angle_provider")
43 : nullptr),
44 _crysrot(isParamValid("euler_angle_provider")
45 ? &declareProperty<RankTwoTensor>(_base_name + "crysrot")
46 : nullptr),
48 _JtoeV(6.24150974e18)
49{
50 // Loop over variables (ops)
51 for (MooseIndex(_op_num) op_index = 0; op_index < _op_num; ++op_index)
52 {
53 // declare elasticity tensor derivative properties
54 _D_elastic_tensor[op_index] = &declarePropertyDerivative<RankFourTensor>(
55 _elasticity_tensor_name, coupledName("v", op_index));
56 }
57}
ComputeElasticityTensorBaseTempl< false > ComputeElasticityTensorBase
const std::string _base_name
Base name of the material system.
MaterialProperty< RankTwoTensor > * _crysrot
Crystal Rotation Matrix used to rotate the slip system direction and normal.
const GrainDataTracker< RankFourTensor > & _grain_tracker
Grain tracker object.
std::vector< MaterialProperty< RankFourTensor > * > _D_elastic_tensor
vector of elasticity tensor material properties
const std::vector< const VariableValue * > _vals
Order parameters.
const EulerAngleProvider *const _euler
object providing the Euler angles
const Real _JtoeV
Conversion factor from J to eV.
const unsigned int _op_num
Number of order parameters.
GrainTracker derived class template to base objects on which maintain physical parameters for individ...

Member Function Documentation

◆ computeQpElasticityTensor()

void ComputePolycrystalElasticityTensor::computeQpElasticityTensor ( )
protectedvirtual

Implements ComputeElasticityTensorBaseTempl< is_ad, T >.

Definition at line 60 of file ComputePolycrystalElasticityTensor.C.

61{
62 // Get list of active order parameters from grain tracker
63 const auto & op_to_grains = _grain_tracker.getVarToFeatureVector(_current_elem->id());
64
65 // Calculate elasticity tensor
66 _elasticity_tensor[_qp].zero();
67 Real sum_h = 0.0;
68 for (MooseIndex(op_to_grains) op_index = 0; op_index < op_to_grains.size(); ++op_index)
69 {
70 auto grain_id = op_to_grains[op_index];
71 if (grain_id == FeatureFloodCount::invalid_id)
72 continue;
73
74 // Interpolation factor for elasticity tensors
75 Real h = (1.0 + std::sin(libMesh::pi * ((*_vals[op_index])[_qp] - 0.5))) / 2.0;
76
77 // Sum all rotated elasticity tensors
78 _elasticity_tensor[_qp] += _grain_tracker.getData(grain_id) * h;
79 sum_h += h;
80
81 if (isParamValid("euler_angle_provider"))
82 {
83 EulerAngles angles;
84 angles = _euler->getEulerAngles(grain_id);
85
86 RotationTensor R(angles);
87 if ((*_vals[op_index])[_qp] > 0.5)
88 (*_crysrot)[_qp] = R; // this is done for the crystal plasticity model compatibility
89 }
90 }
91
92 const Real tol = 1.0e-10;
93 sum_h = std::max(sum_h, tol);
94 _elasticity_tensor[_qp] /= sum_h;
95
96 // Calculate elasticity tensor derivative: Cderiv = dhdopi/sum_h * (Cop - _Cijkl)
97 for (MooseIndex(_op_num) op_index = 0; op_index < _op_num; ++op_index)
98 (*_D_elastic_tensor[op_index])[_qp].zero();
99
100 for (MooseIndex(op_to_grains) op_index = 0; op_index < op_to_grains.size(); ++op_index)
101 {
102 auto grain_id = op_to_grains[op_index];
103 if (grain_id == FeatureFloodCount::invalid_id)
104 continue;
105
106 Real dhdopi = libMesh::pi * std::cos(libMesh::pi * ((*_vals[op_index])[_qp] - 0.5)) / 2.0;
107 RankFourTensor & C_deriv = (*_D_elastic_tensor[op_index])[_qp];
108
109 C_deriv = (_grain_tracker.getData(grain_id) - _elasticity_tensor[_qp]) * dhdopi / sum_h;
110
111 // Convert from XPa to eV/(xm)^3, where X is pressure scale and x is length scale;
113 }
114}
const double tol
const double R
GenericMaterialProperty< T, is_ad > & _elasticity_tensor
virtual const EulerAngles & getEulerAngles(unsigned int i) const
Euler angle triplet.
Definition EulerAngles.h:25
static const unsigned int invalid_id
const T & getData(unsigned int grain_id) const
return data for selected grain
virtual const std::vector< unsigned int > & getVarToFeatureVector(dof_id_type elem_id) const override
Returns a list of active unique feature ids for a particular element.
This is a RealTensor version of a rotation matrix It is instantiated with the Euler angles,...
const Real pi
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ computeQpProperties()

template<bool is_ad, typename T = RankFourTensor>
virtual void ComputeElasticityTensorBaseTempl< is_ad, T >::computeQpProperties ( )
protectedvirtualinherited

◆ hasGuarantee()

bool GuaranteeProvider::hasGuarantee ( const MaterialPropertyName &  prop_name,
Guarantee  guarantee 
)
inherited

Definition at line 16 of file GuaranteeProvider.C.

17{
18 auto it = _guarantees.find(prop_name);
19 if (it == _guarantees.end())
20 return false;
21
22 auto it2 = it->second.find(guarantee);
23 return it2 != it->second.end();
24}
std::map< MaterialPropertyName, std::set< Guarantee > > _guarantees

◆ issueGuarantee()

void GuaranteeProvider::issueGuarantee ( const MaterialPropertyName &  prop_name,
Guarantee  guarantee 
)
protectedinherited

◆ revokeGuarantee()

void GuaranteeProvider::revokeGuarantee ( const MaterialPropertyName &  prop_name,
Guarantee  guarantee 
)
protectedinherited

Definition at line 34 of file GuaranteeProvider.C.

35{
36 auto it = _guarantees.find(prop_name);
37 if (it != _guarantees.end())
38 it->second.erase(guarantee);
39}

Referenced by ComputeElasticityTensorCP::ComputeElasticityTensorCP().

◆ validParams()

InputParameters ComputePolycrystalElasticityTensor::validParams ( )
static

Definition at line 16 of file ComputePolycrystalElasticityTensor.C.

17{
20 "Compute an evolving elasticity tensor coupled to a grain growth phase field model.");
21 params.addRequiredParam<UserObjectName>(
22 "grain_tracker", "Name of GrainTracker user object that provides RankFourTensors");
23 params.addParam<Real>("length_scale", 1.0e-9, "Length scale of the problem, in meters");
24 params.addParam<Real>("pressure_scale", 1.0e6, "Pressure scale of the problem, in pa");
26 "v", "var_name_base", "op_num", "Array of coupled variables");
27 params.addParam<UserObjectName>("euler_angle_provider",
28 "Name of Euler angle provider user object");
29
30 return params;
31}
static InputParameters validParams()
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
void addRequiredCoupledVarWithAutoBuild(const std::string &name, const std::string &base_name, const std::string &num_name, const std::string &doc_string)

Member Data Documentation

◆ _base_name

template<bool is_ad, typename T = RankFourTensor>
const std::string ComputeElasticityTensorBaseTempl< is_ad, T >::_base_name
protectedinherited

◆ _crysrot

MaterialProperty<RankTwoTensor>* ComputePolycrystalElasticityTensor::_crysrot
protected

Crystal Rotation Matrix used to rotate the slip system direction and normal.

Definition at line 48 of file ComputePolycrystalElasticityTensor.h.

◆ _D_elastic_tensor

std::vector<MaterialProperty<RankFourTensor> *> ComputePolycrystalElasticityTensor::_D_elastic_tensor
protected

vector of elasticity tensor material properties

Definition at line 51 of file ComputePolycrystalElasticityTensor.h.

Referenced by ComputePolycrystalElasticityTensor(), and computeQpElasticityTensor().

◆ _effective_stiffness

template<bool is_ad, typename T = RankFourTensor>
GenericMaterialProperty<Real, is_ad>& ComputeElasticityTensorBaseTempl< is_ad, T >::_effective_stiffness
protectedinherited

Definition at line 40 of file ComputeElasticityTensorBase.h.

◆ _elasticity_tensor

template<bool is_ad, typename T = RankFourTensor>
GenericMaterialProperty<T, is_ad>& ComputeElasticityTensorBaseTempl< is_ad, T >::_elasticity_tensor
protectedinherited

◆ _elasticity_tensor_name

template<bool is_ad, typename T = RankFourTensor>
std::string ComputeElasticityTensorBaseTempl< is_ad, T >::_elasticity_tensor_name
protectedinherited

◆ _euler

const EulerAngleProvider* const ComputePolycrystalElasticityTensor::_euler
protected

object providing the Euler angles

Definition at line 45 of file ComputePolycrystalElasticityTensor.h.

Referenced by computeQpElasticityTensor().

◆ _grain_tracker

const GrainDataTracker<RankFourTensor>& ComputePolycrystalElasticityTensor::_grain_tracker
protected

Grain tracker object.

Definition at line 36 of file ComputePolycrystalElasticityTensor.h.

Referenced by computeQpElasticityTensor().

◆ _guarantees

std::map<MaterialPropertyName, std::set<Guarantee> > GuaranteeProvider::_guarantees
privateinherited

◆ _JtoeV

const Real ComputePolycrystalElasticityTensor::_JtoeV
protected

Conversion factor from J to eV.

Definition at line 54 of file ComputePolycrystalElasticityTensor.h.

Referenced by computeQpElasticityTensor().

◆ _length_scale

Real ComputePolycrystalElasticityTensor::_length_scale
protected

Definition at line 32 of file ComputePolycrystalElasticityTensor.h.

Referenced by computeQpElasticityTensor().

◆ _op_num

const unsigned int ComputePolycrystalElasticityTensor::_op_num
protected

Number of order parameters.

Definition at line 39 of file ComputePolycrystalElasticityTensor.h.

Referenced by ComputePolycrystalElasticityTensor(), and computeQpElasticityTensor().

◆ _prefactor_function

template<bool is_ad, typename T = RankFourTensor>
const Function* const ComputeElasticityTensorBaseTempl< is_ad, T >::_prefactor_function
protectedinherited

prefactor function to multiply the elasticity tensor with

Definition at line 43 of file ComputeElasticityTensorBase.h.

Referenced by ComputeLayeredCosseratElasticityTensor::computeQpElasticityTensor().

◆ _pressure_scale

Real ComputePolycrystalElasticityTensor::_pressure_scale
protected

Definition at line 33 of file ComputePolycrystalElasticityTensor.h.

Referenced by computeQpElasticityTensor().

◆ _vals

const std::vector<const VariableValue *> ComputePolycrystalElasticityTensor::_vals
protected

Order parameters.

Definition at line 42 of file ComputePolycrystalElasticityTensor.h.

Referenced by computeQpElasticityTensor().


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