18 InputParameters params = validParams<Material>();
19 params.addRequiredParam<MaterialPropertyName>(
20 "h_name",
"Name of the switching function material property for the given phase");
21 params.addRequiredCoupledVar(
"phase_etas",
"Vector of order parameters for the given phase");
22 params.addRequiredCoupledVar(
"all_etas",
"Vector of all order parameters for all phases");
23 params.addClassDescription(
"Calculates the switching function for a given phase for a "
24 "multi-phase, multi-order parameter model");
29 const InputParameters & parameters)
30 : DerivativeMaterialInterface<Material>(parameters),
31 _h_name(getParam<MaterialPropertyName>(
"h_name")),
32 _num_eta_p(coupledComponents(
"phase_etas")),
34 _eta_p_names(_num_eta_p),
35 _num_eta(coupledComponents(
"all_etas")),
39 _prop_h(declareProperty<Real>(_h_name)),
46 _eta_p[i] = &coupledValue(
"phase_etas", i);
51 for (
unsigned int i = 0; i <
_num_eta; ++i)
57 for (
unsigned int i = 0; i <
_num_eta; ++i)
60 _eta[i] = &coupledValue(
"all_etas", i);
61 for (
unsigned int j = i; j <
_num_eta; ++j)
69 for (
unsigned int i = 0; i <
_num_eta; ++i)
89 for (
unsigned int i = 0; i <
_num_eta; ++i)
90 sum_all += (*
_eta[i])[_qp] * (*
_eta[i])[_qp];
92 Real sum_notp = sum_all - sum_p;
96 for (
unsigned int i = 0; i <
_num_eta; ++i)
100 (*
_prop_dh[i])[_qp] = 2.0 * (*
_eta[i])[_qp] * sum_notp / (sum_all * sum_all);
102 (*
_prop_dh[i])[_qp] = -2.0 * (*
_eta[i])[_qp] * sum_p / (sum_all * sum_all);
105 for (
unsigned int j = 0; j <
_num_eta; ++j)
111 (2.0 * sum_all * sum_notp - 8.0 * (*
_eta[i])[_qp] * (*
_eta[i])[_qp] * sum_notp) /
112 (sum_all * sum_all * sum_all);
115 (-2.0 * sum_p * sum_all + 8.0 * (*
_eta[i])[_qp] * (*
_eta[i])[_qp] * sum_p) /
116 (sum_all * sum_all * sum_all);
120 -8.0 * (*
_eta[i])[_qp] * (*
_eta[j])[_qp] * sum_notp / (sum_all * sum_all * sum_all);
123 8.0 * (*
_eta[i])[_qp] * (*
_eta[j])[_qp] * sum_p / (sum_all * sum_all * sum_all);
125 (*
_prop_d2h[i][j])[_qp] = (4.0 * sum_all - 8.0 * sum_notp) * (*
_eta[i])[_qp] *
126 (*
_eta[j])[_qp] / (sum_all * sum_all * sum_all);