25#ifndef DUMUX_ONEP_SUB_TEST_PROBLEM_HH
26#define DUMUX_ONEP_SUB_TEST_PROBLEM_HH
28#include <dune/common/indices.hh>
43template<
class TypeTag, std::
size_t tag>
45:
public PorousMediumFlowProblem<TypeTag>
47 using ParentType = PorousMediumFlowProblem<TypeTag>;
48 using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>;
49 using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>;
50 using FVElementGeometry =
typename GridGeometry::LocalView;
51 using SubControlVolumeFace =
typename GridGeometry::SubControlVolumeFace;
52 using GridView =
typename GridGeometry::GridView;
53 using Element =
typename GridView::template Codim<0>::Entity;
54 using Scalar = GetPropType<TypeTag, Properties::Scalar>;
55 using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>;
56 using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>;
58 using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>;
59 using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>;
60 static constexpr int dimWorld = GridView::dimensionworld;
61 using GlobalPosition =
typename Element::Geometry::GlobalCoordinate;
62 static constexpr auto domainIdx = Dune::index_constant<tag>{};
66 std::shared_ptr<CouplingManager> couplingManager,
69 , couplingManager_(couplingManager)
71 injectionRate_ = getParam<double>(
"Problem.InjectionRate");
72 problemName_ = getParam<std::string>(
"Vtk.OutputName") +
"_" + getParamFromGroup<std::string>(
paramGroup,
"Problem.Name");
78 const std::string&
name()
const
91 const SubControlVolumeFace &scvf)
const
94 values.setAllDirichlet();
96 if (couplingManager_->isCoupled(domainIdx, scvf))
97 values.setAllCouplingNeumann();
117 template<
class ElementVolumeVariables,
class ElementFluxVarsCache>
119 const FVElementGeometry& fvGeometry,
120 const ElementVolumeVariables& elemVolVars,
121 const ElementFluxVarsCache& elemFluxVarsCache,
122 const SubControlVolumeFace& scvf)
const
124 NumEqVector values(0.0);
126 if (bcTypes.hasCouplingNeumann())
127 values[Indices::conti0EqIdx] = couplingManager_->advectiveFluxCoupling(domainIdx, element, fvGeometry, elemVolVars, scvf, FluidSystem::phase0Idx);
141 PrimaryVariables values(0.0);
142 values[Indices::pressureIdx] = 1.0e6;
143 if (NumEqVector::dimension > 1)
144 values[Indices::pressureIdx + 1] = 1e-10;
160 template<
class Po
intSource>
163 NumEqVector values(0.0);
165 if (NumEqVector::dimension > 1)
166 values[Indices::conti0EqIdx + 1] = injectionRate_;
167 pointSources.emplace_back(GlobalPosition(0.0), values);
192 Scalar injectionRate_;
193 std::shared_ptr<CouplingManager> couplingManager_;
194 static constexpr Scalar eps_ = 1e-7;
195 std::string problemName_;
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
Property tag Indices
Definition: porousmediumflow/sequential/properties.hh:59
Base class for all finite-volume problems.
Definition: common/fvproblem.hh:50
const std::string & paramGroup() const
The parameter group in which to retrieve runtime parameters.
Definition: common/fvproblem.hh:592
const GridGeometry & gridGeometry() const
The finite volume grid geometry.
Definition: common/fvproblem.hh:588
BoundaryTypes boundaryTypes(const Element &element, const SubControlVolumeFace &scvf) const
Specifies which kind of boundary condition should be used for which equation on a given boundary segm...
Definition: test/multidomain/boundary/darcydarcy/1p_2p/problem.hh:90
PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
Evaluates the boundary conditions for a Dirichlet control volume.
Definition: test/multidomain/boundary/darcydarcy/1p_2p/problem.hh:139
void addPointSources(std::vector< PointSource > &pointSources) const
Applies a vector of point sources which are possibly solution dependent.
Definition: test/multidomain/boundary/darcydarcy/1p_2p/problem.hh:161
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
Evaluates the initial value for a control volume.
Definition: test/multidomain/boundary/darcydarcy/1p_2p/problem.hh:187
Scalar temperature() const
Returns the temperature for an isothermal problem.
Definition: test/multidomain/boundary/darcydarcy/1p_2p/problem.hh:177
NumEqVector neumann(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const ElementFluxVarsCache &elemFluxVarsCache, const SubControlVolumeFace &scvf) const
Evaluates the boundary conditions for a Neumann boundary segment.
Definition: test/multidomain/boundary/darcydarcy/1p_2p/problem.hh:118
const std::string & name() const
The problem name.
Definition: test/multidomain/boundary/darcydarcy/1p_2p/problem.hh:78
OnePTestProblem(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< CouplingManager > couplingManager, const std::string ¶mGroup="")
Definition: test/multidomain/boundary/darcydarcy/1p_2p/problem.hh:65
Base class for all porous media problems.
Definition of the spatial parameters for the MaxwellStefan problem.