18 InputParameters params = validParams<KernelValue>();
19 params.addClassDescription(
20 "KKS multi-phase model kernel to enforce $c = h_1c_1 + h_2c_2 + h_3c_3 + \\dots$"
21 ". The non-linear variable of this kernel is $c_n$, the final phase "
22 "concentration in the list.");
23 params.addRequiredCoupledVar(
24 "cj",
"Array of phase concentrations cj. Place in same order as hj_names!");
25 params.addRequiredCoupledVar(
"c",
"Physical concentration");
26 params.addCoupledVar(
"etas",
"Order parameters for all phases");
27 params.addRequiredParam<std::vector<MaterialPropertyName>>(
28 "hj_names",
"Switching Function Materials that provide $h(\\eta_1, \\eta_2,\\dots)$");
34 : DerivativeMaterialInterface<JvarMapKernelInterface<KernelValue>>(parameters),
35 _num_j(coupledComponents(
"cj")),
37 _cj_map(getParameterJvarMap(
"cj")),
39 _c(coupledValue(
"c")),
41 _hj_names(getParam<std::vector<MaterialPropertyName>>(
"hj_names")),
42 _prop_hj(_hj_names.size()),
43 _eta_names(coupledComponents(
"etas")),
44 _eta_map(getParameterJvarMap(
"etas")),
45 _prop_dhjdetai(_num_j)
49 paramError(
"hj_names",
"Need to pass in as many hj_names as cjs");
52 paramError(
"etas",
"Need to pass in as many etas as cjs");
55 mooseError(
"Need to supply at least 1 phase concentration cj in KKSMultiPhaseConcentration",
59 for (
unsigned int i = 0; i <
_num_j; ++i)
63 for (
unsigned int m = 0; m <
_num_j; ++m)
65 _cj[m] = &coupledValue(
"cj", m);
69 if (coupled(
"cj", m) == _var.number())
73 for (
unsigned int n = 0; n <
_num_j; ++n)
79 mooseError(
"Need to set nonlinear variable to one of the cj's in KKSMultiPhaseConcentration",
88 for (
unsigned int m = 0; m <
_num_j; ++m)
91 return sum_ch -
_c[_qp];
104 return -_test[_i][_qp] * _phi[_j][_qp];
106 auto cjvar = mapJvarToCvar(jvar,
_cj_map);
108 return _test[_i][_qp] * (*
_prop_hj[cjvar])[_qp] * _phi[_j][_qp];
110 auto etavar = mapJvarToCvar(jvar,
_eta_map);
115 for (
unsigned int n = 0; n <
_num_j; ++n)
118 return _test[_i][_qp] * sum * _phi[_j][_qp];