25#ifndef DUMUX_TEST_TPFAFACETCOUPLING_TRACER_LOWDIM_PROBLEM_HH
26#define DUMUX_TEST_TPFAFACETCOUPLING_TRACER_LOWDIM_PROBLEM_HH
28#include <dune/foamgrid/foamgrid.hh>
44template <
class TypeTag>
45class TracerLowDimProblem;
59template<
class TypeTag>
60struct Grid<TypeTag, TTag::TracerTestLowDim> {
using type = Dune::FoamGrid<1, 2>; };
63template<
class TypeTag>
67template<
class TypeTag>
76template<
class TypeTag>
77struct UseMoles<TypeTag, TTag::TracerTestLowDim> {
static constexpr bool value =
false; };
80template<
class TypeTag>
90template<
class TypeTag>
99template <
class TypeTag>
108 using FVElementGeometry =
typename GridGeometry::LocalView;
109 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
117 static constexpr bool useMoles = getPropValue<TypeTag, Properties::UseMoles>();
119 using Element =
typename GridGeometry::GridView::template Codim<0>::Entity;
120 using GlobalPosition =
typename Element::Geometry::GlobalCoordinate;
134 const auto problemName = getParamFromGroup<std::string>(this->
paramGroup(),
"Problem.Name");
135 std::cout<<
"problem " << problemName <<
" uses " << (useMoles ?
"mole" :
"mass") <<
" fractions" <<
'\n';
136 problemName_ = getParamFromGroup<std::string>(this->
paramGroup(),
"Vtk.OutputName") +
"_" + problemName;
140 const std::string&
name()
const
141 {
return problemName_; }
151 BoundaryTypes values;
152 values.setAllNeumann();
162 {
return PrimaryVariables(0.0); }
173 template<
class ElementVolumeVariables,
class SubControlVolume>
174 NumEqVector
source(
const Element& element,
175 const FVElementGeometry& fvGeometry,
176 const ElementVolumeVariables& elemVolVars,
177 const SubControlVolume& scv)
const
180 auto source = couplingManagerPtr_->evalSourcesFromBulk(element, fvGeometry, elemVolVars, scv);
181 source /= scv.volume()*elemVolVars[scv].extrusionFactor();
197 template<
class ElementVolumeVariables,
class ElementFluxVarsCache>
199 const FVElementGeometry& fvGeometry,
200 const ElementVolumeVariables& elemVolVars,
201 const ElementFluxVarsCache& elemFluxVarsCache,
202 const SubControlVolumeFace& scvf)
const
205 const auto flux = this->
spatialParams().volumeFlux(element, fvGeometry, elemVolVars, scvf);
208 const auto& insideVolVars = elemVolVars[fvGeometry.scv(scvf.insideScvIdx())];
209 const auto tracerFlux = insideVolVars.massFraction(0, 0)*flux;
210 return NumEqVector(tracerFlux);
213 return NumEqVector(0.0);
218 {
return aperture_; }
222 {
return *couplingManagerPtr_; }
225 std::shared_ptr<CouplingManager> couplingManagerPtr_;
227 std::string problemName_;
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.
Fluid system for the tracer facet coupling test.
The model traits used in the tracer facet coupling test.
T getParamFromGroup(Args &&... args)
A free function to get a parameter from the parameter tree singleton with a model group.
Definition: parameters.hh:438
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 std::string & paramGroup() const
The parameter group in which to retrieve runtime parameters.
Definition: common/fvproblem.hh:592
const GridGeometry & gridGeometry() const
The finite volume grid geometry.
Definition: common/fvproblem.hh:588
The DUNE grid type.
Definition: common/properties.hh:57
Traits class encapsulating model specifications.
Definition: common/properties.hh:65
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
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
GetPropType< TypeTag, Properties::SpatialParams > SpatialParams
Export spatial parameter type.
Definition: dumux/porousmediumflow/problem.hh:58
The problem for the bulk domain of the tracer facet coupling test.
Definition: problem_tracer_lowdim.hh:101
NumEqVector source(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolume &scv) const
Evaluates the source term at a given position.
Definition: problem_tracer_lowdim.hh:174
TracerLowDimProblem(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< SpatialParams > spatialParams, std::shared_ptr< CouplingManager > couplingManager, const std::string ¶mGroup="")
Definition: problem_tracer_lowdim.hh:125
BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const
Specifies which kind of boundary condition should be used for which equation on a given boundary segm...
Definition: problem_tracer_lowdim.hh:149
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
Evaluates the initial value for a control volume.
Definition: problem_tracer_lowdim.hh:161
const CouplingManager & couplingManager() const
Returns reference to the coupling manager.
Definition: problem_tracer_lowdim.hh:221
PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
Evaluates the Dirichlet boudnary conditions for a control volume.
Definition: problem_tracer_lowdim.hh:169
const std::string & name() const
The problem name.
Definition: problem_tracer_lowdim.hh:140
NumEqVector neumann(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const ElementFluxVarsCache &elemFluxVarsCache, const SubControlVolumeFace &scvf) const
Evaluates the boundary conditions for a Neumann boundary segment.
Definition: problem_tracer_lowdim.hh:198
Scalar extrusionFactorAtPos(const GlobalPosition &globalPos) const
Sets the aperture as extrusion factor.
Definition: problem_tracer_lowdim.hh:217
Definition: problem_tracer_lowdim.hh:50
std::tuple< Tracer > InheritsFrom
Definition: problem_tracer_lowdim.hh:50
Definition: problem_tracer_lowdim.hh:53
std::tuple< TracerTestLowDim, CCTpfaModel > InheritsFrom
Definition: problem_tracer_lowdim.hh:53
Definition: problem_tracer_lowdim.hh:54
std::tuple< TracerTestLowDim, CCTpfaModel > InheritsFrom
Definition: problem_tracer_lowdim.hh:54
Definition: problem_tracer_lowdim.hh:55
std::tuple< TracerTestLowDim, BoxModel > InheritsFrom
Definition: problem_tracer_lowdim.hh:55
Dune::FoamGrid< 1, 2 > type
Definition: problem_tracer_lowdim.hh:60
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition: problem_tracer_lowdim.hh:71
GetPropType< TypeTag, Properties::GridGeometry > GridGeometry
Definition: problem_tracer_lowdim.hh:70
Definition of the spatial parameters for the tracer problem.
Definition: multidomain/facet/tracer_tracer/spatialparams_tracer.hh:41
Custom model traits disabling diffusion.
Definition: tracermodeltraits.hh:35
A simple fluid system with one tracer component.
Definition: 1ptracer/problem_tracer.hh:89
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.