26#ifndef DUMUX_TISSUE_PROBLEM_HH
27#define DUMUX_TISSUE_PROBLEM_HH
29#include <dune/grid/yaspgrid.hh>
30#include <dune/geometry/quadraturerules.hh>
31#include <dune/geometry/referenceelements.hh>
32#include <dune/localfunctions/lagrange/pqkfactory.hh>
47template <
class TypeTag>
60template<
class TypeTag>
61struct Grid<TypeTag, TTag::Soil> {
using type = Dune::YaspGrid<3, Dune::EquidistantOffsetCoordinates<GetPropType<TypeTag, Properties::Scalar>, 3> >; };
63template<
class TypeTag>
65template<
class TypeTag>
66struct EnableGridVolumeVariablesCache<TypeTag, TTag::Soil> {
static constexpr bool value =
true; };
67template<
class TypeTag>
68struct EnableGridFluxVariablesCache<TypeTag, TTag::Soil> {
static constexpr bool value =
true; };
69template<
class TypeTag>
70struct SolutionDependentAdvection<TypeTag, TTag::Soil> {
static constexpr bool value =
false; };
71template<
class TypeTag>
72struct SolutionDependentMolecularDiffusion<TypeTag, TTag::Soil> {
static constexpr bool value =
false; };
73template<
class TypeTag>
74struct SolutionDependentHeatConduction<TypeTag, TTag::Soil> {
static constexpr bool value =
false; };
77template<
class TypeTag>
81template<
class TypeTag>
95template <
class TypeTag>
101 using GridView =
typename GridGeometry::GridView;
102 using FVElementGeometry =
typename GridGeometry::LocalView;
103 using SubControlVolume =
typename GridGeometry::SubControlVolume;
104 using GlobalPosition =
typename GridGeometry::GlobalCoordinate;
105 using Element =
typename GridView::template Codim<0>::Entity;
121 name_ = getParam<std::string>(
"Vtk.OutputName") +
"_" + getParamFromGroup<std::string>(this->
paramGroup(),
"Problem.Name");
122 initPressure_ = getParam<Scalar>(
"BoundaryConditions.InitialSoilPressure");
135 const std::string&
name()
const
144 {
return 273.15 + 10; }
171 BoundaryTypes values;
172 values.setAllNeumann();
214 template<
class ElementVolumeVariables>
216 const Element &element,
217 const FVElementGeometry& fvGeometry,
218 const ElementVolumeVariables& elemVolVars,
219 const SubControlVolume &scv)
const
222 const Scalar pressure3D = this->
couplingManager().bulkPriVars(source.id())[Indices::pressureIdx];
223 const Scalar pressure1D = this->
couplingManager().lowDimPriVars(source.id())[Indices::pressureIdx];
226 const auto lowDimElementIdx = this->
couplingManager().pointSourceData(source.id()).lowDimElementIdx();
228 const Scalar rootRadius =
spatialParams.radius(lowDimElementIdx);
232 const Scalar sourceValue = 2* M_PI *rootRadius * Kr *(pressure1D - pressure3D)*
density;
247 PrimaryVariables priVars({initPressure_});
248 priVars.setState(Indices::bothPhases);
256 PrimaryVariables
source(0.0);
257 for (
const auto& element : elements(this->
gridGeometry().gridView()))
260 fvGeometry.bindElement(element);
262 auto elemVolVars =
localView(gridVars.curGridVolVars());
263 elemVolVars.bindElement(element, fvGeometry, sol);
265 for (
auto&& scv : scvs(fvGeometry))
267 auto pointSources = this->
scvPointSources(element, fvGeometry, elemVolVars, scv);
268 pointSources *= scv.volume()*elemVolVars[scv].extrusionFactor();
273 std::cout <<
"Global integrated source (soil): " <<
source <<
" (kg/s) / "
274 <<
source*3600*24*1000 <<
" (g/day)" <<
'\n';
280 {
return *couplingManager_; }
283 Scalar initPressure_;
285 static constexpr Scalar eps_ = 1.5e-7;
288 std::shared_ptr<CouplingManager> couplingManager_;
Define some often used mathematical functions.
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.
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.
GridCache::LocalView localView(const GridCache &gridCache)
Free function to get the local view of a grid cache object.
Definition: localview.hh:38
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 density(int phaseIdx) noexcept
I/O name of density for multiphase systems.
Definition: name.hh:65
Base class for all finite-volume problems.
Definition: common/fvproblem.hh:50
NumEqVector scvPointSources(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolume &scv) const
Adds contribution of point sources for a specific sub control volume to the values....
Definition: common/fvproblem.hh:435
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
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
Definition: common/properties.hh:169
The type of the spatial parameters object.
Definition: common/properties.hh:221
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: 1p_richards/problem_soil.hh:193
Indices
Definition: 1p2c_richards2c/problem_soil.hh:136
void computeSourceIntegral(const SolutionVector &sol, const GridVariables &gridVars)
Definition: 1p_richards/problem_soil.hh:254
const std::string & name() const
The problem name.
Definition: 1p_richards/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: 1p_richards/problem_soil.hh:169
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
Evaluates the initial value for a control volume.
Definition: 1p_richards/problem_soil.hh:245
const CouplingManager & couplingManager() const
Get the coupling manager.
Definition: 1p2c_richards2c/problem_soil.hh:341
Scalar nonWettingReferencePressure() const
Definition: 1p_richards/problem_soil.hh:152
Scalar temperature() const
Returns the temperature within the domain [K].
Definition: 1p_richards/problem_soil.hh:143
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: 1p_richards/problem_soil.hh:215
SoilProblem(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< CouplingManager > couplingManager)
Definition: 1p_richards/problem_soil.hh:115
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
Definition of the spatial parameters for the soil problem.
Definition: 1p2c_richards2c/spatialparams_soil.hh:42
Definition: 1p_richards/problem_soil.hh:55
std::tuple< Soil, CCTpfaModel > InheritsFrom
Definition: 1p_richards/problem_soil.hh:55
Definition: 1p_richards/problem_soil.hh:56
std::tuple< Soil, BoxModel > InheritsFrom
Definition: 1p_richards/problem_soil.hh:56
Declares all properties used in Dumux.
This model implements a variant of the Richards' equation for quasi-twophase flow.
Base class for all porous media problems.
Definition of the spatial parameters for the tissue problem.