28#ifndef EWOMS_MULTI_PHASE_BASE_PROBLEM_HH
29#define EWOMS_MULTI_PHASE_BASE_PROBLEM_HH
31#include <dune/common/fvector.hh>
32#include <dune/common/fmatrix.hh>
34#include <dune/grid/common/partitionset.hh>
36#include <opm/material/fluidmatrixinteractions/NullMaterial.hpp>
37#include <opm/material/common/Means.hpp>
38#include <opm/material/densead/Evaluation.hpp>
47#include <opm/utility/CopyablePtr.hpp>
56template<
class TypeTag>
59 ,
public GetPropType<TypeTag, Properties::FluxModule>::FluxBaseProblem
73 using DirectionalMobilityPtr = Opm::Utility::CopyablePtr<DirectionalMobility<TypeTag, Evaluation>>;
75 enum { dimWorld = GridView::dimensionworld };
77 using DimVector = Dune::FieldVector<Scalar, dimWorld>;
78 using DimMatrix = Dune::FieldMatrix<Scalar, dimWorld, dimWorld>;
94 ParentType::registerParameters();
96 Parameters::Register<Parameters::EnableGravity>
97 (
"Use the gravity correction for the pressure gradients.");
109 template <
class Context>
111 const Context& context,
117 const DimMatrix&
K1 = asImp_().intrinsicPermeability(context,
scvf.interiorIndex(),
timeIdx);
118 const DimMatrix&
K2 = asImp_().intrinsicPermeability(context,
scvf.exteriorIndex(),
timeIdx);
122 for (
unsigned i = 0; i < dimWorld; ++i)
123 for (
unsigned j = 0; j < dimWorld; ++j)
140 template <
class Context>
145 throw std::logic_error(
"Not implemented: Problem::intrinsicPermeability()");
157 template <
class Context>
162 throw std::logic_error(
"Not implemented: Problem::porosity()");
174 template <
class Context>
175 const SolidEnergyLawParams&
180 throw std::logic_error(
"Not implemented: Problem::solidEnergyParams()");
192 template <
class Context>
193 const ThermalConductionLawParams&
198 throw std::logic_error(
"Not implemented: Problem::thermalConductionParams()");
209 template <
class Context>
214 throw std::logic_error(
"Not implemented: Problem::tortuosity()");
225 template <
class Context>
230 throw std::logic_error(
"Not implemented: Problem::dispersivity()");
246 template <
class Context>
247 const MaterialLawParams &
252 static MaterialLawParams
dummy;
256 template <
class Flu
idState>
257 void updateRelperms([[
maybe_unused]] std::array<Evaluation,numPhases>& mobility,
271 template <
class Context>
275 {
return asImp_().temperature(); }
285 {
throw std::logic_error(
"Not implemented:temperature() method not implemented by the actual problem"); }
296 template <
class Context>
300 {
return asImp_().gravity(); }
324 ElementContext elemCtx( this->
simulator() );
326 auto& grid = this->
simulator().vanguard().grid();
327 for (
const auto& element :
elements(
gridView, Dune::Partitions::interior)) {
328 elemCtx.updateAll(element);
334 size_t nDofs = elemCtx.numDof(0);
335 for (
unsigned dofIdx = 0; dofIdx <
nDofs; ++dofIdx)
337 const auto&
intQuant = elemCtx.intensiveQuantities( dofIdx, 0 );
346 if(
indicator > 0.2 && element.level() < 2 ) {
347 grid.mark( 1, element );
351 grid.mark( -1, element );
356 grid.mark( 0, element );
383 for (
unsigned i = 0; i < DimMatrix::rows; ++i)
392 Implementation& asImp_()
393 {
return *
static_cast<Implementation *
>(
this); }
395 const Implementation& asImp_()
const
396 {
return *
static_cast<const Implementation *
>(
this); }
401 if (Parameters::Get<Parameters::EnableGravity>()) {
402 gravity_[dimWorld-1] = -9.81;
Base class for all problems which use a finite volume spatial discretization.
Definition fvbaseproblem.hh:67
Simulator & simulator()
Returns Simulator object used by the simulation.
Definition fvbaseproblem.hh:677
const GridView & gridView() const
The GridView which used by the problem.
Definition fvbaseproblem.hh:645
The base class for the problems of ECFV discretizations which deal with a multi-phase flow through a ...
Definition multiphasebaseproblem.hh:60
void intersectionIntrinsicPermeability(DimMatrix &result, const Context &context, unsigned intersectionIdx, unsigned timeIdx) const
Returns the intrinsic permeability of an intersection.
Definition multiphasebaseproblem.hh:110
const ThermalConductionLawParams & thermalConductionParams(const Context &, unsigned, unsigned) const
Returns the parameter object for the thermal conductivity law in a sub-control volume.
Definition multiphasebaseproblem.hh:194
const MaterialLawParams & materialLawParams(const Context &, unsigned, unsigned) const
Returns the material law parameters within a control volume.
Definition multiphasebaseproblem.hh:248
DimMatrix toDimMatrix_(Scalar val) const
Converts a Scalar value to an isotropic Tensor.
Definition multiphasebaseproblem.hh:380
Scalar temperature() const
Returns the temperature for an isothermal problem.
Definition multiphasebaseproblem.hh:284
Scalar tortuosity(const Context &, unsigned, unsigned) const
Define the tortuosity.
Definition multiphasebaseproblem.hh:210
Scalar temperature(const Context &, unsigned, unsigned) const
Returns the temperature within a control volume.
Definition multiphasebaseproblem.hh:272
const DimVector & gravity() const
Returns the acceleration due to gravity .
Definition multiphasebaseproblem.hh:311
const DimVector & gravity(const Context &, unsigned, unsigned) const
Returns the acceleration due to gravity .
Definition multiphasebaseproblem.hh:297
Scalar porosity(const Context &, unsigned, unsigned) const
Returns the porosity [] of the porous medium for a given control volume.
Definition multiphasebaseproblem.hh:158
MultiPhaseBaseProblem(Simulator &simulator)
Definition multiphasebaseproblem.hh:85
const SolidEnergyLawParams & solidEnergyParams(const Context &, unsigned, unsigned) const
Returns the parameter object for the energy storage law of the solid in a sub-control volume.
Definition multiphasebaseproblem.hh:176
Scalar dispersivity(const Context &, unsigned, unsigned) const
Define the dispersivity.
Definition multiphasebaseproblem.hh:226
const DimMatrix & intrinsicPermeability(const Context &, unsigned, unsigned) const
Returns the intrinsic permeability tensor at a given position.
Definition multiphasebaseproblem.hh:141
unsigned markForGridAdaptation()
Mark grid cells for refinement or coarsening.
Definition multiphasebaseproblem.hh:319
static void registerParameters()
Register all run-time parameters for the problem and the model.
Definition multiphasebaseproblem.hh:92
This file contains definitions related to directional mobilities.
Base class for all problems which use a finite volume spatial discretization.
Declare the properties used by the infrastructure code of the finite volume discretizations.
Defines the common parameters for the porous medium multi-phase models.
Defines the common properties required by the porous medium multi-phase models.
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilboundaryratevector.hh:37
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:242
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property (equivalent to old macro GET_PROP_TYPE(....
Definition propertysystem.hh:235