www.mooseframework.org
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
InterfaceOrientationMultiphaseMaterial Class Reference

Material to compute the angular orientation of order parameter interfaces. More...

#include <InterfaceOrientationMultiphaseMaterial.h>

Inheritance diagram for InterfaceOrientationMultiphaseMaterial:
[legend]

Public Member Functions

 InterfaceOrientationMultiphaseMaterial (const InputParameters &parameters)
 

Protected Member Functions

virtual void computeQpProperties ()
 

Private Attributes

MaterialPropertyName _kappa_name
 
MaterialPropertyName _dkappadgrad_etaa_name
 
MaterialPropertyName _d2kappadgrad_etaa_name
 
Real _delta
 
unsigned int _j
 
Real _theta0
 
Real _kappa_bar
 
MaterialProperty< Real > & _kappa
 
MaterialProperty< RealGradient > & _dkappadgrad_etaa
 
MaterialProperty< RealTensorValue > & _d2kappadgrad_etaa
 
const VariableValue & _etaa
 
const VariableGradient & _grad_etaa
 
const VariableValue & _etab
 
const VariableGradient & _grad_etab
 

Detailed Description

Material to compute the angular orientation of order parameter interfaces.

Definition at line 23 of file InterfaceOrientationMultiphaseMaterial.h.

Constructor & Destructor Documentation

◆ InterfaceOrientationMultiphaseMaterial()

InterfaceOrientationMultiphaseMaterial::InterfaceOrientationMultiphaseMaterial ( const InputParameters &  parameters)

Definition at line 42 of file InterfaceOrientationMultiphaseMaterial.C.

44  : Material(parameters),
45  _kappa_name(getParam<MaterialPropertyName>("kappa_name")),
46  _dkappadgrad_etaa_name(getParam<MaterialPropertyName>("dkappadgrad_etaa_name")),
47  _d2kappadgrad_etaa_name(getParam<MaterialPropertyName>("d2kappadgrad_etaa_name")),
48  _delta(getParam<Real>("anisotropy_strength")),
49  _j(getParam<unsigned int>("mode_number")),
50  _theta0(getParam<Real>("reference_angle")),
51  _kappa_bar(getParam<Real>("kappa_bar")),
52  _kappa(declareProperty<Real>(_kappa_name)),
53  _dkappadgrad_etaa(declareProperty<RealGradient>(_dkappadgrad_etaa_name)),
54  _d2kappadgrad_etaa(declareProperty<RealTensorValue>(_d2kappadgrad_etaa_name)),
55  _etaa(coupledValue("etaa")),
56  _grad_etaa(coupledGradient("etaa")),
57  _etab(coupledValue("etab")),
58  _grad_etab(coupledGradient("etab"))
59 {
60  // this currently only works in 2D simulations
61  if (_mesh.dimension() != 2)
62  mooseError("InterfaceOrientationMultiphaseMaterial requires a two-dimensional mesh.");
63 }

Member Function Documentation

◆ computeQpProperties()

void InterfaceOrientationMultiphaseMaterial::computeQpProperties ( )
protectedvirtual

Definition at line 66 of file InterfaceOrientationMultiphaseMaterial.C.

