25#ifndef DUMUX_INJECTION_PROBLEM_HH
26#define DUMUX_INJECTION_PROBLEM_HH
28#include <dune/grid/yaspgrid.hh>
44#define ENABLECACHING 0
47template <
class TypeTag>
48class InjectionProblem;
60template<
class TypeTag>
61struct Grid<TypeTag, TTag::Injection> {
using type = Dune::YaspGrid<2>; };
64template<
class TypeTag>
68template<
class TypeTag>
76template<
class TypeTag>
85template<
class TypeTag>
86struct UseMoles<TypeTag, TTag::Injection> {
static constexpr bool value =
true; };
89template<
class TypeTag>
91template<
class TypeTag>
93template<
class TypeTag>
97template<
class TypeTag>
105 static constexpr int numIvScvs = 4;
106 static constexpr int numIvScvfs = 4;
141template <
class TypeTag>
156 pressureIdx = Indices::pressureIdx,
157 switchIdx = Indices::switchIdx
161 enum { wPhaseOnly = Indices::firstPhaseOnly };
166 contiH2OEqIdx = Indices::conti0EqIdx + FluidSystem::H2OIdx,
167 contiN2EqIdx = Indices::conti0EqIdx + FluidSystem::N2Idx,
173 gasPhaseIdx = FluidSystem::N2Idx,
174 H2OIdx = FluidSystem::H2OIdx,
175 N2Idx = FluidSystem::N2Idx
181 using ElementVolumeVariables =
typename GridVariables::GridVolumeVariables::LocalView;
182 using ElementFluxVariablesCache =
typename GridVariables::GridFluxVariablesCache::LocalView;
184 using Element =
typename GridView::template Codim<0>::Entity;
185 using GlobalPosition =
typename Element::Geometry::GlobalCoordinate;
187 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
190 static constexpr bool useMoles = ModelTraits::useMoles();
196 nTemperature_ = getParam<int>(
"Problem.NTemperature");
197 nPressure_ = getParam<int>(
"Problem.NPressure");
198 pressureLow_ = getParam<Scalar>(
"Problem.PressureLow");
199 pressureHigh_ = getParam<Scalar>(
"Problem.PressureHigh");
200 temperatureLow_ = getParam<Scalar>(
"Problem.TemperatureLow");
201 temperatureHigh_ = getParam<Scalar>(
"Problem.TemperatureHigh");
202 temperature_ = getParam<Scalar>(
"Problem.InitialTemperature");
203 depthBOR_ = getParam<Scalar>(
"Problem.DepthBOR");
204 name_ = getParam<std::string>(
"Problem.Name");
207 FluidSystem::init(temperatureLow_,
216 std::cout<<
"problem uses mole-fractions"<<std::endl;
218 std::cout<<
"problem uses mass-fractions"<<std::endl;
231 const std::string&
name()
const
238 {
return temperature_; }
255 BoundaryTypes bcTypes;
256 if (globalPos[0] < eps_)
257 bcTypes.setAllDirichlet();
259 bcTypes.setAllNeumann();
270 return initial_(globalPos);
289 const FVElementGeometry& fvGeometry,
290 const ElementVolumeVariables& elemVolVars,
291 const ElementFluxVariablesCache& elemFluxVarsCache,
292 const SubControlVolumeFace& scvf)
const
294 NumEqVector values(0.0);
296 const auto& globalPos = scvf.ipGlobal();
298 Scalar injectedPhaseMass = 1e-3;
299 Scalar moleFracW = elemVolVars[scvf.insideScvIdx()].moleFraction(gasPhaseIdx, H2OIdx);
300 if (globalPos[1] < 14 - eps_ && globalPos[1] > 6.5 - eps_)
302 values[contiN2EqIdx] = -(1-moleFracW)*injectedPhaseMass/FluidSystem::molarMass(N2Idx);
303 values[contiH2OEqIdx] = -moleFracW*injectedPhaseMass/FluidSystem::molarMass(H2OIdx);
321 {
return initial_(globalPos); }
333 PrimaryVariables initial_(
const GlobalPosition &globalPos)
const
335 PrimaryVariables priVars(0.0);
336 priVars.setState(wPhaseOnly);
338 Scalar densityW = FluidSystem::H2O::liquidDensity(temperature_, 1e5);
340 Scalar pl = 1e5 - densityW*this->
spatialParams().gravity(globalPos)[1]*(depthBOR_ - globalPos[1]);
342 Scalar moleFracLiquidH2O = 1.0 - moleFracLiquidN2;
345 FluidSystem::molarMass(H2OIdx)*moleFracLiquidH2O +
346 FluidSystem::molarMass(N2Idx)*moleFracLiquidN2;
350 priVars[switchIdx] = moleFracLiquidN2;
355 Scalar massFracLiquidN2 = moleFracLiquidN2*FluidSystem::molarMass(N2Idx)/meanM;
356 priVars[switchIdx] = massFracLiquidN2;
358 priVars[pressureIdx] = pl;
364 static constexpr Scalar eps_ = 1e-6;
368 Scalar pressureLow_, pressureHigh_;
369 Scalar temperatureLow_, temperatureHigh_;
Class for the interaction volume of the mpfa-o scheme to be used when the sizes are known at compile ...
Defines a type tag and some properties for models using the box scheme.
Properties for all models using cell-centered finite volume scheme with mpfa.
Properties for all models using cell-centered finite volume scheme with TPFA.
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
Property tag Indices
Definition: porousmediumflow/sequential/properties.hh:59
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
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
Definition: common/properties.hh:169
If disabled, the volume variables are not stored (reduces memory, but is slower)
Definition: common/properties.hh:178
specifies if data on flux vars should be saved (faster, but more memory consuming)
Definition: common/properties.hh:188
The primary interaction volume type.
Definition: common/properties.hh:196
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
Forward declaration of the o-method's static interaction volume.
Definition: staticinteractionvolume.hh:126
The default interaction volume traits class for the mpfa-o method with known size of the interaction ...
Definition: staticinteractionvolume.hh:65
static Scalar henry(Scalar temperature)
Henry coefficient for molecular nitrogen in liquid water.
Definition: h2o_n2.hh:48
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
SpatialParams & spatialParams()
Returns the spatial parameters object.
Definition: dumux/porousmediumflow/problem.hh:146
Non-isothermal 2D problem where steam is injected on the lower left side of the domain.
Definition: test/porousmediumflow/2p2c/implicit/injection/problem.hh:143
PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
Evaluates the boundary conditions for a Dirichlet boundary segment.
Definition: test/porousmediumflow/2p2c/implicit/injection/problem.hh:268
Scalar temperature() const
Returns the temperature [K].
Definition: test/porousmediumflow/2p2c/implicit/injection/problem.hh:237
InjectionProblem(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: test/porousmediumflow/2p2c/implicit/injection/problem.hh:193
const std::string & name() const
Returns the problem name.
Definition: test/porousmediumflow/2p2c/implicit/injection/problem.hh:231
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
Evaluates the initial values for a control volume.
Definition: test/porousmediumflow/2p2c/implicit/injection/problem.hh:320
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/2p2c/implicit/injection/problem.hh:253
NumEqVector neumann(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const ElementFluxVariablesCache &elemFluxVarsCache, const SubControlVolumeFace &scvf) const
Evaluates the boundary conditions for a Neumann boundary segment in dependency on the current solutio...
Definition: test/porousmediumflow/2p2c/implicit/injection/problem.hh:288
Definition: test/porousmediumflow/2p2c/implicit/injection/problem.hh:53
std::tuple< TwoPTwoC > InheritsFrom
Definition: test/porousmediumflow/2p2c/implicit/injection/problem.hh:53
Definition: test/porousmediumflow/2p2c/implicit/injection/problem.hh:54
std::tuple< Injection, BoxModel > InheritsFrom
Definition: test/porousmediumflow/2p2c/implicit/injection/problem.hh:54
Definition: test/porousmediumflow/2p2c/implicit/injection/problem.hh:55
std::tuple< Injection, CCTpfaModel > InheritsFrom
Definition: test/porousmediumflow/2p2c/implicit/injection/problem.hh:55
Definition: test/porousmediumflow/2p2c/implicit/injection/problem.hh:56
std::tuple< Injection, CCMpfaModel > InheritsFrom
Definition: test/porousmediumflow/2p2c/implicit/injection/problem.hh:56
Dune::YaspGrid< 2 > type
Definition: test/porousmediumflow/2p2c/implicit/injection/problem.hh:61
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition: test/porousmediumflow/2p2c/implicit/injection/problem.hh:80
GetPropType< TypeTag, Properties::GridGeometry > GridGeometry
Definition: test/porousmediumflow/2p2c/implicit/injection/problem.hh:79
Definition of the spatial parameters for the injection problem which uses the isothermal two-phase tw...
Definition: porousmediumflow/2p2c/implicit/injection/spatialparams.hh:45
Adaption of the fully implicit scheme to the two-phase two-component fully implicit model.
Base class for all porous media problems.
#define ENABLECACHING
Definition: test/porousmediumflow/2p2c/implicit/injection/problem.hh:44
Definition of the spatial parameters for the MaxwellStefan problem.