HydroFemPhysics
The GeMA Hydraulic FEM Physics Plugin
Loading...
Searching...
No Matches
gmpMaterialLiakopoulos.h
Go to the documentation of this file.
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_LIAKOPOULOS_H_
31#define _GEMA_PLUGIN_HYDRAULIC_MATERIAL_LIAKOPOULOS_H_
32
33namespace GmpHydraulicMaterialLiakopoulos
34{
35 // -----------------------------------------------------------------------------------------------------------
36 // ! Returns the liquid saturation
37 // ! Considers that the capillary pressure Pc is given in kPa
38 double liquidSaturation(double Pc)
39 {
40 S_TRACE();
41
42 const double A = 1.9722e-11;
43 const double B = 2.4279;
44 const double SL_MIN = 0.2;
45
46 // Sl can update according to the capillary pressure
47 const double Sl = (Pc < 0.0) ? 1.0 : 1.0 - A * std::pow(1000 * Pc, B);
48
49 // return liquid saturation
50 return std::clamp(Sl, SL_MIN, 1.0);
51 }
52
53 // -----------------------------------------------------------------------------------------------------------
56 double derivativeLiquidSaturation(double Pc)
57 {
58 S_TRACE();
59
60 const double a = 1.9722e-11;
61 const double b = 2.4279;
62 const double Slmin = 0.2;
63
64 // Sl can update according to the capillary pressure
65 if (Pc < 0.0)
66 return 0.0;
67 else
68 {
69 double pcmax = std::pow((1.0 - Slmin) / a,(1.0 / b));
70 return - 1000 * a * b * std::pow(std::min(1000 * Pc, pcmax), b-1);
71 }
72 }
73
74 // -----------------------------------------------------------------------------------------------------------
76 double liquidRelativePermeability(double Sl)
77 {
78 S_TRACE();
79
80 const double a = 2.207;
81 const double b = 1.0121;
82 const double Slmin = 0.2;
83
84 double klr;
85
86 if (Sl < Slmin)
87 return 0.0;
88 else if (Sl > 1.0)
89 return 1.0;
90 else
91 return 1.0 - a * std::pow(1.0 - Sl, b);
92
93 }
94
95 // -----------------------------------------------------------------------------------------------------------
97 double derivativeLiquidRelativePermeability(double Sl)
98 {
99 S_TRACE();
100
101 double a = 2.207;
102 double b = 1.0121;
103 double Slmin = 0.2;
104
105 if (Sl < Slmin)
106 return 0.0;
107 else if(Sl > 1.0)
108 return 0.0;
109 else
110 return a * b * std::pow(1.0 - Sl, b - 1.0);
111
112 }
113};
114#endif
#define S_TRACE()