26#ifndef DUMUX_MPNC_TWOPTWOC_COMPARISON_OBSTACLEPROBLEM_HH
27#define DUMUX_MPNC_TWOPTWOC_COMPARISON_OBSTACLEPROBLEM_HH
29#include <dune/common/parametertreeparser.hh>
30#include <dune/grid/yaspgrid.hh>
53template <
class TypeTag>
54class MPNCComparisonProblem;
65template<
class TypeTag>
66struct Grid<TypeTag, TTag::MPNCComparison> {
using type = Dune::YaspGrid<2>; };
69template<
class TypeTag>
73template<
class TypeTag>
82template<
class TypeTag>
90template<
class TypeTag>
91struct Scalar<TypeTag, TTag::MPNCComparison> {
using type = double; };
92template<
class TypeTag>
93struct UseMoles<TypeTag, TTag::MPNCComparison> {
static constexpr bool value =
true; };
94template<
class TypeTag>
105template <
class TypeTag>
118 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
120 using Element =
typename GridView::template Codim<0>::Entity;
123 using ParameterCache =
typename FluidSystem::ParameterCache;
127 static constexpr auto gasPhaseIdx = FluidSystem::gasPhaseIdx;
128 static constexpr auto liquidPhaseIdx = FluidSystem::liquidPhaseIdx;
129 static constexpr auto wCompIdx = FluidSystem::H2OIdx;
130 static constexpr auto nCompIdx = FluidSystem::N2Idx;
131 static constexpr auto fug0Idx = Indices::fug0Idx;
132 static constexpr auto s0Idx = Indices::s0Idx;
133 static constexpr auto p0Idx = Indices::p0Idx;
135 using GlobalPosition =
typename SubControlVolumeFace::GlobalPosition;
136 using PhaseVector = Dune::FieldVector<Scalar, numPhases>;
143 temperature_ = 273.15 + 25;
146 Scalar Tmin = temperature_ - 1.0;
147 Scalar Tmax = temperature_ + 1.0;
150 Scalar pmin = 1.0e5 * 0.75;
151 Scalar pmax = 2.0e5 * 1.25;
154 FluidSystem::init(Tmin, Tmax, nT, pmin, pmax, np);
155 name_ = getParam<std::string>(
"Problem.Name");
176 {
return temperature_; }
192 BoundaryTypes bcTypes;
193 if (onOutlet_(globalPos))
194 bcTypes.setAllDirichlet();
196 bcTypes.setAllNeumann();
207 return initial_(globalPos);
216 NeumannFluxes values(0.0);
217 Scalar injectedAirMass = -1e-3;
218 Scalar injectedAirMolarMass = injectedAirMass/FluidSystem::molarMass(FluidSystem::N2Idx);
219 if (onInlet_(globalPos))
220 values[Indices::conti0EqIdx + FluidSystem::N2Idx] = injectedAirMolarMass;
241 return initial_(globalPos);
248 PrimaryVariables initial_(
const GlobalPosition &globalPos)
const
250 PrimaryVariables values(0.0);
257 fs.setSaturation(liquidPhaseIdx, 0.8);
258 fs.setSaturation(gasPhaseIdx, 1.0 - fs.saturation(liquidPhaseIdx));
260 fs.setPressure(gasPhaseIdx, 1e5);
262 const auto& matParams =
265 using MaterialLaw =
typename ParentType::SpatialParams::MaterialLaw;
268 const int wPhaseIdx = this->
spatialParams().template wettingPhaseAtPos<FluidSystem>(globalPos);
269 MPAdapter::capillaryPressures(pc, matParams, fs, wPhaseIdx);
270 fs.setPressure(liquidPhaseIdx,
271 fs.pressure(gasPhaseIdx) + pc[liquidPhaseIdx] - pc[gasPhaseIdx]);
277 ParameterCache paramCache;
285 for (
int compIdx = 0; compIdx < numComponents; ++compIdx)
286 values[fug0Idx + compIdx] = fs.fugacity(gasPhaseIdx, compIdx);
289 for (
int phaseIdx = 0; phaseIdx < numPhases - 1; ++phaseIdx)
290 values[s0Idx + phaseIdx] = fs.saturation(phaseIdx);
293 values[p0Idx] = fs.pressure(0);
297 bool onInlet_(
const GlobalPosition &globalPos)
const
299 Scalar x = globalPos[0];
300 Scalar y = globalPos[1];
301 return x >= 60 - eps_ && y <= 10 + eps_;
304 bool onOutlet_(
const GlobalPosition &globalPos)
const
306 Scalar x = globalPos[0];
307 Scalar y = globalPos[1];
308 return x < eps_ && y <= 10 + eps_;
312 static constexpr Scalar eps_ = 1e-6;
Defines a type tag and some properties for models using the box scheme.
Properties for all models using cell-centered finite volume scheme with TPFA.
Computes the composition of all phases of a N-phase, N-component fluid system assuming that all N pha...
Represents all relevant thermodynamic quantities of a multi-phase, multi-component fluid system assum...
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
Base class for all finite-volume problems.
Definition: common/fvproblem.hh:50
const GridGeometry & gridGeometry() const
The finite volume grid geometry.
Definition: common/fvproblem.hh:588
Property to specify the type of scalar values.
Definition: common/properties.hh:53
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
A class helping models to define input and output fields.
Definition: common/properties.hh:78
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
Computes the composition of all phases of a N-phase, N-component fluid system assuming that all N pha...
Definition: misciblemultiphasecomposition.hh:60
static void solve(FluidState &fluidState, ParameterCache ¶mCache, int knownPhaseIdx=0)
Computes the composition of all phases of a N-phase, N-component fluid system assuming that all N pha...
Definition: misciblemultiphasecomposition.hh:82
An adapter for mpnc to use the capillary pressure-saturation relationships.
Definition: mpadapter.hh:42
Policy for the H2O-N2 fluid system.
Definition: h2on2.hh:52
A two-phase fluid system with two components water Nitrogen for non-equilibrium models.
Definition: h2on2.hh:69
Base class for all fully implicit porous media problems.
Definition: dumux/porousmediumflow/problem.hh:39
Scalar temperatureAtPos(const GlobalPosition &globalPos) const
Returns the temperature at a given global position.
Definition: dumux/porousmediumflow/problem.hh:105
SpatialParams & spatialParams()
Returns the spatial parameters object.
Definition: dumux/porousmediumflow/problem.hh:146
Adds I/O fields specific to the two-phase two-component model.
Definition: test/porousmediumflow/2p2c/implicit/mpnccomparison/iofields.hh:36
Problem where air is injected in a unsaturated porous medium.
Definition: test/porousmediumflow/mpnc/implicit/2p2ccomparison/problem.hh:108
MPNCComparisonProblem(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: test/porousmediumflow/mpnc/implicit/2p2ccomparison/problem.hh:140
NeumannFluxes neumannAtPos(const GlobalPosition &globalPos) const
Evaluates the boundary conditions for a Neumann boundary segment.
Definition: test/porousmediumflow/mpnc/implicit/2p2ccomparison/problem.hh:214
BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const
Specifies which kind of boundary condition should be used for which equation on a given boundary segm...
Definition: test/porousmediumflow/mpnc/implicit/2p2ccomparison/problem.hh:190
PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
Evaluates the boundary conditions for a Dirichlet boundary segment.
Definition: test/porousmediumflow/mpnc/implicit/2p2ccomparison/problem.hh:205
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
Evaluates the initial value for a control volume.
Definition: test/porousmediumflow/mpnc/implicit/2p2ccomparison/problem.hh:239
Scalar temperature() const
Returns the temperature .
Definition: test/porousmediumflow/mpnc/implicit/2p2ccomparison/problem.hh:175
const std::string name() const
Returns the problem name.
Definition: test/porousmediumflow/mpnc/implicit/2p2ccomparison/problem.hh:168
Definition: test/porousmediumflow/mpnc/implicit/2p2ccomparison/problem.hh:59
std::tuple< MPNC > InheritsFrom
Definition: test/porousmediumflow/mpnc/implicit/2p2ccomparison/problem.hh:59
Definition: test/porousmediumflow/mpnc/implicit/2p2ccomparison/problem.hh:60
std::tuple< MPNCComparison, BoxModel > InheritsFrom
Definition: test/porousmediumflow/mpnc/implicit/2p2ccomparison/problem.hh:60
Definition: test/porousmediumflow/mpnc/implicit/2p2ccomparison/problem.hh:61
std::tuple< MPNCComparison, CCTpfaModel > InheritsFrom
Definition: test/porousmediumflow/mpnc/implicit/2p2ccomparison/problem.hh:61
Dune::YaspGrid< 2 > type
Definition: test/porousmediumflow/mpnc/implicit/2p2ccomparison/problem.hh:66
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition: test/porousmediumflow/mpnc/implicit/2p2ccomparison/problem.hh:77
GetPropType< TypeTag, Properties::GridGeometry > GridGeometry
Definition: test/porousmediumflow/mpnc/implicit/2p2ccomparison/problem.hh:76
double type
Definition: test/porousmediumflow/mpnc/implicit/2p2ccomparison/problem.hh:91
Definition of the spatial params properties for the obstacle problem.
Definition: porousmediumflow/mpnc/implicit/2p2ccomparison/spatialparams.hh:46
A fully implicit model for MpNc flow using vertex centered finite volumes.
Adds I/O fields specific to the twop model.
Base class for all porous media problems.
Definition of the spatial parameters for the MaxwellStefan problem.