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