www.mooseframework.org
GBAnisotropy.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #include "GBAnisotropy.h"
11 
12 registerMooseObject("PhaseFieldApp", GBAnisotropy);
13 
14 template <>
15 InputParameters
17 {
18  InputParameters params = validParams<GBAnisotropyBase>();
19  params.addRequiredParam<Real>("wGB", "Diffuse GB width in nm");
20  return params;
21 }
22 
23 GBAnisotropy::GBAnisotropy(const InputParameters & parameters)
24  : GBAnisotropyBase(parameters), _wGB(getParam<Real>("wGB"))
25 {
26  Real sigma_init;
27  Real g2 = 0.0;
28  Real f_interf = 0.0;
29  Real a_0 = 0.75;
30  Real a_star = 0.0;
31  Real kappa_star = 0.0;
32  Real gamma_star = 0.0;
33  Real y = 0.0; // 1/gamma
34  Real yyy = 0.0;
35 
36  Real sigma_big = 0.0;
37  Real sigma_small = 0.0;
38 
39  for (unsigned int m = 0; m < _op_num - 1; ++m)
40  for (unsigned int n = m + 1; n < _op_num; ++n)
41  {
42  // Convert units of mobility and energy
43  _sigma[m][n] *= _JtoeV * (_length_scale * _length_scale); // eV/nm^2
44 
46  _length_scale)); // Convert to nm^4/(eV*ns);
47 
48  if (m == 0 && n == 1)
49  {
50  sigma_big = _sigma[m][n];
51  sigma_small = sigma_big;
52  }
53 
54  else if (_sigma[m][n] > sigma_big)
55  sigma_big = _sigma[m][n];
56 
57  else if (_sigma[m][n] < sigma_small)
58  sigma_small = _sigma[m][n];
59  }
60 
61  sigma_init = (sigma_big + sigma_small) / 2.0;
62  _mu_qp = 6.0 * sigma_init / _wGB;
63 
64  for (unsigned int m = 0; m < _op_num - 1; ++m)
65  for (unsigned int n = m + 1; n < _op_num; ++n) // m<n
66  {
67 
68  a_star = a_0;
69  a_0 = 0.0;
70 
71  while (std::abs(a_0 - a_star) > 1.0e-9)
72  {
73  a_0 = a_star;
74  kappa_star = a_0 * _wGB * _sigma[m][n];
75  g2 = _sigma[m][n] * _sigma[m][n] / (kappa_star * _mu_qp);
76  y = -5.288 * g2 * g2 * g2 * g2 - 0.09364 * g2 * g2 * g2 + 9.965 * g2 * g2 - 8.183 * g2 +
77  2.007;
78  gamma_star = 1 / y;
79  yyy = y * y * y;
80  f_interf = 0.05676 * yyy * yyy - 0.2924 * yyy * y * y + 0.6367 * yyy * y - 0.7749 * yyy +
81  0.6107 * y * y - 0.4324 * y + 0.2792;
82  a_star = std::sqrt(f_interf / g2);
83  }
84 
85  _kappa_gamma[m][n] = kappa_star; // upper triangle stores the discrete set of kappa values
86  _kappa_gamma[n][m] = gamma_star; // lower triangle stores the discrete set of gamma values
87 
88  _a_g2[m][n] = a_star; // upper triangle stores "a" data.
89  _a_g2[n][m] = g2; // lower triangle stores "g2" data.
90  }
91 }
GBAnisotropyBase
Function[kappa, gamma, m, L] = parameters (sigma, mob, w_GB, sigma0) Parameter determination method i...
Definition: GBAnisotropyBase.h:25
GBAnisotropy
Function[kappa, gamma, m, L] = parameters (sigma, mob, w_GB, sigma0) Parameter determination method i...
Definition: GBAnisotropy.h:25
GBAnisotropyBase::_sigma
std::vector< std::vector< Real > > _sigma
Definition: GBAnisotropyBase.h:47
GBAnisotropyBase::_time_scale
const Real _time_scale
Definition: GBAnisotropyBase.h:36
GBAnisotropy::GBAnisotropy
GBAnisotropy(const InputParameters &parameters)
Definition: GBAnisotropy.C:23
GBAnisotropyBase::_mob
std::vector< std::vector< Real > > _mob
Definition: GBAnisotropyBase.h:48
GBAnisotropy.h
GBAnisotropyBase::_kappa_gamma
std::vector< std::vector< Real > > _kappa_gamma
Definition: GBAnisotropyBase.h:50
GBAnisotropyBase::_length_scale
const Real _length_scale
Definition: GBAnisotropyBase.h:35
GBAnisotropyBase::_JtoeV
const Real _JtoeV
Definition: GBAnisotropyBase.h:63
GBAnisotropyBase::_op_num
const unsigned int _op_num
Definition: GBAnisotropyBase.h:66
validParams< GBAnisotropyBase >
InputParameters validParams< GBAnisotropyBase >()
Definition: GBAnisotropyBase.C:17
GBAnisotropyBase::_a_g2
std::vector< std::vector< Real > > _a_g2
Definition: GBAnisotropyBase.h:51
validParams< GBAnisotropy >
InputParameters validParams< GBAnisotropy >()
Definition: GBAnisotropy.C:16
GBAnisotropy::_wGB
const Real _wGB
Definition: GBAnisotropy.h:31
GBAnisotropyBase::_mu_qp
Real _mu_qp
Definition: GBAnisotropyBase.h:64
registerMooseObject
registerMooseObject("PhaseFieldApp", GBAnisotropy)