HydroFemPhysics
The GeMA Hydraulic FEM Physics Plugin
Loading...
Searching...
No Matches
gmpMaterialVanGenuchten.h
1/************************************************************************
2**
3** Copyright (C) 2014 by Carlos Augusto Teixera Mendes
4** All rights reserved.
5**
6** This file is part of the "GeMA" software. It's use should respect
7** the terms in the license agreement that can be found together
8** with this source code.
9** It is provided AS IS, with NO WARRANTY OF ANY KIND,
10** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR
11** A PARTICULAR PURPOSE.
12**
13************************************************************************/
14
24#include <gmTrace.h>
25#include <assert.h>
26#include <cmath>
27#include <limits>
28#include <iostream>
29
30#ifndef _GEMA_PLUGIN_HYDRAULIC_MATERIAL_VANGENUCHTEN_H_
31#define _GEMA_PLUGIN_HYDRAULIC_MATERIAL_VANGENUCHTEN_H_
32
33namespace GmpHydraulicMaterialVanGenuchten
34{
35//public:
36 // -----------------------------------------------------------------------------------------------------------
38 double liquidSaturation(double Pc, double Slr, double Sgr, double Pb, double lambda)
39 {
40 S_TRACE();
41
42 // Sl can update according to the capillary pressure
43 double Sl = 1.0;
44 if (Pc >= Pb)
45 {
46 Sl = Slr + (1.0 - Slr - Sgr) * std::pow(1.0 + std::pow(Pc / Pb, lambda), (1.0 - lambda) / lambda);
47 }
48
49 // Apply limits
50 Sl = std::min(Sl, 1.0 - Sgr - std::numeric_limits<double>::epsilon()); // Upper bound
51 Sl = std::max(Sl, Slr + std::numeric_limits<double>::epsilon()); // Lower bound
52
53 // return liquid saturation
54 return Sl;
55 }
56
57 // -----------------------------------------------------------------------------------------------------------
59 double derivativeLiquidSaturation(double Sl, double Slr, double Sgr, double Pb, double lambda)
60 {
61 S_TRACE();
62
63 // Compute the effective liquid saturation degree
64 double Se = (Sl - Slr) / (1.0 - Sgr - Slr);
65
66 // Compute the derivative of the capillary pressure in relation to the liquid saturation
67 double m = 1.0 - 1.0 / lambda;
68 double v1 = std::pow(Se, (-1.0 / m));
69 double v2 = std::pow(v1 - 1.0, -m);
70 double dPcdSl = (Pb * (m - 1.0) * v1 * v2) / (m * (Sl - Slr));
71
72 return 1.0 / dPcdSl;
73 }
74
75 // -----------------------------------------------------------------------------------------------------------
77 double liquidRelativePermeability(double Se, double lambda)
78 {
79 S_TRACE();
80
81 double m = 1.0 - 1.0 / lambda;
82 double klr = std::sqrt(Se) * std::pow(1.0 - std::pow(1.0 - std::pow(Se, 1.0 / m), m), 2);
83
84 return klr;
85 }
86
87 // -----------------------------------------------------------------------------------------------------------
89 double gasRelativePermeability(double Se, double lambda)
90 {
91 S_TRACE();
92
93 // Empirical curve fitting parameter
94 double m = 1.0 - 1.0 / lambda;
95 double kgr = std::pow(1.0 - Se, 1.0 / 3.0) * std::pow(1.0 - std::pow(Se, 1.0 / m), 2.0 * m);
96
97 return kgr;
98 }
99};
100#endif
#define S_TRACE()
double derivativeLiquidSaturation(double Sl, double Slr, double Sgr, double Pb, double lambda)
Returns the derivative water saturation in relation to Pc.
Definition gmpMaterialBrooksCorey.h:61
double gasRelativePermeability(double Se, double lambda)
Returns the gas fluid relative permeability.
Definition gmpMaterialBrooksCorey.h:98
double liquidRelativePermeability(double Se, double lambda)
Returns the liquid-phase relative permeability.
Definition gmpMaterialBrooksCorey.h:76