21 RealVectorValue g(0, 0, -9.81);
22 params.
addParam<RealVectorValue>(
"gravity", g,
"Gravity vector. Defaults to (0, 0, -9.81)");
24 "The PorousFlowDictator UserObject");
25 params.
addParam<
unsigned int>(
"fluid_component", 0,
"The fluid component");
27 "disp_long",
"Vector of longitudinal dispersion coefficients for each phase");
29 "disp_trans",
"Vector of transverse dispersion coefficients for each phase");
31 "Dispersive and diffusive flux of the component given by fluid_component in all phases");
32 params.
set<
unsigned short>(
"ghost_layers") = 2;
37 "ElementSideNeighborLayers",
38 Moose::RelationshipManagerType::GEOMETRIC | Moose::RelationshipManagerType::ALGEBRAIC |
39 Moose::RelationshipManagerType::COUPLING,
51 _num_phases(_dictator.numPhases()),
52 _fluid_component(getParam<unsigned
int>(
"fluid_component")),
53 _density(getADMaterialProperty<
std::vector<Real>>(
"PorousFlow_fluid_phase_density_qp")),
54 _viscosity(getADMaterialProperty<
std::vector<Real>>(
"PorousFlow_viscosity_qp")),
56 getNeighborADMaterialProperty<
std::vector<Real>>(
"PorousFlow_viscosity_qp")),
57 _relperm(getADMaterialProperty<
std::vector<Real>>(
"PorousFlow_relative_permeability_qp")),
59 getNeighborADMaterialProperty<
std::vector<Real>>(
"PorousFlow_relative_permeability_qp")),
61 getADMaterialProperty<
std::vector<
std::vector<Real>>>(
"PorousFlow_mass_frac_qp")),
62 _mass_fractions_neighbor(
63 getNeighborADMaterialProperty<
std::vector<
std::vector<Real>>>(
"PorousFlow_mass_frac_qp")),
64 _grad_mass_frac(getADMaterialProperty<
std::vector<
std::vector<RealGradient>>>(
65 "PorousFlow_grad_mass_frac_qp")),
66 _permeability(getADMaterialProperty<RealTensorValue>(
"PorousFlow_permeability_qp")),
67 _permeability_neighbor(
68 getNeighborADMaterialProperty<RealTensorValue>(
"PorousFlow_permeability_qp")),
69 _pressure(getADMaterialProperty<
std::vector<Real>>(
"PorousFlow_porepressure_qp")),
71 getNeighborADMaterialProperty<
std::vector<Real>>(
"PorousFlow_porepressure_qp")),
72 _grad_p(getADMaterialProperty<
std::vector<RealGradient>>(
"PorousFlow_grad_porepressure_qp")),
73 _porosity(getADMaterialProperty<Real>(
"PorousFlow_porosity_qp")),
74 _porosity_neighbor(getNeighborADMaterialProperty<Real>(
"PorousFlow_porosity_qp")),
75 _tortuosity(getADMaterialProperty<
std::vector<Real>>(
"PorousFlow_tortuosity_qp")),
77 getNeighborADMaterialProperty<
std::vector<Real>>(
"PorousFlow_tortuosity_qp")),
79 getMaterialProperty<
std::vector<
std::vector<Real>>>(
"PorousFlow_diffusion_coeff_qp")),
80 _diffusion_coeff_neighbor(getNeighborMaterialProperty<
std::vector<
std::vector<Real>>>(
81 "PorousFlow_diffusion_coeff_qp")),
82 _gravity(getParam<RealVectorValue>(
"gravity")),
84 _disp_long(getParam<
std::vector<Real>>(
"disp_long")),
85 _disp_trans(getParam<
std::vector<Real>>(
"disp_trans"))
90 "The Dictator proclaims that the maximum fluid component index in this simulation is ",
92 " whereas you have used ",
94 ". Remember that indexing starts at 0. The Dictator does not take such mistakes lightly.");
100 "The number of longitudinal dispersion coefficients is not equal to the number of phases");
104 "The number of transverse dispersion coefficients disp_trans is not equal to the "
145 Moose::FV::InterpMethod::Average, diffusion, coeff, coeff_neighbor, *
_face_info,
true);
169 const auto mobility_neighbor =
172 interpolate(Moose::FV::InterpMethod::Upwind,
181 const auto velocity = mobility * gradp;
184 if (!MooseUtils::isZero(velocity_abs))
DualNumber< Real, DNDerivativeType, true > ADReal
registerADMooseObject("PorousFlowApp", FVPorousFlowDispersiveFlux)
void ErrorVector unsigned int
const bool _correct_skewness
static InputParameters validParams()
static InputParameters validParams()
bool onBoundary(const FaceInfo &fi) const
virtual ADReal gradUDotNormal(const Moose::StateArg &time, const bool correct_skewness) const
const FaceInfo * _face_info
Dispersive flux of component k in fluid phase alpha.
static InputParameters validParams()
const ADMaterialProperty< Real > & _porosity_neighbor
const ADMaterialProperty< std::vector< Real > > & _tortuosity_neighbor
const ADMaterialProperty< std::vector< Real > > & _viscosity_neighbor
const ADMaterialProperty< std::vector< Real > > & _relperm
Relative permeability.
const RealVectorValue & _gravity
Gravity vector.
const MaterialProperty< std::vector< std::vector< Real > > > & _diffusion_coeff
Diffusion coefficients of component k in fluid phase alpha.
const std::vector< Real > _disp_trans
Transverse dispersivity for each phase.
const ADMaterialProperty< std::vector< std::vector< Real > > > & _mass_fractions
Mass fraction of fluid components in fluid phases.
const ADMaterialProperty< std::vector< Real > > & _density
Fluid density.
const ADMaterialProperty< std::vector< Real > > & _tortuosity
Tortuosity tau_0 * tau_{alpha} for fluid phase alpha.
const std::vector< Real > _disp_long
Longitudinal dispersivity for each phase.
const PorousFlowDictator & _dictator
UserObject that holds information (number of phases, components, etc)
const ADMaterialProperty< RealTensorValue > & _permeability
Permeability.
const unsigned int _fluid_component
Index of the fluid component this kernel applies to.
const ADMaterialProperty< std::vector< Real > > & _pressure
Fluid pressure.
const unsigned int _num_phases
Number of fluid phases present.
virtual ADReal computeQpResidual() override
const ADMaterialProperty< std::vector< Real > > & _relperm_neighbor
const ADMaterialProperty< Real > & _porosity
Porosity.
const ADMaterialProperty< std::vector< std::vector< RealGradient > > > & _grad_mass_frac
const MaterialProperty< std::vector< std::vector< Real > > > & _diffusion_coeff_neighbor
const ADMaterialProperty< RealTensorValue > & _permeability_neighbor
const ADMaterialProperty< std::vector< Real > > & _pressure_neighbor
const ADMaterialProperty< std::vector< std::vector< Real > > > & _mass_fractions_neighbor
const ADMaterialProperty< std::vector< Real > > & _viscosity
Fluid viscosity.
const ADRankTwoTensor _identity_tensor
FVPorousFlowDispersiveFlux(const InputParameters ¶ms)
const ADMaterialProperty< std::vector< RealGradient > > & _grad_p
static void setRMParamsDiffusion(const InputParameters &obj_params, InputParameters &rm_params, const unsigned short conditional_extended_layers)
const Point & eCN() const
void paramError(const std::string ¶m, Args... args) const
This holds maps between the nonlinear variables used in a PorousFlow simulation and the variable numb...
unsigned int numComponents() const
The number of fluid components.
static RankTwoTensorTempl< T > selfOuterProduct(const libMesh::TypeVector< T > &)
Moose::StateArg determineState() const