26#ifndef DUMUX_ROOT_PROBLEM_HH
27#define DUMUX_ROOT_PROBLEM_HH
29#include <dune/foamgrid/foamgrid.hh>
45template <
class TypeTag>
class RootProblem;
55template<
class TypeTag>
56struct Grid<TypeTag, TTag::Root> {
using type = Dune::FoamGrid<1, 3>; };
58template<
class TypeTag>
60template<
class TypeTag>
62template<
class TypeTag>
64template<
class TypeTag>
66template<
class TypeTag>
68template<
class TypeTag>
72template<
class TypeTag>
76template<
class TypeTag>
85template<
class TypeTag>
92template<
class TypeTag>
93struct UseMoles<TypeTag, TTag::Root> {
static constexpr bool value =
true; };
101template <
class TypeTag>
112 using GridView =
typename GridGeometry::GridView;
113 using FVElementGeometry =
typename GridGeometry::LocalView;
114 using SubControlVolume =
typename GridGeometry::SubControlVolume;
115 using SubControlVolumeFace =
typename GridGeometry::SubControlVolumeFace;
116 using GlobalPosition =
typename GridGeometry::GlobalCoordinate;
117 using Element =
typename GridView::template Codim<0>::Entity;
127 dim = GridView::dimension,
139 template<
class SpatialParams>
147 name_ = getParam<std::string>(
"Vtk.OutputName") +
"_" + getParamFromGroup<std::string>(this->
paramGroup(),
"Problem.Name");
148 transpirationRate_ = getParam<Scalar>(
"BoundaryConditions.TranspirationRate");
149 initPressure_ = getParam<Scalar>(
"BoundaryConditions.InitialRootPressure");
158 template<
class ElementSolution>
160 const SubControlVolume &scv,
161 const ElementSolution& elemSol)
const
163 const auto eIdx = this->
gridGeometry().elementMapper().index(element);
165 return M_PI*radius*radius;
178 const std::string&
name()
const
185 {
return 273.15 + 10.0; }
201 BoundaryTypes values;
202 values.setAllNeumann();
224 template<
class ElementVolumeVariables,
class ElementFluxVarsCache>
226 const FVElementGeometry& fvGeometry,
227 const ElementVolumeVariables& elemVolvars,
228 const ElementFluxVarsCache& elemFluxVarsCache,
229 const SubControlVolumeFace& scvf)
const
231 NeumannFluxes values(0.0);
232 if (scvf.center()[2] + eps_ > this->gridGeometry().bBoxMax()[2])
234 const auto& volVars = elemVolvars[scvf.insideScvIdx()];
237 values[
conti0EqIdx] = value / volVars.extrusionFactor() / scvf.area();
283 template<
class ElementVolumeVariables>
285 const Element &element,
286 const FVElementGeometry& fvGeometry,
287 const ElementVolumeVariables& elemVolVars,
288 const SubControlVolume &scv)
const
290 SourceValues sourceValues;
293 const auto priVars3D = this->
couplingManager().bulkPriVars(source.id());
294 const auto priVars1D = this->
couplingManager().lowDimPriVars(source.id());
298 const auto lowDimElementIdx = this->
couplingManager().pointSourceData(source.id()).lowDimElementIdx();
299 const Scalar Kr = this->
spatialParams().Kr(lowDimElementIdx);
300 const Scalar rootRadius = this->
spatialParams().radius(lowDimElementIdx);
303 const auto molarDensityH20 = 1000 / 0.018;
304 sourceValues[
conti0EqIdx] = 2 * M_PI * rootRadius * Kr * (pressure3D - pressure1D) * molarDensityH20;
317 const auto molarDensityD20 = 1000 / 0.020;
318 sourceValues[
transportEqIdx] += 2 * M_PI * rootRadius * 1.0e-8 * (x3D - x1D) * molarDensityD20;
320 sourceValues *=
source.quadratureWeight()*
source.integrationElement();
331 {
return PrimaryVariables({initPressure_, 0.0}); }
340 template<
class VtkOutputModule>
348 {
return *couplingManager_; }
351 Scalar transpirationRate_, initPressure_;
353 static constexpr Scalar eps_ = 1.5e-7;
356 std::shared_ptr<CouplingManager> couplingManager_;
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.
Properties for all models using cell-centered finite volume scheme with TPFA.
A liquid phase consisting of a two components, a main component and a conservative tracer component.
A much simpler (and thus potentially less buggy) version of pure water.
Setting constant fluid properties via the input file.
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
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 VTK output module to simplify writing dumux simulation data to VTK format.
Definition: io/vtkoutputmodule.hh:66
void addField(const Vector &v, const std::string &name, FieldType fieldType=FieldType::automatic)
Definition: io/vtkoutputmodule.hh:161
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
Exact solution 1D-3D.
Definition: 1p_richards/problem_root.hh:103
void addVtkOutputFields(VtkOutputModule &vtk) const
Adds additional VTK output data to the VTKWriter.
Definition: 1p2c_richards2c/problem_root.hh:341
const CouplingManager & couplingManager() const
Get the coupling manager.
Definition: 1p2c_richards2c/problem_root.hh:347
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_root.hh:284
void addPointSources(std::vector< PointSource > &pointSources) const
Applies a vector of point sources which are possibly solution dependent.
Definition: 1p2c_richards2c/problem_root.hh:262
GetPropType< TypeTag, Properties::FluidSystem > FluidSystem
Definition: 1p2c_richards2c/problem_root.hh:124
RootProblem(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< SpatialParams > spatialParams, std::shared_ptr< CouplingManager > couplingManager)
Definition: 1p2c_richards2c/problem_root.hh:140
Scalar temperature() const
Returns the temperature within the domain in [K].
Definition: 1p2c_richards2c/problem_root.hh:184
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
Evaluates the initial value for a control volume.
Definition: 1p2c_richards2c/problem_root.hh:330
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_root.hh:199
const std::string & name() const
The problem name.
Definition: 1p2c_richards2c/problem_root.hh:178
NeumannFluxes 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: 1p2c_richards2c/problem_root.hh:225
Scalar extrusionFactor(const Element &element, const SubControlVolume &scv, const ElementSolution &elemSol) const
Returns how much the domain is extruded at a given sub-control volume.
Definition: 1p2c_richards2c/problem_root.hh:159
PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
Evaluates the boundary conditions for a Dirichlet control volume.
Definition: 1p2c_richards2c/problem_root.hh:213
Indices
Definition: 1p2c_richards2c/problem_root.hh:125
@ dim
Definition: 1p2c_richards2c/problem_root.hh:127
@ liquidPhaseIdx
Definition: 1p2c_richards2c/problem_root.hh:136
@ conti0EqIdx
Definition: 1p2c_richards2c/problem_root.hh:133
@ dimworld
Definition: 1p2c_richards2c/problem_root.hh:128
@ pressureIdx
Definition: 1p2c_richards2c/problem_root.hh:130
@ transportCompIdx
Definition: 1p2c_richards2c/problem_root.hh:131
@ transportEqIdx
Definition: 1p2c_richards2c/problem_root.hh:134
Definition: 1p2c_richards2c/problem_root.hh:51
std::tuple< OnePNC, CCTpfaModel > InheritsFrom
Definition: 1p2c_richards2c/problem_root.hh:51
Dune::FoamGrid< 1, 3 > type
Definition: 1p2c_richards2c/problem_root.hh:56
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition: 1p2c_richards2c/problem_root.hh:79
Definition of the spatial parameters for the root xylem flow.
Definition: 1p2c_richards2c/spatialparams_root.hh:42
Declares all properties used in Dumux.
Adaption of the fully implicit model to the one-phase n-component flow model.
Base class for all porous media problems.
The spatial parameters class blood flow problem.