20 "Computes the KKS phase concentration derivatives wrt global concentrations and order "
21 "parameters, which are used in the chain rules in the KKS kernels. This class is intended to "
22 "be used with KKSPhaseConcentrationMaterial.");
27 "Phase concentrations. The order must match Fa, Fb, and global_cs, for example, c1, "
31 params.
addParam<MaterialPropertyName>(
"h_name",
"h",
"Switching function h(eta).");
38 _num_c(coupledComponents(
"global_cs")),
39 _c_names(coupledNames(
"global_cs")),
40 _eta_name(getVar(
"eta", 0)->
name()),
41 _ci_names(getParam<
std::vector<MaterialPropertyName>>(
"ci_names")),
45 _Fa_name(getParam<MaterialName>(
"fa_name")),
46 _Fb_name(getParam<MaterialName>(
"fb_name")),
48 _prop_h(getMaterialProperty<Real>(
"h_name")),
49 _prop_dh(getMaterialPropertyDerivative<Real>(
"h_name", _eta_name))
51 for (
const auto m : make_range(
_num_c * 2))
54 for (
const auto m : make_range(
_num_c))
58 for (
const auto n : make_range(2))
67 for (
const auto l : make_range(
_num_c))
76 for (
const auto m : make_range(2))
79 for (
const auto n : make_range(
_num_c))
82 for (
const auto l : make_range(
_num_c))
89 _d2Fidcidbi[1][n][l] = &getMaterialPropertyDerivative<Real>(
105 for (
const auto m : make_range(
_num_c))
107 for (
const auto n : make_range(
_num_c))
115 A(m * 2 + 1, m * 2) = 1 -
_prop_h[_qp];
116 A(m * 2 + 1, m * 2 + 1) =
_prop_h[_qp];
123 for (
const auto i : make_range(
_num_c))
125 std::vector<Real> k_c(
_num_c * 2);
126 std::vector<Real> x_c(
_num_c * 2);
132 for (
const auto m : make_range(
_num_c * 2))
134 for (
const auto n : make_range(
_num_c * 2))
135 x_c[m] +=
A(m, n) * k_c[n];
139 for (
const auto m : make_range(
_num_c))
141 for (
const auto n : make_range(2))
142 (*
_dcidb[m][n][i])[_qp] = x_c[m * 2 + n];
148 std::vector<Real> k_eta(
_num_c * 2);
149 std::vector<Real> x_eta(
_num_c * 2);
152 for (
const auto m : make_range(
_num_c))
159 for (
const auto m : make_range(
_num_c * 2))
161 for (
const auto n : make_range(
_num_c * 2))
162 x_eta[m] +=
A(m, n) * k_eta[n];
166 for (
const auto m : make_range(
_num_c))
168 for (
const auto n : make_range(2))
169 (*
_dcideta[m][n])[_qp] = x_eta[m * 2 + n];
registerMooseObject("PhaseFieldApp", KKSPhaseConcentrationDerivatives)
KKSPhaseConcentrationDerivatives(const InputParameters ¶meters)
const std::vector< MaterialPropertyName > _ci_names
Phase concentrations.
const unsigned int _num_c
Number of global concentrations.
std::vector< std::vector< std::vector< MaterialProperty< Real > * > > > _dcidb
Derivative of phase concentrations wrt global concentrations .
const MaterialProperty< Real > & _prop_dh
Derivative of switching function.
const MaterialName _Fa_name
Free energy names.
std::vector< const MaterialProperty< Real > * > _prop_ci
const MaterialName _Fb_name
virtual void computeQpProperties() override
std::vector< std::vector< std::vector< const MaterialProperty< Real > * > > > _d2Fidcidbi
Second derivative of phase concentrations wrt two phase concentrations .
const VariableName _eta_name
Phase parameter.
std::vector< std::vector< MaterialProperty< Real > * > > _dcideta
Derivative of phase concentrations wrt eta .
const MaterialProperty< Real > & _prop_h
Switching function.
static InputParameters validParams()
const std::vector< VariableName > _c_names
Names of global concentrations.