22 Eigen::MatrixXd
const& pore_diffusion_coefficient,
23 Eigen::VectorXd
const& velocity,
24 double const porosity,
25 double const solute_dispersivity_transverse,
26 double const solute_dispersivity_longitudinal)
28 double const velocity_magnitude = velocity.norm();
29 if (velocity_magnitude == 0.0)
31 return porosity * pore_diffusion_coefficient;
34 auto const dim = velocity.size();
35 Eigen::MatrixXd
const& I(Eigen::MatrixXd::Identity(dim, dim));
36 return porosity * pore_diffusion_coefficient +
37 solute_dispersivity_transverse * velocity_magnitude * I +
38 (solute_dispersivity_longitudinal - solute_dispersivity_transverse) /
39 velocity_magnitude * velocity * velocity.transpose();
44 std::size_t
const element_id,
45 Eigen::MatrixXd
const& pore_diffusion_coefficient,
46 Eigen::VectorXd
const& velocity,
47 double const porosity,
48 double const solute_dispersivity_transverse,
49 double const solute_dispersivity_longitudinal)
51 double const velocity_magnitude = velocity.norm();
52 if (velocity_magnitude == 0.0)
54 return porosity * pore_diffusion_coefficient;
57 double const artificial_diffusion =
60 auto const dim = velocity.size();
61 Eigen::MatrixXd
const& I(Eigen::MatrixXd::Identity(dim, dim));
62 return porosity * pore_diffusion_coefficient +
63 (solute_dispersivity_transverse * velocity_magnitude +
64 artificial_diffusion) *
66 (solute_dispersivity_longitudinal - solute_dispersivity_transverse) /
67 velocity_magnitude * velocity * velocity.transpose();
73 std::size_t
const element_id,
74 Eigen::MatrixXd
const& pore_diffusion_coefficient,
75 Eigen::VectorXd
const& velocity,
76 double const porosity,
77 double const solute_dispersivity_transverse,
78 double const solute_dispersivity_longitudinal)
81 [&](
auto&& stabilizer)
83 using Stabilizer = std::decay_t<
decltype(stabilizer)>;
84 if constexpr (std::is_same_v<Stabilizer,
90 pore_diffusion_coefficient,
93 solute_dispersivity_transverse,
94 solute_dispersivity_longitudinal);
98 pore_diffusion_coefficient,
101 solute_dispersivity_transverse,
102 solute_dispersivity_longitudinal);
double computeArtificialDiffusion(std::size_t const element_id, double const velocity_norm) const
Eigen::MatrixXd getHydrodynamicDispersion(Eigen::MatrixXd const &pore_diffusion_coefficient, Eigen::VectorXd const &velocity, double const porosity, double const solute_dispersivity_transverse, double const solute_dispersivity_longitudinal)
Eigen::MatrixXd getHydrodynamicDispersionWithArtificialDiffusion(IsotropicDiffusionStabilization const &stabilizer, std::size_t const element_id, Eigen::MatrixXd const &pore_diffusion_coefficient, Eigen::VectorXd const &velocity, double const porosity, double const solute_dispersivity_transverse, double const solute_dispersivity_longitudinal)
std::variant< NoStabilization, IsotropicDiffusionStabilization, FullUpwind, FluxCorrectedTransport > NumericalStabilization
Eigen::MatrixXd computeHydrodynamicDispersion(NumericalStabilization const &stabilizer, std::size_t const element_id, Eigen::MatrixXd const &pore_diffusion_coefficient, Eigen::VectorXd const &velocity, double const porosity, double const solute_dispersivity_transverse, double const solute_dispersivity_longitudinal)