26#ifndef DUMUX_DARCY_SUBPROBLEM_DIFFUSION_COMPARISON_HH
27#define DUMUX_DARCY_SUBPROBLEM_DIFFUSION_COMPARISON_HH
29#include <dune/grid/yaspgrid.hh>
37#include "./../spatialparams.hh"
47#define DIFFUSIONTYPE FicksLaw<TypeTag>
51template <
class TypeTag>
61template<
class TypeTag>
65template<
class TypeTag>
69 static constexpr auto phaseIdx = H2OAir::liquidPhaseIdx;
74template<
class TypeTag>
75struct UseMoles<TypeTag, TTag::DarcyOnePTwoC> {
static constexpr bool value =
true; };
78template<
class TypeTag>
79struct ReplaceCompEqIdx<TypeTag, TTag::DarcyOnePTwoC> {
static constexpr int value = 3; };
82template<
class TypeTag>
87template<
class TypeTag>
88struct Grid<TypeTag, TTag::DarcyOnePTwoC> {
using type = Dune::YaspGrid<2>; };
91template<
class TypeTag>
95template<
class TypeTag>
104template <
class TypeTag>
115 using SubControlVolume =
typename FVElementGeometry::SubControlVolume;
116 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
124 dim = GridView::dimension,
125 dimworld = GridView::dimensionworld,
128 conti0EqIdx = Indices::conti0EqIdx,
129 pressureIdx = Indices::pressureIdx,
132 using Element =
typename GridView::template Codim<0>::Entity;
133 using GlobalPosition = Dune::FieldVector<Scalar, dimworld>;
135 using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>;
142 pressure_ = getParamFromGroup<Scalar>(this->
paramGroup(),
"Problem.Pressure");
143 initialMoleFraction_ = getParamFromGroup<Scalar>(this->
paramGroup(),
"Problem.InitialMoleFraction");
170 {
return 273.15 + 10; }
185 BoundaryTypes
boundaryTypes(
const Element& element,
const SubControlVolumeFace& scvf)
const
187 BoundaryTypes values;
188 values.setAllNeumann();
190 if (
couplingManager().isCoupledEntity(CouplingManager::darcyIdx, scvf))
191 values.setAllCouplingNeumann();
207 template<
class ElementVolumeVariables,
class ElementFluxVarsCache>
209 const FVElementGeometry& fvGeometry,
210 const ElementVolumeVariables& elemVolVars,
211 const ElementFluxVarsCache& elemFluxVarsCache,
212 const SubControlVolumeFace& scvf)
const
214 NumEqVector values(0.0);
216 if (
couplingManager().isCoupledEntity(CouplingManager::darcyIdx, scvf))
217 values =
couplingManager().couplingData().massCouplingCondition(element, fvGeometry, elemVolVars, scvf, DiffusionCoefficientAveragingType::harmonic);
237 template<
class ElementVolumeVariables>
238 NumEqVector
source(
const Element &element,
239 const FVElementGeometry& fvGeometry,
240 const ElementVolumeVariables& elemVolVars,
241 const SubControlVolume &scv)
const
242 {
return NumEqVector(0.0); }
254 PrimaryVariables
initial(
const Element &element)
const
256 PrimaryVariables values(0.0);
257 values[pressureIdx] = pressure_;
258 values[conti0EqIdx + 1] = initialMoleFraction_;
267 {
return *couplingManager_; }
270 bool onLeftBoundary_(
const GlobalPosition &globalPos)
const
271 {
return globalPos[0] < this->
gridGeometry().bBoxMin()[0] + eps_; }
273 bool onRightBoundary_(
const GlobalPosition &globalPos)
const
274 {
return globalPos[0] > this->
gridGeometry().bBoxMax()[0] - eps_; }
276 bool onLowerBoundary_(
const GlobalPosition &globalPos)
const
277 {
return globalPos[1] < this->
gridGeometry().bBoxMin()[1] + eps_; }
279 bool onUpperBoundary_(
const GlobalPosition &globalPos)
const
280 {
return globalPos[1] > this->
gridGeometry().bBoxMax()[1] - eps_; }
284 Scalar initialMoleFraction_;
286 std::shared_ptr<CouplingManager> couplingManager_;
Properties for all models using cell-centered finite volume scheme with TPFA.
This file contains the data which is required to calculate diffusive mass fluxes due to molecular dif...
Relation for the saturation-dependent effective diffusion coefficient.
An adapter for multi-phase fluid systems to be used with (compositional) one-phase models.
A compositional two-phase fluid system with water and air as components in both, the liquid and the g...
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
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
Property whether to use moles or kg as amount unit for balance equations.
Definition: common/properties.hh:102
The component balance index that should be replaced by the total mass/mole balance.
Definition: common/properties.hh:104
The type for the calculation of the molecular diffusion fluxes.
Definition: common/properties.hh:212
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
The employed model for the computation of the effective diffusivity.
Definition: common/properties.hh:231
Relation for the saturation-dependent effective diffusion coefficient.
Definition: diffusivityconstanttortuosity.hh:49
An adapter for multi-phase fluid systems to be used with (compositional) one-phase models.
Definition: 1padapter.hh:46
A compositional two-phase fluid system with water and air as components in both, the liquid and the g...
Definition: h2oair.hh:75
DiffusionCoefficientAveragingType
Defines which kind of averanging of diffusion coefficiencients (moleculat diffusion or thermal conduc...
Definition: couplingdata.hh:52
Base class for all fully implicit porous media problems.
Definition: dumux/porousmediumflow/problem.hh:39
Definition: 1p_2p/problem_darcy.hh:79
bool shouldWriteOutput() const
Definition: 1p2c_1p2c/diffusionlawcomparison/problem_darcy.hh:162
const CouplingManager & couplingManager() const
Get the coupling manager.
Definition: 1p2c_1p2c/diffusionlawcomparison/problem_darcy.hh:266
bool shouldWriteRestartFile() const
Returns true if a restart file should be written to disk.
Definition: 1p2c_1p2c/diffusionlawcomparison/problem_darcy.hh:154
PrimaryVariables initial(const Element &element) const
Evaluates the initial value for a control volume.
Definition: 1p2c_1p2c/diffusionlawcomparison/problem_darcy.hh:254
DarcySubProblem(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< CouplingManager > couplingManager)
Definition: 1p2c_1p2c/diffusionlawcomparison/problem_darcy.hh:138
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 control volume.
Definition: 1p2c_1p2c/diffusionlawcomparison/problem_darcy.hh:208
Scalar temperature() const
Returns the temperature within the domain in [K].
Definition: 1p2c_1p2c/diffusionlawcomparison/problem_darcy.hh:169
BoundaryTypes boundaryTypes(const Element &element, const SubControlVolumeFace &scvf) const
Specifies which kind of boundary condition should be used for which equation on a given boundary cont...
Definition: 1p2c_1p2c/diffusionlawcomparison/problem_darcy.hh:185
NumEqVector source(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolume &scv) const
Evaluates the source term for all phases within a given sub control volume.
Definition: 1p2c_1p2c/diffusionlawcomparison/problem_darcy.hh:238
Definition: 1p2c_1p2c/diffusionlawcomparison/problem_darcy.hh:57
std::tuple< OnePNC, CCTpfaModel > InheritsFrom
Definition: 1p2c_1p2c/diffusionlawcomparison/problem_darcy.hh:57
Dune::YaspGrid< 2 > type
Definition: 1p2c_1p2c/diffusionlawcomparison/problem_darcy.hh:88
DIFFUSIONTYPE type
Definition: 1p2c_1p2c/diffusionlawcomparison/problem_darcy.hh:92
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition: 1p2c_1p2c/diffusionlawcomparison/problem_darcy.hh:99
GetPropType< TypeTag, Properties::GridGeometry > GridGeometry
Definition: 1p2c_1p2c/diffusionlawcomparison/problem_darcy.hh:98
The spatial parameters class for the test problem using the 1p cc model.
Definition: multidomain/boundary/stokesdarcy/1p2c_1p2c/spatialparams.hh:41
Adaption of the fully implicit model to the one-phase n-component flow model.
Base class for all porous media problems.
#define DIFFUSIONTYPE
Definition: 1p2c_1p2c/diffusionlawcomparison/problem_darcy.hh:47