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