13#ifndef DUMUX_2P1C_SPURIOUS_FLUX_BLOCKING_DARCYS_LAW_HH
14#define DUMUX_2P1C_SPURIOUS_FLUX_BLOCKING_DARCYS_LAW_HH
25 template<
class TypeTag,
class MyTypeTag>
35template <
class TypeTag>
41 using SubControlVolume =
typename FVElementGeometry::SubControlVolume;
42 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
44 using ElemFluxVarCache =
typename GridFluxVariablesCache::LocalView;
51 using Element =
typename GridView::template Codim<0>::Entity;
52 using CoordScalar =
typename GridView::ctype;
54 enum { dim = GridView::dimension};
55 enum { dimWorld = GridView::dimensionworld};
60 liquidPhaseIdx = FluidSystem::liquidPhaseIdx,
61 gasPhaseIdx = FluidSystem::gasPhaseIdx,
64 using DimWorldMatrix = Dune::FieldMatrix<Scalar, dimWorld, dimWorld>;
65 using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
70 static Scalar
flux(
const Problem& problem,
71 const Element& element,
72 const FVElementGeometry& fvGeometry,
73 const ElementVolumeVariables& elemVolVars,
74 const SubControlVolumeFace& scvf,
76 const ElemFluxVarCache& elemFluxVarCache)
78 const Scalar
flux = ParentType::flux(problem, element, fvGeometry, elemVolVars, scvf, phaseIdx, elemFluxVarCache);
81 if((!getPropValue<TypeTag, Properties::UseBlockingOfSpuriousFlow>()) || phaseIdx != liquidPhaseIdx)
84 const auto& insideVolVars = elemVolVars[scvf.insideScvIdx()];
85 const auto& outsideVolVars = elemVolVars[scvf.outsideScvIdx()];
87 const Scalar factor = std::signbit(
flux) ? factor_(outsideVolVars, insideVolVars, phaseIdx) :
88 factor_(insideVolVars, outsideVolVars, phaseIdx);
101 static Scalar factor_(
const VolumeVariables &up,
const VolumeVariables &dn,
const int phaseIdx)
105 const Scalar tDn = dn.temperature();
106 const Scalar tUp = up.temperature();
108 const Scalar sgDn = dn.saturation(gasPhaseIdx);
109 const Scalar sgUp = up.saturation(gasPhaseIdx);
111 bool upIsNotSteam =
false;
112 bool downIsSteam =
false;
113 bool spuriousFlow =
false;
121 if(upIsNotSteam && downIsSteam && tDn > tUp && phaseIdx == liquidPhaseIdx)
126 Scalar deltaT = tDn - tUp;
132 factor = 1-(deltaT/15);
forward declaration of the method-specific implementation
Definition: flux/ccmpfa/darcyslaw.hh:27
Specialization of Darcy's Law for the two-phase one-component model, including a the possibility to...
Definition: porousmediumflow/2p1c/darcyslaw.hh:37
static Scalar flux(const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolumeFace &scvf, const int phaseIdx, const ElemFluxVarCache &elemFluxVarCache)
Compute the Darcy flux and use a blocking factor, if specified.
Definition: porousmediumflow/2p1c/darcyslaw.hh:70
Defines all properties used in Dumux.
Advective fluxes according to Darcy's law.
typename GetProp< TypeTag, Property >::type GetPropType
get the type alias defined in the property
Definition: propertysystem.hh:296
Define some often used mathematical functions.
The available discretization methods in Dumux.
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.
a tag to mark properties as undefined
Definition: propertysystem.hh:27
Determines whether blocking of spurious flow is used or not.
Definition: porousmediumflow/2p1c/darcyslaw.hh:26