24#ifndef DUMUX_TWOP_TRACER_TEST_PROBLEM_HH
25#define DUMUX_TWOP_TRACER_TEST_PROBLEM_HH
27#include <dune/grid/yaspgrid.hh>
41template <
class TypeTag>
52template<
class TypeTag>
53struct Grid<TypeTag,
TTag::TwoPTracerTest> {
using type = Dune::YaspGrid<2>; };
56template<
class TypeTag>
60template<
class TypeTag>
69template<
class TypeTag>
71template<
class TypeTag>
75template<
class TypeTag>
77 TracerFluidSystem<TypeTag>>
82 using Element =
typename GridView::template Codim<0>::Entity;
84 using SubControlVolume =
typename FVElementGeometry::SubControlVolume;
100 {
return "tracer_" + std::to_string(compIdx); }
109 const Problem& problem,
110 const Element& element,
111 const SubControlVolume& scv)
113 static const Scalar D =
getParam<Scalar>(
"Problem.BinaryDiffusionCoefficient");
118template<
class TypeTag>
135template <
class TypeTag>
152 using Element =
typename GridGeometry::GridView::template Codim<0>::Entity;
153 using GlobalPosition =
typename Element::Geometry::GlobalCoordinate;
161 std::cout<<
"problem uses mole fractions" <<
'\n';
163 std::cout<<
"problem uses mass fractions" <<
'\n';
181 BoundaryTypes values;
182 if (onLeftBoundary_(globalPos) || onRightBoundary_(globalPos))
183 values.setAllDirichlet();
185 values.setAllNeumann();
202 PrimaryVariables initialValues(0.0);
203 return initialValues;
216 PrimaryVariables initialValues(0.0);
218 if (onStripe1_(globalPos) || onStripe2_(globalPos) || onStripe3_(globalPos))
221 initialValues = 1e-9;
223 initialValues = 1e-9*FluidSystem::molarMass(0)/this->
spatialParams().fluidMolarMass(globalPos);
225 return initialValues;
229 static constexpr Scalar eps_ = 1e-6;
232 bool onUpperBoundary_(
const GlobalPosition &globalPos)
const
234 return globalPos[1] > this->
gridGeometry().bBoxMax()[1] - 0.1 - eps_;
237 bool onLeftBoundary_(
const GlobalPosition &globalPos)
const
239 return globalPos[0] < this->
gridGeometry().bBoxMin()[0] + eps_;
242 bool onRightBoundary_(
const GlobalPosition &globalPos)
const
244 return globalPos[0] > this->
gridGeometry().bBoxMax()[0] - eps_;
247 bool onStripe1_(
const GlobalPosition &globalPos)
const
251 ( (xMax /4.0 - stripeWidth_*0.5) < globalPos[0] + eps_ ) &&
252 ( (xMax/4.0 + stripeWidth_*0.5) > globalPos[0] + eps_ )
256 bool onStripe2_(
const GlobalPosition &globalPos)
const
260 ( (2.0 * xMax /4.0 - stripeWidth_*0.5) < globalPos[0] + eps_ ) &&
261 ( (2.0 * xMax/4.0 + stripeWidth_*0.5) > globalPos[0] + eps_ )
265 bool onStripe3_(
const GlobalPosition &globalPos)
const
269 ( (3.0 * xMax /4.0 - stripeWidth_*0.5) < globalPos[0] + eps_ ) &&
270 ( (3.0 * xMax/4.0 + stripeWidth_*0.5) > globalPos[0] + eps_ )
Properties for all models using cell-centered finite volume scheme with TPFA.
T getParam(Args &&... args)
A free function to get a parameter from the parameter tree singleton.
Definition parameters.hh:428
make the local view function available whenever we use the grid geometry
Definition adapt.hh:29
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:153
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
Definition common/properties.hh:47
Type tag for numeric models.
Definition grid.hh:35
const GridGeometry & gridGeometry() const
The finite volume grid geometry.
Definition common/fvproblem.hh:588
Property to specify the type of scalar values.
Definition common/properties.hh:53
The DUNE grid type.
Definition common/properties.hh:57
The type of the grid view according to the grid type.
Definition common/properties.hh:63
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
specifies if the parameters for the diffusive fluxes depend on the solution
Definition common/properties.hh:214
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
Fluid system base class.
Definition fluidsystems/base.hh:45
SpatialParams & spatialParams()
Returns the spatial parameters object.
Definition dumux/porousmediumflow/problem.hh:146
PorousMediumFlowProblem(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< SpatialParams > spatialParams, const std::string ¶mGroup="")
Constructor, passing the spatial parameters.
Definition dumux/porousmediumflow/problem.hh:67
A simple fluid system with one tracer component.
Definition 1ptracer/problem_tracer.hh:89
static constexpr int numComponents
The number of components.
Definition 1ptracer/problem_tracer.hh:107
static Scalar binaryDiffusionCoefficient(unsigned int compIdx, const Problem &problem, const Element &element, const SubControlVolume &scv)
Definition 2ptracer/problem_tracer.hh:108
static std::string componentName(int compIdx)
Human readable component name (index compIdx) (for vtk output).
Definition 2ptracer/problem_tracer.hh:99
static constexpr bool isTracerFluidSystem()
If the fluid system only contains tracer components.
Definition 2ptracer/problem_tracer.hh:88
static Scalar molarMass(unsigned int compIdx)
Molar mass in kg/mol of the component with index compIdx.
Definition 2ptracer/problem_tracer.hh:103
static constexpr int getMainComponent(int phaseIdx)
No component is the main component.
Definition 2ptracer/problem_tracer.hh:92
A 2p problem with multiple tracer bands in a porous groundwater reservoir with a lens.
Definition 2ptracer/problem_tracer.hh:137
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
Evaluates the initial value for a control volume.
Definition 2ptracer/problem_tracer.hh:214
BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const
Specifies which kind of boundary condition should be used for which equation on a given boundary segm...
Definition 2ptracer/problem_tracer.hh:179
TwoPTracerTestProblem(std::shared_ptr< const GridGeometry > gridGeometry)
Definition 2ptracer/problem_tracer.hh:156
PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
Evaluates the boundary conditions for a Dirichlet boundary segment.
Definition 2ptracer/problem_tracer.hh:200
Definition 2ptracer/problem_tracer.hh:47
std::tuple< Tracer > InheritsFrom
Definition 2ptracer/problem_tracer.hh:47
Definition 2ptracer/problem_tracer.hh:48
std::tuple< TwoPTracerTest, CCTpfaModel > InheritsFrom
Definition 2ptracer/problem_tracer.hh:48
Dune::YaspGrid< 2 > type
Definition 2ptracer/problem_tracer.hh:53
TwoPTracerTestProblem< TypeTag > type
Definition 2ptracer/problem_tracer.hh:57
TwoPTracerTestSpatialParams< GridGeometry, Scalar > type
Definition 2ptracer/problem_tracer.hh:65
GetPropType< TypeTag, Properties::GridGeometry > GridGeometry
Definition 2ptracer/problem_tracer.hh:63
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition 2ptracer/problem_tracer.hh:64
static constexpr bool value
Definition 2ptracer/problem_tracer.hh:70
static constexpr bool value
Definition 2ptracer/problem_tracer.hh:72
TracerFluidSystem< TypeTag > type
Definition 2ptracer/problem_tracer.hh:119
Definition of the spatial parameters for the tracer problem.
Definition porousmediumflow/tracer/2ptracer/spatialparams_tracer.hh:41
Adaption of the fully implicit scheme to the tracer transport model.
Base class for all porous media problems.
Definition of the spatial parameters for the tracer problem.