25#ifndef DUMUX_SAGDPROBLEM_HH
26#define DUMUX_SAGDPROBLEM_HH
28#include <dune/grid/yaspgrid.hh>
43template <
class TypeTag>
54template<
class TypeTag>
55struct Grid<TypeTag, TTag::Sagd> {
using type = Dune::YaspGrid<2>; };
58template<
class TypeTag>
62template<
class TypeTag>
71template<
class TypeTag>
75template<
class TypeTag>
78template<
class TypeTag>
79struct UseMoles<TypeTag, TTag::Sagd> {
static constexpr bool value =
true; };
82template<
class TypeTag>
97template <
class TypeTag >
107 pressureIdx = Indices::pressureIdx,
108 switch1Idx = Indices::switch1Idx,
109 switch2Idx = Indices::switch2Idx,
111 contiWEqIdx = Indices::conti0EqIdx + FluidSystem::wCompIdx,
112 contiNEqIdx = Indices::conti0EqIdx + FluidSystem::nCompIdx,
113 energyEqIdx = Indices::energyEqIdx,
116 wPhaseIdx = FluidSystem::wPhaseIdx,
117 nPhaseIdx = FluidSystem::nPhaseIdx,
120 wnPhaseOnly = Indices::wnPhaseOnly,
123 dimWorld = GridView::dimensionworld
129 using ElementVolumeVariables =
typename GridVariables::GridVolumeVariables::LocalView;
130 using ElementFluxVariablesCache =
typename GridVariables::GridFluxVariablesCache::LocalView;
132 using Element =
typename GridView::template Codim<0>::Entity;
134 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
135 using GlobalPosition =
typename SubControlVolumeFace::GlobalPosition;
144 totalMassProducedOil_ = 0.0;
145 totalMassProducedWater_ = 0.0;
161 BoundaryTypes bcTypes;
163 if (globalPos[1] < eps_)
164 bcTypes.setAllNeumann();
167 else if (globalPos[1] > 40.0 - eps_)
168 bcTypes.setAllNeumann();
171 else if (globalPos[0] > 60 - eps_ )
172 bcTypes.setAllDirichlet();
176 bcTypes.setAllNeumann();
187 return initial_(globalPos);
202 const FVElementGeometry& fvGeometry,
203 const ElementVolumeVariables& elemVolVars,
204 const ElementFluxVariablesCache& elemFluxVarsCache,
205 const SubControlVolumeFace& scvf)
const
207 NumEqVector values(0.0);
209 const auto& insideScv = fvGeometry.scv(scvf.insideScvIdx());
210 const auto& globalPos = insideScv.dofPosition();
213 if (globalPos[1] > 8.5 - eps_ && globalPos[1] < 9.5 + eps_)
215 values[contiNEqIdx] = -0.0;
216 values[contiWEqIdx] = -0.193;
217 values[energyEqIdx] = -9132;
219 else if (globalPos[1] > 2.5 - eps_ && globalPos[1] < 3.5 + eps_)
222 const Scalar elemPressW = elemVolVars[scvf.insideScvIdx()].pressure(wPhaseIdx);
223 const Scalar elemPressN = elemVolVars[scvf.insideScvIdx()].pressure(nPhaseIdx);
225 const Scalar densityW = elemVolVars[scvf.insideScvIdx()].fluidState().density(wPhaseIdx);
226 const Scalar densityN = elemVolVars[scvf.insideScvIdx()].fluidState().density(nPhaseIdx);
228 const Scalar elemMobW = elemVolVars[scvf.insideScvIdx()].mobility(wPhaseIdx);
229 const Scalar elemMobN = elemVolVars[scvf.insideScvIdx()].mobility(nPhaseIdx);
231 const Scalar enthW = elemVolVars[scvf.insideScvIdx()].enthalpy(wPhaseIdx);
232 const Scalar enthN = elemVolVars[scvf.insideScvIdx()].enthalpy(nPhaseIdx);
234 const Scalar wellRadius = 0.50 * 0.3048;
237 const Scalar gridHeight_ = 0.5;
238 const Scalar effectiveRadius_ = 0.208 * gridHeight_;
242 const Scalar qW = (((2*3.1415*0.5*4e-14)/(log(effectiveRadius_/wellRadius))) *
243 densityW * elemMobW * ( elemPressW-pOut_))/0.01801528;
245 const Scalar qN = (((2*3.1415*0.5*4e-14)/(log(effectiveRadius_/wellRadius))) *
246 densityN * elemMobN * (elemPressN-pOut_))/0.35;
253 Scalar wT = elemVolVars[scvf.insideScvIdx()].temperature();
256 qE = qW*0.018*enthW + qN*enthN*0.350 + (wT-495.)*5000.;
257 std::cout<<
"Cooling now! Extracted enthalpy: " << qE << std::endl;
259 qE = qW*0.018*enthW + qN*enthN*0.350;
263 values[contiWEqIdx] = qW;
264 values[contiNEqIdx] = qN;
265 values[energyEqIdx] = qE;
266 massProducedOil_ = qN;
267 massProducedWater_ = qW;
286 return initial_(globalPos);
292 PrimaryVariables initial_(
const GlobalPosition &globalPos)
const
294 PrimaryVariables values(0.0);
295 values.setState(wnPhaseOnly);
296 Scalar densityW = 1000.0;
297 values[pressureIdx] = 101300.0 + (maxDepth_ - globalPos[1])*densityW*9.81;
299 values[switch1Idx] = 295.13;
300 values[switch2Idx] = 0.3;
305 static constexpr Scalar eps_ = 1e-6;
308 Scalar totalMassProducedOil_;
309 Scalar totalMassProducedWater_;
311 mutable Scalar massProducedOil_;
312 mutable Scalar massProducedWater_;
A compositional fluid system with water and heavy oil components in both the liquid and the gas phase...
Setting constant fluid properties via the input file.
A solid phase consisting of a single inert solid component.
Defines a type tag and some properties for models using the box scheme.
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
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
The type of the solid system to use.
Definition: common/properties.hh:227
reduces the phasestates to threePhases and wnPhaseOnly
Definition: common/properties.hh:264
A component which returns run time specified values for all fluid properties.
Definition: constant.hh:58
A compositional fluid system with water and heavy oil components in both the liquid and the gas phase...
Definition: h2oheavyoil.hh:50
A solid phase consisting of a single inert solid component.
Definition: inertsolidphase.hh:41
Base class for all fully implicit porous media problems.
Definition: dumux/porousmediumflow/problem.hh:39
Definition: test/porousmediumflow/3pwateroil/implicit/problem.hh:99
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/3pwateroil/implicit/problem.hh:201
SagdProblem(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: test/porousmediumflow/3pwateroil/implicit/problem.hh:139
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
Evaluates the initial value for a control volume.
Definition: test/porousmediumflow/3pwateroil/implicit/problem.hh:284
PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
Evaluates the boundary conditions for a Dirichlet control volume.
Definition: test/porousmediumflow/3pwateroil/implicit/problem.hh:185
BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const
Specifies which kind of boundary condition should be used for which equation on a given boundary cont...
Definition: test/porousmediumflow/3pwateroil/implicit/problem.hh:159
Definition: test/porousmediumflow/3pwateroil/implicit/problem.hh:49
std::tuple< ThreePWaterOilNI > InheritsFrom
Definition: test/porousmediumflow/3pwateroil/implicit/problem.hh:49
Definition: test/porousmediumflow/3pwateroil/implicit/problem.hh:50
std::tuple< Sagd, BoxModel > InheritsFrom
Definition: test/porousmediumflow/3pwateroil/implicit/problem.hh:50
Dune::YaspGrid< 2 > type
Definition: test/porousmediumflow/3pwateroil/implicit/problem.hh:55
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition: test/porousmediumflow/3pwateroil/implicit/problem.hh:66
GetPropType< TypeTag, Properties::GridGeometry > GridGeometry
Definition: test/porousmediumflow/3pwateroil/implicit/problem.hh:65
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition: test/porousmediumflow/3pwateroil/implicit/problem.hh:85
Definition of the spatial parameters for the SAGD problem.
Definition: porousmediumflow/3pwateroil/implicit/spatialparams.hh:47
Adaption of the fully implicit scheme to the three-phase three-component flow model.
Base class for all porous media problems.
Definition of the spatial parameters for the MaxwellStefan problem.