www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
GBAnisotropyBase Class Reference

Function[kappa, gamma, m, L] = parameters (sigma, mob, w_GB, sigma0) Parameter determination method is elaborated in Phys. More...

#include <GBAnisotropyBase.h>

Inheritance diagram for GBAnisotropyBase:
[legend]

Public Member Functions

 GBAnisotropyBase (const InputParameters &parameters)
 

Protected Member Functions

virtual void computeQpProperties ()
 

Protected Attributes

const unsigned int _mesh_dimension
 
const Real _length_scale
 
const Real _time_scale
 
const Real _M_V
 
const Real _delta_sigma
 
const Real _delta_mob
 
const FileName _Anisotropic_GB_file_name
 
const bool _inclination_anisotropy
 
const VariableValue & _T
 
std::vector< std::vector< Real > > _sigma
 
std::vector< std::vector< Real > > _mob
 
std::vector< std::vector< Real > > _Q
 
std::vector< std::vector< Real > > _kappa_gamma
 
std::vector< std::vector< Real > > _a_g2
 
MaterialProperty< Real > & _kappa
 
MaterialProperty< Real > & _gamma
 
MaterialProperty< Real > & _L
 
MaterialProperty< Real > & _mu
 
MaterialProperty< Real > & _molar_volume
 
MaterialProperty< Real > & _entropy_diff
 
MaterialProperty< Real > & _act_wGB
 
const Real _kb
 
const Real _JtoeV
 
Real _mu_qp
 
const unsigned int _op_num
 
std::vector< const VariableValue * > _vals
 
std::vector< const VariableGradient * > _grad_vals
 

Detailed Description

Function[kappa, gamma, m, L] = parameters (sigma, mob, w_GB, sigma0) Parameter determination method is elaborated in Phys.

Rev. B, 78(2), 024113, 2008, by N. Moelans Thanks to Prof. Moelans for the explanation of her paper.

Definition at line 26 of file GBAnisotropyBase.h.

Constructor & Destructor Documentation

◆ GBAnisotropyBase()

GBAnisotropyBase::GBAnisotropyBase ( const InputParameters &  parameters)

Definition at line 40 of file GBAnisotropyBase.C.

41  : Material(parameters),
42  _mesh_dimension(_mesh.dimension()),
43  _length_scale(getParam<Real>("length_scale")),
44  _time_scale(getParam<Real>("time_scale")),
45  _M_V(getParam<Real>("molar_volume_value")),
46  _delta_sigma(getParam<Real>("delta_sigma")),
47  _delta_mob(getParam<Real>("delta_mob")),
48  _Anisotropic_GB_file_name(getParam<FileName>("Anisotropic_GB_file_name")),
49  _inclination_anisotropy(getParam<bool>("inclination_anisotropy")),
50  _T(coupledValue("T")),
51  _kappa(declareProperty<Real>("kappa_op")),
52  _gamma(declareProperty<Real>("gamma_asymm")),
53  _L(declareProperty<Real>("L")),
54  _mu(declareProperty<Real>("mu")),
55  _molar_volume(declareProperty<Real>("molar_volume")),
56  _entropy_diff(declareProperty<Real>("entropy_diff")),
57  _act_wGB(declareProperty<Real>("act_wGB")),
58  _kb(8.617343e-5), // Boltzmann constant in eV/K
59  _JtoeV(6.24150974e18), // Joule to eV conversion
60  _mu_qp(0.0),
61  _op_num(coupledComponents("v")),
62  _vals(_op_num),
64 {
65  // reshape vectors
66  _sigma.resize(_op_num);
67  _mob.resize(_op_num);
68  _Q.resize(_op_num);
69  _kappa_gamma.resize(_op_num);
70  _a_g2.resize(_op_num);
71 
72  for (unsigned int op = 0; op < _op_num; ++op)
73  {
74  // Initialize variables
75  _vals[op] = &coupledValue("v", op);
76  _grad_vals[op] = &coupledGradient("v", op);
77 
78  _sigma[op].resize(_op_num);
79  _mob[op].resize(_op_num);
80  _Q[op].resize(_op_num);
81  _kappa_gamma[op].resize(_op_num);
82  _a_g2[op].resize(_op_num);
83  }
84 
85  // Read in data from "Anisotropic_GB_file_name"
86  std::ifstream inFile(_Anisotropic_GB_file_name.c_str());
87 
88  if (!inFile)
89  paramError("Anisotropic_GB_file_name", "Can't open GB anisotropy input file");
90 
91  for (unsigned int i = 0; i < 2; ++i)
92  inFile.ignore(255, '\n'); // ignore line
93 
94  Real data;
95  for (unsigned int i = 0; i < 3 * _op_num; ++i)
96  {
97  std::vector<Real> row; // create an empty row of double values
98  for (unsigned int j = 0; j < _op_num; ++j)
99  {
100  inFile >> data;
101  row.push_back(data);
102  }
103 
104  if (i < _op_num)
105  _sigma[i] = row; // unit: J/m^2
106 
107  else if (i < 2 * _op_num)
108  _mob[i - _op_num] = row; // unit: m^4/(J*s)
109 
110  else
111  _Q[i - 2 * _op_num] = row; // unit: eV
112  }
113 
114  inFile.close();
115 }
MaterialProperty< Real > & _kappa
const Real _delta_sigma
std::vector< std::vector< Real > > _Q
const unsigned int _op_num
const Real _delta_mob
std::vector< std::vector< Real > > _a_g2
MaterialProperty< Real > & _act_wGB
const VariableValue & _T
std::vector< std::vector< Real > > _sigma
const FileName _Anisotropic_GB_file_name
MaterialProperty< Real > & _L
MaterialProperty< Real > & _entropy_diff
const unsigned int _mesh_dimension
MaterialProperty< Real > & _molar_volume
std::vector< const VariableGradient * > _grad_vals
const bool _inclination_anisotropy
std::vector< std::vector< Real > > _kappa_gamma
const Real _length_scale
std::vector< std::vector< Real > > _mob
const Real _time_scale
std::vector< const VariableValue * > _vals
MaterialProperty< Real > & _mu
MaterialProperty< Real > & _gamma

