https://mooseframework.inl.gov
Loading...
Searching...
No Matches
GBWidthAnisotropy.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 "GBWidthAnisotropy.h"
11
13
16{
19 "A material to compute anisotropic grain boundary energies and mobilities with "
20 "user-specified grain boundary widths, independently for each interface between grains");
21 params.addRequiredParam<Real>("mu", "Prefactor of bulk free energy");
22 params.addRequiredParam<Real>("kappa",
23 "Prefactor of gradient free energies for all i-j interfaces");
24 return params;
25}
26
28 : GBAnisotropyBase(parameters), _mu(getParam<Real>("mu")), _kappa(getParam<Real>("kappa"))
29{
30 _mu_qp = _mu;
31 Real g2 = 0.0;
32 Real f_interf = 0.0;
33 Real a = 0.0;
34 Real gamma = 0.0;
35 Real y = 0.0; // 1/gamma
36
37 for (unsigned int m = 0; m < _op_num - 1; ++m)
38 for (unsigned int n = m + 1; n < _op_num; ++n)
39 {
40 // Convert units of mobility and energy
41 _sigma[m][n] *= _JtoeV * (_length_scale * _length_scale); // eV/nm^2
42
44 _length_scale)); // Convert to nm^4/(eV*ns);
45 }
46
47 for (unsigned int m = 0; m < _op_num - 1; ++m)
48 for (unsigned int n = m + 1; n < _op_num; ++n) // m<n
49 {
50 g2 = _sigma[m][n] * _sigma[m][n] / (_kappa * _mu_qp);
51 checkFitRange(g2);
53 gamma = 1 / y;
55 a = std::sqrt(f_interf / g2);
56
57 _kappa_gamma[m][n] = _kappa; // upper triangle stores the discrete set of kappa values
58 _kappa_gamma[n][m] = gamma; // lower triangle stores the discrete set of gamma values
59
60 _a_g2[m][n] = a; // upper triangle stores "a" data.
61 _a_g2[n][m] = g2; // lower triangle stores "g2" data.
62 }
63}
const std::vector< double > y
registerMooseObject("PhaseFieldApp", GBWidthAnisotropy)
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...
GBWidthAnisotropy(const InputParameters &parameters)
static InputParameters validParams()
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