24#ifndef DUMUX_PNM_BASE_THROAT_PROPERTIES_HH
25#define DUMUX_PNM_BASE_THROAT_PROPERTIES_HH
31#include <dune/common/exceptions.hh>
32#include <dune/common/reservedvector.hh>
52 default: DUNE_THROW(Dune::InvalidStateException,
"Unknown shape!");
66 else DUNE_THROW(Dune::InvalidStateException, s <<
" is not a valid shape");
80inline Scalar
averagedRadius(
const Scalar poreRadiusOne,
const Scalar poreRadiusTwo,
const Scalar centerTocenterDist,
const Scalar n = 0.1)
83 using std::sin;
using std::cos;
using std::pow;
84 const Scalar rOneTilde = poreRadiusOne/centerTocenterDist;
85 const Scalar rTwoTilde = poreRadiusTwo/centerTocenterDist;
86 const Scalar a = sin(M_PI/4.0);
87 const Scalar b = cos(M_PI/4.0);
88 const Scalar rhoOne = rOneTilde*a / pow((1.0 - rOneTilde*b), n);
89 const Scalar rhoTwo = rTwoTilde*a / pow((1.0 - rTwoTilde*b), n);
90 const Scalar rTilde = rhoOne*rhoTwo * pow((pow(rhoOne, 1.0/n) + pow(rhoTwo, 1.0/n)), -n);
91 return rTilde * centerTocenterDist;
103 const Scalar value = M_PI/6.0;
104 return Dune::ReservedVector<Scalar, 4>{value, value, value};
108 const Scalar value = M_PI/4.0;
109 return Dune::ReservedVector<Scalar, 4>{value, value, value, value};
113 const Scalar value = M_PI/4.0;
114 return Dune::ReservedVector<Scalar, 4>{value, value, value, value};
118 const Scalar value = 0.5*M_PI;
121 case Shape::polygon: DUNE_THROW(Dune::InvalidStateException,
"Corner half angles for polygons must be calculated explicitly");
122 default: DUNE_THROW(Dune::InvalidStateException,
"Unknown shape");
128template<
class Scalar>
132 return sqrt(3.0)/36.0;
136template<
class Scalar>
143template<
class Scalar>
146 const Scalar a = 2.0*inscribedRadius;
147 const Scalar b = height;
148 const Scalar area = a*b;
149 const Scalar perimeter = 2.0*a + 2.0*b;
150 return area / (perimeter*perimeter);
154template<
class Scalar>
157 return 1.0/(4.0*M_PI);
161template<
class Scalar>
170 case Shape::polygon: DUNE_THROW(Dune::InvalidStateException,
"The shape factor for a polygon has to be defined by the input data");
171 default: DUNE_THROW(Dune::InvalidStateException,
"Unknown shape");
176template<
class Scalar>
179 if (
shapeFactor < shapeFactorEquilateralTriangle<Scalar>())
181 else if (
shapeFactor <= shapeFactorEquilateralTriangle<Scalar>())
183 else if (
shapeFactor < shapeFactorSquare<Scalar>())
185 else if (
shapeFactor == shapeFactorSquare<Scalar>())
187 else if (
shapeFactor == shapeFactorCircle<Scalar>())
203 case Shape::polygon: DUNE_THROW(Dune::InvalidStateException,
"Equality of Corner half angles for polygons must be determined explicitly");
205 DUNE_THROW(Dune::InvalidStateException,
"Unknown shape");
210template<
class Scalar>
217 case Shape::square:
return 4.0*inscribedRadius*inscribedRadius;
218 case Shape::circle:
return M_PI*inscribedRadius*inscribedRadius;
220 default : DUNE_THROW(Dune::InvalidStateException,
"Unsupported geometry: " <<
shapeToString(
shape));
225template<
class Scalar>
228 return 2.0*inscribedRadius * height;
241 default : DUNE_THROW(Dune::InvalidStateException,
"Unsupported geometry: " <<
shapeToString(
shape));
254template<
class Scalar>
256 const Scalar contactAngle,
257 const Scalar cornerHalfAngle)
noexcept
261 return curvatureRadius*curvatureRadius *(cos(contactAngle) * cos(contactAngle + cornerHalfAngle) / sin(cornerHalfAngle)
262 + cornerHalfAngle + contactAngle - M_PI/2.0);
Definition: throatproperties.hh:34
constexpr Scalar totalCrossSectionalAreaForRectangle(const Scalar inscribedRadius, const Scalar height) noexcept
Returns the cross-sectional area of a rectangle.
Definition: throatproperties.hh:226
constexpr Scalar shapeFactorSquare() noexcept
Returns the value of the shape factor for a square.
Definition: throatproperties.hh:137
constexpr Shape shape(const Scalar shapeFactor) noexcept
Returns the shape for a given shape factor.
Definition: throatproperties.hh:177
constexpr Scalar shapeFactorRectangle(const Scalar inscribedRadius, const Scalar height) noexcept
Returns the value of the shape factor for a rectangle.
Definition: throatproperties.hh:144
constexpr Scalar shapeFactorEquilateralTriangle() noexcept
Returns the value of the shape factor for an equilateral triangle.
Definition: throatproperties.hh:129
std::size_t numCorners(Shape shape)
Returns the number of corners of a given geometry.
Definition: throatproperties.hh:232
constexpr Scalar wettingLayerCrossSectionalArea(const Scalar curvatureRadius, const Scalar contactAngle, const Scalar cornerHalfAngle) noexcept
Return the cross-sectional area of a wetting layer residing in a corner of a throat.
Definition: throatproperties.hh:255
Dune::ReservedVector< Scalar, 4 > cornerHalfAngles(Shape shape)
Returns the corner half angle.
Definition: throatproperties.hh:97
Scalar totalCrossSectionalArea(const Shape shape, const Scalar inscribedRadius)
Returns the cross-sectional area of a given geometry.
Definition: throatproperties.hh:211
Shape shapeFromString(const std::string &s)
Get the shape from a string description of the shape.
Definition: throatproperties.hh:57
Shape
Collection of different pore-throat shapes.
Definition: throatproperties.hh:38
constexpr Scalar shapeFactorCircle() noexcept
Returns the value of the shape factor for a circle.
Definition: throatproperties.hh:155
Scalar shapeFactor(Shape shape, const Scalar inscribedRadius)
Returns the value of the shape factor for a given shape.
Definition: throatproperties.hh:162
std::string shapeToString(Shape s)
Get the shape from a string description of the shape.
Definition: throatproperties.hh:41
bool isRegularShape(Shape shape)
Returns if a shape is regular.
Definition: throatproperties.hh:194
Scalar averagedRadius(const Scalar poreRadiusOne, const Scalar poreRadiusTwo, const Scalar centerTocenterDist, const Scalar n=0.1)
Returns the radius of a pore throat.
Definition: throatproperties.hh:80