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"))
113 setMaterialVectorSize();
115 thermophysicalProperties();
120 if (_nodal_material || is_ad)
121 for (
unsigned int ph = 0; ph < _num_phases; ++ph)
123 _saturation[_qp][ph] = genericValue(_fsp[ph].saturation);
124 _porepressure[_qp][ph] = genericValue(_fsp[ph].pressure);
125 _fluid_density[_qp][ph] = genericValue(_fsp[ph].density);
126 _fluid_viscosity[_qp][ph] = genericValue(_fsp[ph].viscosity);
127 _fluid_enthalpy[_qp][ph] = genericValue(_fsp[ph].enthalpy);
128 _fluid_internal_energy[_qp][ph] = genericValue(_fsp[ph].internal_energy);
130 for (
unsigned int comp = 0; comp < _num_components; ++comp)
131 _mass_frac[_qp][ph][comp] = genericValue(_fsp[ph].mass_fraction[comp]);
144 setMaterialVectorSize();
147 thermophysicalProperties();
149 for (
unsigned int ph = 0; ph < _num_phases; ++ph)
151 _saturation[_qp][ph] = genericValue(_fsp[ph].saturation);
152 _porepressure[_qp][ph] = genericValue(_fsp[ph].pressure);
153 _fluid_density[_qp][ph] = genericValue(_fsp[ph].density);
154 _fluid_viscosity[_qp][ph] = genericValue(_fsp[ph].viscosity);
155 _fluid_enthalpy[_qp][ph] = genericValue(_fsp[ph].enthalpy);
156 _fluid_internal_energy[_qp][ph] = genericValue(_fsp[ph].internal_energy);
158 for (
unsigned int comp = 0; comp < _num_components; ++comp)
159 _mass_frac[_qp][ph][comp] = genericValue(_fsp[ph].mass_fraction[comp]);
167 _fluid_density[_qp].resize(_num_phases, 0.0);
168 _fluid_viscosity[_qp].resize(_num_phases, 0.0);
169 _fluid_enthalpy[_qp].resize(_num_phases, 0.0);
170 _fluid_internal_energy[_qp].resize(_num_phases, 0.0);
171 _mass_frac[_qp].resize(_num_phases);
173 for (
unsigned int ph = 0; ph < _num_phases; ++ph)
174 _mass_frac[_qp][ph].resize(_num_components);
180 if (!_nodal_material || is_ad)
182 (*_grad_mass_frac_qp)[_qp].resize(_num_phases);
184 for (
unsigned int ph = 0; ph < _num_phases; ++ph)
185 (*_grad_mass_frac_qp)[_qp][ph].assign(_num_components, RealGradient());
191 (*_dfluid_density_dvar)[_qp].resize(_num_phases);
192 (*_dfluid_viscosity_dvar)[_qp].resize(_num_phases);
193 (*_dfluid_enthalpy_dvar)[_qp].resize(_num_phases);
194 (*_dfluid_internal_energy_dvar)[_qp].resize(_num_phases);
195 (*_dmass_frac_dvar)[_qp].resize(_num_phases);
197 for (
unsigned int ph = 0; ph < _num_phases; ++ph)
199 (*_dfluid_density_dvar)[_qp][ph].assign(_num_pf_vars, 0.0);
200 (*_dfluid_viscosity_dvar)[_qp][ph].assign(_num_pf_vars, 0.0);
201 (*_dfluid_enthalpy_dvar)[_qp][ph].assign(_num_pf_vars, 0.0);
202 (*_dfluid_internal_energy_dvar)[_qp][ph].assign(_num_pf_vars, 0.0);
203 (*_dmass_frac_dvar)[_qp][ph].resize(_num_components);
205 for (
unsigned int comp = 0; comp < _num_components; ++comp)
206 (*_dmass_frac_dvar)[_qp][ph][comp].assign(_num_pf_vars, 0.0);