26#ifndef DUMUX_INFILTRATION_THREEPTHREEC_PROBLEM_HH
27#define DUMUX_INFILTRATION_THREEPTHREEC_PROBLEM_HH
29#include <dune/grid/yaspgrid.hh>
46template <
class TypeTag>
47class InfiltrationThreePThreeCProblem;
58template<
class TypeTag>
59struct Grid<TypeTag, TTag::InfiltrationThreePThreeC> {
using type = Dune::YaspGrid<2>; };
62template<
class TypeTag>
66template<
class TypeTag>
75template<
class TypeTag>
111template <
class TypeTag >
123 pressureIdx = Indices::pressureIdx,
124 switch1Idx = Indices::switch1Idx,
125 switch2Idx = Indices::switch2Idx,
128 wgPhaseOnly = Indices::wgPhaseOnly,
130 contiWEqIdx = Indices::conti0EqIdx + FluidSystem::wCompIdx,
131 contiNEqIdx = Indices::conti0EqIdx + FluidSystem::nCompIdx,
132 contiAEqIdx = Indices::conti0EqIdx + FluidSystem::gCompIdx,
135 dimWorld = GridView::dimensionworld
143 using Element =
typename GridView::template Codim<0>::Entity;
144 using GlobalPosition =
typename Element::Geometry::GlobalCoordinate;
150 temperature_ = 273.15 + 10.0;
151 FluidSystem::init(temperature_ - 1,
158 name_ = getParam<std::string>(
"Problem.Name");
166 const std::string&
name()
const
196 BoundaryTypes values;
197 if(globalPos[0] > this->
gridGeometry().bBoxMax()[0] - eps_)
198 values.setAllDirichlet();
199 else if(globalPos[0] < this->
gridGeometry().bBoxMin()[0] + eps_)
200 values.setAllDirichlet();
202 values.setAllNeumann();
214 {
return initial_(globalPos); }
226 NumEqVector values(0.0);
229 if ((globalPos[0] < 80.0 + eps_) && (globalPos[0] > 55.0 - eps_) && (globalPos[1] > 10.0 - eps_))
231 values[contiWEqIdx] = -0.0;
234 values[contiNEqIdx] = -0.001;
235 values[contiAEqIdx] = -0.0;
257 {
return initial_(globalPos); }
261 PrimaryVariables initial_(
const GlobalPosition &globalPos)
const
263 PrimaryVariables values(0.0);
264 values.setState(wgPhaseOnly);
266 Scalar y = globalPos[1];
267 Scalar x = globalPos[0];
268 Scalar sw, swr=0.12, sgr=0.03;
270 if(y >(-1.E-3*x+5) - eps_)
272 Scalar pc = 9.81 * 1000.0 * (y - (-5E-4*x+5));
273 if (pc < 0.0) pc = 0.0;
275 sw = invertPcgw_(pc, this->
spatialParams().materialLawParamsAtPos(globalPos));
276 if (sw < swr) sw = swr;
277 if (sw > 1.-sgr) sw = 1.-sgr;
279 values[pressureIdx] = 1e5 ;
280 values[switch1Idx] = sw;
281 values[switch2Idx] = 1.e-6;
283 values[pressureIdx] = 1e5 + 9.81 * 1000.0 * ((-5E-4*x+5) - y);
284 values[switch1Idx] = 1.-sgr;
285 values[switch2Idx] = 1.e-6;
290 template<
class MaterialLawParams>
291 static Scalar invertPcgw_(Scalar pcIn,
const MaterialLawParams &pcParams)
293 using MaterialLaw =
typename ParentType::SpatialParams::MaterialLaw;
297 Scalar bisLimit = 1.;
299 lower=0.0; upper=1.0;
300 for (k=1; k<=25; k++)
302 sw = 0.5*(upper+lower);
303 pcgw = MaterialLaw::pcgw(pcParams, sw);
304 Scalar delta = pcgw-pcIn;
305 if (delta<0.) delta*=-1.;
313 if (pcgw>pcIn) lower=sw;
320 static constexpr Scalar eps_ = 1e-6;
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.
A three-phase fluid system featuring gas, NAPL and water as phases and distilled water and air (Pseu...
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
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
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
Isothermal NAPL infiltration problem: LNAPL contaminates the unsaturated and the saturated groundwate...
Definition: test/porousmediumflow/3p3c/implicit/infiltration/problem.hh:113
Scalar temperatureAtPos(const GlobalPosition &globalPos) const
Returns the temperature within the domain.
Definition: test/porousmediumflow/3p3c/implicit/infiltration/problem.hh:176
const std::string & name() const
The problem name.
Definition: test/porousmediumflow/3p3c/implicit/infiltration/problem.hh:166
InfiltrationThreePThreeCProblem(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: test/porousmediumflow/3p3c/implicit/infiltration/problem.hh:147
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
Evaluates the initial value for a control volume.
Definition: test/porousmediumflow/3p3c/implicit/infiltration/problem.hh:256
PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
Evaluates the boundary conditions for a Dirichlet boundary segment.
Definition: test/porousmediumflow/3p3c/implicit/infiltration/problem.hh:213
NumEqVector neumannAtPos(const GlobalPosition &globalPos) const
Evaluates the boundary conditions for a Neumann boundary segment.
Definition: test/porousmediumflow/3p3c/implicit/infiltration/problem.hh:224
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/3p3c/implicit/infiltration/problem.hh:194
Definition: test/porousmediumflow/3p3c/implicit/infiltration/problem.hh:52
std::tuple< ThreePThreeC > InheritsFrom
Definition: test/porousmediumflow/3p3c/implicit/infiltration/problem.hh:52
Definition: test/porousmediumflow/3p3c/implicit/infiltration/problem.hh:53
std::tuple< InfiltrationThreePThreeC, BoxModel > InheritsFrom
Definition: test/porousmediumflow/3p3c/implicit/infiltration/problem.hh:53
Definition: test/porousmediumflow/3p3c/implicit/infiltration/problem.hh:54
std::tuple< InfiltrationThreePThreeC, CCTpfaModel > InheritsFrom
Definition: test/porousmediumflow/3p3c/implicit/infiltration/problem.hh:54
Dune::YaspGrid< 2 > type
Definition: test/porousmediumflow/3p3c/implicit/infiltration/problem.hh:59
GetPropType< TypeTag, Properties::GridGeometry > GridGeometry
Definition: test/porousmediumflow/3p3c/implicit/infiltration/problem.hh:69
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition: test/porousmediumflow/3p3c/implicit/infiltration/problem.hh:70
Definition of the spatial parameters for the infiltration problem.
Definition: porousmediumflow/3p3c/implicit/infiltration/spatialparams.hh:46
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.