11 #include "libmesh/quadrature.h" 12 #include "libmesh/utility.h" 21 "potential sintering model coupled with electrochemistry");
23 "etas",
"var_name_base",
"op_num",
"Array of order parameters that describe solid phase");
25 "The name of the chemical potential variables for defects");
29 "Name of the electric potential variable with units of V");
30 params.
addParam<std::vector<MaterialPropertyName>>(
31 "solid_energy_coefficients",
32 "Vector of parabolic solid energy coefficients (energy*volume) for " 33 "each defect species. Only used for parabolic energy. Place in same order as " 34 "chemical_potentials!");
36 "void_energy_coefficients",
37 "Vector of parabolic void energy coefficients (energy*volume) for each defect species. Place " 38 "in same order as chemical_potentials!");
39 params.
addParam<
Real>(
"surface_energy", 19.7,
"Surface energy in units of problem (energy/area)");
41 "grainboundary_energy", 9.86,
"Grain boundary energy in units of problem (energy/area)");
42 params.
addParam<
Real>(
"int_width", 1,
"Interface width in units of problem (length)");
44 "surface_switch_value",
46 "surface_switch_value >= 0 & surface_switch_value <= 1.0",
47 "Value between 0 and 1 that determines when the interface begins to switch " 48 "from surface to GB. Small values give less error while large values " 51 "min_vacancy_concentrations_solid",
52 "Vector of names of materials that determine the minimum in energy wrt defect concentrations " 53 "in the solid phase. Place in same order as chemical_potentials!");
54 params.
addRequiredParam<std::vector<Real>>(
"min_vacancy_concentrations_void",
55 "Vector of minima in energy wrt defect concentrations " 56 "in the void phase. Place in same order as " 57 "chemical_potentials!");
58 MooseEnum solid_energy_model(
"PARABOLIC DILUTE IDEAL",
"PARABOLIC");
61 "Type of energy function to use for the solid phase.");
64 "Vector of charges of defect species. Place in same order as chemical_potentials!");
66 "Solid phase relative permittivity (dimensionless)");
67 params.
addParam<
Real>(
"voltage_scale", 1,
"Voltage scale (default is for voltage in V)");
74 _neta(coupledComponents(
"etas")),
77 _ndefects(coupledComponents(
"chemical_potentials")),
78 _w(coupledValues(
"chemical_potentials")),
80 _phi(coupledValue(
"void_op")),
81 _phi_name(coupledName(
"void_op", 0)),
82 _ns_min_names(getParam<
std::vector<MaterialPropertyName>>(
"min_vacancy_concentrations_solid")),
86 _temp(coupledValue(
"Temperature")),
87 _v(coupledValue(
"electric_potential")),
88 _grad_V(coupledGradient(
"electric_potential")),
89 _kv_names(getParam<
std::vector<MaterialPropertyName>>(
"void_energy_coefficients")),
91 _ks_names(getParam<
std::vector<MaterialPropertyName>>(
"solid_energy_coefficients")),
93 _hv(declareProperty<
Real>(
"hv")),
94 _dhv(declarePropertyDerivative<
Real>(
"hv", _phi_name)),
95 _d2hv(declarePropertyDerivative<
Real>(
"hv", _phi_name, _phi_name)),
96 _hs(declareProperty<
Real>(
"hs")),
97 _dhs(declarePropertyDerivative<
Real>(
"hs", _phi_name)),
98 _d2hs(declarePropertyDerivative<
Real>(
"hs", _phi_name, _phi_name)),
99 _omegav(declareProperty<
Real>(
"omegav")),
100 _domegavdw(_ndefects),
101 _d2omegavdw2(_ndefects),
102 _omegas(declareProperty<
Real>(
"omegas")),
103 _domegasdw(_ndefects),
104 _d2omegasdw2(_ndefects),
106 _d2omegasdwdeta(_ndefects),
107 _d2omegasdetadeta(_neta),
108 _mu(declareProperty<
Real>(
"mu")),
109 _dmu(declarePropertyDerivative<
Real>(
"mu", _phi_name)),
110 _d2mu(declarePropertyDerivative<
Real>(
"mu", _phi_name, _phi_name)),
111 _kappa(declareProperty<
Real>(
"kappa")),
112 _dkappa(declarePropertyDerivative<
Real>(
"kappa", _phi_name)),
113 _d2kappa(declarePropertyDerivative<
Real>(
"kappa", _phi_name, _phi_name)),
114 _gamma(declareProperty<
Real>(
"gamma")),
115 _sigma_s(getParam<
Real>(
"surface_energy")),
116 _sigma_gb(getParam<
Real>(
"grainboundary_energy")),
117 _int_width(getParam<
Real>(
"int_width")),
118 _switch(getParam<
Real>(
"surface_switch_value")),
119 _solid_energy(getParam<
MooseEnum>(
"solid_energy_model")),
120 _mu_s(6.0 * _sigma_s / _int_width),
121 _mu_gb(6.0 * _sigma_gb / _int_width),
122 _kappa_s(0.75 * _sigma_s * _int_width),
123 _kappa_gb(0.75 * _sigma_gb * _int_width),
126 _z(getParam<
std::vector<
int>>(
"defect_charges")),
127 _v_scale(getParam<
Real>(
"voltage_scale")),
128 _eps_r(getParam<
Real>(
"solid_relative_permittivity")),
129 _nv_min(getParam<
std::vector<
Real>>(
"min_vacancy_concentrations_void"))
132 paramError(
"defect_charges",
"Need to pass in as many defect_charges as chemical_potentials");
134 paramError(
"min_vacancy_concentrations_solid",
135 "Need to pass in as many min_vacancy_concentrations_solid as chemical_potentials");
138 "Need to pass in as many min_vacancy_concentrations_void as chemical_potentials");
141 "Need to pass in as many void_energy_coefficients as chemical_potentials");
144 "Need to pass in as many solid_energy_coefficients as chemical_potentials");
146 for (
unsigned int i = 0; i <
_ndefects; ++i)
153 _kv[i] = &getMaterialPropertyByName<Real>(
_kv_names[i]);
154 _ks[i] = &getMaterialPropertyByName<Real>(
_ks_names[i]);
159 for (
unsigned int j = 0;
j <
_neta; ++
j)
164 for (
unsigned int k = 0;
k <
_neta; ++
k)
165 _d2ns_min[i][
j][
k] = &getMaterialPropertyDerivativeByName<Real>(
170 for (
unsigned int i = 0; i <
_neta; ++i)
177 for (
unsigned int j = 0;
j <= i; ++
j)
182 for (
unsigned int i = 0; i <
_ndefects; ++i)
183 for (
unsigned int j = 0;
j <
_neta; ++
j)
217 f = phi * phi * phi * (10.0 + phi * (-15.0 + phi * 6.0));
218 df = 30.0 /
_switch * phi * phi * (phi - 1.0) * (phi - 1.0);
219 d2f = 60.0 * phi / (
_switch *
_switch) * (2.0 * phi - 1.0) * (phi - 1.0);
226 Real sum_omega_v = 0.0;
227 for (
unsigned int i = 0; i <
_ndefects; ++i)
235 for (
unsigned int i = 0; i <
_ndefects; ++i)
248 Real sum_omega_s = 0.0;
249 for (
unsigned int i = 0; i <
_ndefects; ++i)
263 for (
unsigned int i = 0; i <
_neta; ++i)
265 Real sum_domegasdeta = 0.0;
274 for (
unsigned int j = i;
j <
_neta; ++
j)
276 Real sum_d2omegadeta2 = 0.0;
289 Real sum_omega_s = 0.0;
290 for (
unsigned int i = 0; i <
_ndefects; ++i)
301 for (
unsigned int i = 0; i <
_neta; ++i)
303 Real sum_domegasdeta = 0.0;
313 for (
unsigned int j = i;
j <
_neta; ++
j)
315 Real sum_d2omegadeta2 = 0.0;
332 "Ideal solution in solid is not yet supported in ElectrochemicalSinteringMaterial");
This material calculates necessary parameters for the grand potential sintering model with multiple d...
const std::vector< int > _z
Defects species charges in units of e.
MaterialProperty< Real > & _mu
energy barrier coefficient
ElectrochemicalSinteringMaterial(const InputParameters ¶meters)
MaterialProperty< Real > & _hs
solid phase switching function
VariableName coupledName(const std::string &var_name, unsigned int comp=0) const
const VariableValue & _v
electric potential
virtual void computeQpProperties()
const unsigned int _ndefects
number of defect species
const VariableValue & _phi
void phase order parameter
std::vector< MaterialPropertyName > _ns_min_names
minima in energy wrt vacancy concentration in solid
MaterialProperty< Real > & _hv
void phase switching function
const Real _kappa_gb
kappa value on grain boundaries
std::vector< std::vector< MaterialProperty< Real > * > > _d2omegasdwdeta
const Real _kappa_s
kappa value on surfaces
const VariableValue & _temp
temperature
MaterialProperty< Real > & _dkappa
const std::vector< Real > _nv_min
minima in energy wrt vacancy concentration in void
MaterialProperty< Real > & _d2kappa
MaterialProperty< Real > & _d2hv
virtual const VariableValue & coupledValue(const std::string &var_name, unsigned int comp=0) const
MaterialProperty< Real > & _omegas
solid phase grand potential density
MaterialProperty< Real > & _d2mu
static InputParameters validParams()
std::vector< const MaterialProperty< Real > * > _kv
void energy coefficients for each defect
Real f(Real x)
Test function for Brents method.
std::vector< MaterialProperty< Real > * > _d2omegasdw2
registerMooseObject("PhaseFieldApp", ElectrochemicalSinteringMaterial)
const Real _e
Electron charge.
MaterialProperty< Real > & _kappa
gradient energy coefficient
void paramError(const std::string ¶m, Args... args) const
std::vector< const VariableValue * > _w
chemical potentials for defects
std::vector< MaterialProperty< Real > * > _d2omegavdw2
MaterialProperty< Real > & _omegav
void phase grand potential density
const VariableGradient & _grad_V
Gradient of electric potential.
MaterialProperty< Real > & _dhs
std::vector< const MaterialProperty< Real > * > _ks
solid energy coefficient for each defect
const Real _mu_s
mu value on surfaces
std::vector< MaterialProperty< Real > * > _domegasdeta
const Real _v_scale
Voltage scale.
static const Real eps_0
Electric permittivity of free space in SI units (F/m)
std::vector< VariableName > _w_name
MaterialProperty< Real > & _d2hs
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< MaterialPropertyName > _ks_names
Names of solid energy coefficient for each defect.
std::vector< MaterialProperty< Real > * > _domegasdw
const Real _mu_gb
mu value on grain boundaries
static InputParameters validParams()
const Real _kB
Boltzmann constant.
const Real _switch
Parameter to determine accuracy of surface/GB phase switching function.
std::vector< MaterialProperty< Real > * > _domegavdw
MaterialProperty< Real > & _gamma
interface profile coefficient
const unsigned int _neta
number of solid phase order paramters
std::vector< MaterialPropertyName > _kv_names
Names of void energy coefficient for each defect.
void mooseError(Args &&... args) const
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
std::vector< VariableName > _eta_name
MaterialProperty< Real > & _dhv
std::vector< std::vector< const MaterialProperty< Real > * > > _dns_min
std::vector< const MaterialProperty< Real > * > _ns_min
const Real _eps_r
Solid phase relative permittivity.
const MooseEnum _solid_energy
Type of energy function to use for the solid phase.
std::vector< const VariableValue * > _eta
solid phase order parameters
static const std::string k
void ErrorVector unsigned int
MaterialProperty< Real > & _dmu
std::vector< std::vector< std::vector< const MaterialProperty< Real > * > > > _d2ns_min
std::vector< std::vector< MaterialProperty< Real > * > > _d2omegasdetadeta