65 using FVElementGeometry =
typename GridGeometry::LocalView;
66 using SubControlVolumeFace =
typename GridGeometry::SubControlVolumeFace;
71 static const int dimWorld = GridView::dimensionworld;
72 using DimWorldMatrix = Dune::FieldMatrix<Scalar, dimWorld, dimWorld>;
80 template <
class ElementFluxVariablesCache>
82 const SubControlVolumeFace& scvf,
83 const FVElementGeometry& fvGeometry,
84 const ElementVolumeVariables& elemVolVars,
85 const ElementFluxVariablesCache& elemFluxVarsCache,
90 DUNE_THROW(Dune::NotImplemented,
"Scheidegger dispersion tensors are only implemented for single phase flows.");
93 auto velocity = dispersionVelocity_(problem, scvf, fvGeometry, elemVolVars, elemFluxVarsCache);
96 std::array<Scalar,2> dispersivity = problem.spatialParams().dispersionAlphas(scvf.center(), phaseIdx, compIdx);
98 return scheideggerDispersionTensor_(dispersivity, velocity);
101 template <
class ElementFluxVariablesCache>
103 const SubControlVolumeFace& scvf,
104 const FVElementGeometry& fvGeometry,
105 const ElementVolumeVariables& elemVolVars,
106 const ElementFluxVariablesCache& elemFluxVarsCache,
110 DUNE_THROW(Dune::NotImplemented,
"Scheidegger dispersion tensors are only implemented for single phase flows.");
113 auto velocity = dispersionVelocity_(problem, scvf, fvGeometry, elemVolVars, elemFluxVarsCache);
116 std::array<Scalar,2> dispersivity = problem.spatialParams().dispersionAlphas(scvf.center(), phaseIdx);
118 return scheideggerDispersionTensor_(dispersivity, velocity);
123 template <
class ElementFluxVariablesCache>
124 static Dune::FieldVector<Scalar, dimWorld> dispersionVelocity_(
const Problem& problem,
125 const SubControlVolumeFace& scvf,
126 [[maybe_unused]]
const FVElementGeometry& fvGeometry,
127 [[maybe_unused]]
const ElementVolumeVariables& elemVolVars,
128 [[maybe_unused]]
const ElementFluxVariablesCache& elemFluxVarsCache)
131 Dune::FieldVector<Scalar, dimWorld> velocity(0.0);
132 if constexpr (stationaryVelocityField)
135 DUNE_THROW(Dune::NotImplemented,
"\n Please provide the stationary velocity field in the spatialparams via a velocity function.");
137 velocity = problem.spatialParams().velocity(scvf);
143 const auto& insideVolVars = elemVolVars[scvf.insideScvIdx()];
144 const auto& outsideVolVars = elemVolVars[scvf.outsideScvIdx()];
146 outsideVolVars.permeability(),
147 scvf.unitOuterNormal());
149 const auto gradPotential = AdvectionType::potentialGradient(problem, fvGeometry, elemVolVars, scvf,
150 0, elemFluxVarsCache[scvf]);
151 velocity =
mv(K, gradPotential);
152 velocity /= -0.5 * (insideVolVars.viscosity() + outsideVolVars.viscosity());
155 DUNE_THROW(Dune::NotImplemented,
"\n Scheidegger Dispersion for compositional models without given constant velocity field is only implemented using the Box method.");
161 static DimWorldMatrix scheideggerDispersionTensor_(
const std::array<Scalar,2>& dispersivity,
162 const Dune::FieldVector<Scalar, dimWorld>& velocity)
164 DimWorldMatrix dispersionTensor(0.0);
167 for (
int i=0; i < dimWorld; i++)
168 for (
int j = 0; j < dimWorld; j++)
169 dispersionTensor[i][j] = velocity[i]*velocity[j];
172 const Scalar vNorm = velocity.two_norm();
174 return DimWorldMatrix(0.0);
176 dispersionTensor /= vNorm;
179 dispersionTensor *= (dispersivity[0] - dispersivity[1]);
182 for (
int i = 0; i < dimWorld; i++)
183 dispersionTensor[i][i] += vNorm*dispersivity[1];
185 return dispersionTensor;
static DimWorldMatrix compositionalDispersionTensor(const Problem &problem, const SubControlVolumeFace &scvf, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const ElementFluxVariablesCache &elemFluxVarsCache, const int phaseIdx, const int compIdx)
Definition scheidegger.hh:81
static DimWorldMatrix thermalDispersionTensor(const Problem &problem, const SubControlVolumeFace &scvf, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const ElementFluxVariablesCache &elemFluxVarsCache, const int phaseIdx)
Definition scheidegger.hh:102
Dune::DenseVector< V >::derived_type mv(const Dune::DenseMatrix< MAT > &M, const Dune::DenseVector< V > &v)
Returns the result of the projection of a vector v with a Matrix M.
Definition math.hh:829
typename GetProp< TypeTag, Property >::type GetPropType
get the type alias defined in the property
Definition propertysystem.hh:296
Scalar faceTensorAverage(const Scalar T1, const Scalar T2, const Dune::FieldVector< Scalar, dim > &normal)
Average of a discontinuous scalar field at discontinuity interface (for compatibility reasons with th...
Definition facetensoraverage.hh:29