19 "KKS multi-phase model kernel to enforce $c = h_1c_1 + h_2c_2 + h_3c_3 + \\dots$" 20 ". The non-linear variable of this kernel is $c_n$, the final phase " 21 "concentration in the list.");
23 "cj",
"Array of phase concentrations cj. Place in same order as hj_names!");
25 params.
addCoupledVar(
"etas",
"Order parameters for all phases");
27 "hj_names",
"Switching Function Materials that provide $h(\\eta_1, \\eta_2,\\dots)$");
34 _num_j(coupledComponents(
"cj")),
35 _cj(coupledValues(
"cj")),
36 _cj_map(getParameterJvarMap(
"cj")),
38 _c(coupledValue(
"c")),
40 _hj_names(getParam<
std::vector<MaterialPropertyName>>(
"hj_names")),
41 _prop_hj(_hj_names.size()),
42 _eta_names(coupledComponents(
"etas")),
43 _eta_map(getParameterJvarMap(
"etas")),
44 _prop_dhjdetai(_num_j)
48 paramError(
"hj_names",
"Need to pass in as many hj_names as cjs");
51 paramError(
"etas",
"Need to pass in as many etas as cjs");
54 mooseError(
"Need to supply at least 1 phase concentration cj in KKSMultiPhaseConcentration",
58 for (
unsigned int i = 0; i <
_num_j; ++i)
62 for (
unsigned int m = 0; m <
_num_j; ++m)
67 if (coupled(
"cj", m) == _var.number())
71 for (
unsigned int n = 0; n <
_num_j; ++n)
77 mooseError(
"Need to set nonlinear variable to one of the cj's in KKSMultiPhaseConcentration",
86 for (
unsigned int m = 0; m <
_num_j; ++m)
89 return sum_ch -
_c[_qp];
102 return -_test[_i][_qp] * _phi[_j][_qp];
104 auto cjvar = mapJvarToCvar(jvar,
_cj_map);
106 return _test[_i][_qp] * (*
_prop_hj[cjvar])[_qp] * _phi[_j][_qp];
108 auto etavar = mapJvarToCvar(jvar,
_eta_map);
113 for (
unsigned int n = 0; n <
_num_j; ++n)
116 return _test[_i][_qp] * sum * _phi[_j][_qp];
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
void mooseError(Args &&... args)
int _k
Position of the nonlinear variable in the list of cj's.
static InputParameters validParams()
virtual Real precomputeQpResidual()
std::vector< VariableName > _eta_names
Order parameters for each phase .
KKSMultiPhaseConcentration(const InputParameters ¶meters)
std::vector< MaterialPropertyName > _hj_names
Switching functions for each phase .
std::vector< const MaterialProperty< Real > * > _prop_hj
Enforce sum of phase concentrations to be the real concentration.
registerMooseObject("PhaseFieldApp", KKSMultiPhaseConcentration)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual Real precomputeQpJacobian()
const unsigned int _num_j
std::vector< std::vector< const MaterialProperty< Real > * > > _prop_dhjdetai
Derivative of the switching function .
static InputParameters validParams()
const std::vector< const VariableValue * > _cj