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 31 of file ACSEDGPoly.h.

Member Enumeration Documentation

◆ PFFunctionType

enum ACBulk::PFFunctionType
protectedinherited

Definition at line 37 of file ACBulk.h.

38  {
39  Jacobian,
40  Residual
41  };

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 }

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 }

◆ 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 116 of file ACBulk.h.

117 {
118  // Get the coupled variable jvar is referring to
119  const unsigned int cvar = mapJvarToCvar(jvar);
120 
121  // Set off-diagonal Jacobian term from mobility derivatives
122  return (*_dLdarg[cvar])[_qp] * _phi[_j][_qp] * computeDFDOP(Residual) * _test[_i][_qp];
123 }

◆ initialSetup()

void ACBulk< Real >::initialSetup ( )
virtualinherited

Reimplemented in KKSMultiACBulkBase, CoupledAllenCahn, KKSACBulkBase, and AllenCahn.

Definition at line 85 of file ACBulk.h.

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

◆ precomputeQpJacobian()

Real ACBulk< Real >::precomputeQpJacobian ( )
protectedvirtualinherited

Definition at line 103 of file ACBulk.h.

104 {
105  // Get free energy derivative and Jacobian
106  Real dFdop = computeDFDOP(Residual);
107 
108  Real JdFdop = computeDFDOP(Jacobian);
109 
110  // Set Jacobian value using product rule
111  return _L[_qp] * JdFdop + _dLdop[_qp] * _phi[_j][_qp] * dFdop;
112 }

◆ precomputeQpResidual()

Real ACBulk< Real >::precomputeQpResidual ( )
protectedvirtualinherited

Definition at line 92 of file ACBulk.h.

93 {
94  // Get free energy derivative from function
95  Real dFdop = computeDFDOP(Residual);
96 
97  // Set residual
98  return _L[_qp] * dFdop;
99 }

◆ validParams()

InputParameters ACBulk< Real >::validParams ( )
staticinherited

Definition at line 74 of file ACBulk.h.

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

Member Data Documentation

◆ _beta

const MaterialProperty<Real>& ACSEDGPoly::_beta
protected

the prefactor needed to calculate the deformation energy from dislocation density

Definition at line 45 of file ACSEDGPoly.h.

Referenced by computeDFDOP().

◆ _deformed_grain_num

unsigned int ACSEDGPoly::_deformed_grain_num
protected

number of deformed grains

Definition at line 54 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 51 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 52 of file ACBulk.h.

◆ _dLdop

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

Mobility derivative w.r.t. order parameter.

Definition at line 49 of file ACBulk.h.

◆ _grain_tracker

const GrainTrackerInterface& ACSEDGPoly::_grain_tracker
protected

Grain tracker object.

Definition at line 57 of file ACSEDGPoly.h.

Referenced by computeDFDOP().

◆ _L

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

Mobility.

Definition at line 46 of file ACBulk.h.

◆ _op_index

unsigned int ACSEDGPoly::_op_index
protected

index of the OP the kernel is currently acting on

Definition at line 60 of file ACSEDGPoly.h.

Referenced by computeDFDOP().

◆ _op_num

const unsigned int ACSEDGPoly::_op_num
protected

Definition at line 39 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 48 of file ACSEDGPoly.h.

Referenced by computeDFDOP().

◆ _vals

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

Definition at line 41 of file ACSEDGPoly.h.

Referenced by ACSEDGPoly(), and computeDFDOP().

◆ _vals_var

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

Definition at line 42 of file ACSEDGPoly.h.

Referenced by ACSEDGPoly().


The documentation for this class was generated from the following files:
ACSEDGPoly::_op_index
unsigned int _op_index
index of the OP the kernel is currently acting on
Definition: ACSEDGPoly.h:60
ACBulk< Real >::Residual
Definition: ACBulk.h:40
ACBulk< Real >
ACSEDGPoly::_Disloc_Den_i
const MaterialProperty< Real > & _Disloc_Den_i
dislocation density in grain i
Definition: ACSEDGPoly.h:51
ACBulk< Real >::_dLdarg
std::vector< const MaterialProperty< Real > * > _dLdarg
Mobility derivative w.r.t coupled variables.
Definition: ACBulk.h:52
ACSEDGPoly::_rho_eff
const MaterialProperty< Real > & _rho_eff
the average/effective dislocation density
Definition: ACSEDGPoly.h:48
ACSEDGPoly::_beta
const MaterialProperty< Real > & _beta
the prefactor needed to calculate the deformation energy from dislocation density
Definition: ACSEDGPoly.h:45
ACBulk< Real >::_dLdop
const MaterialProperty< Real > & _dLdop
Mobility derivative w.r.t. order parameter.
Definition: ACBulk.h:49
ACSEDGPoly::_grain_tracker
const GrainTrackerInterface & _grain_tracker
Grain tracker object.
Definition: ACSEDGPoly.h:57
ACBulk< Real >::computeDFDOP
virtual Real computeDFDOP(PFFunctionType type)=0
GrainTrackerInterface::getVarToFeatureVector
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.
ACBulk< Real >::Jacobian
Definition: ACBulk.h:39
ACSEDGPoly::_op_num
const unsigned int _op_num
Definition: ACSEDGPoly.h:39
ACSEDGPoly::_deformed_grain_num
unsigned int _deformed_grain_num
number of deformed grains
Definition: ACSEDGPoly.h:54
ACSEDGPoly::_vals
std::vector< const VariableValue * > _vals
Definition: ACSEDGPoly.h:41
ACSEDGPoly::_vals_var
std::vector< unsigned int > _vals_var
Definition: ACSEDGPoly.h:42
ACBulk< Real >::_L
const MaterialProperty< Real > & _L
Mobility.
Definition: ACBulk.h:46