26#ifndef DUMUX_TISSUE_PROBLEM_HH
27#define DUMUX_TISSUE_PROBLEM_HH
29#include <dune/geometry/quadraturerules.hh>
30#include <dune/geometry/referenceelements.hh>
31#include <dune/grid/yaspgrid.hh>
32#include <dune/grid/uggrid.hh>
33#include <dune/localfunctions/lagrange/pqkfactory.hh>
50template <
class TypeTag>
62template<
class TypeTag>
63struct Grid<TypeTag, TTag::Soil> {
using type = Dune::UGGrid<3>; };
65template<
class TypeTag>
66struct Grid<TypeTag, TTag::Soil> {
using type = Dune::YaspGrid<3, Dune::EquidistantOffsetCoordinates<double, 3>>; };
69template<
class TypeTag>
71template<
class TypeTag>
73template<
class TypeTag>
75template<
class TypeTag>
77template<
class TypeTag>
79template<
class TypeTag>
83template<
class TypeTag>
87template<
class TypeTag>
95template<
class TypeTag>
103template<
class TypeTag>
104struct UseMoles<TypeTag, TTag::Soil> {
static constexpr bool value =
true; };
114template <
class TypeTag>
120 using FVElementGeometry =
typename GridGeometry::LocalView;
121 using SubControlVolume =
typename GridGeometry::SubControlVolume;
122 using GridView =
typename GridGeometry::GridView;
123 using GlobalPosition =
typename GridGeometry::GlobalCoordinate;
130 using Element =
typename GridView::template Codim<0>::Entity;
138 dim = GridView::dimension,
156 name_ = getParam<std::string>(
"Vtk.OutputName") +
"_" + getParamFromGroup<std::string>(this->
paramGroup(),
"Problem.Name");
157 contaminantMoleFraction_ = getParam<Scalar>(
"Problem.ContaminantMoleFraction");
160 const Scalar sw = getParam<Scalar>(
"Problem.InitTopSaturation", 0.3);
175 const std::string&
name()
const
184 {
return 273.15 + 10; }
211 BoundaryTypes values;
212 values.setAllNeumann();
264 template<
class ElementVolumeVariables>
266 const Element &element,
267 const FVElementGeometry& fvGeometry,
268 const ElementVolumeVariables& elemVolVars,
269 const SubControlVolume &scv)
const
271 NumEqVector sourceValues;
274 const auto priVars3D = this->
couplingManager().bulkPriVars(source.id());
275 const auto priVars1D = this->
couplingManager().lowDimPriVars(source.id());
280 const auto lowDimElementIdx = this->
couplingManager().pointSourceData(source.id()).lowDimElementIdx();
282 const Scalar rootRadius =
spatialParams.radius(lowDimElementIdx);
285 const auto molarDensityH20 = 1000 / 0.018;
286 sourceValues[
conti0EqIdx] = 2 * M_PI * rootRadius * Kr * (pressure1D - pressure3D) * molarDensityH20;
299 const auto molarDensityD20 = 1000 / 0.020;
300 sourceValues[
transportEqIdx] += 2 * M_PI * rootRadius * 1.0e-8 * (x1D - x3D) * molarDensityD20;
302 sourceValues *=
source.quadratureWeight()*
source.integrationElement();
317 static const Scalar extend = 0.15*(gg.bBoxMax()[0]-gg.bBoxMin()[0]);
318 const auto xTracer = [&]()
320 auto contaminationPos = gg.bBoxMax()-gg.bBoxMin();
321 contaminationPos[0] *= 0.26;
322 contaminationPos[1] *= 0.56;
323 contaminationPos[2] *= 0.26;
324 contaminationPos += gg.bBoxMin();
326 if ((globalPos - contaminationPos).infinity_norm() < extend + eps_)
327 return contaminantMoleFraction_;
332 PrimaryVariables priVars(0.0);
342 {
return *couplingManager_; }
345 Scalar pcTop_, contaminantMoleFraction_;
347 static constexpr Scalar eps_ = 1.5e-7;
350 std::shared_ptr<CouplingManager> couplingManager_;
Define some often used mathematical functions.
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.
Properties for all models using cell-centered finite volume scheme with TPFA.
Setting constant fluid properties via the input file.
A much simpler (and thus potentially less buggy) version of pure water.
A liquid phase consisting of a two components, a main component and a conservative tracer component.
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
Class to specify the type of a boundary.
Definition: common/boundarytypes.hh:38
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
NumEqVector source(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolume &scv) const
Evaluate the source term for all phases within a given sub-control-volume.
Definition: common/fvproblem.hh:327
const GridGeometry & gridGeometry() const
The finite volume grid geometry.
Definition: common/fvproblem.hh:588
A point source base class.
Definition: pointsource.hh:49
The DUNE grid type.
Definition: common/properties.hh:57
UndefinedProperty 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
Definition: common/properties.hh:169
If disabled, the volume variables are not stored (reduces memory, but is slower)
Definition: common/properties.hh:178
specifies if data on flux vars should be saved (faster, but more memory consuming)
Definition: common/properties.hh:188
specifies if the parameters for the advective fluxes depend on the solution
Definition: common/properties.hh:210
specifies if the parameters for the diffusive fluxes depend on the solution
Definition: common/properties.hh:214
specifies if the parameters for the heat conduction fluxes depend on the solution
Definition: common/properties.hh:218
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 component which returns run time specified values for all fluid properties.
Definition: constant.hh:58
A liquid phase consisting of a two components, a main component and a conservative tracer component.
Definition: liquidphase2c.hh:46
Definition: multidomain/couplingmanager.hh:46
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 a problem, for the 1p2c problem: Component transport of oxygen in interstitial fluid.
Definition: 1p_richards/problem_soil.hh:97
void addPointSources(std::vector< PointSource > &pointSources) const
Applies a vector of point sources which are possibly solution dependent.
Definition: 1p2c_richards2c/problem_soil.hh:243
Indices
Definition: 1p2c_richards2c/problem_soil.hh:136
@ dim
Definition: 1p2c_richards2c/problem_soil.hh:138
@ transportEqIdx
Definition: 1p2c_richards2c/problem_soil.hh:145
@ liquidPhaseIdx
Definition: 1p2c_richards2c/problem_soil.hh:147
@ transportCompIdx
Definition: 1p2c_richards2c/problem_soil.hh:142
@ conti0EqIdx
Definition: 1p2c_richards2c/problem_soil.hh:144
@ dimWorld
Definition: 1p2c_richards2c/problem_soil.hh:139
@ pressureIdx
Definition: 1p2c_richards2c/problem_soil.hh:141
PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
Evaluates the boundary conditions for a Dirichlet boundary segment.
Definition: 1p2c_richards2c/problem_soil.hh:223
const std::string & name() const
The problem name.
Definition: 1p2c_richards2c/problem_soil.hh:175
GetPropType< TypeTag, Properties::FluidSystem > FluidSystem
Definition: 1p2c_richards2c/problem_soil.hh:135
BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const
Specifies which kind of boundary condition should be used for which equation on a given boundary segm...
Definition: 1p2c_richards2c/problem_soil.hh:209
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
Evaluates the initial value for a control volume.
Definition: 1p2c_richards2c/problem_soil.hh:314
const CouplingManager & couplingManager() const
Get the coupling manager.
Definition: 1p2c_richards2c/problem_soil.hh:341
Scalar nonWettingReferencePressure() const
Definition: 1p2c_richards2c/problem_soil.hh:192
Scalar temperature() const
Returns the temperature within the domain [K].
Definition: 1p2c_richards2c/problem_soil.hh:183
void pointSource(PointSource &source, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolume &scv) const
Evaluates the point sources (added by addPointSources) for all phases within a given sub control volu...
Definition: 1p2c_richards2c/problem_soil.hh:265
SoilProblem(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< CouplingManager > couplingManager)
Definition: 1p2c_richards2c/problem_soil.hh:150
Definition: 1p2c_richards2c/problem_soil.hh:57
std::tuple< RichardsNC, CCTpfaModel > InheritsFrom
Definition: 1p2c_richards2c/problem_soil.hh:57
Dune::YaspGrid< 3, Dune::EquidistantOffsetCoordinates< double, 3 > > type
Definition: 1p2c_richards2c/problem_soil.hh:66
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition: 1p2c_richards2c/problem_soil.hh:98
Definition of the spatial parameters for the soil problem.
Definition: 1p2c_richards2c/spatialparams_soil.hh:42
Declares all properties used in Dumux.
Base class for all models which use the Richards, n-component fully implicit model.
Base class for all porous media problems.
Definition of the spatial parameters for the tissue problem.