33 _T_c2k(this->template getParam<
MooseEnum>(
"temperature_unit") == 0 ? 0.0 : 273.15),
36 _sfx(_nodal_material ?
"_nodal" :
"_qp"),
37 _mass_frac(this->template declareGenericProperty<
std::vector<
std::vector<Real>>, is_ad>(
38 "PorousFlow_mass_frac" + _sfx)),
42 : &this->template declareGenericProperty<
std::vector<
std::vector<RealGradient>>, is_ad>(
43 "PorousFlow_grad_mass_frac" + _sfx)),
46 : &this->template declareProperty<
std::vector<
std::vector<
std::vector<Real>>>>(
47 "dPorousFlow_mass_frac" + _sfx +
"_dvar")),
48 _fluid_density(this->template declareGenericProperty<
std::vector<Real>, is_ad>(
49 "PorousFlow_fluid_phase_density" + _sfx)),
50 _dfluid_density_dvar(is_ad ? nullptr
51 : &this->template declareProperty<
std::vector<
std::vector<Real>>>(
52 "dPorousFlow_fluid_phase_density" + _sfx +
"_dvar")),
53 _fluid_viscosity(this->template declareGenericProperty<
std::vector<Real>, is_ad>(
54 "PorousFlow_viscosity" + _sfx)),
55 _dfluid_viscosity_dvar(is_ad ? nullptr
56 : &this->template declareProperty<
std::vector<
std::vector<Real>>>(
57 "dPorousFlow_viscosity" + _sfx +
"_dvar")),
58 _fluid_enthalpy(this->template declareGenericProperty<
std::vector<Real>, is_ad>(
59 "PorousFlow_fluid_phase_enthalpy" + _sfx)),
60 _dfluid_enthalpy_dvar(is_ad ? nullptr
61 : &this->template declareProperty<
std::vector<
std::vector<Real>>>(
62 "dPorousFlow_fluid_phase_enthalpy" + _sfx +
"_dvar")),
63 _fluid_internal_energy(this->template declareGenericProperty<
std::vector<Real>, is_ad>(
64 "PorousFlow_fluid_phase_internal_energy" + _sfx)),
65 _dfluid_internal_energy_dvar(
67 : &this->template declareProperty<
std::vector<
std::vector<Real>>>(
68 "dPorousFlow_fluid_phase_internal_energy" + _sfx +
"_dvar"))
97 setMaterialVectorSize();
99 thermophysicalProperties();
104 if (_nodal_material || is_ad)
105 for (
unsigned int ph = 0; ph < _num_phases; ++ph)
107 _saturation[_qp][ph] = genericValue(_fsp[ph].saturation);
108 _porepressure[_qp][ph] = genericValue(_fsp[ph].pressure);
109 _fluid_density[_qp][ph] = genericValue(_fsp[ph].density);
110 _fluid_viscosity[_qp][ph] = genericValue(_fsp[ph].viscosity);
111 _fluid_enthalpy[_qp][ph] = genericValue(_fsp[ph].enthalpy);
112 _fluid_internal_energy[_qp][ph] = genericValue(_fsp[ph].internal_energy);
114 for (
unsigned int comp = 0; comp < _num_components; ++comp)
115 _mass_frac[_qp][ph][comp] = genericValue(_fsp[ph].mass_fraction[comp]);
128 setMaterialVectorSize();
131 thermophysicalProperties();
133 for (
unsigned int ph = 0; ph < _num_phases; ++ph)
135 _saturation[_qp][ph] = genericValue(_fsp[ph].saturation);
136 _porepressure[_qp][ph] = genericValue(_fsp[ph].pressure);
137 _fluid_density[_qp][ph] = genericValue(_fsp[ph].density);
138 _fluid_viscosity[_qp][ph] = genericValue(_fsp[ph].viscosity);
139 _fluid_enthalpy[_qp][ph] = genericValue(_fsp[ph].enthalpy);
140 _fluid_internal_energy[_qp][ph] = genericValue(_fsp[ph].internal_energy);
142 for (
unsigned int comp = 0; comp < _num_components; ++comp)
143 _mass_frac[_qp][ph][comp] = genericValue(_fsp[ph].mass_fraction[comp]);
151 _fluid_density[_qp].resize(_num_phases, 0.0);
152 _fluid_viscosity[_qp].resize(_num_phases, 0.0);
153 _fluid_enthalpy[_qp].resize(_num_phases, 0.0);
154 _fluid_internal_energy[_qp].resize(_num_phases, 0.0);
155 _mass_frac[_qp].resize(_num_phases);
157 for (
unsigned int ph = 0; ph < _num_phases; ++ph)
158 _mass_frac[_qp][ph].resize(_num_components);
164 if (!_nodal_material || is_ad)
166 (*_grad_mass_frac_qp)[_qp].resize(_num_phases);
168 for (
unsigned int ph = 0; ph < _num_phases; ++ph)
169 (*_grad_mass_frac_qp)[_qp][ph].assign(_num_components, RealGradient());
175 (*_dfluid_density_dvar)[_qp].resize(_num_phases);
176 (*_dfluid_viscosity_dvar)[_qp].resize(_num_phases);
177 (*_dfluid_enthalpy_dvar)[_qp].resize(_num_phases);
178 (*_dfluid_internal_energy_dvar)[_qp].resize(_num_phases);
179 (*_dmass_frac_dvar)[_qp].resize(_num_phases);
181 for (
unsigned int ph = 0; ph < _num_phases; ++ph)
183 (*_dfluid_density_dvar)[_qp][ph].assign(_num_pf_vars, 0.0);
184 (*_dfluid_viscosity_dvar)[_qp][ph].assign(_num_pf_vars, 0.0);
185 (*_dfluid_enthalpy_dvar)[_qp][ph].assign(_num_pf_vars, 0.0);
186 (*_dfluid_internal_energy_dvar)[_qp][ph].assign(_num_pf_vars, 0.0);
187 (*_dmass_frac_dvar)[_qp][ph].resize(_num_components);
189 for (
unsigned int comp = 0; comp < _num_components; ++comp)
190 (*_dmass_frac_dvar)[_qp][ph][comp].assign(_num_pf_vars, 0.0);