12#ifndef DUMUX_PNM_BASE_THROAT_PROPERTIES_HH
13#define DUMUX_PNM_BASE_THROAT_PROPERTIES_HH
19#include <dune/common/exceptions.hh>
20#include <dune/common/reservedvector.hh>
40 default: DUNE_THROW(Dune::InvalidStateException,
"Unknown shape!");
54 else DUNE_THROW(Dune::InvalidStateException, s <<
" is not a valid shape");
68inline Scalar
averagedRadius(
const Scalar poreRadiusOne,
const Scalar poreRadiusTwo,
const Scalar centerTocenterDist,
const Scalar n = 0.1)
71 using std::sin;
using std::cos;
using std::pow;
72 const Scalar rOneTilde = poreRadiusOne/centerTocenterDist;
73 const Scalar rTwoTilde = poreRadiusTwo/centerTocenterDist;
74 const Scalar a = sin(M_PI/4.0);
75 const Scalar b = cos(M_PI/4.0);
76 const Scalar rhoOne = rOneTilde*a / pow((1.0 - rOneTilde*b), n);
77 const Scalar rhoTwo = rTwoTilde*a / pow((1.0 - rTwoTilde*b), n);
78 const Scalar rTilde = rhoOne*rhoTwo * pow((pow(rhoOne, 1.0/n) + pow(rhoTwo, 1.0/n)), -n);
79 return rTilde * centerTocenterDist;
91 const Scalar value = M_PI/6.0;
92 return Dune::ReservedVector<Scalar, 4>{value, value, value};
96 const Scalar value = M_PI/4.0;
97 return Dune::ReservedVector<Scalar, 4>{value, value, value, value};
101 const Scalar value = M_PI/4.0;
102 return Dune::ReservedVector<Scalar, 4>{value, value, value, value};
106 const Scalar value = 0.5*M_PI;
109 case Shape::polygon: DUNE_THROW(Dune::InvalidStateException,
"Corner half angles for polygons must be calculated explicitly");
110 default: DUNE_THROW(Dune::InvalidStateException,
"Unknown shape");
116template<
class Scalar>
120 return sqrt(3.0)/36.0;
124template<
class Scalar>
131template<
class Scalar>
134 const Scalar a = 2.0*inscribedRadius;
135 const Scalar b = height;
136 const Scalar area = a*b;
137 const Scalar perimeter = 2.0*a + 2.0*b;
138 return area / (perimeter*perimeter);
142template<
class Scalar>
145 return 1.0/(4.0*M_PI);
149template<
class Scalar>
158 case Shape::polygon: DUNE_THROW(Dune::InvalidStateException,
"The shape factor for a polygon has to be defined by the input data");
159 default: DUNE_THROW(Dune::InvalidStateException,
"Unknown shape");
164template<
class Scalar>
167 if (
shapeFactor < shapeFactorEquilateralTriangle<Scalar>())
169 else if (
shapeFactor <= shapeFactorEquilateralTriangle<Scalar>())
171 else if (
shapeFactor < shapeFactorSquare<Scalar>())
173 else if (
shapeFactor == shapeFactorSquare<Scalar>())
175 else if (
shapeFactor == shapeFactorCircle<Scalar>())
191 case Shape::polygon: DUNE_THROW(Dune::InvalidStateException,
"Equality of Corner half angles for polygons must be determined explicitly");
193 DUNE_THROW(Dune::InvalidStateException,
"Unknown shape");
198template<
class Scalar>
205 case Shape::square:
return 4.0*inscribedRadius*inscribedRadius;
206 case Shape::circle:
return M_PI*inscribedRadius*inscribedRadius;
208 default : DUNE_THROW(Dune::InvalidStateException,
"Unsupported geometry: " <<
shapeToString(
shape));
213template<
class Scalar>
216 return 2.0*inscribedRadius * height;
229 default : DUNE_THROW(Dune::InvalidStateException,
"Unsupported geometry: " <<
shapeToString(
shape));
242template<
class Scalar>
244 const Scalar contactAngle,
245 const Scalar cornerHalfAngle)
noexcept
249 return curvatureRadius*curvatureRadius *(cos(contactAngle) * cos(contactAngle + cornerHalfAngle) / sin(cornerHalfAngle)
250 + cornerHalfAngle + contactAngle - M_PI/2.0);
Definition: throatproperties.hh:22
constexpr Scalar totalCrossSectionalAreaForRectangle(const Scalar inscribedRadius, const Scalar height) noexcept
Returns the cross-sectional area of a rectangle.
Definition: throatproperties.hh:214
constexpr Scalar shapeFactorSquare() noexcept
Returns the value of the shape factor for a square.
Definition: throatproperties.hh:125
constexpr Shape shape(const Scalar shapeFactor) noexcept
Returns the shape for a given shape factor.
Definition: throatproperties.hh:165
constexpr Scalar shapeFactorRectangle(const Scalar inscribedRadius, const Scalar height) noexcept
Returns the value of the shape factor for a rectangle.
Definition: throatproperties.hh:132
constexpr Scalar shapeFactorEquilateralTriangle() noexcept
Returns the value of the shape factor for an equilateral triangle.
Definition: throatproperties.hh:117
std::size_t numCorners(Shape shape)
Returns the number of corners of a given geometry.
Definition: throatproperties.hh:220
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:243
Dune::ReservedVector< Scalar, 4 > cornerHalfAngles(Shape shape)
Returns the corner half angle.
Definition: throatproperties.hh:85
Scalar totalCrossSectionalArea(const Shape shape, const Scalar inscribedRadius)
Returns the cross-sectional area of a given geometry.
Definition: throatproperties.hh:199
Shape shapeFromString(const std::string &s)
Get the shape from a string description of the shape.
Definition: throatproperties.hh:45
Shape
Collection of different pore-throat shapes.
Definition: throatproperties.hh:26
constexpr Scalar shapeFactorCircle() noexcept
Returns the value of the shape factor for a circle.
Definition: throatproperties.hh:143
Scalar shapeFactor(Shape shape, const Scalar inscribedRadius)
Returns the value of the shape factor for a given shape.
Definition: throatproperties.hh:150
std::string shapeToString(Shape s)
Get the shape from a string description of the shape.
Definition: throatproperties.hh:29
bool isRegularShape(Shape shape)
Returns if a shape is regular.
Definition: throatproperties.hh:182
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:68