www.mooseframework.org
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
ACSEDGPoly Class Referenceabstract

#include <ACSEDGPoly.h>

Inheritance diagram for ACSEDGPoly:
[legend]

Public Member Functions

 ACSEDGPoly (const InputParameters &parameters)
 
virtual void initialSetup ()
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Types

enum  PFFunctionType
 

Protected Member Functions

virtual Real computeDFDOP (PFFunctionType type)
 
virtual Real precomputeQpResidual ()
 
virtual Real precomputeQpJacobian ()
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar)
 
virtual Real computeDFDOP (PFFunctionType type)=0
 

Protected Attributes

const unsigned int _op_num
 
std::vector< const VariableValue * > _vals
 
std::vector< unsigned int > _vals_var
 
const MaterialProperty< Real > & _beta
 the prefactor needed to calculate the deformation energy from dislocation density More...
 
const MaterialProperty< Real > & _rho_eff
 the average/effective dislocation density More...
 
const MaterialProperty< Real > & _Disloc_Den_i
 dislocation density in grain i More...
 
unsigned int _deformed_grain_num
 number of deformed grains More...
 
const GrainTrackerInterface_grain_tracker
 Grain tracker object. More...
 
unsigned int _op_index
 index of the OP the kernel is currently acting on More...
 
const MaterialProperty< Real > & _L
 Mobility. More...
 
const MaterialProperty< Real > & _dLdop
 Mobility derivative w.r.t. order parameter. More...
 
std::vector< const MaterialProperty< Real > *> _dLdarg
 Mobility derivative w.r.t coupled variables. More...
 

Detailed Description

Definition at line 32 of file ACSEDGPoly.h.

Member Enumeration Documentation

◆ PFFunctionType

enum ACBulk::PFFunctionType
protectedinherited

Definition at line 38 of file ACBulk.h.

Constructor & Destructor Documentation

◆ ACSEDGPoly()

ACSEDGPoly::ACSEDGPoly ( const InputParameters &  parameters)

Definition at line 31 of file ACSEDGPoly.C.

32  : ACBulk<Real>(parameters),
33  _op_num(coupledComponents("v")),
34  _vals(_op_num),
36  _beta(getMaterialProperty<Real>("beta")),
37  _rho_eff(getMaterialProperty<Real>("rho_eff")),
38  _Disloc_Den_i(getMaterialProperty<Real>("Disloc_Den_i")),
39  _deformed_grain_num(getParam<unsigned int>("deformed_grain_num")),
40  _grain_tracker(getUserObject<GrainTrackerInterface>("grain_tracker")),
41  _op_index(getParam<unsigned int>("op_index"))
42 {
43  // Loop through grains and load coupled variables into the arrays
44  for (unsigned int i = 0; i < _op_num; ++i)
45  {
46  _vals[i] = &coupledValue("v", i);
47  _vals_var[i] = coupled("v", i);
48  }
49 }
const unsigned int _op_num
Definition: ACSEDGPoly.h:40
std::vector< unsigned int > _vals_var
Definition: ACSEDGPoly.h:43
unsigned int _deformed_grain_num
number of deformed grains
Definition: ACSEDGPoly.h:55
const GrainTrackerInterface & _grain_tracker
Grain tracker object.
Definition: ACSEDGPoly.h:58
const MaterialProperty< Real > & _rho_eff
the average/effective dislocation density
Definition: ACSEDGPoly.h:49
const MaterialProperty< Real > & _beta
the prefactor needed to calculate the deformation energy from dislocation density ...
Definition: ACSEDGPoly.h:46
unsigned int _op_index
index of the OP the kernel is currently acting on
Definition: ACSEDGPoly.h:61
const MaterialProperty< Real > & _Disloc_Den_i
dislocation density in grain i
Definition: ACSEDGPoly.h:52
std::vector< const VariableValue * > _vals
Definition: ACSEDGPoly.h:42

Member Function Documentation

◆ computeDFDOP() [1/2]

Real ACSEDGPoly::computeDFDOP ( PFFunctionType  type)
protectedvirtual

Definition at line 52 of file ACSEDGPoly.C.

