From 6e9a46b34de9ff179abfe3ea359173fb645267b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Mon, 27 May 2013 12:53:06 +0200 Subject: [PATCH] Added gasoilratio() to BlackoilState. --- opm/core/simulator/BlackoilState.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/opm/core/simulator/BlackoilState.hpp b/opm/core/simulator/BlackoilState.hpp index caf570e5c..974deffd8 100644 --- a/opm/core/simulator/BlackoilState.hpp +++ b/opm/core/simulator/BlackoilState.hpp @@ -48,6 +48,7 @@ namespace Opm // but use available phase information instead. sat_[num_phases*cell + 1] = 1.0; } + gor_.resize(g.number_of_cells, 0.0); } enum ExtremalSat { MinSat, MaxSat }; @@ -60,10 +61,13 @@ namespace Opm const Opm::BlackoilPropertiesInterface& props, ExtremalSat es) { + if (cells.empty()) { + return; + } const int n = cells.size(); + ASSERT(n > 0); std::vector smin(num_phases_*n); std::vector smax(num_phases_*n); - ASSERT(n > 0); props.satRange(n, &cells[0], &smin[0], &smax[0]); const double* svals = (es == MinSat) ? &smin[0] : &smax[0]; for (int ci = 0; ci < n; ++ci) { @@ -83,12 +87,14 @@ namespace Opm std::vector& faceflux () { return flux_ ; } std::vector& surfacevol () { return surfvol_; } std::vector& saturation () { return sat_ ; } + std::vector& gasoilratio () { return gor_ ; } const std::vector& pressure () const { return press_ ; } const std::vector& facepressure() const { return fpress_; } const std::vector& faceflux () const { return flux_ ; } const std::vector& surfacevol () const { return surfvol_; } const std::vector& saturation () const { return sat_ ; } + const std::vector& gasoilratio () const { return gor_ ; } private: int num_phases_; @@ -97,6 +103,7 @@ namespace Opm std::vector flux_ ; std::vector surfvol_; std::vector sat_ ; + std::vector gor_ ; }; } // namespace Opm