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 24 of file InterfaceOrientationMultiphaseMaterial.h.

Constructor & Destructor Documentation

◆ InterfaceOrientationMultiphaseMaterial()

InterfaceOrientationMultiphaseMaterial::InterfaceOrientationMultiphaseMaterial ( const InputParameters &  parameters)

Definition at line 40 of file InterfaceOrientationMultiphaseMaterial.C.

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

Member Function Documentation

◆ computeQpProperties()

void InterfaceOrientationMultiphaseMaterial::computeQpProperties ( )
protectedvirtual

Definition at line 64 of file InterfaceOrientationMultiphaseMaterial.C.

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

Member Data Documentation

◆ _d2kappadgrad_etaa

MaterialProperty<RealTensorValue>& InterfaceOrientationMultiphaseMaterial::_d2kappadgrad_etaa
private

Definition at line 43 of file InterfaceOrientationMultiphaseMaterial.h.

Referenced by computeQpProperties().

◆ _d2kappadgrad_etaa_name

MaterialPropertyName InterfaceOrientationMultiphaseMaterial::_d2kappadgrad_etaa_name
private

Definition at line 35 of file InterfaceOrientationMultiphaseMaterial.h.

◆ _delta

Real InterfaceOrientationMultiphaseMaterial::_delta
private

Definition at line 36 of file InterfaceOrientationMultiphaseMaterial.h.

Referenced by computeQpProperties().

◆ _dkappadgrad_etaa

MaterialProperty<RealGradient>& InterfaceOrientationMultiphaseMaterial::_dkappadgrad_etaa
private

Definition at line 42 of file InterfaceOrientationMultiphaseMaterial.h.

Referenced by computeQpProperties().

◆ _dkappadgrad_etaa_name

MaterialPropertyName InterfaceOrientationMultiphaseMaterial::_dkappadgrad_etaa_name
private

Definition at line 34 of file InterfaceOrientationMultiphaseMaterial.h.

◆ _etaa

const VariableValue& InterfaceOrientationMultiphaseMaterial::_etaa
private

Definition at line 45 of file InterfaceOrientationMultiphaseMaterial.h.

◆ _etab

const VariableValue& InterfaceOrientationMultiphaseMaterial::_etab
private

Definition at line 48 of file InterfaceOrientationMultiphaseMaterial.h.

◆ _grad_etaa

const VariableGradient& InterfaceOrientationMultiphaseMaterial::_grad_etaa
private

Definition at line 46 of file InterfaceOrientationMultiphaseMaterial.h.

Referenced by computeQpProperties().

◆ _grad_etab

const VariableGradient& InterfaceOrientationMultiphaseMaterial::_grad_etab
private

Definition at line 49 of file InterfaceOrientationMultiphaseMaterial.h.

Referenced by computeQpProperties().

◆ _j

unsigned int InterfaceOrientationMultiphaseMaterial::_j
private

Definition at line 37 of file InterfaceOrientationMultiphaseMaterial.h.

Referenced by computeQpProperties().

◆ _kappa

MaterialProperty<Real>& InterfaceOrientationMultiphaseMaterial::_kappa
private

Definition at line 41 of file InterfaceOrientationMultiphaseMaterial.h.

Referenced by computeQpProperties().

◆ _kappa_bar

Real InterfaceOrientationMultiphaseMaterial::_kappa_bar
private

Definition at line 39 of file InterfaceOrientationMultiphaseMaterial.h.

Referenced by computeQpProperties().

◆ _kappa_name

MaterialPropertyName InterfaceOrientationMultiphaseMaterial::_kappa_name
private

Definition at line 33 of file InterfaceOrientationMultiphaseMaterial.h.

◆ _theta0

Real InterfaceOrientationMultiphaseMaterial::_theta0
private

Definition at line 38 of file InterfaceOrientationMultiphaseMaterial.h.

Referenced by computeQpProperties().


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