3.6-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
thresholdcapillarypressures.hh
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3/*****************************************************************************
4 * See the file COPYING for full copying permissions. *
5 * *
6 * This program is free software: you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation, either version 3 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
18 *****************************************************************************/
19
26#ifndef DUMUX_PNM_THRESHOLD_CAPILLARY_PRESSURES_HH
27#define DUMUX_PNM_THRESHOLD_CAPILLARY_PRESSURES_HH
28
29#include <cmath>
30
31#include <dune/common/exceptions.hh>
33
35
42template <class Scalar>
43Scalar pcSnapoffRegularShape(const Scalar surfaceTension,
44 const Scalar contactAngle,
45 const Scalar inscribedRadius,
46 const Throat::Shape shape) noexcept
47{
48 using std::cos;
49 using std::sin;
50
51 const Scalar cornerHalfAngle = Throat::cornerHalfAngles<Scalar>(shape)[0];
52
53 // check if snap-off is possible with such contact angle and corner half-angle
54 // if the criteriun is not fulfilled, return the lowest negative value to make sure that snap-off will not happen
55 if (cornerHalfAngle + contactAngle >= 0.5*M_PI)
56 return std::numeric_limits<Scalar>::lowest();
57
58 const Scalar cosContactAngle = cos(contactAngle);
59 const Scalar sinContactAngle = sin(contactAngle);
60
61 // Get tangent of corner half-angle
62 const Scalar tanCornerHalfAngle = [&]{ switch (shape){ // optimized tan(corner half-angle) for certain shapes
63 case Throat::Shape::equilateralTriangle: return 0.577;
64 case Throat::Shape::square: return 1.0;
65 default: using std::tan; return tan(cornerHalfAngle);
66 }}();
67
68 return surfaceTension / inscribedRadius * (cosContactAngle - sinContactAngle * tanCornerHalfAngle);
69}
70
71
76template <class Scalar>
77Scalar pcSnapoff(const Scalar surfaceTension,
78 const Scalar contactAngle,
79 const Scalar inscribedRadius,
80 const Throat::Shape shape)
81{
82 if (Throat::isRegularShape(shape)) // call the pc snap-off calculated for regular shapes(same corner angles and side length)
83 return pcSnapoffRegularShape(surfaceTension, contactAngle, inscribedRadius, shape);
84 else
85 DUNE_THROW(Dune::NotImplemented, "Pc snap-off is not implemented for this irregular shape");
86}
87
93template<class Scalar>
94Scalar pcEntry(const Scalar surfaceTension,
95 const Scalar contactAngle,
96 const Scalar inscribedRadius,
97 const Scalar shapeFactor) noexcept
98{
99 using std::sin;
100 using std::cos;
101 using std::sqrt;
102
103 const Scalar cosContactAngle = cos(contactAngle);
104 const Scalar sinContactAngle = sin(contactAngle);
105
106 const Scalar D = M_PI - 3*contactAngle + 3*sinContactAngle*cosContactAngle - (cosContactAngle*cosContactAngle) / (4*shapeFactor);
107 const Scalar F = (1 + sqrt(1 + 4*shapeFactor*D / (cosContactAngle*cosContactAngle))) / (1 + 2*sqrt(M_PI*shapeFactor));
108 return surfaceTension / inscribedRadius * cosContactAngle * (1 + 2*sqrt(M_PI*shapeFactor)) * F;
109}
110
111} // namespace Dumux::PoreNetwork::ThresholdCapillaryPressures
112
113#endif
This file contains functions related to calculate pore-throat properties.
Definition: thresholdcapillarypressures.hh:34
Scalar pcSnapoff(const Scalar surfaceTension, const Scalar contactAngle, const Scalar inscribedRadius, const Throat::Shape shape)
The snap-off capillary pressure of a pore throat It checks if the cross section shape of the throat i...
Definition: thresholdcapillarypressures.hh:77
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:94
Scalar pcSnapoffRegularShape(const Scalar surfaceTension, const Scalar contactAngle, const Scalar inscribedRadius, const Throat::Shape shape) noexcept
The snap-off capillary pressure of a pore throat with regular cross section shape (with same corner a...
Definition: thresholdcapillarypressures.hh:43
constexpr Shape shape(const Scalar shapeFactor) noexcept
Returns the shape for a given shape factor.
Definition: throatproperties.hh:177
Shape
Collection of different pore-throat shapes.
Definition: throatproperties.hh:38
Scalar shapeFactor(Shape shape, const Scalar inscribedRadius)
Returns the value of the shape factor for a given shape.
Definition: throatproperties.hh:162
bool isRegularShape(Shape shape)
Returns if a shape is regular.
Definition: throatproperties.hh:194