18 params.
addClassDescription(
"Multi-phase KKS model kernel (part 2 of 2) for the Bulk Allen-Cahn. "
19 "This includes all terms dependent on chemical potential.");
24 "Phase concentrations. They must have the same order as Fj_names and global_cs, for "
25 "example, c1, c2, b1, b2.");
31 _c_names(coupledNames(
"global_cs")),
32 _c_map(getParameterJvarMap(
"global_cs")),
33 _num_c(coupledComponents(
"global_cs")),
34 _eta_names(coupledNames(
"all_etas")),
35 _eta_map(getParameterJvarMap(
"all_etas")),
37 _ci_names(getParam<
std::vector<MaterialPropertyName>>(
"ci_names")),
38 _ci_name_matrix(_num_c),
42 _prop_d2hjdetaidetap(_num_j),
47 for (
unsigned int i = 0; i <
_num_j; ++i)
53 if (coupled(
"all_etas", i) == _var.number())
58 for (
unsigned int m = 0; m <
_num_c; ++m)
63 for (
const auto n : make_range(
_num_j))
71 for (
const auto m : make_range(
_num_c))
76 for (
const auto n : make_range(
_num_j))
81 for (
const auto l : make_range(
_num_j))
85 for (
const auto l : make_range(
_num_c))
91 for (
const auto m : make_range(
_num_j))
95 for (
const auto n : make_range(
_num_j))
101 for (
const auto m : make_range(
_num_c))
106 for (
const auto n : make_range(
_num_c))
107 _d2F1dc1db1[m][n] = &getMaterialPropertyDerivative<Real>(
112 for (
const auto m : make_range(
_num_c))
116 for (
const auto n : make_range(_n_args))
131 for (
const auto m : make_range(
_num_c))
135 for (
const auto n : make_range(
_num_j))
138 sum += (*
_dF1dc1[m])[_qp] * sum1;
149 for (
const auto m : make_range(
_num_c))
155 for (
const auto n : make_range(
_num_c))
158 for (
const auto l : make_range(
_num_j))
166 sum += sum1 * sum2 + (*
_dF1dc1[m])[_qp] * sum3;
169 return -sum * _phi[_j][_qp];
184 auto compvar = mapJvarToCvar(jvar,
_c_map);
187 for (
const auto m : make_range(
_num_c))
193 for (
const auto n : make_range(
_num_c))
196 for (
const auto l : make_range(
_num_j))
202 sum += sum1 * sum2 + (*
_dF1dc1[m])[_qp] * sum3;
205 res += -
_L[_qp] * sum * _phi[_j][_qp] * _test[_i][_qp];
211 auto etavar = mapJvarToCvar(jvar,
_eta_map);
214 for (
const auto m : make_range(
_num_c))
220 for (
const auto n : make_range(
_num_c))
223 for (
const auto l : make_range(
_num_j))
231 sum += sum1 * sum2 + (*
_dF1dc1[m])[_qp] * sum3;
234 res += -
_L[_qp] * sum * _phi[_j][_qp] * _test[_i][_qp];
238 const unsigned int cvar = mapJvarToCvar(jvar);
239 for (
unsigned int m = 0; m <
_num_c; ++m)
243 for (
const auto n : make_range(
_num_j))
246 res += -
_L[_qp] * sum1 * _phi[_j][_qp] * _test[_i][_qp];
void mooseError(Args &&... args)
registerMooseObject("PhaseFieldApp", NestedKKSMultiACBulkC)
const MaterialProperty< Real > & _L
Mobility.
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
ACBulk child class that sets up necessary variables and materials for calculation of residual contrib...
std::vector< MaterialPropertyName > _Fj_names
Names of free energy functions for each phase .
unsigned int _etai_var
index of order parameter that derivatives are taken wrt
std::vector< const MaterialProperty< Real > * > _prop_dhjdetai
Derivatives of the switching functions wrt the order parameter for this kernel.
static InputParameters validParams()
std::vector< MaterialPropertyName > _hj_names
switching function names
KKSACBulkBase child class for the phase concentration term in the the Allen-Cahn bulk residual.
unsigned int _num_c
Number of global concentrations.
std::vector< MaterialPropertyName > _ci_names
Phase concentrations.
std::vector< std::vector< MaterialPropertyName > > _ci_name_matrix
std::vector< std::vector< std::vector< const MaterialProperty< Real > * > > > _dcidetaj
Derivative of phase concentrations wrt etaj .
int _k
Position of the nonlinear variable in the list of cj's.
std::vector< const MaterialProperty< Real > * > _dF1dc1
Derivative of the free energy function .
std::vector< std::vector< const MaterialProperty< Real > * > > _d2F1dc1db1
Second derivative of the free energy function .
std::vector< std::vector< const MaterialProperty< Real > * > > _prop_ci
std::vector< std::vector< const MaterialProperty< Real > * > > _prop_d2hjdetaidetap
Second derivative of switching function .
std::vector< std::vector< std::vector< const MaterialProperty< Real > * > > > _dcidb
Derivative of phase concentrations wrt global concentrations .
virtual Real computeDFDOP(PFFunctionType type)
NestedKKSMultiACBulkC(const InputParameters ¶meters)
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
std::vector< VariableName > _c_names
Global concentrations.
static InputParameters validParams()
std::vector< VariableName > _eta_names
Phase parameters.
std::vector< std::vector< const MaterialProperty< Real > * > > _d2F1dc1darg
Mixed partial derivatives of the free energy function wrt c and any other coupled variables .