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

 ComputePolycrystalElasticityTensor (const InputParameters &parameters)
 
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. 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...
 
const std::string _base_name
 
std::string _elasticity_tensor_name
 
MaterialProperty< RankFourTensor > & _elasticity_tensor
 
MaterialProperty< Real > & _effective_stiffness
 
const Function *const _prefactor_function
 prefactor function to multiply the elasticity tensor with More...
 

Private Attributes

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 25 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 (MooseIndex(_op_num) op_index = 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 }

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 (MooseIndex(op_to_grains) op_index = 0; 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 (MooseIndex(_op_num) op_index = 0; op_index < _op_num; ++op_index)
83  (*_D_elastic_tensor[op_index])[_qp].zero();
84 
85  for (MooseIndex(op_to_grains) op_index = 0; 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 }

◆ computeQpProperties()

void ComputeElasticityTensorBase::computeQpProperties ( )
protectedvirtualinherited

Definition at line 43 of file ComputeElasticityTensorBase.C.

44 {
45  _effective_stiffness[_qp] = 0; // Currently overriden by ComputeIsotropicElasticityTensor
47 
48  // Multiply by prefactor
50  {
51  _elasticity_tensor[_qp] *= _prefactor_function->value(_t, _q_point[_qp]);
52  _effective_stiffness[_qp] *= std::sqrt(_prefactor_function->value(_t, _q_point[_qp]));
53  }
54 }

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

◆ 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 ComputeElasticityTensorBase::validParams ( )
staticinherited

Definition at line 16 of file ComputeElasticityTensorBase.C.

17 {
18  InputParameters params = Material::validParams();
19  params.addParam<FunctionName>(
20  "elasticity_tensor_prefactor",
21  "Optional function to use as a scalar prefactor on the elasticity tensor.");
22  params.addParam<std::string>("base_name",
23  "Optional parameter that allows the user to define "
24  "multiple mechanics material systems on the same "
25  "block, i.e. for multiple phases");
26  return params;
27 }

Referenced by ComputeCosseratElasticityTensor::validParams(), ComputeIsotropicElasticityTensor::validParams(), ComputeRotatedElasticityTensorBase::validParams(), ComputeVariableIsotropicElasticityTensor::validParams(), ComputeLayeredCosseratElasticityTensor::validParams(), and LinearViscoelasticityBase::validParams().

Member Data Documentation

◆ _base_name

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

Referenced by ComputePolycrystalElasticityTensor(), and computeQpElasticityTensor().

◆ _effective_stiffness

MaterialProperty<Real>& ComputeElasticityTensorBase::_effective_stiffness
protectedinherited

◆ _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 37 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 49 of file ComputePolycrystalElasticityTensor.h.

Referenced by computeQpElasticityTensor().

◆ _length_scale

Real ComputePolycrystalElasticityTensor::_length_scale
protected

Definition at line 33 of file ComputePolycrystalElasticityTensor.h.

Referenced by computeQpElasticityTensor().

◆ _op_num

const unsigned int ComputePolycrystalElasticityTensor::_op_num
protected

Number of order parameters.

Definition at line 40 of file ComputePolycrystalElasticityTensor.h.

Referenced by ComputePolycrystalElasticityTensor(), and computeQpElasticityTensor().

◆ _prefactor_function

const Function* const ComputeElasticityTensorBase::_prefactor_function
protectedinherited

prefactor function to multiply the elasticity tensor with

Definition at line 44 of file ComputeElasticityTensorBase.h.

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

◆ _pressure_scale

Real ComputePolycrystalElasticityTensor::_pressure_scale
protected

Definition at line 34 of file ComputePolycrystalElasticityTensor.h.

Referenced by computeQpElasticityTensor().

◆ _vals

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

Order parameters.

Definition at line 43 of file ComputePolycrystalElasticityTensor.h.

Referenced by ComputePolycrystalElasticityTensor(), and computeQpElasticityTensor().


The documentation for this class was generated from the following files:
ComputeElasticityTensorBase::ComputeElasticityTensorBase
ComputeElasticityTensorBase(const InputParameters &parameters)
Definition: ComputeElasticityTensorBase.C:29
ComputePolycrystalElasticityTensor::_pressure_scale
Real _pressure_scale
Definition: ComputePolycrystalElasticityTensor.h:34
ComputeElasticityTensorBase::_effective_stiffness
MaterialProperty< Real > & _effective_stiffness
Definition: ComputeElasticityTensorBase.h:41
GuaranteeProvider::_guarantees
std::map< MaterialPropertyName, std::set< Guarantee > > _guarantees
Definition: GuaranteeProvider.h:37
GrainDataTracker< RankFourTensor >
GrainDataTracker::getData
const T & getData(unsigned int grain_id) const
return data for selected grain
Definition: GrainDataTracker.h:44
ComputeElasticityTensorBase::computeQpElasticityTensor
virtual void computeQpElasticityTensor()=0
ComputePolycrystalElasticityTensor::_op_num
const unsigned int _op_num
Number of order parameters.
Definition: ComputePolycrystalElasticityTensor.h:40
tol
const double tol
Definition: Setup.h:18
validParams
InputParameters validParams()
name
const std::string name
Definition: Setup.h:21
FeatureFloodCount::invalid_id
static const unsigned int invalid_id
Definition: FeatureFloodCount.h:94
GrainTracker::getVarToFeatureVector
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:131
ComputeElasticityTensorBase::_elasticity_tensor
MaterialProperty< RankFourTensor > & _elasticity_tensor
Definition: ComputeElasticityTensorBase.h:40
ComputePolycrystalElasticityTensor::_D_elastic_tensor
std::vector< MaterialProperty< RankFourTensor > * > _D_elastic_tensor
vector of elasticity tensor material properties
Definition: ComputePolycrystalElasticityTensor.h:46
RankFourTensorTempl
Definition: ACGrGrElasticDrivingForce.h:20
ComputeElasticityTensorBase::_elasticity_tensor_name
std::string _elasticity_tensor_name
Definition: ComputeElasticityTensorBase.h:38
ComputePolycrystalElasticityTensor::_length_scale
Real _length_scale
Definition: ComputePolycrystalElasticityTensor.h:33
ComputePolycrystalElasticityTensor::_JtoeV
const Real _JtoeV
Conversion factor from J to eV.
Definition: ComputePolycrystalElasticityTensor.h:49
ComputePolycrystalElasticityTensor::_grain_tracker
const GrainDataTracker< RankFourTensor > & _grain_tracker
Grain tracker object.
Definition: ComputePolycrystalElasticityTensor.h:37
ComputePolycrystalElasticityTensor::_vals
std::vector< const VariableValue * > _vals
Order parameters.
Definition: ComputePolycrystalElasticityTensor.h:43
ComputeElasticityTensorBase::_prefactor_function
const Function *const _prefactor_function
prefactor function to multiply the elasticity tensor with
Definition: ComputeElasticityTensorBase.h:44