53 {
54  Real SumEtaj = 0.0;
55  for (unsigned int i = 0; i < _op_num; ++i)
56  SumEtaj += (*_vals[i])[_qp] * (*_vals[i])[_qp];
57 
58  // Add the current OP to the sum
59  Real SumEtai2 = SumEtaj + _u[_qp] * _u[_qp];
60  // Dislocation density in deformed grains
61  Real rho_i = _Disloc_Den_i[_qp];
62  // undeformed grains are dislocation-free
63  const auto & op_to_grain = _grain_tracker.getVarToFeatureVector(_current_elem->id());
64  const auto grn_index = op_to_grain[_op_index];
65  if (grn_index >= _deformed_grain_num)
66  rho_i = 0.0;
67 
68  // Calculate the contributions of the deformation energy to the residual and Jacobian
69  Real drho_eff_detai = 2.0 * _u[_qp] * (rho_i - _rho_eff[_qp]) / SumEtai2;
70 
71  // Calculate the Stored Energy contribution to either the residual or Jacobian of the grain growth
72  // free energy
73  switch (type)
74  {
75  case Residual:
76  return _beta[_qp] * drho_eff_detai;
77 
78  case Jacobian:
79  return _beta[_qp] * _phi[_j][_qp] *
80  (2.0 * SumEtai2 * ((rho_i - _rho_eff[_qp]) - _u[_qp] * drho_eff_detai) -
81  4.0 * _u[_qp] * _u[_qp] * (rho_i - _rho_eff[_qp])) /
82  (SumEtai2 * SumEtai2);
83  }
84  mooseError("Invalid type passed in");
85 }
const unsigned int _op_num
Definition: ACSEDGPoly.h:40
unsigned int _deformed_grain_num
number of deformed grains
Definition: ACSEDGPoly.h:55
const GrainTrackerInterface & _grain_tracker
Grain tracker object.
Definition: ACSEDGPoly.h:58
const MaterialProperty< Real > & _rho_eff
the average/effective dislocation density
Definition: ACSEDGPoly.h:49
const MaterialProperty< Real > & _beta
the prefactor needed to calculate the deformation energy from dislocation density ...
Definition: ACSEDGPoly.h:46
unsigned int _op_index
index of the OP the kernel is currently acting on
Definition: ACSEDGPoly.h:61
const MaterialProperty< Real > & _Disloc_Den_i
dislocation density in grain i
Definition: ACSEDGPoly.h:52
virtual const std::vector< unsigned int > & getVarToFeatureVector(dof_id_type elem_id) const =0
Returns a list of active unique feature ids for a particular element.
std::vector< const VariableValue * > _vals
Definition: ACSEDGPoly.h:42

◆ computeDFDOP() [2/2]

virtual Real ACBulk< Real >::computeDFDOP ( PFFunctionType  type)
protectedpure virtualinherited

◆ computeQpOffDiagJacobian()

Real ACBulk< Real >::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtualinherited

Reimplemented in CoupledAllenCahn, AllenCahn, KKSACBulkC, KKSACBulkF, KKSMultiACBulkC, KKSMultiACBulkF, ACGrGrMulti, ACGrGrPoly, ACBarrierFunction, and ACGBPoly.

Definition at line 117 of file ACBulk.h.

118 {
119  // Get the coupled variable jvar is referring to
120  const unsigned int cvar = mapJvarToCvar(jvar);
121 
122  // Set off-diagonal Jacobian term from mobility derivatives
123  return (*_dLdarg[cvar])[_qp] * _phi[_j][_qp] * computeDFDOP(Residual) * _test[_i][_qp];
124 }
virtual Real computeDFDOP(PFFunctionType type)=0
std::vector< const MaterialProperty< Real > *> _dLdarg
Mobility derivative w.r.t coupled variables.
Definition: ACBulk.h:53

◆ initialSetup()

void ACBulk< Real >::initialSetup ( )
virtualinherited

Reimplemented in KKSMultiACBulkBase, CoupledAllenCahn, KKSACBulkBase, and AllenCahn.

Definition at line 86 of file ACBulk.h.

87 {
88  validateNonlinearCoupling<Real>("mob_name");
89 }

◆ precomputeQpJacobian()

Real ACBulk< Real >::precomputeQpJacobian ( )
protectedvirtualinherited

