22 "The property that you want joined into a std::vector");
23 params.
set<std::string>(
"pf_material_type") =
"joiner";
24 params.
addClassDescription(
"This Material forms a std::vector of properties, old properties " 25 "(optionally), and derivatives, out of the individual phase " 33 _pf_prop(getParam<
std::string>(
"material_property")),
34 _dporepressure_dvar(is_ad ? nullptr
35 : !_nodal_material ? &getMaterialProperty<
std::vector<
std::vector<
Real>>>(
36 "dPorousFlow_porepressure_qp_dvar")
37 : &getMaterialProperty<
std::vector<
std::vector<
Real>>>(
38 "dPorousFlow_porepressure_nodal_dvar")),
39 _dsaturation_dvar(is_ad ? nullptr
40 : !_nodal_material ? &getMaterialProperty<
std::vector<
std::vector<
Real>>>(
41 "dPorousFlow_saturation_qp_dvar")
42 : &getMaterialProperty<
std::vector<
std::vector<
Real>>>(
43 "dPorousFlow_saturation_nodal_dvar")),
47 ? &getMaterialProperty<
std::vector<
Real>>(
"dPorousFlow_temperature_qp_dvar")
48 : &getMaterialProperty<
std::vector<
Real>>(
"dPorousFlow_temperature_nodal_dvar")),
49 _has_mass_fraction(!_nodal_material
50 ? hasGenericMaterialProperty<
std::vector<
std::vector<
Real>>, is_ad>(
51 "PorousFlow_mass_frac_qp")
52 : hasGenericMaterialProperty<
std::vector<
std::vector<
Real>>, is_ad>(
53 "PorousFlow_mass_frac_nodal")),
57 ? (!_nodal_material ? &getMaterialProperty<
std::vector<
std::vector<
std::vector<
Real>>>>(
58 "dPorousFlow_mass_frac_qp_dvar")
59 : &getMaterialProperty<
std::vector<
std::vector<
std::vector<
Real>>>>(
60 "dPorousFlow_mass_frac_nodal_dvar"))
62 _property(declareGenericProperty<
std::vector<
Real>, is_ad>(_pf_prop)),
65 : &declareProperty<
std::vector<
std::vector<
Real>>>(
"d" + _pf_prop +
"_dvar"))
85 &getMaterialPropertyDerivative<Real>(
_pf_prop + phase, _pressure_variable_name);
87 &getMaterialPropertyDerivative<Real>(
_pf_prop + phase, _saturation_variable_name);
89 &getMaterialPropertyDerivative<Real>(
_pf_prop + phase, _temperature_variable_name);
91 &getMaterialPropertyDerivative<Real>(
_pf_prop + phase, _mass_fraction_variable_name);
100 _property[_qp].resize(_num_phases);
102 for (
unsigned int ph = 0; ph < _num_phases; ++ph)
103 _property[_qp][ph] = (*_phase_property[ph])[_qp];
106 template <
bool is_ad>
110 initQpStatefulProperties();
114 (*_dproperty_dvar)[_qp].resize(_num_phases);
115 for (
unsigned int ph = 0; ph < _num_phases; ++ph)
117 (*_dproperty_dvar)[_qp][ph].resize(_num_var);
118 for (
unsigned v = 0;
v < _num_var; ++
v)
125 (*_dproperty_dvar)[_qp][ph][
v] = 0.0;
126 if ((*_dphase_property_dp[ph]).size() > _qp)
127 (*_dproperty_dvar)[_qp][ph][
v] +=
128 (*_dphase_property_dp[ph])[_qp] * (*_dporepressure_dvar)[_qp][ph][
v];
129 if ((*_dphase_property_ds[ph]).size() > _qp)
130 (*_dproperty_dvar)[_qp][ph][
v] +=
131 (*_dphase_property_ds[ph])[_qp] * (*_dsaturation_dvar)[_qp][ph][
v];
132 if ((*_dphase_property_dt[ph]).size() > _qp)
133 (*_dproperty_dvar)[_qp][ph][
v] +=
134 (*_dphase_property_dt[ph])[_qp] * (*_dtemperature_dvar)[_qp][
v];
137 if (_has_mass_fraction)
138 if ((*_dphase_property_dX[ph]).size() > _qp)
139 (*_dproperty_dvar)[_qp][ph][
v] +=
140 (*_dphase_property_dX[ph])[_qp] * (*_dmass_fraction_dvar)[_qp][ph][0][
v];
const unsigned int _num_phases
Number of phases.
std::vector< const MaterialProperty< Real > * > _dphase_property_ds
d(property of each phase)/d(saturation)
const std::string _pf_prop
Name of material property to be joined.
std::vector< const MaterialProperty< Real > * > _dphase_property_dp
d(property of each phase)/d(pressure)
static InputParameters validParams()
std::vector< const MaterialProperty< Real > * > _dphase_property_dt
d(property of each phase)/d(temperature)
virtual void initQpStatefulProperties() override
std::vector< const GenericMaterialProperty< Real, is_ad > * > _phase_property
Property of each phase.
Base class for all PorousFlow vector materials.
std::vector< const MaterialProperty< Real > * > _dphase_property_dX
d(property of each phase)/d(mass fraction)
PorousFlowJoinerTempl(const InputParameters ¶meters)
std::string stringify(const T &t)
virtual void computeQpProperties() override
Material designed to form a std::vector of property and derivatives of these wrt the nonlinear variab...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const std::string v
static InputParameters validParams()
registerMooseObject("PorousFlowApp", PorousFlowJoiner)