67 {
68  const Real tol = 1e-9;
69  const Real cutoff = 1.0 - tol;
70 
71  // Normal direction of the interface
72  Real n = 0.0;
73  const RealGradient nd = _grad_etaa[_qp] - _grad_etab[_qp];
74  const Real nx = nd(0);
75  const Real ny = nd(1);
76  const Real n2x = nd(0) * nd(0);
77  const Real n2y = nd(1) * nd(1);
78  const Real nsq = nd.norm_sq();
79  const Real n2sq = nsq * nsq;
80  if (nsq > tol)
81  n = nx / std::sqrt(nsq);
82 
83  if (n > cutoff)
84  n = cutoff;
85 
86  if (n < -cutoff)
87  n = -cutoff;
88 
89  // Calculate the orientation angle
90  const Real angle = std::acos(n) * MathUtils::sign(ny);
91 
92  // Compute derivatives of the angle wrt n
93  const Real dangledn = -MathUtils::sign(ny) / std::sqrt(1.0 - n * n);
94  const Real d2angledn2 = -MathUtils::sign(ny) * n / (1.0 - n * n) / std::sqrt(1.0 - n * n);
95 
96  // Compute derivative of n wrt grad_eta
97  RealGradient dndgrad_etaa;
98  if (nsq > tol)
99  {
100  dndgrad_etaa(0) = ny * ny;
101  dndgrad_etaa(1) = -nx * ny;
102  dndgrad_etaa /= nsq * std::sqrt(nsq);
103  }
104 
105  // Compute the square of dndgrad_etaa
106  RealTensorValue dndgrad_etaa_sq;
107  if (nsq > tol)
108  {
109  dndgrad_etaa_sq(0, 0) = n2y * n2y;
110  dndgrad_etaa_sq(0, 1) = -nx * ny * n2y;
111  dndgrad_etaa_sq(1, 0) = -nx * ny * n2y;
112  dndgrad_etaa_sq(1, 1) = n2x * n2y;
113  dndgrad_etaa_sq /= n2sq * nsq;
114  }
115 
116  // Compute the second derivative of n wrt grad_eta
117  RealTensorValue d2ndgrad_etaa2;
118  if (nsq > tol)
119  {
120  d2ndgrad_etaa2(0, 0) = -3.0 * nx * n2y;
121  d2ndgrad_etaa2(0, 1) = -ny * n2y + 2.0 * ny * n2x;
122  d2ndgrad_etaa2(1, 0) = -ny * n2y + 2.0 * ny * n2x;
123  d2ndgrad_etaa2(1, 1) = -nx * n2x + 2.0 * nx * n2y;
124  d2ndgrad_etaa2 /= n2sq * std::sqrt(nsq);
125  }
126 
127  // Calculate interfacial coefficient kappa and its derivatives wrt the angle
128  Real anglediff = _j * (angle - _theta0 * libMesh::pi / 180.0);
129  _kappa[_qp] =
130  _kappa_bar * (1.0 + _delta * std::cos(anglediff)) * (1.0 + _delta * std::cos(anglediff));
131  Real dkappadangle =
132  -2.0 * _kappa_bar * _delta * _j * (1.0 + _delta * std::cos(anglediff)) * std::sin(anglediff);
133  Real d2kappadangle =
134  2.0 * _kappa_bar * _delta * _delta * _j * _j * std::sin(anglediff) * std::sin(anglediff) -
135  2.0 * _kappa_bar * _delta * _j * _j * (1.0 + _delta * std::cos(anglediff)) *
136  std::cos(anglediff);
137 
138  // Compute derivatives of kappa wrt grad_eta
139  _dkappadgrad_etaa[_qp] = dkappadangle * dangledn * dndgrad_etaa;
140  _d2kappadgrad_etaa[_qp] = d2kappadangle * dangledn * dangledn * dndgrad_etaa_sq +
141  dkappadangle * d2angledn2 * dndgrad_etaa_sq +
142  dkappadangle * dangledn * d2ndgrad_etaa2;
143 }

Member Data Documentation

◆ _d2kappadgrad_etaa

MaterialProperty<RealTensorValue>& InterfaceOrientationMultiphaseMaterial::_d2kappadgrad_etaa
private

Definition at line 42 of file InterfaceOrientationMultiphaseMaterial.h.

Referenced by computeQpProperties().

◆ _d2kappadgrad_etaa_name

MaterialPropertyName InterfaceOrientationMultiphaseMaterial::_d2kappadgrad_etaa_name
private

Definition at line 34 of file InterfaceOrientationMultiphaseMaterial.h.

◆ _delta

Real InterfaceOrientationMultiphaseMaterial::_delta
private

Definition at line 35 of file InterfaceOrientationMultiphaseMaterial.h.

Referenced by computeQpProperties().

◆ _dkappadgrad_etaa

MaterialProperty<RealGradient>& InterfaceOrientationMultiphaseMaterial::_dkappadgrad_etaa
private

Definition at line 41 of file InterfaceOrientationMultiphaseMaterial.h.

Referenced by computeQpProperties().

◆ _dkappadgrad_etaa_name

MaterialPropertyName InterfaceOrientationMultiphaseMaterial::_dkappadgrad_etaa_name
private

Definition at line 33 of file InterfaceOrientationMultiphaseMaterial.h.

◆ _etaa

const VariableValue& InterfaceOrientationMultiphaseMaterial::_etaa
private

Definition at line 44 of file InterfaceOrientationMultiphaseMaterial.h.

◆ _etab

const VariableValue& InterfaceOrientationMultiphaseMaterial::_etab
private

