commit
a35520a65d
@ -47,9 +47,9 @@ namespace Opm
|
||||
const Opm::PvdoTable& pvdoTable = pvdoTables.getTable<PvdoTable>(regionIdx);
|
||||
|
||||
// Copy data
|
||||
const std::vector<double>& press = pvdoTable.getPressureColumn();
|
||||
const std::vector<double>& b_var = pvdoTable.getFormationFactorColumn();
|
||||
const std::vector<double>& visc = pvdoTable.getViscosityColumn();
|
||||
const auto& press = pvdoTable.getColumn("P");
|
||||
const auto& b_var = pvdoTable.getColumn("BO");
|
||||
const auto& visc = pvdoTable.getColumn("MUO");
|
||||
|
||||
const int sz = b_var.size();
|
||||
std::vector<double> inverseB(sz);
|
||||
@ -82,9 +82,9 @@ namespace Opm
|
||||
const Opm::PvdgTable& pvdgTable = pvdgTables.getTable<PvdgTable>(regionIdx);
|
||||
|
||||
// Copy data
|
||||
const std::vector<double>& press = pvdgTable.getPressureColumn();
|
||||
const std::vector<double>& b = pvdgTable.getFormationFactorColumn();
|
||||
const std::vector<double>& visc = pvdgTable.getViscosityColumn();
|
||||
const auto& press = pvdgTable.getColumn("P");
|
||||
const auto& b = pvdgTable.getColumn("BG");
|
||||
const auto& visc = pvdgTable.getColumn("MUG");
|
||||
|
||||
const int sz = b.size();
|
||||
std::vector<double> inverseB(sz);
|
||||
|
@ -53,9 +53,9 @@ namespace Opm
|
||||
int numRows = pvdoTable.numRows();
|
||||
|
||||
// Copy data
|
||||
const std::vector<double> &press = pvdoTable.getPressureColumn();
|
||||
const std::vector<double> &B_var = pvdoTable.getFormationFactorColumn();
|
||||
const std::vector<double> &visc = pvdoTable.getViscosityColumn();
|
||||
std::vector<double> press = pvdoTable.getColumn("P").vectorCopy();
|
||||
std::vector<double> B_var = pvdoTable.getColumn("BO").vectorCopy();
|
||||
std::vector<double> visc = pvdoTable.getColumn("MUO").vectorCopy();
|
||||
|
||||
std::vector<double> B_inv(numRows);
|
||||
for (int i = 0; i < numRows; ++i) {
|
||||
@ -82,9 +82,9 @@ namespace Opm
|
||||
int numRows = pvdgTable.numRows();
|
||||
|
||||
// Copy data
|
||||
const std::vector<double> &press = pvdgTable.getPressureColumn();
|
||||
const std::vector<double> &B = pvdgTable.getFormationFactorColumn();
|
||||
const std::vector<double> &visc = pvdgTable.getViscosityColumn();
|
||||
std::vector<double> press = pvdgTable.getColumn("P").vectorCopy();
|
||||
std::vector<double> B = pvdgTable.getColumn("BG").vectorCopy();
|
||||
std::vector<double> visc = pvdgTable.getColumn("MUG").vectorCopy();
|
||||
|
||||
std::vector<double> B_inv(numRows);
|
||||
for (int i = 0; i < numRows; ++i) {
|
||||
|
@ -55,31 +55,39 @@ namespace Opm
|
||||
|
||||
for (int pvtTableIdx = 0; pvtTableIdx < numTables; ++pvtTableIdx) {
|
||||
const Opm::PvtgTable& pvtgTable = pvtgTables[pvtTableIdx];
|
||||
|
||||
// GAS, PVTG
|
||||
const auto& saturatedPvtg = pvtgTable.getSaturatedTable( );
|
||||
// GAS, P
|
||||
// saturated_gas_table_[pvtTableIdx].resize(4);
|
||||
// Adding one extra line to PVTG to store 1./(Bg*mu_g)
|
||||
saturated_gas_table_[pvtTableIdx].resize(5);
|
||||
saturated_gas_table_[pvtTableIdx][0] = pvtgTable.getOuterTable()->getPressureColumn(); // Pressure
|
||||
saturated_gas_table_[pvtTableIdx][1] = pvtgTable.getOuterTable()->getGasFormationFactorColumn(); // Bg
|
||||
saturated_gas_table_[pvtTableIdx][2] = pvtgTable.getOuterTable()->getGasViscosityColumn(); // mu_g
|
||||
// The number of the columns
|
||||
int nRows = saturated_gas_table_[pvtTableIdx][2].size();
|
||||
saturated_gas_table_[pvtTableIdx][3].resize(nRows); // allocate memory for 1/(Bg*mu_g)
|
||||
saturated_gas_table_[pvtTableIdx][4] = pvtgTable.getOuterTable()->getOilSolubilityColumn(); // Rv
|
||||
for (int k=0; k<5; ++k) {
|
||||
saturated_gas_table_[pvtTableIdx][k].resize(saturatedPvtg.numRows());
|
||||
}
|
||||
|
||||
int sz = pvtgTable.getOuterTable()->numRows();
|
||||
for (size_t row=0; row < saturatedPvtg.numRows(); row++) {
|
||||
saturated_gas_table_[pvtTableIdx][0][row] = saturatedPvtg.get("PG" , row); // Pressure
|
||||
saturated_gas_table_[pvtTableIdx][1][row] = saturatedPvtg.get("BG" , row); // Bg
|
||||
saturated_gas_table_[pvtTableIdx][2][row] = saturatedPvtg.get("MUG" , row); // mu_g
|
||||
// 1/Bg will go in [3]
|
||||
saturated_gas_table_[pvtTableIdx][4][row] = saturatedPvtg.get("RV" , row); // Rv
|
||||
}
|
||||
|
||||
|
||||
int sz = saturatedPvtg.numRows();
|
||||
undersat_gas_tables_[pvtTableIdx].resize(sz);
|
||||
for (int i=0; i<sz; ++i) {
|
||||
const auto &undersatTable = *pvtgTable.getInnerTable(i);
|
||||
const auto &undersatTable = pvtgTable.getUnderSaturatedTable(i);
|
||||
|
||||
// undersat_gas_tables_[pvtTableIdx][i].resize(3);
|
||||
undersat_gas_tables_[pvtTableIdx][i].resize(4);
|
||||
undersat_gas_tables_[pvtTableIdx][i][0] = undersatTable.getOilSolubilityColumn(); // Rv
|
||||
undersat_gas_tables_[pvtTableIdx][i][1] = undersatTable.getGasFormationFactorColumn(); // Bg
|
||||
undersat_gas_tables_[pvtTableIdx][i][2] = undersatTable.getGasViscosityColumn(); // mu_g
|
||||
int nUndersatRows = undersat_gas_tables_[pvtTableIdx][i][2].size();
|
||||
undersat_gas_tables_[pvtTableIdx][i][3].resize(nUndersatRows); // allocate memory for 1/(Bg*mu_g)
|
||||
for (size_t j=0; j < 4; j++) {
|
||||
undersat_gas_tables_[pvtTableIdx][i][j].resize( undersatTable.numRows() );
|
||||
}
|
||||
|
||||
for (size_t row=0; row < undersatTable.numRows(); row++) {
|
||||
undersat_gas_tables_[pvtTableIdx][i][0][row] = undersatTable.get("RV" , row); // Rv
|
||||
undersat_gas_tables_[pvtTableIdx][i][1][row] = undersatTable.get("BG" , row); // Bg
|
||||
undersat_gas_tables_[pvtTableIdx][i][2][row] = undersatTable.get("MUG" , row); // mu_g
|
||||
}
|
||||
}
|
||||
|
||||
// Bg -> 1/Bg
|
||||
|
@ -41,46 +41,46 @@ namespace Opm
|
||||
undersat_oil_tables_.resize(numTables);
|
||||
|
||||
for (int pvtTableIdx = 0; pvtTableIdx < numTables; ++pvtTableIdx) {
|
||||
Opm::PvtoTable pvtoTable = pvtoTables[pvtTableIdx];
|
||||
const Opm::PvtoTable& pvtoTable = pvtoTables[pvtTableIdx];
|
||||
|
||||
const auto saturatedPvto = pvtoTable.getOuterTable();
|
||||
const auto& saturatedPvto = pvtoTable.getSaturatedTable();
|
||||
|
||||
// OIL, PVTO
|
||||
// saturated_oil_table_[pvtTableIdx].resize(4);
|
||||
// adding a extra colummn to the PVTO to store 1/(B*mu)
|
||||
saturated_oil_table_[pvtTableIdx].resize(5);
|
||||
const int sz = saturatedPvto->numRows();
|
||||
const int sz = saturatedPvto.numRows();
|
||||
// for (int k=0; k<4; ++k) {
|
||||
for (int k=0; k<5; ++k) {
|
||||
saturated_oil_table_[pvtTableIdx][k].resize(sz);
|
||||
}
|
||||
for (int i=0; i<sz; ++i) {
|
||||
saturated_oil_table_[pvtTableIdx][0][i] = saturatedPvto->getPressureColumn()[i]; // p
|
||||
saturated_oil_table_[pvtTableIdx][1][i] = 1.0/saturatedPvto->getOilFormationFactorColumn()[i]; // 1/Bo
|
||||
saturated_oil_table_[pvtTableIdx][2][i] = saturatedPvto->getOilViscosityColumn()[i]; // mu_o
|
||||
saturated_oil_table_[pvtTableIdx][3][i] = 1.0 / (saturatedPvto->getOilFormationFactorColumn()[i]
|
||||
* saturatedPvto->getOilViscosityColumn()[i]); // 1/(Bo*mu_o)
|
||||
saturated_oil_table_[pvtTableIdx][4][i] = saturatedPvto->getGasSolubilityColumn()[i]; // Rs
|
||||
saturated_oil_table_[pvtTableIdx][0][i] = saturatedPvto.get("P" , i); // P
|
||||
saturated_oil_table_[pvtTableIdx][1][i] = 1.0/saturatedPvto.get("BO" , i); // BO
|
||||
saturated_oil_table_[pvtTableIdx][2][i] = saturatedPvto.get("MU" , i); // MU
|
||||
saturated_oil_table_[pvtTableIdx][3][i] = 1.0 / (saturatedPvto.get("BO" , i)
|
||||
* saturatedPvto.get("MU" , i));; // 1/(Bo*mu_o)
|
||||
saturated_oil_table_[pvtTableIdx][4][i] = saturatedPvto.get("RS" , i); // RS
|
||||
}
|
||||
|
||||
undersat_oil_tables_[pvtTableIdx].resize(sz);
|
||||
for (int i=0; i<sz; ++i) {
|
||||
const auto undersaturatedPvto = pvtoTable.getInnerTable(i);
|
||||
const auto& undersaturatedPvto = pvtoTable.getUnderSaturatedTable( i );
|
||||
|
||||
// undersat_oil_tables_[pvtTableIdx][i].resize(3);
|
||||
// adding a extra colummn to the PVTO to store 1/(B*mu)
|
||||
undersat_oil_tables_[pvtTableIdx][i].resize(4);
|
||||
int tsize = undersaturatedPvto->numRows();
|
||||
int tsize = undersaturatedPvto.numRows();
|
||||
undersat_oil_tables_[pvtTableIdx][i][0].resize(tsize);
|
||||
undersat_oil_tables_[pvtTableIdx][i][1].resize(tsize);
|
||||
undersat_oil_tables_[pvtTableIdx][i][2].resize(tsize);
|
||||
undersat_oil_tables_[pvtTableIdx][i][3].resize(tsize);
|
||||
for (int j=0; j<tsize; ++j) {
|
||||
undersat_oil_tables_[pvtTableIdx][i][0][j] = undersaturatedPvto->getPressureColumn()[j]; // p
|
||||
undersat_oil_tables_[pvtTableIdx][i][1][j] = 1.0/undersaturatedPvto->getOilFormationFactorColumn()[j]; // 1/Bo
|
||||
undersat_oil_tables_[pvtTableIdx][i][2][j] = undersaturatedPvto->getOilViscosityColumn()[j]; // mu_o
|
||||
undersat_oil_tables_[pvtTableIdx][i][3][j] = 1.0 / (undersaturatedPvto->getOilFormationFactorColumn()[j] *
|
||||
undersaturatedPvto->getOilViscosityColumn()[j]); // 1/(Bo*mu_o)
|
||||
undersat_oil_tables_[pvtTableIdx][i][0][j] = undersaturatedPvto.get("P" , j); // P
|
||||
undersat_oil_tables_[pvtTableIdx][i][1][j] = 1.0/undersaturatedPvto.get("BO" , j); // BO
|
||||
undersat_oil_tables_[pvtTableIdx][i][2][j] = undersaturatedPvto.get("MU" , j); // MU
|
||||
undersat_oil_tables_[pvtTableIdx][i][3][j] = 1.0 / (undersaturatedPvto.get("BO", j)*
|
||||
undersaturatedPvto.get("MU", j)); // 1/(Bo*mu_o)
|
||||
}
|
||||
}
|
||||
|
||||
@ -126,9 +126,11 @@ namespace Opm
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Destructor.
|
||||
PvtLiveOil::~PvtLiveOil()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -137,8 +139,8 @@ namespace Opm
|
||||
const int* pvtTableIdx,
|
||||
const double* p,
|
||||
const double* /*T*/,
|
||||
const double* z,
|
||||
double* output_mu) const
|
||||
const double* z,
|
||||
double* output_mu) const
|
||||
{
|
||||
// #pragma omp parallel for
|
||||
for (int i = 0; i < n; ++i) {
|
||||
|
@ -50,9 +50,13 @@ namespace Opm
|
||||
if (rocktabTables.size() != 1)
|
||||
OPM_THROW(std::runtime_error, "Can only handle a single region in ROCKTAB.");
|
||||
|
||||
p_ = rocktabTable.getPressureColumn();
|
||||
poromult_ = rocktabTable.getPoreVolumeMultiplierColumn();
|
||||
transmult_ = rocktabTable.getTransmissibilityMultiplierColumn();
|
||||
p_ = rocktabTable.getColumn("PO").vectorCopy( );
|
||||
poromult_ = rocktabTable.getColumn("PV_MULT").vectorCopy();
|
||||
if (rocktabTable.hasColumn("PV_MULT_TRAN")) {
|
||||
transmult_ = rocktabTable.getColumn("PV_MULT_TRAN").vectorCopy();
|
||||
} else {
|
||||
transmult_ = rocktabTable.getColumn("PV_MULT_TRANX").vectorCopy();
|
||||
}
|
||||
} else if (deck->hasKeyword("ROCK")) {
|
||||
Opm::DeckKeywordConstPtr rockKeyword = deck->getKeyword("ROCK");
|
||||
if (rockKeyword->size() != 1) {
|
||||
|
@ -541,27 +541,25 @@ namespace Opm{
|
||||
if (fluidSystem_ == FluidSystem::BlackOil) {
|
||||
if (satFamily_ == SaturationFunctionFamily::FamilyI) {
|
||||
if (!sgofTables.empty()) {
|
||||
auto sg = sgofTables.getTable<SgofTable>(satnumIdx).getSgColumn();
|
||||
auto krog = sgofTables.getTable<SgofTable>(satnumIdx).getKrogColumn();
|
||||
krog_value=Opm::linearInterpolation(sg, krog,unscaledEpsInfo_[satnumIdx].Sgl);
|
||||
const auto& table = sgofTables.getTable<SgofTable>(satnumIdx);
|
||||
krog_value = table.evaluate( "KROG" , unscaledEpsInfo_[satnumIdx].Sgl );
|
||||
} else {
|
||||
assert(!slgofTables.empty());
|
||||
auto sl = slgofTables.getTable<SlgofTable>(satnumIdx).getSlColumn();
|
||||
auto krog = slgofTables.getTable<SlgofTable>(satnumIdx).getKrogColumn();
|
||||
krog_value=Opm::linearInterpolation(sl, krog, unscaledEpsInfo_[satnumIdx].Sgl);
|
||||
const auto& table = slgofTables.getTable<SlgofTable>(satnumIdx);
|
||||
krog_value = table.evaluate( "KROG" , unscaledEpsInfo_[satnumIdx].Sgl );
|
||||
}
|
||||
{
|
||||
const auto& table = swofTables.getTable<SwofTable>(satnumIdx);
|
||||
krow_value = table.evaluate("KROW" , unscaledEpsInfo_[satnumIdx].Swl);
|
||||
}
|
||||
auto sw = swofTables.getTable<SwofTable>(satnumIdx).getSwColumn();
|
||||
auto krow = swofTables.getTable<SwofTable>(satnumIdx).getKrowColumn();
|
||||
krow_value = Opm::linearInterpolation(sw, krow,unscaledEpsInfo_[satnumIdx].Swl);
|
||||
}
|
||||
if (satFamily_ == SaturationFunctionFamily::FamilyII) {
|
||||
assert(!sof3Tables.empty());
|
||||
const auto& table = sof3Tables.getTable<Sof3Table>(satnumIdx);
|
||||
const double Sou = 1.- unscaledEpsInfo_[satnumIdx].Swl - unscaledEpsInfo_[satnumIdx].Sgl;
|
||||
auto so = sof3Tables.getTable<Sof3Table>(satnumIdx).getSoColumn();
|
||||
auto krow = sof3Tables.getTable<Sof3Table>(satnumIdx).getKrowColumn();
|
||||
auto krog = sof3Tables.getTable<Sof3Table>(satnumIdx).getKrogColumn();
|
||||
krow_value = Opm::linearInterpolation(so, krow, Sou);
|
||||
krog_value = Opm::linearInterpolation(so, krog, Sou);
|
||||
|
||||
krow_value = table.evaluate("KROW" , Sou);
|
||||
krog_value = table.evaluate("KROG" , Sou);
|
||||
}
|
||||
if (krow_value != krog_value) {
|
||||
std::string msg = "Warning: Krow(sSomax) should equal Krog(Somax).";
|
||||
|
@ -294,10 +294,11 @@ namespace Opm
|
||||
if (rec[i].live_oil_table_index > 0) {
|
||||
if (rsvdTables.size() > 0 && size_t(rec[i].live_oil_table_index) <= rsvdTables.size()) {
|
||||
const RsvdTable& rsvdTable = rsvdTables.getTable<RsvdTable>(i);
|
||||
std::vector<double> depthColumn = rsvdTable.getColumn("DEPTH").vectorCopy();
|
||||
std::vector<double> rsColumn = rsvdTable.getColumn("RS").vectorCopy();
|
||||
rs_func_.push_back(std::make_shared<Miscibility::RsVD>(props,
|
||||
cell,
|
||||
rsvdTable.getDepthColumn(),
|
||||
rsvdTable.getRsColumn()));
|
||||
depthColumn , rsColumn));
|
||||
} else {
|
||||
OPM_THROW(std::runtime_error, "Cannot initialise: RSVD table " << (rec[i].live_oil_table_index) << " not available.");
|
||||
}
|
||||
@ -327,10 +328,13 @@ namespace Opm
|
||||
if (rec[i].wet_gas_table_index > 0) {
|
||||
if (rvvdTables.size() > 0 && size_t(rec[i].wet_gas_table_index) <= rvvdTables.size()) {
|
||||
const RvvdTable& rvvdTable = rvvdTables.getTable<RvvdTable>(i);
|
||||
std::vector<double> depthColumn = rvvdTable.getColumn("DEPTH").vectorCopy();
|
||||
std::vector<double> rvColumn = rvvdTable.getColumn("RV").vectorCopy();
|
||||
|
||||
rv_func_.push_back(std::make_shared<Miscibility::RvVD>(props,
|
||||
cell,
|
||||
rvvdTable.getDepthColumn(),
|
||||
rvvdTable.getRvColumn()));
|
||||
depthColumn , rvColumn));
|
||||
|
||||
} else {
|
||||
OPM_THROW(std::runtime_error, "Cannot initialise: RVVD table " << (rec[i].wet_gas_table_index) << " not available.");
|
||||
}
|
||||
|
@ -27,8 +27,10 @@
|
||||
#include <utility>
|
||||
|
||||
#include <opm/common/ErrorMacros.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/TableColumn.hpp>
|
||||
#include <opm/core/utility/linearInterpolation.hpp>
|
||||
|
||||
|
||||
namespace Opm
|
||||
{
|
||||
|
||||
@ -51,6 +53,12 @@ namespace Opm
|
||||
NonuniformTableLinear(const std::vector<double>& x_values,
|
||||
const std::vector<T>& y_values);
|
||||
|
||||
NonuniformTableLinear(const TableColumn& x_column,
|
||||
const std::vector<T>& y_values);
|
||||
|
||||
NonuniformTableLinear(const TableColumn& x_column,
|
||||
const TableColumn& y_column);
|
||||
|
||||
/// @brief Get the domain.
|
||||
/// @return the domain as a pair of doubles.
|
||||
std::pair<double, double> domain();
|
||||
@ -120,6 +128,32 @@ namespace Opm
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
template<typename T>
|
||||
inline
|
||||
NonuniformTableLinear<T>
|
||||
::NonuniformTableLinear(const TableColumn& x_column,
|
||||
const TableColumn& y_column)
|
||||
: x_values_( x_column.begin() , x_column.end()),
|
||||
y_values_( y_column.begin() , y_column.end())
|
||||
{
|
||||
assert(isNondecreasing(x_values_.begin(), x_values_.end()));
|
||||
}
|
||||
|
||||
|
||||
template<typename T>
|
||||
inline
|
||||
NonuniformTableLinear<T>
|
||||
::NonuniformTableLinear(const TableColumn& x_column,
|
||||
const std::vector<T>& y_values)
|
||||
: x_values_( x_column.begin() , x_column.end()),
|
||||
y_values_(y_values)
|
||||
{
|
||||
assert(isNondecreasing(x_values_.begin(), x_values_.end()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<typename T>
|
||||
inline
|
||||
NonuniformTableLinear<T>
|
||||
|
@ -76,7 +76,8 @@ void verify_norne_oil_pvt_region2(const TableManager& tableManager) {
|
||||
61, 61,
|
||||
70, 70,
|
||||
80, 80,
|
||||
100, 100, 100};
|
||||
100, 100 ,
|
||||
100};
|
||||
|
||||
|
||||
std::vector<double> P = {114, 148,
|
||||
@ -86,7 +87,7 @@ void verify_norne_oil_pvt_region2(const TableManager& tableManager) {
|
||||
194, 228,
|
||||
214, 248,
|
||||
234, 268,
|
||||
270 , 300, 330};
|
||||
270 };
|
||||
|
||||
|
||||
std::vector<double> mu_expected = {0.00106736588, 0.00113961037,
|
||||
@ -96,7 +97,7 @@ void verify_norne_oil_pvt_region2(const TableManager& tableManager) {
|
||||
0.00072883113, 0.00076988665,
|
||||
0.00068250424, 0.00072040786,
|
||||
0.00062347677, 0.00064963306,
|
||||
0.00065122911, 0.00409946846, 0.00472871311};
|
||||
0.00065122911};
|
||||
|
||||
|
||||
std::vector<double> b_expected = {0.88421444595, 0.88893909117,
|
||||
@ -106,7 +107,7 @@ void verify_norne_oil_pvt_region2(const TableManager& tableManager) {
|
||||
0.81904041272, 0.82404719615,
|
||||
0.80341044483, 0.80845950744,
|
||||
0.77131381726, 0.77661604334,
|
||||
0.77691738473, 0.98268067196, 0.98617572121};
|
||||
0.77691738473};
|
||||
|
||||
{
|
||||
std::vector<int> tableIndex(P.size() , 0);
|
||||
|
Loading…
Reference in New Issue
Block a user