26#ifndef DUMUX_WATER_AIR_PROBLEM_HH
27#define DUMUX_WATER_AIR_PROBLEM_HH
29#include <dune/grid/yaspgrid.hh>
44template <
class TypeTag>
56template<
class TypeTag>
57struct Grid<TypeTag, TTag::WaterAir> {
using type = Dune::YaspGrid<2>; };
60template<
class TypeTag>
64template<
class TypeTag>
68template<
class TypeTag>
77template<
class TypeTag>
78struct UseMoles<TypeTag, TTag::WaterAir> {
static constexpr bool value =
true; };
115template <
class TypeTag >
129 pressureIdx = Indices::pressureIdx,
130 switchIdx = Indices::switchIdx,
131 temperatureIdx = Indices::temperatureIdx,
132 energyEqIdx = Indices::energyEqIdx
138 contiH2OEqIdx = Indices::conti0EqIdx + FluidSystem::H2OIdx,
139 contiN2EqIdx = Indices::conti0EqIdx + FluidSystem::N2Idx
143 enum { wPhaseOnly = Indices::firstPhaseOnly };
145 enum { N2Idx = FluidSystem::N2Idx };
150 using Element =
typename GridView::template Codim<0>::Entity;
151 using GlobalPosition =
typename Element::Geometry::GlobalCoordinate;
154 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
158 static constexpr bool useMoles = ModelTraits::useMoles();
168 name_ = getParam<std::string>(
"Problem.Name");
169 useDirichlet_ = name_.find(
"buoyancy") != std::string::npos;
173 std::cout <<
"The problem uses mole-fractions" << std::endl;
175 std::cout <<
"The problem uses mass-fractions" << std::endl;
190 const std::string&
name()
const
208 BoundaryTypes bcTypes;
209 if(globalPos[0] > 40 - eps_ || globalPos[0] < eps_)
210 bcTypes.setAllDirichlet();
212 bcTypes.setAllNeumann();
216 if (isInjectionArea_(globalPos))
217 bcTypes.setAllDirichlet();
230 PrimaryVariables priVars = initial_(globalPos);
234 if (isInjectionArea_(globalPos))
236 priVars.setState(Indices::bothPhases);
237 priVars[switchIdx] = 0.2;
255 NumEqVector values(0.0);
258 if (isInjectionArea_(globalPos))
260 values[contiN2EqIdx] = useMoles ? -1e-3/FluidSystem::molarMass(N2Idx) : -1e-3;
262 const auto initialValues = initial_(globalPos);
263 const auto& mParams = this->
spatialParams().materialLawParamsAtPos(globalPos);
264 using MaterialLaw =
typename ParentType::SpatialParams::MaterialLaw;
265 const auto pn = initialValues[pressureIdx] + MaterialLaw::endPointPc(mParams);
266 const auto t = initialValues[temperatureIdx];
292 auto priVars = initial_(globalPos);
294 if (globalPos[0] > 20 - eps_ && globalPos[0] < 30 + eps_ && globalPos[1] < 30 + eps_)
295 priVars[temperatureIdx] = 380.0;
303 PrimaryVariables initial_(
const GlobalPosition &globalPos)
const
305 PrimaryVariables priVars(0.0);
306 priVars.setState(wPhaseOnly);
307 Scalar densityW = 1000.0;
308 priVars[pressureIdx] = 1e5 + (maxDepth_ - globalPos[1])*densityW*9.81;
309 priVars[switchIdx] = 0.0;
310 priVars[temperatureIdx] = initialTemperatureProfile_(globalPos);
314 Scalar initialTemperatureProfile_(
const GlobalPosition &globalPos)
const
315 {
return 283.0 + (maxDepth_ - globalPos[1])*0.03; }
317 bool isInjectionArea_(
const GlobalPosition& globalPos)
const
319 return globalPos[0] > 14.8 - eps_ && globalPos[0] < 25.2 + eps_ && globalPos[1] < eps_;
323 static constexpr Scalar eps_ = 1e-2;
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.
The available discretization methods in Dumux.
Properties of pure molecular nitrogen .
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
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
static const Scalar gasEnthalpy(Scalar temperature, Scalar pressure)
Specific enthalpy of pure nitrogen gas.
Definition: n2.hh:176
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 gas injection problem where a gas (e.g. air) is injected into a fully water saturated ...
Definition: test/porousmediumflow/2p2c/implicit/waterair/problem.hh:117
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
Evaluates the initial value for a control volume.
Definition: test/porousmediumflow/2p2c/implicit/waterair/problem.hh:290
PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
Evaluates the boundary conditions for a Dirichlet boundary segment.
Definition: test/porousmediumflow/2p2c/implicit/waterair/problem.hh:228
NumEqVector neumannAtPos(const GlobalPosition &globalPos) const
Evaluates the boundary conditions for a Neumann boundary segment.
Definition: test/porousmediumflow/2p2c/implicit/waterair/problem.hh:253
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/waterair/problem.hh:206
WaterAirProblem(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: test/porousmediumflow/2p2c/implicit/waterair/problem.hh:161
const std::string & name() const
The problem name.
Definition: test/porousmediumflow/2p2c/implicit/waterair/problem.hh:190
Definition: test/porousmediumflow/2p2c/implicit/waterair/problem.hh:50
std::tuple< TwoPTwoCNI > InheritsFrom
Definition: test/porousmediumflow/2p2c/implicit/waterair/problem.hh:50
Definition: test/porousmediumflow/2p2c/implicit/waterair/problem.hh:51
std::tuple< WaterAir, BoxModel > InheritsFrom
Definition: test/porousmediumflow/2p2c/implicit/waterair/problem.hh:51
Definition: test/porousmediumflow/2p2c/implicit/waterair/problem.hh:52
std::tuple< WaterAir, CCTpfaModel > InheritsFrom
Definition: test/porousmediumflow/2p2c/implicit/waterair/problem.hh:52
Dune::YaspGrid< 2 > type
Definition: test/porousmediumflow/2p2c/implicit/waterair/problem.hh:57
GetPropType< TypeTag, Properties::GridGeometry > GridGeometry
Definition: test/porousmediumflow/2p2c/implicit/waterair/problem.hh:71
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition: test/porousmediumflow/2p2c/implicit/waterair/problem.hh:72
Definition of the spatial parameters for the water-air problem.
Definition: porousmediumflow/2p2c/implicit/waterair/spatialparams.hh:46
Adaption of the fully implicit scheme to the two-phase two-component fully implicit model.
Base class for all porous media problems.
Definition of the spatial parameters for the MaxwellStefan problem.