25#ifndef DUMUX_PNM2P_SPATIAL_PARAMS_HH
26#define DUMUX_PNM2P_SPATIAL_PARAMS_HH
46template<
class Gr
idGeometry,
class Scalar,
class LocalRules,
class Implementation>
48:
public BaseSpatialParams<GridGeometry, Scalar, TwoPBaseSpatialParams<GridGeometry, Scalar, LocalRules, Implementation>>
51 using GridView =
typename GridGeometry::GridView;
52 using SubControlVolume =
typename GridGeometry::SubControlVolume;
53 using Element =
typename GridView::template Codim<0>::Entity;
60 if (!
gridGeometry->useSameGeometryForAllPores() && LocalRules::supportsMultipleGeometries())
61 DUNE_THROW(Dune::InvalidStateException,
"Your MaterialLaw does not support multiple pore body shapes.");
65 cornerHalfAngles_.resize(1);
67 cornerHalfAngles_[0] = Throat::cornerHalfAngles<Scalar>(
shape);
74 const auto eIdx = this->
gridGeometry().elementMapper().index(element);
76 cornerHalfAngles_[eIdx] = Throat::cornerHalfAngles<Scalar>(
shape);
84 template<
class FS,
class ElementVolumeVariables>
85 int wettingPhase(
const Element&,
const ElementVolumeVariables& elemVolVars)
const
91 template<
class FS,
class ElementSolutionVector>
92 int wettingPhase(
const Element&,
const SubControlVolume& scv,
const ElementSolutionVector& elemSol)
const
102 template<
class ElementVolumeVariables>
104 const ElementVolumeVariables& elemVolVars)
const
106 static const Scalar theta = getParam<Scalar>(
"SpatialParams.ContactAngle", 0.0);
118 template<
class ElementSolutionVector>
120 const SubControlVolume& scv,
121 const ElementSolutionVector& elemSol)
const
123 static const Scalar theta = getParam<Scalar>(
"SpatialParams.ContactAngle", 0.0);
132 template<
class ElementVolumeVariables>
133 const Scalar
pcEntry(
const Element& element,
const ElementVolumeVariables& elemVolVars)
const
135 const auto eIdx = this->
gridGeometry().elementMapper().index(element);
137 const Scalar
surfaceTension = 0.5*(elemVolVars[0].surfaceTension() + elemVolVars[1].surfaceTension());
149 template<
class ElementVolumeVariables>
150 const Scalar
pcSnapoff(
const Element& element,
const ElementVolumeVariables& elemVolVars)
const
153 const Scalar
surfaceTension = 0.5*(elemVolVars[0].surfaceTension() + elemVolVars[1].surfaceTension());
166 template<
class ElementSolution>
168 const SubControlVolume& scv,
169 const ElementSolution& elemSol)
const
171 static const Scalar gamma = getParam<Scalar>(
"SpatialParams.SurfaceTension", 0.0725);
183 template<
class ElementSolution>
185 const SubControlVolume& scv,
186 const ElementSolution& elemSol)
const
188 const auto params =
typename LocalRules::BasicParams(*
this, element, scv, elemSol);
195 return cornerHalfAngles_[0];
198 const auto eIdx = this->
gridGeometry().gridView().indexSet().index(element);
199 return cornerHalfAngles_[eIdx];
204 std::vector<Dune::ReservedVector<Scalar, 4>> cornerHalfAngles_;
208template<
class Gr
idGeometry,
class Scalar,
class MaterialLawT>
210 TwoPDefaultSpatialParams<GridGeometry, Scalar, MaterialLawT>>
Wrapper type to combine an arbitrary number of different laws for fluid-matrix interaction (e....
Specification of threshold capillary pressures for the PNM.
The base class for spatial parameters for pore-network models.
This file contains functions related to calculate pore-body properties.
This file contains functions related to calculate pore-throat properties.
auto makeFluidMatrixInteraction(Laws &&... laws)
Helper function to create an FluidMatrixInteraction object containing an arbitrary number of fluid ma...
Definition: fluidmatrixinteraction.hh:51
Definition: discretization/porenetwork/fvelementgeometry.hh:33
constexpr Shape shape(const Scalar shapeFactor) noexcept
Returns the shape for a given shape factor.
Definition: throatproperties.hh:176
Base class for the finite volume geometry for porenetwork models.
Definition: discretization/porenetwork/gridgeometry.hh:488
static constexpr Scalar pcSnapoff(const Scalar surfaceTension, const Scalar contactAngle, const Scalar inscribedRadius) noexcept
The snap-off capillary pressure of a pore throat.
Definition: thresholdcapillarypressures.hh:36
static constexpr Scalar pcEntry(const Scalar surfaceTension, const Scalar contactAngle, const Scalar inscribedRadius, const Scalar shapeFactor) noexcept
The entry capillary pressure of a pore throat.
Definition: thresholdcapillarypressures.hh:54
The base class for spatial parameters for pore-network models.
Definition: porenetwork2p.hh:49
const Scalar pcSnapoff(const Element &element, const ElementVolumeVariables &elemVolVars) const
Return the element (throat) specific snap-off capillary pressure .
Definition: porenetwork2p.hh:150
int wettingPhase(const Element &, const SubControlVolume &scv, const ElementSolutionVector &elemSol) const
The index of the wetting phase within a pore body.
Definition: porenetwork2p.hh:92
int wettingPhase(const Element &, const ElementVolumeVariables &elemVolVars) const
The index of the wetting phase within a pore throat.
Definition: porenetwork2p.hh:85
Scalar contactAngle(const Element &element, const SubControlVolume &scv, const ElementSolutionVector &elemSol) const
The contact angle within a pore body .
Definition: porenetwork2p.hh:119
TwoPBaseSpatialParams(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: porenetwork2p.hh:57
Scalar contactAngle(const Element &element, const ElementVolumeVariables &elemVolVars) const
The contact angle within a pore throat .
Definition: porenetwork2p.hh:103
auto fluidMatrixInteraction(const Element &element, const SubControlVolume &scv, const ElementSolution &elemSol) const
Returns the parameter object for the pore-local pc-Sw law.
Definition: porenetwork2p.hh:184
const Dune::ReservedVector< Scalar, 4 > & cornerHalfAngles(const Element &element) const
Definition: porenetwork2p.hh:192
Scalar surfaceTension(const Element &element, const SubControlVolume &scv, const ElementSolution &elemSol) const
Returns the surface tension .
Definition: porenetwork2p.hh:167
const Scalar pcEntry(const Element &element, const ElementVolumeVariables &elemVolVars) const
Return the element (throat) specific entry capillary pressure .
Definition: porenetwork2p.hh:133
Definition: porenetwork2p.hh:211
The base class for spatial parameters for pore-network models.
Definition: porenetworkbase.hh:92
TwoPBaseSpatialParams< GridGeometry, Scalar, LocalRules, Implementation > & asImp_()
Definition: porenetworkbase.hh:308
Scalar throatInscribedRadius(const Element &element, const ElementVolumeVariables &elemVolVars) const
Inscribed radius of the throat . Can be solution-dependent.
Definition: porenetworkbase.hh:135
const GridGeometry & gridGeometry() const
The finite volume grid geometry.
Definition: porenetworkbase.hh:203
const GridView & gridView() const
Returns a reference to the gridview.
Definition: porenetworkbase.hh:176