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 return Dune::ReservedVector<Scalar, 4>{};
120 case Shape::polygon: DUNE_THROW(Dune::InvalidStateException,
"Corner half angles for polygons must be calculated explicitly");
121 default: DUNE_THROW(Dune::InvalidStateException,
"Unkown shape");
127template<
class Scalar>
131 return sqrt(3.0)/36.0;
135template<
class Scalar>
142template<
class Scalar>
145 const Scalar a = 2.0*inscribedRadius;
146 const Scalar b = height;
147 const Scalar area = a*b;
148 const Scalar perimeter = 2.0*a + 2.0*b;
149 return area / (perimeter*perimeter);
153template<
class Scalar>
156 return 1.0/(4.0*M_PI);
160template<
class Scalar>
169 case Shape::polygon: DUNE_THROW(Dune::InvalidStateException,
"The shape factor for a polygon has to be defined by the input data");
170 default: DUNE_THROW(Dune::InvalidStateException,
"Unkown shape");
175template<
class Scalar>
178 if (
shapeFactor < shapeFactorEquilateralTriangle<Scalar>())
180 else if (
shapeFactor <= shapeFactorEquilateralTriangle<Scalar>())
182 else if (
shapeFactor < shapeFactorSquare<Scalar>())
184 else if (
shapeFactor == shapeFactorSquare<Scalar>())
186 else if (
shapeFactor == shapeFactorCircle<Scalar>())
193template<
class Scalar>
200 case Shape::square:
return 4.0*inscribedRadius*inscribedRadius;
201 case Shape::circle:
return M_PI*inscribedRadius*inscribedRadius;
203 default : DUNE_THROW(Dune::InvalidStateException,
"Unsupported geometry: " <<
shapeToString(
shape));
208template<
class Scalar>
211 return 2.0*inscribedRadius * height;
224 default : DUNE_THROW(Dune::InvalidStateException,
"Unsupported geometry: " <<
shapeToString(
shape));
237template<
class Scalar>
239 const Scalar contactAngle,
240 const Scalar cornerHalfAngle)
noexcept
244 return curvatureRadius*curvatureRadius *(cos(contactAngle) * cos(contactAngle + cornerHalfAngle) / sin(cornerHalfAngle)
245 + 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:209
constexpr Scalar shapeFactorSquare() noexcept
Returns the value of the shape factor for a square.
Definition: throatproperties.hh:136
constexpr Shape shape(const Scalar shapeFactor) noexcept
Returns the shape for a given shape factor.
Definition: throatproperties.hh:176
constexpr Scalar shapeFactorRectangle(const Scalar inscribedRadius, const Scalar height) noexcept
Returns the value of the shape factor for a rectangle.
Definition: throatproperties.hh:143
constexpr Scalar shapeFactorEquilateralTriangle() noexcept
Returns the value of the shape factor for an equilateral triangle.
Definition: throatproperties.hh:128
std::size_t numCorners(Shape shape)
Returns the number of corners of a given geometry.
Definition: throatproperties.hh:215
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:238
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:194
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 cicle.
Definition: throatproperties.hh:154
Scalar shapeFactor(Shape shape, const Scalar inscribedRadius)
Returns the value of the shape factor for a given shape.
Definition: throatproperties.hh:161
std::string shapeToString(Shape s)
Get the shape from a string description of the shape.
Definition: throatproperties.hh:41
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