19 params.addCoupledVar(
"mass_fraction_vars",
20 "List of variables that represent the mass fractions. Format is 'f_ph0^c0 "
21 "f_ph0^c1 f_ph0^c2 ... f_ph0^c(N-1) f_ph1^c0 f_ph1^c1 fph1^c2 ... "
22 "fph1^c(N-1) ... fphP^c0 f_phP^c1 fphP^c2 ... fphP^c(N-1)' where "
23 "N=num_components and P=num_phases, and it is assumed that "
24 "f_ph^cN=1-sum(f_ph^c,{c,0,N-1}) so that f_ph^cN need not be given. If no "
25 "variables are provided then num_phases=1=num_components.");
26 params.addPrivateParam<std::string>(
"pf_material_type",
"mass_fraction");
27 params.addClassDescription(
"This Material forms a std::vector<std::vector ...> of mass-fractions "
28 "out of the individual mass fractions");
35 _mass_frac(_nodal_material
36 ? declareProperty<std::vector<std::vector<Real>>>(
"PorousFlow_mass_frac_nodal")
37 : declareProperty<std::vector<std::vector<Real>>>(
"PorousFlow_mass_frac_qp")),
38 _grad_mass_frac(_nodal_material ? nullptr
39 : &declareProperty<std::vector<std::vector<
RealGradient>>>(
40 "PorousFlow_grad_mass_frac_qp")),
41 _dmass_frac_dvar(_nodal_material ? declareProperty<std::vector<std::vector<std::vector<Real>>>>(
42 "dPorousFlow_mass_frac_nodal_dvar")
43 : declareProperty<std::vector<std::vector<std::vector<Real>>>>(
44 "dPorousFlow_mass_frac_qp_dvar")),
46 _num_passed_mf_vars(coupledComponents(
"mass_fraction_vars"))
49 mooseError(
"PorousFlowMassFraction: The Dictator proclaims that the number of phases is ",
51 " and the number of components is ",
53 ", and stipulates that you should not use PorousFlowMassFraction in this case");
56 paramError(
"mass_fraction_vars",
57 "This value must be equal to the Dictator's num_phases (",
59 ") multiplied by num_components-1 (",
69 _mf_vars[i] = (_nodal_material ? &coupledDofValues(
"mass_fraction_vars", i)
70 : &coupledValue(
"mass_fraction_vars", i));
105 Real total_mass_frac = 0;
106 if (!_nodal_material)
112 if (!_nodal_material)
114 (*_grad_mass_frac)[_qp][ph][comp] = (*
_grad_mf_vars[i])[_qp];
120 const unsigned int pf_var_num = _dictator.porousFlowVariableNum(
_mf_vars_num[i]);