Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dmitri Naumov
ogs
Commits
da5e4202
"...docs/benchmarks/hydro-component/hydro-component.pandoc" did not exist on "c346e771e0b16aa855dcc231db958b3b0ba70c82"
Commit
da5e4202
authored
3 years ago
by
Norbert Grunwald
Browse files
Options
Downloads
Patches
Plain Diff
<MPL> add unit test for MPL::SaturationExponential
parent
e1d720c3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
MaterialLib/MPL/Properties/CapillaryPressureSaturation/SaturationExponential.h
+14
-16
14 additions, 16 deletions
...rties/CapillaryPressureSaturation/SaturationExponential.h
Tests/MaterialLib/TestMPLSaturationExponential.cpp
+82
-0
82 additions, 0 deletions
Tests/MaterialLib/TestMPLSaturationExponential.cpp
with
96 additions
and
16 deletions
MaterialLib/MPL/Properties/CapillaryPressureSaturation/SaturationExponential.h
+
14
−
16
View file @
da5e4202
...
...
@@ -13,41 +13,39 @@
*/
#pragma once
#include
<limits>
#include
"MaterialLib/MPL/Property.h"
namespace
MaterialPropertyLib
{
/**
* \brief A simplistic soil characteristics function
* \details This property must be a medium property
, i
t
* \brief A simplistic soil characteristics function
.
* \details This property must be a medium property
. I
t
* computes the saturation of the wetting phase as function
* of capillary pressure.
*
*
Very simpl
e capillary pressure-saturation relationship given by
* \f$s_{eff}=1-\left(\frac{p_{c}}{p_{c}^{ref}}\right)^{\lambda}\f$
*
Th
e capillary pressure-saturation relationship given by
* \f$s_{eff}=1-\left(\frac{p_{c}}{p_{c}^{ref}}\right)^{\lambda}\f$
,
* where
* \f$\lambda\f$ is an exponent
* \f$p_{c}\f$ is capillary pressure
* \f$p_{c}^{ref}\f$ is reference capillary pressure at which \f$s_{eff}=0\f$
* \f$\lambda\f$ is an exponent,
* \f$p_{c}\f$ is capillary pressure,
* \f$p_{c}^{ref}\f$ is reference capillary pressure at which \f$s_{eff}=0\f$.
*
* This property can mainly be used for testing. If the exponent is set to 1,
* the characteristic curve shows a linear dependence.
*
*
* Reference capillary pressure at which \f$s_{eff}=0\f$
*
* Reference capillary pressure at which \f$s_{eff}=0\f$.
*/
class
SaturationExponential
final
:
public
Property
{
private:
const
double
residual_liquid_saturation_
;
/// Residual saturation of the gas phase.
residual_liquid_saturation_
;
///
<
Residual saturation of the gas phase.
const
double
residual_gas_saturation_
;
/// Residual saturation of the liquid phase.
const
double
p_cap_ref_
;
/// Reference capillary pressure at which
/// effective saturation is zero.
const
double
exponent_
;
/// Exponent to govern the shape of the curve
residual_gas_saturation_
;
///
<
Residual saturation of the liquid phase.
const
double
p_cap_ref_
;
///
<
Reference capillary pressure at which
///
effective saturation is zero.
const
double
exponent_
;
///
<
Exponent to govern the shape of the curve
.
public:
SaturationExponential
(
std
::
string
name
,
...
...
This diff is collapsed.
Click to expand it.
Tests/MaterialLib/TestMPLSaturationExponential.cpp
0 → 100644
+
82
−
0
View file @
da5e4202
/**
* \file
* \copyright
* Copyright (c) 2012-2021, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*/
#include
<gtest/gtest.h>
#include
<iomanip>
#include
"MaterialLib/MPL/Medium.h"
#include
"MaterialLib/MPL/Properties/CapillaryPressureSaturation/SaturationExponential.h"
#include
"TestMPL.h"
#include
"Tests/TestTools.h"
namespace
MPL
=
MaterialPropertyLib
;
TEST
(
MaterialPropertyLib
,
SaturationExponential
)
{
double
const
residual_liquid_saturation
=
0.1
;
double
const
residual_gas_saturation
=
0.05
;
double
const
exponent
=
1.5
;
double
const
p_cap_ref
=
30000
;
MPL
::
Property
const
&
saturation
=
MPL
::
SaturationExponential
{
"saturation"
,
residual_liquid_saturation
,
residual_gas_saturation
,
p_cap_ref
,
exponent
};
MPL
::
VariableArray
variable_array
;
ParameterLib
::
SpatialPosition
const
pos
;
double
const
t
=
std
::
numeric_limits
<
double
>::
quiet_NaN
();
double
const
dt
=
std
::
numeric_limits
<
double
>::
quiet_NaN
();
double
const
p_0
=
-
p_cap_ref
;
double
const
p_max
=
1.5
*
p_cap_ref
;
int
const
n_steps
=
9999
;
for
(
int
i
=
0
;
i
<=
n_steps
;
++
i
)
{
double
const
p_cap
=
p_0
+
i
*
(
p_max
-
p_0
)
/
n_steps
;
variable_array
[
static_cast
<
int
>
(
MPL
::
Variable
::
capillary_pressure
)]
=
p_cap
;
double
const
s_res
=
residual_liquid_saturation
;
double
const
s_max
=
1.
-
residual_gas_saturation
;
double
const
s_eff
=
1.
-
std
::
pow
(
std
::
clamp
(
p_cap
,
0.
,
p_cap_ref
)
/
p_cap_ref
,
exponent
);
double
s_ref
=
s_eff
*
(
s_max
-
s_res
)
+
s_res
;
double
const
S
=
saturation
.
template
value
<
double
>(
variable_array
,
pos
,
t
,
dt
);
double
const
dS
=
saturation
.
template
dValue
<
double
>(
variable_array
,
MPL
::
Variable
::
capillary_pressure
,
pos
,
t
,
dt
);
double
const
eps
=
1e-2
;
variable_array
[
static_cast
<
int
>
(
MPL
::
Variable
::
capillary_pressure
)]
=
p_cap
-
eps
;
double
const
S_minus
=
saturation
.
template
value
<
double
>(
variable_array
,
pos
,
t
,
dt
);
variable_array
[
static_cast
<
int
>
(
MPL
::
Variable
::
capillary_pressure
)]
=
p_cap
+
eps
;
double
const
S_plus
=
saturation
.
template
value
<
double
>(
variable_array
,
pos
,
t
,
dt
);
double
const
dS_ref
=
p_cap
>
0
?
(
S_plus
-
S_minus
)
/
2
/
eps
:
0.
;
ASSERT_LE
(
std
::
abs
(
s_ref
-
S
),
1e-9
)
<<
std
::
setprecision
(
16
)
<<
"with:
\n
capillary pressure: "
<<
p_cap
<<
"
\n
saturation: "
<<
S
<<
"
\n
saturation_ref = "
<<
s_ref
<<
"
\n
at point: "
<<
i
;
ASSERT_LE
(
std
::
abs
(
dS
-
dS_ref
),
1e-9
)
<<
std
::
setprecision
(
16
)
<<
"with:
\n
p_cap: "
<<
p_cap
<<
"
\n
S: "
<<
S
<<
"
\n
S_ref = "
<<
s_ref
<<
"
\n
dS = "
<<
dS
<<
"
\n
dS_ref = "
<<
dS_ref
<<
"
\n
at point: "
<<
i
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment