https://mooseframework.inl.gov
GBAnisotropy.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
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 
16 {
18  params.addClassDescription(
19  "A material to compute anisotropic grain boundary energies and mobilities.");
20  params.addRequiredParam<Real>("wGB", "Diffuse GB width in nm");
21  return params;
22 }
23 
25  : GBAnisotropyBase(parameters), _wGB(getParam<Real>("wGB"))
26 {
27  Real sigma_init;
28  Real g2 = 0.0;
29  Real f_interf = 0.0;
30  Real a_0 = 0.75;
31  Real a_star = 0.0;
32  Real kappa_star = 0.0;
33  Real gamma_star = 0.0;
34  Real y = 0.0; // 1/gamma
35  Real yyy = 0.0;
36 
37  Real sigma_big = 0.0;
38  Real sigma_small = 0.0;
39 
40  for (unsigned int m = 0; m < _op_num - 1; ++m)
41  for (unsigned int n = m + 1; n < _op_num; ++n)
42  {
43  // Convert units of mobility and energy
44  _sigma[m][n] *= _JtoeV * (_length_scale * _length_scale); // eV/nm^2
45 
47  _length_scale)); // Convert to nm^4/(eV*ns);
48 
49  if (m == 0 && n == 1)
50  {
51  sigma_big = _sigma[m][n];
52  sigma_small = sigma_big;
53  }
54 
55  else if (_sigma[m][n] > sigma_big)
56  sigma_big = _sigma[m][n];
57 
58  else if (_sigma[m][n] < sigma_small)
59  sigma_small = _sigma[m][n];
60  }
61 
62  sigma_init = (sigma_big + sigma_small) / 2.0;
63  _mu_qp = 6.0 * sigma_init / _wGB;
64 
65  for (unsigned int m = 0; m < _op_num - 1; ++m)
66  for (unsigned int n = m + 1; n < _op_num; ++n) // m<n
67  {
68 
69  a_star = a_0;
70  a_0 = 0.0;
71 
72  while (std::abs(a_0 - a_star) > 1.0e-9)
73  {
74  a_0 = a_star;
75  kappa_star = a_0 * _wGB * _sigma[m][n];
76  g2 = _sigma[m][n] * _sigma[m][n] / (kappa_star * _mu_qp);
77  y = -5.288 * g2 * g2 * g2 * g2 - 0.09364 * g2 * g2 * g2 + 9.965 * g2 * g2 - 8.183 * g2 +
78  2.007;
79  gamma_star = 1 / y;
80  yyy = y * y * y;
81  f_interf = 0.05676 * yyy * yyy - 0.2924 * yyy * y * y + 0.6367 * yyy * y - 0.7749 * yyy +
82  0.6107 * y * y - 0.4324 * y + 0.2792;
83  a_star = std::sqrt(f_interf / g2);
84  }
85 
86  _kappa_gamma[m][n] = kappa_star; // upper triangle stores the discrete set of kappa values
87  _kappa_gamma[n][m] = gamma_star; // lower triangle stores the discrete set of gamma values
88 
89  _a_g2[m][n] = a_star; // upper triangle stores "a" data.
90  _a_g2[n][m] = g2; // lower triangle stores "g2" data.
91  }
92 }
static InputParameters validParams()
GBAnisotropy(const InputParameters &parameters)
Definition: GBAnisotropy.C:24
const unsigned int _op_num
std::vector< std::vector< Real > > _a_g2
const std::vector< double > y
void addRequiredParam(const std::string &name, const std::string &doc_string)
registerMooseObject("PhaseFieldApp", GBAnisotropy)
std::vector< std::vector< Real > > _sigma
std::vector< std::vector< Real > > _kappa_gamma
const Real _length_scale
std::vector< std::vector< Real > > _mob
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Real _time_scale
static InputParameters validParams()
Definition: GBAnisotropy.C:15
const Real _wGB
Definition: GBAnisotropy.h:29
void addClassDescription(const std::string &doc_string)
Function[kappa, gamma, m, L] = parameters (sigma, mob, w_GB, sigma0) Parameter determination method i...
Definition: GBAnisotropy.h:21
Function[kappa, gamma, m, L] = parameters (sigma, mob, w_GB, sigma0) Parameter determination method i...