Definition at line 104 of file ACBulk.h.

105 {
106  // Get free energy derivative and Jacobian
107  Real dFdop = computeDFDOP(Residual);
108 
109  Real JdFdop = computeDFDOP(Jacobian);
110 
111  // Set Jacobian value using product rule
112  return _L[_qp] * JdFdop + _dLdop[_qp] * _phi[_j][_qp] * dFdop;
113 }
const MaterialProperty< Real > & _L
Mobility.
Definition: ACBulk.h:47
virtual Real computeDFDOP(PFFunctionType type)=0
const MaterialProperty< Real > & _dLdop
Mobility derivative w.r.t. order parameter.
Definition: ACBulk.h:50

◆ precomputeQpResidual()

Real ACBulk< Real >::precomputeQpResidual ( )
protectedvirtualinherited

Definition at line 93 of file ACBulk.h.

94 {
95  // Get free energy derivative from function
96  Real dFdop = computeDFDOP(Residual);
97 
98  // Set residual
99  return _L[_qp] * dFdop;
100 }
const MaterialProperty< Real > & _L
Mobility.
Definition: ACBulk.h:47
virtual Real computeDFDOP(PFFunctionType type)=0

◆ validParams()

InputParameters ACBulk< Real >::validParams ( )
staticinherited

Definition at line 75 of file ACBulk.h.

76 {
77  InputParameters params = ::validParams<KernelValue>();
78  params.addClassDescription("Allen-Cahn base Kernel");
79  params.addParam<MaterialPropertyName>("mob_name", "L", "The mobility used with the kernel");
80  params.addCoupledVar("args", "Vector of arguments of the mobility");
81  return params;
82 }

Member Data Documentation

◆ _beta

const MaterialProperty<Real>& ACSEDGPoly::_beta
protected

the prefactor needed to calculate the deformation energy from dislocation density

Definition at line 46 of file ACSEDGPoly.h.

Referenced by computeDFDOP().

◆ _deformed_grain_num

unsigned int ACSEDGPoly::_deformed_grain_num
protected

number of deformed grains

Definition at line 55 of file ACSEDGPoly.h.

Referenced by computeDFDOP().

◆ _Disloc_Den_i

const MaterialProperty<Real>& ACSEDGPoly::_Disloc_Den_i
protected

dislocation density in grain i

Definition at line 52 of file ACSEDGPoly.h.

Referenced by computeDFDOP().

◆ _dLdarg

std::vector<const MaterialProperty<Real > *> ACBulk< Real >::_dLdarg
protectedinherited

Mobility derivative w.r.t coupled variables.

Definition at line 53 of file ACBulk.h.

◆ _dLdop

const MaterialProperty<Real >& ACBulk< Real >::_dLdop
protectedinherited

Mobility derivative w.r.t. order parameter.

Definition at line 50 of file ACBulk.h.

◆ _grain_tracker

const GrainTrackerInterface& ACSEDGPoly::_grain_tracker
protected

Grain tracker object.

Definition at line 58 of file ACSEDGPoly.h.

Referenced by computeDFDOP().

◆ _L

const MaterialProperty<Real >& ACBulk< Real >::_L
protectedinherited

◆ _op_index

unsigned int ACSEDGPoly::_op_index
protected

index of the OP the kernel is currently acting on

Definition at line 61 of file ACSEDGPoly.h.

Referenced by computeDFDOP().

◆ _op_num

const unsigned int ACSEDGPoly::_op_num
protected

Definition at line 40 of file ACSEDGPoly.h.

Referenced by ACSEDGPoly(), and computeDFDOP().

◆ _rho_eff

const MaterialProperty<Real>& ACSEDGPoly::_rho_eff
protected

the average/effective dislocation density

Definition at line 49 of file ACSEDGPoly.h.

Referenced by computeDFDOP().

◆ _vals

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

Definition at line 42 of file ACSEDGPoly.h.

Referenced by ACSEDGPoly(), and computeDFDOP().

◆ _vals_var

std::vector<unsigned int> ACSEDGPoly::_vals_var
protected

Definition at line 43 of file ACSEDGPoly.h.

Referenced by ACSEDGPoly().


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