25#ifndef DUMUX_DARCY_SUBPROBLEM_HH
26#define DUMUX_DARCY_SUBPROBLEM_HH
28#include <dune/grid/yaspgrid.hh>
42template <
class TypeTag>
52template<
class TypeTag>
56template<
class TypeTag>
60 static constexpr auto phaseIdx = H2OAir::liquidPhaseIdx;
65template<
class TypeTag>
66struct UseMoles<TypeTag, TTag::DarcyOnePTwoC> {
static constexpr bool value =
true; };
69template<
class TypeTag>
70struct ReplaceCompEqIdx<TypeTag, TTag::DarcyOnePTwoC> {
static constexpr int value = 3; };
73template<
class TypeTag>
74struct EffectiveDiffusivityModel<TypeTag, TTag::DarcyOnePTwoC>
78template<
class TypeTag>
79struct Grid<TypeTag, TTag::DarcyOnePTwoC> {
using type = Dune::YaspGrid<2>; };
82template<
class TypeTag>
91template <
class TypeTag>
96 using GridView =
typename GridGeometry::GridView;
102 using SubControlVolume =
typename FVElementGeometry::SubControlVolume;
103 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
104 using Element =
typename GridView::template Codim<0>::Entity;
107 using GlobalPosition =
typename Element::Geometry::GlobalCoordinate;
110 using TimeLoopPtr = std::shared_ptr<TimeLoop<Scalar>>;
117 problemName_ = getParam<std::string>(
"Vtk.OutputName") +
"_" + getParamFromGroup<std::string>(this->
paramGroup(),
"Problem.Name");
120 verticalFlow_ = problemName_.find(
"vertical") != std::string::npos;
126 const std::string&
name()
const
136 {
return 273.15 + 10; }
151 BoundaryTypes
boundaryTypes(
const Element& element,
const SubControlVolumeFace& scvf)
const
153 BoundaryTypes values;
154 values.setAllNeumann();
156 if (
couplingManager().isCoupledEntity(CouplingManager::darcyIdx, scvf))
157 values.setAllCouplingNeumann();
161 if (onLowerBoundary_(scvf.center()))
162 values.setAllDirichlet();
175 PrimaryVariables
dirichlet(
const Element &element,
const SubControlVolumeFace &scvf)
const
177 PrimaryVariables values(0.0);
183 static const bool isDiffusionProblem = problemName_.find(
"diffusion") != std::string::npos;
185 Scalar bottomMoleFraction = 0.0;
187 if (isDiffusionProblem)
192 bottomMoleFraction = 1e-3;
195 if(onLowerBoundary_(scvf.center()))
196 values[Indices::conti0EqIdx + 1] = bottomMoleFraction;
213 template<
class ElementVolumeVariables,
class ElementFluxVarsCache>
215 const FVElementGeometry& fvGeometry,
216 const ElementVolumeVariables& elemVolVars,
217 const ElementFluxVarsCache& elemFluxVarsCache,
218 const SubControlVolumeFace& scvf)
const
220 NumEqVector values(0.0);
222 if (
couplingManager().isCoupledEntity(CouplingManager::darcyIdx, scvf))
223 values =
couplingManager().couplingData().massCouplingCondition(element, fvGeometry, elemVolVars, scvf);
243 template<
class ElementVolumeVariables>
244 NumEqVector
source(
const Element &element,
245 const FVElementGeometry& fvGeometry,
246 const ElementVolumeVariables& elemVolVars,
247 const SubControlVolume &scv)
const
248 {
return NumEqVector(0.0); }
260 PrimaryVariables
initial(
const Element &element)
const
262 PrimaryVariables values(0.0);
263 values[Indices::pressureIdx] = 1e5;
272 {
return *couplingManager_; }
278 { timeLoop_ = timeLoop; }
284 {
return timeLoop_->time(); }
287 bool onLeftBoundary_(
const GlobalPosition &globalPos)
const
288 {
return globalPos[0] < this->
gridGeometry().bBoxMin()[0] + eps_; }
290 bool onRightBoundary_(
const GlobalPosition &globalPos)
const
291 {
return globalPos[0] > this->
gridGeometry().bBoxMax()[0] - eps_; }
293 bool onLowerBoundary_(
const GlobalPosition &globalPos)
const
294 {
return globalPos[1] < this->
gridGeometry().bBoxMin()[1] + eps_; }
296 bool onUpperBoundary_(
const GlobalPosition &globalPos)
const
297 {
return globalPos[1] > this->
gridGeometry().bBoxMax()[1] - eps_; }
300 std::string problemName_;
302 std::shared_ptr<CouplingManager> couplingManager_;
303 TimeLoopPtr timeLoop_;
Properties for all models using cell-centered finite volume scheme with TPFA.
Relation for the saturation-dependent effective diffusion coefficient.
An adapter for multi-phase fluid systems to be used with (compositional) one-phase models.
A compositional two-phase fluid system with water and air as components in both, the liquid and the g...
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
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:149
Class to specify the type of a boundary.
Definition: common/boundarytypes.hh:38
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
The DUNE grid type.
Definition: common/properties.hh:57
Property to specify the type of a problem which has to be solved.
Definition: common/properties.hh:69
Property whether to use moles or kg as amount unit for balance equations.
Definition: common/properties.hh:102
The type of the spatial parameters object.
Definition: common/properties.hh:221
The type of the fluid system to use.
Definition: common/properties.hh:223
Relation for the saturation-dependent effective diffusion coefficient.
Definition: diffusivityconstanttortuosity.hh:49
An adapter for multi-phase fluid systems to be used with (compositional) one-phase models.
Definition: 1padapter.hh:46
A compositional two-phase fluid system with water and air as components in both, the liquid and the g...
Definition: h2oair.hh:75
Definition: multidomain/couplingmanager.hh:46
Base class for all fully implicit porous media problems.
Definition: dumux/porousmediumflow/problem.hh:39
Definition: 1p_2p/problem_darcy.hh:79
Scalar time() const
Returns the time.
Definition: 1p2c_1p2c/problem_darcy.hh:283
const CouplingManager & couplingManager() const
Get the coupling manager.
Definition: 1p2c_1p2c/diffusionlawcomparison/problem_darcy.hh:266
PrimaryVariables initial(const Element &element) const
Evaluates the initial value for a control volume.
Definition: 1p2c_1p2c/diffusionlawcomparison/problem_darcy.hh:254
DarcySubProblem(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< CouplingManager > couplingManager)
Definition: 1p2c_1p2c/problem_darcy.hh:113
void setTimeLoop(TimeLoopPtr timeLoop)
Sets the time loop pointer.
Definition: 1p2c_1p2c/problem_darcy.hh:277
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 control volume.
Definition: 1p2c_1p2c/problem_darcy.hh:214
PrimaryVariables dirichlet(const Element &element, const SubControlVolumeFace &scvf) const
Evaluates the boundary conditions for a Dirichlet control volume.
Definition: 1p2c_1p2c/problem_darcy.hh:175
Scalar temperature() const
Returns the temperature within the domain in [K].
Definition: 1p2c_1p2c/problem_darcy.hh:135
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 cont...
Definition: 1p2c_1p2c/problem_darcy.hh:151
const std::string & name() const
The problem name.
Definition: 1p2c_1p2c/problem_darcy.hh:126
NumEqVector source(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolume &scv) const
Evaluates the source term for all phases within a given sub control volume.
Definition: 1p2c_1p2c/problem_darcy.hh:244
Definition: 1p2c_1p2c/diffusionlawcomparison/problem_darcy.hh:57
std::tuple< OnePNC, CCTpfaModel > InheritsFrom
Definition: 1p2c_1p2c/diffusionlawcomparison/problem_darcy.hh:57
Dune::YaspGrid< 2 > type
Definition: 1p2c_1p2c/diffusionlawcomparison/problem_darcy.hh:88
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition: 1p2c_1p2c/diffusionlawcomparison/problem_darcy.hh:99
GetPropType< TypeTag, Properties::GridGeometry > GridGeometry
Definition: 1p2c_1p2c/diffusionlawcomparison/problem_darcy.hh:98
The spatial parameters class for the test problem using the 1p cc model.
Definition: multidomain/boundary/stokesdarcy/1p2c_1p2c/spatialparams.hh:41
Adaption of the fully implicit model to the one-phase n-component flow model.
Base class for all porous media problems.
Definition of the spatial parameters for the MaxwellStefan problem.