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

 ComputePolycrystalElasticityTensor (const InputParameters &parameters)
 
bool hasGuarantee (const MaterialPropertyName &prop_name, Guarantee guarantee)
 

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. More...
 
const unsigned int _op_num
 Number of order parameters. More...
 
std::vector< const VariableValue * > _vals
 Order parameters. More...
 
std::vector< MaterialProperty< RankFourTensor > * > _D_elastic_tensor
 vector of elasticity tensor material properties More...
 
const Real _JtoeV
 Conversion factor from J to eV. More...
 
std::string _base_name
 
std::string _elasticity_tensor_name
 
MaterialProperty< RankFourTensor > & _elasticity_tensor
 
Function *const _prefactor_function
 prefactor function to multiply the elasticity tensor with More...
 

Detailed Description

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

Definition at line 26 of file ComputePolycrystalElasticityTensor.h.

Constructor & Destructor Documentation

◆ ComputePolycrystalElasticityTensor()

ComputePolycrystalElasticityTensor::ComputePolycrystalElasticityTensor ( const InputParameters &  parameters)

Definition at line 31 of file ComputePolycrystalElasticityTensor.C.

33  : ComputeElasticityTensorBase(parameters),
34  _length_scale(getParam<Real>("length_scale")),
35  _pressure_scale(getParam<Real>("pressure_scale")),
36  _grain_tracker(getUserObject<GrainDataTracker<RankFourTensor>>("grain_tracker")),
37  _op_num(coupledComponents("v")),
38  _vals(_op_num),
40  _JtoeV(6.24150974e18)
41 {
42  // Loop over variables (ops)
43  for (auto op_index = decltype(_op_num)(0); op_index < _op_num; ++op_index)
44  {
45  // Initialize variables
46  _vals[op_index] = &coupledValue("v", op_index);
47 
48  // declare elasticity tensor derivative properties
49  _D_elastic_tensor[op_index] = &declarePropertyDerivative<RankFourTensor>(
50  _elasticity_tensor_name, getVar("v", op_index)->name());
51  }
52 }
const Real _JtoeV
Conversion factor from J to eV.
const unsigned int _op_num
Number of order parameters.
std::vector< MaterialProperty< RankFourTensor > * > _D_elastic_tensor
vector of elasticity tensor material properties
ComputeElasticityTensorBase(const InputParameters &parameters)
const GrainDataTracker< RankFourTensor > & _grain_tracker
Grain tracker object.
std::vector< const VariableValue * > _vals
Order parameters.

Member Function Documentation

◆ computeQpElasticityTensor()

void ComputePolycrystalElasticityTensor::computeQpElasticityTensor ( )
protectedvirtual

Implements ComputeElasticityTensorBase.

Definition at line 55 of file ComputePolycrystalElasticityTensor.C.

56 {
57  // Get list of active order parameters from grain tracker
58  const auto & op_to_grains = _grain_tracker.getVarToFeatureVector(_current_elem->id());
59 
60  // Calculate elasticity tensor
61  _elasticity_tensor[_qp].zero();
62  Real sum_h = 0.0;
63  for (auto op_index = beginIndex(op_to_grains); op_index < op_to_grains.size(); ++op_index)
64  {
65  auto grain_id = op_to_grains[op_index];
66  if (grain_id == FeatureFloodCount::invalid_id)
67  continue;
68 
69  // Interpolation factor for elasticity tensors
70  Real h = (1.0 + std::sin(libMesh::pi * ((*_vals[op_index])[_qp] - 0.5))) / 2.0;
71 
72  // Sum all rotated elasticity tensors
73  _elasticity_tensor[_qp] += _grain_tracker.getData(grain_id) * h;
74  sum_h += h;
75  }
76 
77  const Real tol = 1.0e-10;
78  sum_h = std::max(sum_h, tol);
79  _elasticity_tensor[_qp] /= sum_h;
80 
81  // Calculate elasticity tensor derivative: Cderiv = dhdopi/sum_h * (Cop - _Cijkl)
82  for (auto op_index = decltype(_op_num)(0); op_index < _op_num; ++op_index)
83  (*_D_elastic_tensor[op_index])[_qp].zero();
84 
85  for (auto op_index = beginIndex(op_to_grains); op_index < op_to_grains.size(); ++op_index)
86  {
87  auto grain_id = op_to_grains[op_index];
88  if (grain_id == FeatureFloodCount::invalid_id)
89  continue;
90 
91  Real dhdopi = libMesh::pi * std::cos(libMesh::pi * ((*_vals[op_index])[_qp] - 0.5)) / 2.0;
92  RankFourTensor & C_deriv = (*_D_elastic_tensor[op_index])[_qp];
93 
94  C_deriv = (_grain_tracker.getData(grain_id) - _elasticity_tensor[_qp]) * dhdopi / sum_h;
95 
96  // Convert from XPa to eV/(xm)^3, where X is pressure scale and x is length scale;
98  }
99 }
const Real _JtoeV
Conversion factor from J to eV.
const T & getData(unsigned int grain_id) const
return data for selected grain
const double tol
Definition: Setup.h:19
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.
Definition: GrainTracker.C:119
static const unsigned int invalid_id
const unsigned int _op_num
Number of order parameters.
std::vector< MaterialProperty< RankFourTensor > * > _D_elastic_tensor
vector of elasticity tensor material properties
const GrainDataTracker< RankFourTensor > & _grain_tracker
Grain tracker object.
std::vector< const VariableValue * > _vals
Order parameters.
MaterialProperty< RankFourTensor > & _elasticity_tensor

