21 "fluid_component", 0,
"The index corresponding to the fluid component for this kernel");
23 "Fully-upwinded advective flux of the component given by fluid_component");
32 this->template getGenericMaterialProperty<
std::vector<
std::vector<
Real>>, is_ad>(
33 "PorousFlow_mass_frac_nodal")),
34 _dmass_fractions_dvar(
36 : &this->template getMaterialProperty<
std::vector<
std::vector<
std::vector<
Real>>>>(
37 "dPorousFlow_mass_frac_nodal_dvar")),
38 _relative_permeability(this->template getGenericMaterialProperty<
std::vector<
Real>, is_ad>(
39 "PorousFlow_relative_permeability_nodal")),
40 _drelative_permeability_dvar(
42 : &this->template getMaterialProperty<
std::vector<
std::vector<
Real>>>(
43 "dPorousFlow_relative_permeability_nodal_dvar")),
44 _fluid_component(this->template getParam<unsigned
int>(
"fluid_component"))
49 "The Dictator proclaims that the maximum fluid component index in this simulation is ",
51 " whereas you have used ",
53 ". Remember that indexing starts at 0. The Dictator does not take such mistakes lightly.");
60 return _mass_fractions[nodenum][phase][_fluid_component] * _fluid_density_node[nodenum][phase] *
61 _relative_permeability[nodenum][phase] / _fluid_viscosity[nodenum][phase];
72 Real dm = (*_dmass_fractions_dvar)[nodenum][phase][_fluid_component][pvar] *
73 _fluid_density_node[nodenum][phase] * _relative_permeability[nodenum][phase] /
74 _fluid_viscosity[nodenum][phase];
75 dm += _mass_fractions[nodenum][phase][_fluid_component] *
76 (*_dfluid_density_node_dvar)[nodenum][phase][pvar] *
77 _relative_permeability[nodenum][phase] / _fluid_viscosity[nodenum][phase];
78 dm += _mass_fractions[nodenum][phase][_fluid_component] * _fluid_density_node[nodenum][phase] *
79 (*_drelative_permeability_dvar)[nodenum][phase][pvar] / _fluid_viscosity[nodenum][phase];
80 dm -= _mass_fractions[nodenum][phase][_fluid_component] * _fluid_density_node[nodenum][phase] *
81 _relative_permeability[nodenum][phase] * (*_dfluid_viscosity_dvar)[nodenum][phase][pvar] /
82 std::pow(_fluid_viscosity[nodenum][phase], 2);
Moose::GenericType< Real, is_ad > GenericReal
void paramError(const std::string ¶m, Args... args) const
virtual GenericReal< is_ad > mobility(unsigned nodenum, unsigned phase) const override
The mobility of the fluid.
unsigned int numComponents() const
The number of fluid components.
PetscErrorCode PetscOptionItems *PetscErrorCode DM dm
Convective flux of component k in fluid phase alpha.
registerMooseObject("PorousFlowApp", PorousFlowAdvectiveFlux)
const PorousFlowDictator & _dictator
PorousFlowDictator UserObject.
static InputParameters validParams()
void libmesh_ignore(const Args &...)
PorousFlowAdvectiveFluxTempl(const InputParameters ¶meters)
virtual Real dmobility(unsigned nodenum, unsigned phase, unsigned pvar) const override
The derivative of mobility with respect to PorousFlow variable pvar – non-AD path only...
static InputParameters validParams()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
MooseUnits pow(const MooseUnits &, int)
void ErrorVector unsigned int
const unsigned int _fluid_component
Index of the fluid component that this kernel acts on.