Definition at line 47 of file InterfaceOrientationMultiphaseMaterial.h.

◆ _grad_etaa

const VariableGradient& InterfaceOrientationMultiphaseMaterial::_grad_etaa
private

Definition at line 45 of file InterfaceOrientationMultiphaseMaterial.h.

Referenced by computeQpProperties().

◆ _grad_etab

const VariableGradient& InterfaceOrientationMultiphaseMaterial::_grad_etab
private

Definition at line 48 of file InterfaceOrientationMultiphaseMaterial.h.

Referenced by computeQpProperties().

◆ _j

unsigned int InterfaceOrientationMultiphaseMaterial::_j
private

Definition at line 36 of file InterfaceOrientationMultiphaseMaterial.h.

Referenced by computeQpProperties().

◆ _kappa

MaterialProperty<Real>& InterfaceOrientationMultiphaseMaterial::_kappa
private

Definition at line 40 of file InterfaceOrientationMultiphaseMaterial.h.

Referenced by computeQpProperties().

◆ _kappa_bar

Real InterfaceOrientationMultiphaseMaterial::_kappa_bar
private

Definition at line 38 of file InterfaceOrientationMultiphaseMaterial.h.

Referenced by computeQpProperties().

◆ _kappa_name

MaterialPropertyName InterfaceOrientationMultiphaseMaterial::_kappa_name
private

Definition at line 32 of file InterfaceOrientationMultiphaseMaterial.h.

◆ _theta0

Real InterfaceOrientationMultiphaseMaterial::_theta0
private

Definition at line 37 of file InterfaceOrientationMultiphaseMaterial.h.

Referenced by computeQpProperties().


The documentation for this class was generated from the following files:
InterfaceOrientationMultiphaseMaterial::_dkappadgrad_etaa_name
MaterialPropertyName _dkappadgrad_etaa_name
Definition: InterfaceOrientationMultiphaseMaterial.h:33
InterfaceOrientationMultiphaseMaterial::_theta0
Real _theta0
Definition: InterfaceOrientationMultiphaseMaterial.h:37
libMesh::RealGradient
VectorValue< Real > RealGradient
Definition: GrainForceAndTorqueInterface.h:17
InterfaceOrientationMultiphaseMaterial::_grad_etaa
const VariableGradient & _grad_etaa
Definition: InterfaceOrientationMultiphaseMaterial.h:45
InterfaceOrientationMultiphaseMaterial::_delta
Real _delta
Definition: InterfaceOrientationMultiphaseMaterial.h:35
InterfaceOrientationMultiphaseMaterial::_grad_etab
const VariableGradient & _grad_etab
Definition: InterfaceOrientationMultiphaseMaterial.h:48
InterfaceOrientationMultiphaseMaterial::_kappa_name
MaterialPropertyName _kappa_name
Definition: InterfaceOrientationMultiphaseMaterial.h:32
InterfaceOrientationMultiphaseMaterial::_j
unsigned int _j
Definition: InterfaceOrientationMultiphaseMaterial.h:36
InterfaceOrientationMultiphaseMaterial::_d2kappadgrad_etaa
MaterialProperty< RealTensorValue > & _d2kappadgrad_etaa
Definition: InterfaceOrientationMultiphaseMaterial.h:42
InterfaceOrientationMultiphaseMaterial::_kappa_bar
Real _kappa_bar
Definition: InterfaceOrientationMultiphaseMaterial.h:38
tol
const double tol
Definition: Setup.h:18
InterfaceOrientationMultiphaseMaterial::_kappa
MaterialProperty< Real > & _kappa
Definition: InterfaceOrientationMultiphaseMaterial.h:40
InterfaceOrientationMultiphaseMaterial::_d2kappadgrad_etaa_name
MaterialPropertyName _d2kappadgrad_etaa_name
Definition: InterfaceOrientationMultiphaseMaterial.h:34
InterfaceOrientationMultiphaseMaterial::_dkappadgrad_etaa
MaterialProperty< RealGradient > & _dkappadgrad_etaa
Definition: InterfaceOrientationMultiphaseMaterial.h:41
InterfaceOrientationMultiphaseMaterial::_etaa
const VariableValue & _etaa
Definition: InterfaceOrientationMultiphaseMaterial.h:44
InterfaceOrientationMultiphaseMaterial::_etab
const VariableValue & _etab
Definition: InterfaceOrientationMultiphaseMaterial.h:47