Member Function Documentation

◆ computeQpProperties()

void GBAnisotropyBase::computeQpProperties ( )
protectedvirtual

Definition at line 118 of file GBAnisotropyBase.C.

119 {
120  Real sum_kappa = 0.0;
121  Real sum_gamma = 0.0;
122  Real sum_L = 0.0;
123  Real Val = 0.0;
124  Real sum_val = 0.0;
125  Real f_sigma = 1.0;
126  Real f_mob = 1.0;
127  Real gamma_value = 0.0;
128 
129  for (unsigned int m = 0; m < _op_num - 1; ++m)
130  {
131  for (unsigned int n = m + 1; n < _op_num; ++n) // m<n
132  {
133  gamma_value = _kappa_gamma[n][m];
134 
136  {
137  if (_mesh_dimension == 3)
138  mooseError("This material doesn't support inclination dependence for 3D for now!");
139 
140  Real phi_ave = libMesh::pi * n / (2.0 * _op_num);
141  Real sin_phi = std::sin(2.0 * phi_ave);
142  Real cos_phi = std::cos(2.0 * phi_ave);
143 
144  Real a = (*_grad_vals[m])[_qp](0) - (*_grad_vals[n])[_qp](0);
145  Real b = (*_grad_vals[m])[_qp](1) - (*_grad_vals[n])[_qp](1);
146  Real ab = a * a + b * b + 1.0e-7; // for the sake of numerical convergence, the smaller the
147  // more accurate, but more difficult to converge
148 
149  Real cos_2phi = cos_phi * (a * a - b * b) / ab + sin_phi * 2.0 * a * b / ab;
150  Real cos_4phi = 2.0 * cos_2phi * cos_2phi - 1.0;
151 
152  f_sigma = 1.0 + _delta_sigma * cos_4phi;
153  f_mob = 1.0 + _delta_mob * cos_4phi;
154 
155  Real g2 = _a_g2[n][m] * f_sigma;
156  Real y = -5.288 * g2 * g2 * g2 * g2 - 0.09364 * g2 * g2 * g2 + 9.965 * g2 * g2 -
157  8.183 * g2 + 2.007;
158  gamma_value = 1.0 / y;
159  }
160 
161  Val = (100000.0 * ((*_vals[m])[_qp]) * ((*_vals[m])[_qp]) + 0.01) *
162  (100000.0 * ((*_vals[n])[_qp]) * ((*_vals[n])[_qp]) + 0.01);
163 
164  sum_val += Val;
165  sum_kappa += _kappa_gamma[m][n] * f_sigma * Val;
166  sum_gamma += gamma_value * Val;
167  // Following comes from substituting Eq. (36c) from the paper into (36b)
168  sum_L += Val * _mob[m][n] * std::exp(-_Q[m][n] / (_kb * _T[_qp])) * f_mob * _mu_qp *
169  _a_g2[n][m] / _sigma[m][n];
170  }
171  }
172 
173  _kappa[_qp] = sum_kappa / sum_val;
174  _gamma[_qp] = sum_gamma / sum_val;
175  _L[_qp] = sum_L / sum_val;
176  _mu[_qp] = _mu_qp;
177 
178  _molar_volume[_qp] =
179  _M_V / (_length_scale * _length_scale * _length_scale); // m^3/mol converted to ls^3/mol
180  _entropy_diff[_qp] = 9.5 * _JtoeV; // J/(K mol) converted to eV(K mol)
181  _act_wGB[_qp] = 0.5e-9 / _length_scale; // 0.5 nm
182 }
MaterialProperty< Real > & _kappa
const Real _delta_sigma
std::vector< std::vector< Real > > _Q
const unsigned int _op_num
const Real _delta_mob
std::vector< std::vector< Real > > _a_g2
MaterialProperty< Real > & _act_wGB
const VariableValue & _T
std::vector< std::vector< Real > > _sigma
MaterialProperty< Real > & _L
MaterialProperty< Real > & _entropy_diff
const unsigned int _mesh_dimension
MaterialProperty< Real > & _molar_volume
std::vector< const VariableGradient * > _grad_vals
const bool _inclination_anisotropy
std::vector< std::vector< Real > > _kappa_gamma
const Real _length_scale
std::vector< std::vector< Real > > _mob
std::vector< const VariableValue * > _vals
MaterialProperty< Real > & _mu
MaterialProperty< Real > & _gamma