◆ computeQpProperties()

void ComputeElasticityTensorBase::computeQpProperties ( )
protectedvirtualinherited

Definition at line 41 of file ComputeElasticityTensorBase.C.

42 {
44 
45  // Multiply by prefactor
47  _elasticity_tensor[_qp] *= _prefactor_function->value(_t, _q_point[_qp]);
48 }
Function *const _prefactor_function
prefactor function to multiply the elasticity tensor with
virtual void computeQpElasticityTensor()=0
MaterialProperty< RankFourTensor > & _elasticity_tensor

◆ 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.

Referenced by ComputeElasticityTensorCP::ComputeElasticityTensorCP().

35 {
36  auto it = _guarantees.find(prop_name);
37  if (it != _guarantees.end())
38  it->second.erase(guarantee);
39 }
std::map< MaterialPropertyName, std::set< Guarantee > > _guarantees

Member Data Documentation

◆ _base_name

std::string ComputeElasticityTensorBase::_base_name
protectedinherited

◆ _D_elastic_tensor

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

vector of elasticity tensor material properties

Definition at line 47 of file ComputePolycrystalElasticityTensor.h.

Referenced by ComputePolycrystalElasticityTensor(), and computeQpElasticityTensor().

◆ _elasticity_tensor

MaterialProperty<RankFourTensor>& ComputeElasticityTensorBase::_elasticity_tensor
protectedinherited

◆ _elasticity_tensor_name

std::string ComputeElasticityTensorBase::_elasticity_tensor_name
protectedinherited

◆ _grain_tracker

const GrainDataTracker<RankFourTensor>& ComputePolycrystalElasticityTensor::_grain_tracker
protected

Grain tracker object.

Definition at line 38 of file ComputePolycrystalElasticityTensor.h.

Referenced by computeQpElasticityTensor().

◆ _JtoeV

const Real ComputePolycrystalElasticityTensor::_JtoeV
protected

Conversion factor from J to eV.

Definition at line 50 of file ComputePolycrystalElasticityTensor.h.

Referenced by computeQpElasticityTensor().

◆ _length_scale

Real ComputePolycrystalElasticityTensor::_length_scale
protected

Definition at line 34 of file ComputePolycrystalElasticityTensor.h.

Referenced by computeQpElasticityTensor().

◆ _op_num

const unsigned int ComputePolycrystalElasticityTensor::_op_num
protected

Number of order parameters.

Definition at line 41 of file ComputePolycrystalElasticityTensor.h.

Referenced by ComputePolycrystalElasticityTensor(), and computeQpElasticityTensor().

◆ _prefactor_function

Function* const ComputeElasticityTensorBase::_prefactor_function
protectedinherited

prefactor function to multiply the elasticity tensor with

Definition at line 42 of file ComputeElasticityTensorBase.h.

Referenced by ComputeLayeredCosseratElasticityTensor::computeQpElasticityTensor(), and ComputeElasticityTensorBase::computeQpProperties().

◆ _pressure_scale

Real ComputePolycrystalElasticityTensor::_pressure_scale
protected

Definition at line 35 of file ComputePolycrystalElasticityTensor.h.

Referenced by computeQpElasticityTensor().

◆ _vals

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

Order parameters.

Definition at line 44 of file ComputePolycrystalElasticityTensor.h.

Referenced by ComputePolycrystalElasticityTensor(), and computeQpElasticityTensor().


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