https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
13
16{
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
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);
77 gamma_star = 1 / y;
79 a_star = std::sqrt(f_interf / g2);
80 }
81 checkFitRange(g2);
82
83 _kappa_gamma[m][n] = kappa_star; // upper triangle stores the discrete set of kappa values
84 _kappa_gamma[n][m] = gamma_star; // lower triangle stores the discrete set of gamma values
85
86 _a_g2[m][n] = a_star; // upper triangle stores "a" data.
87 _a_g2[n][m] = g2; // lower triangle stores "g2" data.
88 }
89}
const std::vector< double > y
registerMooseObject("PhaseFieldApp", GBAnisotropy)
Function[kappa, gamma, m, L] = parameters (sigma, mob, w_GB, sigma0) Parameter determination method i...
void checkFitRange(Real g2) const
Error if g^2 lies outside the range covered by the selected interface fit.
std::vector< std::vector< Real > > _a_g2
const MoelansInterfaceFits::Fit _interface_fit
Polynomial fits used to compute gamma and the diffuse interface width.
std::vector< std::vector< Real > > _sigma
const Real _length_scale
const unsigned int _op_num
static InputParameters validParams()
std::vector< std::vector< Real > > _mob
std::vector< std::vector< Real > > _kappa_gamma
Function[kappa, gamma, m, L] = parameters (sigma, mob, w_GB, sigma0) Parameter determination method i...
GBAnisotropy(const InputParameters &parameters)
static InputParameters validParams()
const Real _wGB
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
Real inverseGamma(Real g2, Fit fit)
1/gamma as a function of g^2
Real f0Interf(Real inverse_gamma, Fit fit)
f0_interf as a function of 1/gamma