Member Data Documentation

◆ _a_g2

std::vector<std::vector<Real> > GBAnisotropyBase::_a_g2
protected

◆ _act_wGB

MaterialProperty<Real>& GBAnisotropyBase::_act_wGB
protected

Definition at line 61 of file GBAnisotropyBase.h.

Referenced by computeQpProperties().

◆ _Anisotropic_GB_file_name

const FileName GBAnisotropyBase::_Anisotropic_GB_file_name
protected

Definition at line 42 of file GBAnisotropyBase.h.

Referenced by GBAnisotropyBase().

◆ _delta_mob

const Real GBAnisotropyBase::_delta_mob
protected

Definition at line 40 of file GBAnisotropyBase.h.

Referenced by computeQpProperties().

◆ _delta_sigma

const Real GBAnisotropyBase::_delta_sigma
protected

Definition at line 39 of file GBAnisotropyBase.h.

Referenced by computeQpProperties().

◆ _entropy_diff

MaterialProperty<Real>& GBAnisotropyBase::_entropy_diff
protected

Definition at line 60 of file GBAnisotropyBase.h.

Referenced by computeQpProperties().

◆ _gamma

MaterialProperty<Real>& GBAnisotropyBase::_gamma
protected

Definition at line 55 of file GBAnisotropyBase.h.

Referenced by computeQpProperties().

◆ _grad_vals

std::vector<const VariableGradient *> GBAnisotropyBase::_grad_vals
protected

Definition at line 70 of file GBAnisotropyBase.h.

Referenced by computeQpProperties(), and GBAnisotropyBase().

◆ _inclination_anisotropy

const bool GBAnisotropyBase::_inclination_anisotropy
protected

Definition at line 44 of file GBAnisotropyBase.h.

Referenced by computeQpProperties().

◆ _JtoeV

const Real GBAnisotropyBase::_JtoeV
protected

◆ _kappa

MaterialProperty<Real>& GBAnisotropyBase::_kappa
protected

Definition at line 54 of file GBAnisotropyBase.h.

Referenced by computeQpProperties().

◆ _kappa_gamma

std::vector<std::vector<Real> > GBAnisotropyBase::_kappa_gamma
protected

◆ _kb

const Real GBAnisotropyBase::_kb
protected

Definition at line 63 of file GBAnisotropyBase.h.

Referenced by computeQpProperties().

◆ _L

MaterialProperty<Real>& GBAnisotropyBase::_L
protected

Definition at line 56 of file GBAnisotropyBase.h.

Referenced by computeQpProperties().

◆ _length_scale

const Real GBAnisotropyBase::_length_scale
protected

◆ _M_V

const Real GBAnisotropyBase::_M_V
protected

Definition at line 38 of file GBAnisotropyBase.h.

Referenced by computeQpProperties().

◆ _mesh_dimension

const unsigned int GBAnisotropyBase::_mesh_dimension
protected

Definition at line 34 of file GBAnisotropyBase.h.

Referenced by computeQpProperties().

◆ _mob

std::vector<std::vector<Real> > GBAnisotropyBase::_mob
protected

◆ _molar_volume

MaterialProperty<Real>& GBAnisotropyBase::_molar_volume
protected

Definition at line 59 of file GBAnisotropyBase.h.

Referenced by computeQpProperties().

◆ _mu

MaterialProperty<Real>& GBAnisotropyBase::_mu
protected

Definition at line 57 of file GBAnisotropyBase.h.

Referenced by computeQpProperties().

◆ _mu_qp

Real GBAnisotropyBase::_mu_qp
protected

◆ _op_num

const unsigned int GBAnisotropyBase::_op_num
protected

◆ _Q

std::vector<std::vector<Real> > GBAnisotropyBase::_Q
protected

Definition at line 50 of file GBAnisotropyBase.h.

Referenced by computeQpProperties(), and GBAnisotropyBase().

◆ _sigma

std::vector<std::vector<Real> > GBAnisotropyBase::_sigma
protected

◆ _T

const VariableValue& GBAnisotropyBase::_T
protected

Definition at line 46 of file GBAnisotropyBase.h.

Referenced by computeQpProperties().

◆ _time_scale

const Real GBAnisotropyBase::_time_scale
protected

◆ _vals

std::vector<const VariableValue *> GBAnisotropyBase::_vals
protected

Definition at line 69 of file GBAnisotropyBase.h.

Referenced by computeQpProperties(), and GBAnisotropyBase().


The documentation for this class was generated from the following files: