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 21 of file ComputePolycrystalElasticityTensor.h.

Constructor & Destructor Documentation

ComputePolycrystalElasticityTensor::ComputePolycrystalElasticityTensor ( const InputParameters &  parameters)

Definition at line 27 of file ComputePolycrystalElasticityTensor.C.

29  : ComputeElasticityTensorBase(parameters),
30  _length_scale(getParam<Real>("length_scale")),
31  _pressure_scale(getParam<Real>("pressure_scale")),
32  _grain_tracker(getUserObject<GrainDataTracker<RankFourTensor>>("grain_tracker")),
33  _op_num(coupledComponents("v")),
34  _vals(_op_num),
36  _JtoeV(6.24150974e18)
37 {
38  // Loop over variables (ops)
39  for (auto op_index = decltype(_op_num)(0); op_index < _op_num; ++op_index)
40  {
41  // Initialize variables
42  _vals[op_index] = &coupledValue("v", op_index);
43 
44  // declare elasticity tensor derivative properties
45  _D_elastic_tensor[op_index] = &declarePropertyDerivative<RankFourTensor>(
46  _elasticity_tensor_name, getVar("v", op_index)->name());
47  }
48 }
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

void ComputePolycrystalElasticityTensor::computeQpElasticityTensor ( )
protectedvirtual

Implements ComputeElasticityTensorBase.

Definition at line 51 of file ComputePolycrystalElasticityTensor.C.

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

Definition at line 39 of file ComputeElasticityTensorBase.C.

40 {
42 
43  // Multiply by prefactor
45  _elasticity_tensor[_qp] *= _prefactor_function->value(_t, _q_point[_qp]);
46 }
Function *const _prefactor_function
prefactor function to multiply the elasticity tensor with
virtual void computeQpElasticityTensor()=0
MaterialProperty< RankFourTensor > & _elasticity_tensor
bool GuaranteeProvider::hasGuarantee ( const MaterialPropertyName &  prop_name,
Guarantee  guarantee 
)
inherited

Definition at line 14 of file GuaranteeProvider.C.

15 {
16  auto it = _guarantees.find(prop_name);
17  if (it == _guarantees.end())
18  return false;
19 
20  auto it2 = it->second.find(guarantee);
21  return it2 != it->second.end();
22 }
std::map< MaterialPropertyName, std::set< Guarantee > > _guarantees
void GuaranteeProvider::issueGuarantee ( const MaterialPropertyName &  prop_name,
Guarantee  guarantee 
)
protectedinherited
void GuaranteeProvider::revokeGuarantee ( const MaterialPropertyName &  prop_name,
Guarantee  guarantee 
)
protectedinherited

Definition at line 32 of file GuaranteeProvider.C.

Referenced by ComputeElasticityTensorCP::ComputeElasticityTensorCP().

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

Member Data Documentation

std::string ComputeElasticityTensorBase::_base_name
protectedinherited
std::vector<MaterialProperty<RankFourTensor> *> ComputePolycrystalElasticityTensor::_D_elastic_tensor
protected

vector of elasticity tensor material properties

Definition at line 42 of file ComputePolycrystalElasticityTensor.h.

Referenced by ComputePolycrystalElasticityTensor(), and computeQpElasticityTensor().

MaterialProperty<RankFourTensor>& ComputeElasticityTensorBase::_elasticity_tensor
protectedinherited
std::string ComputeElasticityTensorBase::_elasticity_tensor_name
protectedinherited
const GrainDataTracker<RankFourTensor>& ComputePolycrystalElasticityTensor::_grain_tracker
protected

Grain tracker object.

Definition at line 33 of file ComputePolycrystalElasticityTensor.h.

Referenced by computeQpElasticityTensor().

const Real ComputePolycrystalElasticityTensor::_JtoeV
protected

Conversion factor from J to eV.

Definition at line 45 of file ComputePolycrystalElasticityTensor.h.

Referenced by computeQpElasticityTensor().

Real ComputePolycrystalElasticityTensor::_length_scale
protected

Definition at line 29 of file ComputePolycrystalElasticityTensor.h.

Referenced by computeQpElasticityTensor().

const unsigned int ComputePolycrystalElasticityTensor::_op_num
protected

Number of order parameters.

Definition at line 36 of file ComputePolycrystalElasticityTensor.h.

Referenced by ComputePolycrystalElasticityTensor(), and computeQpElasticityTensor().

Function* const ComputeElasticityTensorBase::_prefactor_function
protectedinherited

prefactor function to multiply the elasticity tensor with

Definition at line 34 of file ComputeElasticityTensorBase.h.

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

Real ComputePolycrystalElasticityTensor::_pressure_scale
protected

Definition at line 30 of file ComputePolycrystalElasticityTensor.h.

Referenced by computeQpElasticityTensor().

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

Order parameters.

Definition at line 39 of file ComputePolycrystalElasticityTensor.h.

Referenced by ComputePolycrystalElasticityTensor(), and computeQpElasticityTensor().


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