mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Make use of EclipseState for EQLNUM and SWATINIT.
This commit is contained in:
parent
f06659cd71
commit
c4b5a7e302
@ -28,6 +28,7 @@
|
|||||||
#include <opm/core/utility/Units.hpp>
|
#include <opm/core/utility/Units.hpp>
|
||||||
#include <opm/parser/eclipse/Utility/EquilWrapper.hpp>
|
#include <opm/parser/eclipse/Utility/EquilWrapper.hpp>
|
||||||
#include <opm/parser/eclipse/Utility/SingleRecordTable.hpp>
|
#include <opm/parser/eclipse/Utility/SingleRecordTable.hpp>
|
||||||
|
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
@ -62,6 +63,7 @@ namespace Opm
|
|||||||
void initStateEquil(const UnstructuredGrid& grid,
|
void initStateEquil(const UnstructuredGrid& grid,
|
||||||
const BlackoilPropertiesInterface& props,
|
const BlackoilPropertiesInterface& props,
|
||||||
const Opm::DeckConstPtr deck,
|
const Opm::DeckConstPtr deck,
|
||||||
|
const Opm::EclipseStateConstPtr eclipseState,
|
||||||
const double gravity,
|
const double gravity,
|
||||||
BlackoilState& state);
|
BlackoilState& state);
|
||||||
|
|
||||||
@ -230,13 +232,14 @@ namespace Opm
|
|||||||
inline
|
inline
|
||||||
std::vector<int>
|
std::vector<int>
|
||||||
equilnum(const Opm::DeckConstPtr deck,
|
equilnum(const Opm::DeckConstPtr deck,
|
||||||
|
const Opm::EclipseStateConstPtr eclipseState,
|
||||||
const UnstructuredGrid& G )
|
const UnstructuredGrid& G )
|
||||||
{
|
{
|
||||||
std::vector<int> eqlnum;
|
std::vector<int> eqlnum;
|
||||||
if (deck->hasKeyword("EQLNUM")) {
|
if (deck->hasKeyword("EQLNUM")) {
|
||||||
eqlnum.resize(G.number_of_cells);
|
eqlnum.resize(G.number_of_cells);
|
||||||
const std::vector<int>& e =
|
const std::vector<int>& e =
|
||||||
deck->getKeyword("EQLNUM")->getIntData();
|
eclipseState->getIntGridProperty("EQLNUM")->getData();
|
||||||
const int* gc = G.global_cell;
|
const int* gc = G.global_cell;
|
||||||
for (int cell = 0; cell < G.number_of_cells; ++cell) {
|
for (int cell = 0; cell < G.number_of_cells; ++cell) {
|
||||||
const int deck_pos = (gc == NULL) ? cell : gc[cell];
|
const int deck_pos = (gc == NULL) ? cell : gc[cell];
|
||||||
@ -257,6 +260,7 @@ namespace Opm
|
|||||||
public:
|
public:
|
||||||
InitialStateComputer(BlackoilPropertiesInterface& props,
|
InitialStateComputer(BlackoilPropertiesInterface& props,
|
||||||
const Opm::DeckConstPtr deck,
|
const Opm::DeckConstPtr deck,
|
||||||
|
const Opm::EclipseStateConstPtr eclipseState,
|
||||||
const UnstructuredGrid& G ,
|
const UnstructuredGrid& G ,
|
||||||
const double grav = unit::gravity)
|
const double grav = unit::gravity)
|
||||||
: pp_(props.numPhases(),
|
: pp_(props.numPhases(),
|
||||||
@ -270,7 +274,7 @@ namespace Opm
|
|||||||
const std::vector<EquilRecord> rec = getEquil(deck);
|
const std::vector<EquilRecord> rec = getEquil(deck);
|
||||||
|
|
||||||
// Create (inverse) region mapping.
|
// Create (inverse) region mapping.
|
||||||
const RegionMapping<> eqlmap(equilnum(deck, G));
|
const RegionMapping<> eqlmap(equilnum(deck, eclipseState, G));
|
||||||
|
|
||||||
// Create Rs functions.
|
// Create Rs functions.
|
||||||
rs_func_.reserve(rec.size());
|
rs_func_.reserve(rec.size());
|
||||||
@ -338,14 +342,13 @@ namespace Opm
|
|||||||
|
|
||||||
// Check for presence of kw SWATINIT
|
// Check for presence of kw SWATINIT
|
||||||
if (deck->hasKeyword("SWATINIT")) {
|
if (deck->hasKeyword("SWATINIT")) {
|
||||||
const std::vector<double>& swat_init = deck->getKeyword("SWATINIT")->getSIDoubleData();
|
const std::vector<double>& swat_init = eclipseState->getDoubleGridProperty("SWATINIT")->getData();
|
||||||
swat_init_.resize(G.number_of_cells);
|
swat_init_.resize(G.number_of_cells);
|
||||||
const int* gc = G.global_cell;
|
const int* gc = G.global_cell;
|
||||||
for (int c = 0; c < G.number_of_cells; ++c) {
|
for (int c = 0; c < G.number_of_cells; ++c) {
|
||||||
const int deck_pos = (gc == NULL) ? c : gc[c];
|
const int deck_pos = (gc == NULL) ? c : gc[c];
|
||||||
swat_init_[c] = swat_init[deck_pos];
|
swat_init_[c] = swat_init[deck_pos];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compute pressures, saturations, rs and rv factors.
|
// Compute pressures, saturations, rs and rv factors.
|
||||||
|
@ -755,11 +755,12 @@ namespace Opm
|
|||||||
void initStateEquil(const UnstructuredGrid& grid,
|
void initStateEquil(const UnstructuredGrid& grid,
|
||||||
BlackoilPropertiesInterface& props,
|
BlackoilPropertiesInterface& props,
|
||||||
const Opm::DeckConstPtr deck,
|
const Opm::DeckConstPtr deck,
|
||||||
|
const Opm::EclipseStateConstPtr eclipseState,
|
||||||
const double gravity,
|
const double gravity,
|
||||||
BlackoilState& state)
|
BlackoilState& state)
|
||||||
{
|
{
|
||||||
typedef Equil::DeckDependent::InitialStateComputer ISC;
|
typedef Equil::DeckDependent::InitialStateComputer ISC;
|
||||||
ISC isc(props, deck, grid, gravity);
|
ISC isc(props, deck, eclipseState, grid, gravity);
|
||||||
const auto pu = props.phaseUsage();
|
const auto pu = props.phaseUsage();
|
||||||
const int ref_phase = pu.phase_used[BlackoilPhases::Liquid]
|
const int ref_phase = pu.phase_used[BlackoilPhases::Liquid]
|
||||||
? pu.phase_pos[BlackoilPhases::Liquid]
|
? pu.phase_pos[BlackoilPhases::Liquid]
|
||||||
|
Loading…
Reference in New Issue
Block a user