25#ifndef DUMUX_3PNI_CONVECTION_PROBLEM_HH
26#define DUMUX_3PNI_CONVECTION_PROBLEM_HH
29#include <dune/grid/yaspgrid.hh>
41#include "../conduction/spatialparams.hh"
48template <
class TypeTag>
49class ThreePNIConvectionProblem;
61template<
class TypeTag>
62struct Grid<TypeTag, TTag::ThreePNIConvection> {
using type = Dune::YaspGrid<2>; };
65template<
class TypeTag>
70template<
class TypeTag>
75template<
class TypeTag>
110template <
class TypeTag>
125 using ElementVolumeVariables =
typename GridVariables::GridVolumeVariables::LocalView;
126 using ElementFluxVariablesCache =
typename GridVariables::GridFluxVariablesCache::LocalView;
127 using VolumeVariables =
typename GridVariables::GridVolumeVariables::VolumeVariables;
130 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
137 pressureIdx = Indices::pressureIdx,
138 swIdx = Indices::swIdx,
139 snIdx = Indices::snIdx,
140 temperatureIdx = Indices::temperatureIdx,
141 wPhaseIdx = FluidSystem::wPhaseIdx,
142 conti0EqIdx = Indices::conti0EqIdx,
143 energyEqIdx = Indices::energyEqIdx
146 enum { dimWorld = GridView::dimensionworld };
148 using Element =
typename GridView::template Codim<0>::Entity;
149 using GlobalPosition =
typename SubControlVolumeFace::GlobalPosition;
158 name_ = getParam<std::string>(
"Problem.Name");
159 outputInterval_ = getParam<int>(
"Problem.OutputInterval");
160 darcyVelocity_ = getParam<Scalar>(
"Problem.DarcyVelocity");
162 temperatureHigh_ = 291.;
163 temperatureLow_ = 290.;
167 temperatureExact_.resize(this->
gridGeometry().numDofs());
173 return temperatureExact_;
179 const auto someElement = *(elements(this->
gridGeometry().gridView()).begin());
182 const auto someInitSol =
initialAtPos(someElement.geometry().center());
185 someFvGeometry.bindElement(someElement);
186 const auto someScv = *(scvs(someFvGeometry).begin());
188 VolumeVariables volVars;
189 volVars.update(someElemSol, *
this, someElement, someScv);
192 const auto densityW = volVars.density(wPhaseIdx);
194 const auto storageW = densityW*heatCapacityW*
porosity;
195 const auto densityS = volVars.solidDensity();
196 const auto heatCapacityS = volVars.solidHeatCapacity();
197 const auto storageTotal = storageW + densityS*heatCapacityS*(1 -
porosity);
198 std::cout <<
"storage: " << storageTotal <<
'\n';
201 time = max(time, 1e-10);
202 const Scalar retardedFrontVelocity = darcyVelocity_*storageW/storageTotal/
porosity;
203 std::cout <<
"retarded velocity: " << retardedFrontVelocity <<
'\n';
205 for (
const auto& element : elements(this->
gridGeometry().gridView()))
208 fvGeometry.bindElement(element);
209 for (
auto&& scv : scvs(fvGeometry))
211 auto dofIdxGlobal = scv.dofIndex();
212 auto dofPosition = scv.dofPosition();
213 temperatureExact_[dofIdxGlobal] = (dofPosition[0] < retardedFrontVelocity*time) ? temperatureHigh_ : temperatureLow_;
228 const std::string&
name()
const
248 BoundaryTypes values;
249 if(globalPos[0] > this->
gridGeometry().bBoxMax()[0] - eps_)
251 values.setAllDirichlet();
255 values.setAllNeumann();
282 const FVElementGeometry& fvGeometry,
283 const ElementVolumeVariables& elemVolVars,
284 const ElementFluxVariablesCache& elemFluxVarsCache,
285 const SubControlVolumeFace& scvf)
const
287 NumEqVector values(0.0);
288 const auto globalPos = scvf.ipGlobal();
289 const auto& volVars = elemVolVars[scvf.insideScvIdx()];
291 if(globalPos[0] < eps_)
293 values[conti0EqIdx] = -darcyVelocity_*volVars.density(wPhaseIdx);
294 values[energyEqIdx] = -darcyVelocity_*volVars.density(wPhaseIdx)
315 PrimaryVariables values;
316 values[pressureIdx] = pressureLow_;
318 values[snIdx] = 1e-10;
319 values[temperatureIdx] = temperatureLow_;
326 Scalar temperatureHigh_;
327 Scalar temperatureLow_;
328 Scalar pressureHigh_;
330 Scalar darcyVelocity_;
331 static constexpr Scalar eps_ = 1e-6;
334 std::vector<Scalar> temperatureExact_;
Element solution classes and factory functions.
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.
Material properties of pure water .
Relation for the saturation-dependent effective thermal conductivity.
A three-phase fluid system featuring gas, NAPL and water as phases and distilled water and air (Pseu...
GridCache::LocalView localView(const GridCache &gridCache)
Free function to get the local view of a grid cache object.
Definition: localview.hh:38
auto elementSolution(const Element &element, const SolutionVector &sol, const GridGeometry &gg) -> std::enable_if_t< GridGeometry::discMethod==DiscretizationMethod::box, BoxElementSolution< typename GridGeometry::LocalView, std::decay_t< decltype(std::declval< SolutionVector >()[0])> > >
Make an element solution for box schemes.
Definition: box/elementsolution.hh:115
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
std::string porosity() noexcept
I/O name of porosity.
Definition: name.hh:139
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
Material properties of pure water .
Definition: h2o.hh:61
static const Scalar liquidHeatCapacity(Scalar temperature, Scalar pressure)
Specific isobaric heat capacity of liquid water .
Definition: h2o.hh:281
static const Scalar liquidEnthalpy(Scalar temperature, Scalar pressure)
Specific enthalpy of liquid water .
Definition: h2o.hh:217
A three-phase fluid system featuring gas, NAPL and water as phases and distilled water and air (Pseu...
Definition: h2oairmesitylene.hh:57
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
Definition of the spatial parameters for the 3pni problems.
Definition: porousmediumflow/3p/implicit/conduction/spatialparams.hh:44
Test for the ThreePModel in combination with the NI model for a convection problem.
Definition: test/porousmediumflow/3p/implicit/convection/problem.hh:112
const std::vector< Scalar > & getExactTemperature()
Get exact temperature vector for output.
Definition: test/porousmediumflow/3p/implicit/convection/problem.hh:171
void updateExactTemperature(const SolutionVector &curSol, Scalar time)
Udpate the analytical temperature.
Definition: test/porousmediumflow/3p/implicit/convection/problem.hh:177
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/3p/implicit/convection/problem.hh:246
PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
Evaluates the boundary conditions for a Dirichlet boundary segment.
Definition: test/porousmediumflow/3p/implicit/convection/problem.hh:266
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/3p/implicit/convection/problem.hh:281
const std::string & name() const
The problem name.
Definition: test/porousmediumflow/3p/implicit/convection/problem.hh:228
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
Evaluates the initial value for a control volume.
Definition: test/porousmediumflow/3p/implicit/convection/problem.hh:313
ThreePNIConvectionProblem(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: test/porousmediumflow/3p/implicit/convection/problem.hh:152
Definition: test/porousmediumflow/3p/implicit/convection/problem.hh:54
std::tuple< ThreePNI > InheritsFrom
Definition: test/porousmediumflow/3p/implicit/convection/problem.hh:54
Definition: test/porousmediumflow/3p/implicit/convection/problem.hh:55
std::tuple< ThreePNIConvection, BoxModel > InheritsFrom
Definition: test/porousmediumflow/3p/implicit/convection/problem.hh:55
Definition: test/porousmediumflow/3p/implicit/convection/problem.hh:56
std::tuple< ThreePNIConvection, CCTpfaModel > InheritsFrom
Definition: test/porousmediumflow/3p/implicit/convection/problem.hh:56
Definition: test/porousmediumflow/3p/implicit/convection/problem.hh:57
std::tuple< ThreePNIConvection, CCMpfaModel > InheritsFrom
Definition: test/porousmediumflow/3p/implicit/convection/problem.hh:57
Dune::YaspGrid< 2 > type
Definition: test/porousmediumflow/3p/implicit/convection/problem.hh:62
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition: test/porousmediumflow/3p/implicit/convection/problem.hh:79
GetPropType< TypeTag, Properties::GridGeometry > GridGeometry
Definition: test/porousmediumflow/3p/implicit/convection/problem.hh:78
Adaption of the fully implicit scheme to the three-phase flow model.
Base class for all porous media problems.