mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Saturation Functions: Create Helpers for Retrieving Sw and Sg
Limits the amount of magic keyword references to the result vectors SWAT and SGAS.
This commit is contained in:
@@ -48,6 +48,13 @@
|
||||
#include <ert/ecl/ecl_kw_magic.h>
|
||||
|
||||
namespace {
|
||||
std::vector<double>
|
||||
gas_saturation(const ::Opm::ECLGraph& G,
|
||||
const ::Opm::ECLRestartData& rstrt)
|
||||
{
|
||||
return G.rawLinearisedCellData<double>(rstrt, "SGAS");
|
||||
}
|
||||
|
||||
std::vector<double>
|
||||
oil_saturation(const std::vector<double>& sg,
|
||||
const std::vector<double>& sw,
|
||||
@@ -84,6 +91,13 @@ namespace {
|
||||
return so;
|
||||
}
|
||||
|
||||
std::vector<double>
|
||||
water_saturation(const ::Opm::ECLGraph& G,
|
||||
const ::Opm::ECLRestartData& rstrt)
|
||||
{
|
||||
return G.rawLinearisedCellData<double>(rstrt, "SWAT");
|
||||
}
|
||||
|
||||
std::vector<int>
|
||||
satnumVector(const ::Opm::ECLGraph& G,
|
||||
const ::Opm::ECLInitFileData& init)
|
||||
@@ -1881,8 +1895,8 @@ kro(const ECLGraph& G,
|
||||
return kr;
|
||||
}
|
||||
|
||||
const auto& sg = G.rawLinearisedCellData<double>(rstrt, "SGAS");
|
||||
const auto& sw = G.rawLinearisedCellData<double>(rstrt, "SWAT");
|
||||
const auto& sg = gas_saturation(G, rstrt);
|
||||
const auto& sw = water_saturation(G, rstrt);
|
||||
|
||||
auto so_g = oil_saturation(sg, sw, G, rstrt);
|
||||
auto so_w = so_g;
|
||||
@@ -2010,7 +2024,7 @@ krg(const ECLGraph& G,
|
||||
return kr;
|
||||
}
|
||||
|
||||
auto sg = G.rawLinearisedCellData<double>(rstrt, "SGAS");
|
||||
auto sg = gas_saturation(G, rstrt);
|
||||
|
||||
if (enableHorizontalEPS(scaling) && this->eps_) {
|
||||
this->eps_->scaleKrGas(this->rmap_, sg);
|
||||
@@ -2162,7 +2176,7 @@ krw(const ECLGraph& G,
|
||||
return kr;
|
||||
}
|
||||
|
||||
auto sw = G.rawLinearisedCellData<double>(rstrt, "SWAT");
|
||||
auto sw = water_saturation(G, rstrt);
|
||||
|
||||
if (enableHorizontalEPS(scaling) && this->eps_) {
|
||||
this->eps_->scaleKrWat(this->rmap_, sw);
|
||||
|
||||
Reference in New Issue
Block a user