www.mooseframework.org
PFParamsPolyFreeEnergy.C
Go to the documentation of this file.
2 
3 template <>
4 InputParameters
6 {
7  InputParameters params = validParams<Material>();
8  params.addClassDescription(
9  "Phase field parameters for polynomial free energy for single component systems");
10  params.addCoupledVar("T", "Temperature variable in Kelvin");
11  params.addRequiredCoupledVar("c", "Concentration");
12  params.addRequiredParam<Real>(
13  "int_width", "The interfacial width of void surface in the lengthscale of the problem");
14  params.addParam<Real>(
15  "length_scale", 1.0e-9, "defines the base length scale of the problem in m");
16  params.addParam<Real>("time_scale", 1.0e-9, "defines the base time scale of the problem");
17  MooseEnum poly_order("4 6 8");
18  params.addRequiredParam<MooseEnum>(
19  "polynomial_order", poly_order, "Order of polynomial free energy");
20  params.addRequiredParam<Real>("D0", "Diffusivity prefactor for vacancies in m^2/s");
21  params.addRequiredParam<Real>("Em", "Migration energy in eV");
22  params.addRequiredParam<Real>("Ef", "Formation energy in eV");
23  params.addRequiredParam<Real>("surface_energy", "Surface energy in J/m2");
24  return params;
25 }
26 
27 PFParamsPolyFreeEnergy::PFParamsPolyFreeEnergy(const InputParameters & parameters)
28  : Material(parameters),
29  _c(coupledValue("c")),
30  _T(coupledValue("T")),
31  _M(declareProperty<Real>("M")),
32  _grad_M(declareProperty<RealGradient>("grad_M")),
33  _kappa(declareProperty<Real>("kappa")),
34  _c_eq(declareProperty<Real>("c_eq")),
35  _W(declareProperty<Real>("barr_height")),
36  _Qstar(declareProperty<Real>("Qstar")),
37  _D(declareProperty<Real>("D")),
38  _int_width(getParam<Real>("int_width")),
39  _length_scale(getParam<Real>("length_scale")),
40  _time_scale(getParam<Real>("time_scale")),
41  _order(getParam<MooseEnum>("polynomial_order")),
42  _D0(getParam<Real>("D0")),
43  _Em(getParam<Real>("Em")),
44  _Ef(getParam<Real>("Ef")),
45  _surface_energy(getParam<Real>("surface_energy")),
46  _JtoeV(6.24150974e18), // joule to eV conversion
47  _kb(8.617343e-5) // Boltzmann constant in eV/K
48 {
49 }
50 
51 void
53 {
54  // Convert mobility from m^2/s to the length and time scale
55  Real D0_c = _D0 * _time_scale / (_length_scale * _length_scale);
56 
57  Real kbT = _kb * _T[_qp];
58 
59  // Compute equilibrium concentration and diffusivity
60  _c_eq[_qp] = std::exp(-_Ef / kbT);
61  _D[_qp] = D0_c * std::exp(-_Em / kbT);
62 
63  // Compute free energy integral constant, such that int^1_0 f_loc = KN*sqrt(W)
64  Real KN = 0.0;
65 
66  switch (_order)
67  {
68  case 0: // Fourth oder
69  KN = 2.0 / 3.0;
70  break;
71  case 1: // Sixth order
72  KN = 3.0 / 16.0 * std::sqrt(3.0) +
73  9.0 / 64.0 * std::sqrt(2.0) * (std::log(-std::sqrt(2.0) + std::sqrt(3.0)) +
74  std::log(std::sqrt(2.0) + std::sqrt(3.0)));
75  break;
76  case 2: // Eigth order
77  KN = 0.835510425;
78  break;
79  default:
80  mooseError("Error in PFParamsPolyFreeEnergy: incorrect polynomial order");
81  }
82 
83  // Convert surface energy from J/m2 to eV/length_scale
84  Real surf_energy = _surface_energy * _JtoeV * _length_scale * _length_scale;
85 
86  // Set interfacial parameter and energy barrier
87  _kappa[_qp] = surf_energy * _int_width / KN;
88  _W[_qp] = surf_energy / (2.0 * _int_width * KN);
89 
90  Real Co = 0.0;
91  Real a = _c_eq[_qp];
92 
93  switch (_order)
94  {
95  case 0: // 4th order polynomial
96  Co = std::pow(2.0, 5.0) * (1.0 + 2.0 * a - 2.0 * a * a);
97  break;
98  case 1: // 6th order polynomial
99  Co = std::pow(2.0, 7.0) * (9.0 / 2.0 * a - 9.0 / 2.0 * a * a + 3.0 / 4.0);
100  break;
101  case 2: // 8th order polynomial
102  Co = std::pow(2.0, 9.0) * (15.0 / 4.0 * a - 15.0 / 4.0 * a * a + 3.0 / 8.0);
103  break;
104  default:
105  mooseError("Error in PFParamsPolyFreeEnergy: incorrect polynomial order");
106  }
107 
108  _M[_qp] = KN / Co * (_D[_qp] * _int_width / surf_energy);
109  _grad_M[_qp] = 0.0;
110 
111  _Qstar[_qp] = -4.0; // eV
112 }
InputParameters validParams< PFParamsPolyFreeEnergy >()
MaterialProperty< Real > & _Qstar
MaterialProperty< Real > & _c_eq
MaterialProperty< Real > & _D
PFParamsPolyFreeEnergy(const InputParameters &parameters)
MaterialProperty< Real > & _M
Mateiral property declarations.
MaterialProperty< RealGradient > & _grad_M
Real _int_width
Input parameters.
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
MaterialProperty< Real > & _W
const VariableValue & _T
MaterialProperty< Real > & _kappa