3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
test/porousmediumflow/2p1c/implicit/problem.hh
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3/*****************************************************************************
4 * See the file COPYING for full copying permissions. *
5 * *
6 * This program is free software: you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation, either version 3 of the License, or *
9 * (at your option) any later vesion. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
18 *****************************************************************************/
25#ifndef DUMUX_STEAM_INJECTIONPROBLEM_HH
26#define DUMUX_STEAM_INJECTIONPROBLEM_HH
27
28#include <dune/grid/yaspgrid.hh>
29
34
36
39
40#include "spatialparams.hh"
41
42namespace Dumux {
43template <class TypeTag>
44class InjectionProblem;
45
46namespace Properties {
47// Create new type tags
48namespace TTag {
49struct InjectionProblem { using InheritsFrom = std::tuple<TwoPOneCNI>; };
50struct TwoPOneCNIBox { using InheritsFrom = std::tuple<InjectionProblem, BoxModel>; };
51struct TwoPOneCNICCTpfa { using InheritsFrom = std::tuple<InjectionProblem, CCTpfaModel>; };
52} // end namespace TTag
53
54template<class TypeTag>
55struct Grid<TypeTag, TTag::InjectionProblem> { using type = Dune::YaspGrid<2>; };
56
57// Set the problem property
58template<class TypeTag>
59struct Problem<TypeTag, TTag::InjectionProblem> { using type = InjectionProblem<TypeTag>; };
60
61
62// Set fluid configuration
63template<class TypeTag>
64struct FluidSystem<TypeTag, TTag::InjectionProblem>
65{
66private:
69public:
71};
72
73// Set the spatial parameters
74template<class TypeTag>
75struct SpatialParams<TypeTag, TTag::InjectionProblem>
76{
80};
81
82//Define whether spurious cold-water flow into the steam is blocked
83template<class TypeTag>
84struct UseBlockingOfSpuriousFlow<TypeTag, TTag::InjectionProblem> { static constexpr bool value = true; };
85} // end namespace Properties
86
93template <class TypeTag>
94class InjectionProblem : public PorousMediumFlowProblem<TypeTag>
95{
96 using ParentType = PorousMediumFlowProblem<TypeTag>;
97
104
106 using ElementVolumeVariables = typename GridVariables::GridVolumeVariables::LocalView;
107 using ElementFluxVariablesCache = typename GridVariables::GridFluxVariablesCache::LocalView;
108
109 using FVElementGeometry = typename GetPropType<TypeTag, Properties::GridGeometry>::LocalView;
110 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
111 using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
113 using Element = typename GridView::template Codim<0>::Entity;
115
116 // copy some indices for convenience
117 enum {
118 pressureIdx = Indices::pressureIdx,
119 switchIdx = Indices::switchIdx,
120
121 conti0EqIdx = Indices::conti0EqIdx,
122 energyEqIdx = Indices::energyEqIdx,
123
124 // phase state
125 liquidPhaseOnly = Indices::liquidPhaseOnly
126 };
127
128 static constexpr int dimWorld = GridView::dimensionworld;
129 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
130
131public:
132 InjectionProblem(std::shared_ptr<const GridGeometry> gridGeometry)
134 { FluidSystem::init(); }
135
139 // \{
140
141
143 NumEqVector source(const Element &element,
144 const FVElementGeometry& fvGeometry,
145 const ElementVolumeVariables& elemVolVars,
146 const SubControlVolume &scv) const
147 { return NumEqVector(0.0); }
148
152 // \{
153
160 BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const
161 {
162 BoundaryTypes bcTypes;
163
164 if(globalPos[1] > this->gridGeometry().bBoxMax()[1] - eps_ || globalPos[0] > this->gridGeometry().bBoxMax()[0] - eps_)
165 bcTypes.setAllDirichlet();
166 else
167 bcTypes.setAllNeumann();
168
169 return bcTypes;
170 }
171
177 PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
178 {
179 return initialAtPos(globalPos);
180 }
181
199 NumEqVector neumann(const Element& element,
200 const FVElementGeometry& fvGeometry,
201 const ElementVolumeVariables& elemVolVars,
202 const ElementFluxVariablesCache& elemFluxVarsCache,
203 const SubControlVolumeFace& scvf) const
204 {
205 NumEqVector values(0.0);
206
207 const auto& ipGlobal = scvf.ipGlobal();
208
209 if (ipGlobal[0] < eps_)
210 {
211 if(ipGlobal[1] > 2.0 - eps_ && ipGlobal[1] < 3.0 + eps_)
212 {
213 const Scalar massRate = 1e-1;
214 values[conti0EqIdx] = -massRate;
215 values[energyEqIdx] = -massRate * 2690e3;
216 }
217 }
218 return values;
219 }
220
221 // \}
222
226 // \{
227
233 PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
234 {
235 PrimaryVariables values(0.0);
236
237 const Scalar densityW = 1000.0;
238 values[pressureIdx] = 101300.0 + (this->gridGeometry().bBoxMax()[1] - globalPos[1])*densityW*9.81; // hydrostatic pressure
239 values[switchIdx] = 283.13;
240
241 values.setState(liquidPhaseOnly);
242
243 return values;
244 }
245
246private:
247
248 static constexpr Scalar eps_ = 1e-6;
249};
250} // end namespace Dumux
251
252#endif
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.
Material properties of pure water .
Tabulates all thermodynamic properties of a given untabulated chemical species.
A two-phase fluid system with only one component.
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 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
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
Tabulates all thermodynamic properties of a given untabulated chemical species.
Definition: tabulatedcomponent.hh:82
A two-phase fluid system with only one component.
Definition: 2p1c.hh:46
Determines whether blocking of spurious flow is used or not.
Definition: porousmediumflow/2p1c/darcyslaw.hh:38
Base class for all fully implicit porous media problems.
Definition: dumux/porousmediumflow/problem.hh:39
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/2p1c/implicit/problem.hh:177
InjectionProblem(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: test/porousmediumflow/2p1c/implicit/problem.hh:132
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
Evaluates the initial values for a control volume.
Definition: test/porousmediumflow/2p1c/implicit/problem.hh:233
NumEqVector source(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolume &scv) const
Evaluate the source term for all phases within a given sub-control-volume.
Definition: test/porousmediumflow/2p1c/implicit/problem.hh:143
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/2p1c/implicit/problem.hh:160
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.
Definition: test/porousmediumflow/2p1c/implicit/problem.hh:199
Definition: test/porousmediumflow/2p1c/implicit/problem.hh:49
std::tuple< TwoPOneCNI > InheritsFrom
Definition: test/porousmediumflow/2p1c/implicit/problem.hh:49
Definition: test/porousmediumflow/2p1c/implicit/problem.hh:50
std::tuple< InjectionProblem, BoxModel > InheritsFrom
Definition: test/porousmediumflow/2p1c/implicit/problem.hh:50
Definition: test/porousmediumflow/2p1c/implicit/problem.hh:51
std::tuple< InjectionProblem, CCTpfaModel > InheritsFrom
Definition: test/porousmediumflow/2p1c/implicit/problem.hh:51
Dune::YaspGrid< 2 > type
Definition: test/porousmediumflow/2p1c/implicit/problem.hh:55
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition: test/porousmediumflow/2p1c/implicit/problem.hh:78
GetPropType< TypeTag, Properties::GridGeometry > GridGeometry
Definition: test/porousmediumflow/2p1c/implicit/problem.hh:77
Definition of the spatial parameters for various steam injection problems.
Definition: porousmediumflow/2p1c/implicit/spatialparams.hh:42
A two-phase one-component flow model using the fully implicit scheme.
Base class for all porous media problems.
Definition of the spatial parameters for the MaxwellStefan problem.