From 6f0f9ff1886c1b9aaf6ffd42bf08e1995067fd17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Mon, 14 May 2012 11:21:13 +0200 Subject: [PATCH 1/2] Added surfaceDensity() method to IncompPropertiesInterface. --- opm/core/fluid/IncompPropertiesBasic.cpp | 10 ++++++++++ opm/core/fluid/IncompPropertiesBasic.hpp | 5 +++++ opm/core/fluid/IncompPropertiesFromDeck.cpp | 6 ++++++ opm/core/fluid/IncompPropertiesFromDeck.hpp | 5 +++++ opm/core/fluid/IncompPropertiesInterface.hpp | 13 +++++++++++++ 5 files changed, 39 insertions(+) diff --git a/opm/core/fluid/IncompPropertiesBasic.cpp b/opm/core/fluid/IncompPropertiesBasic.cpp index 1b93001be..0ce3c88aa 100644 --- a/opm/core/fluid/IncompPropertiesBasic.cpp +++ b/opm/core/fluid/IncompPropertiesBasic.cpp @@ -115,6 +115,16 @@ namespace Opm /// \return Array of P density values. const double* IncompPropertiesBasic::density() const { + // No difference between reservoir and surface densities + // modelled by this class. + return pvt_.surfaceDensities(); + } + + /// \return Array of P density values. + const double* IncompPropertiesBasic::surfaceDensity() const + { + // No difference between reservoir and surface densities + // modelled by this class. return pvt_.surfaceDensities(); } diff --git a/opm/core/fluid/IncompPropertiesBasic.hpp b/opm/core/fluid/IncompPropertiesBasic.hpp index 9784398f2..3c8535df6 100644 --- a/opm/core/fluid/IncompPropertiesBasic.hpp +++ b/opm/core/fluid/IncompPropertiesBasic.hpp @@ -92,9 +92,14 @@ namespace Opm /// \return Array of P viscosity values. virtual const double* viscosity() const; + /// Densities of fluid phases at reservoir conditions. /// \return Array of P density values. virtual const double* density() const; + /// Densities of fluid phases at surface conditions. + /// \return Array of P density values. + virtual const double* surfaceDensity() const; + /// \param[in] n Number of data points. /// \param[in] s Array of nP saturation values. /// \param[in] cells Array of n cell indices to be associated with the s values. diff --git a/opm/core/fluid/IncompPropertiesFromDeck.cpp b/opm/core/fluid/IncompPropertiesFromDeck.cpp index 2789fe920..e61e13c80 100644 --- a/opm/core/fluid/IncompPropertiesFromDeck.cpp +++ b/opm/core/fluid/IncompPropertiesFromDeck.cpp @@ -90,6 +90,12 @@ namespace Opm return pvt_.reservoirDensities(); } + /// \return Array of P density values. + const double* IncompPropertiesFromDeck::surfaceDensity() const + { + return pvt_.surfaceDensities(); + } + /// \param[in] n Number of data points. /// \param[in] s Array of nP saturation values. /// \param[in] cells Array of n cell indices to be associated with the s values. diff --git a/opm/core/fluid/IncompPropertiesFromDeck.hpp b/opm/core/fluid/IncompPropertiesFromDeck.hpp index 1472f0436..d17dd1b7d 100644 --- a/opm/core/fluid/IncompPropertiesFromDeck.hpp +++ b/opm/core/fluid/IncompPropertiesFromDeck.hpp @@ -78,9 +78,14 @@ namespace Opm /// \return Array of P viscosity values. virtual const double* viscosity() const; + /// Densities of fluid phases at reservoir conditions. /// \return Array of P density values. virtual const double* density() const; + /// Densities of fluid phases at surface conditions. + /// \return Array of P density values. + virtual const double* surfaceDensity() const; + /// \param[in] n Number of data points. /// \param[in] s Array of nP saturation values. /// \param[in] cells Array of n cell indices to be associated with the s values. diff --git a/opm/core/fluid/IncompPropertiesInterface.hpp b/opm/core/fluid/IncompPropertiesInterface.hpp index f3c77caa7..a5025e8a1 100644 --- a/opm/core/fluid/IncompPropertiesInterface.hpp +++ b/opm/core/fluid/IncompPropertiesInterface.hpp @@ -62,9 +62,22 @@ namespace Opm /// \return Array of P viscosity values. virtual const double* viscosity() const = 0; + /// Densities of fluid phases at surface conditions. /// \return Array of P density values. virtual const double* density() const = 0; + /// Densities of fluid phases at surface conditions. + /// Note: a reasonable question to ask is why there can be + /// different densities at surface and reservoir conditions, + /// when the phases are assumed incompressible. The answer is + /// that even if we approximate the phases as being + /// incompressible during simulation, the density difference + /// between surface and reservoir may be larger. For accurate + /// reporting and using data given in terms of surface values, + /// we need to handle this difference. + /// \return Array of P density values. + virtual const double* surfaceDensity() const = 0; + /// \param[in] n Number of data points. /// \param[in] s Array of nP saturation values. /// \param[in] cells Array of n cell indices to be associated with the s values. From d4e530eb3c9ae54f841e2c1aa7a1cc4b4e38773d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Mon, 14 May 2012 11:28:05 +0200 Subject: [PATCH 2/2] Added surfaceDensity() method to BlackoilPropertiesInterface. --- opm/core/fluid/BlackoilPropertiesBasic.cpp | 8 ++++++++ opm/core/fluid/BlackoilPropertiesBasic.hpp | 5 +++++ opm/core/fluid/BlackoilPropertiesFromDeck.cpp | 7 +++++++ opm/core/fluid/BlackoilPropertiesFromDeck.hpp | 5 +++++ opm/core/fluid/BlackoilPropertiesInterface.hpp | 5 +++++ 5 files changed, 30 insertions(+) diff --git a/opm/core/fluid/BlackoilPropertiesBasic.cpp b/opm/core/fluid/BlackoilPropertiesBasic.cpp index 4b8dbef29..25b520d61 100644 --- a/opm/core/fluid/BlackoilPropertiesBasic.cpp +++ b/opm/core/fluid/BlackoilPropertiesBasic.cpp @@ -168,6 +168,14 @@ namespace Opm } } + /// Densities of stock components at surface conditions. + /// \return Array of P density values. + const double* BlackoilPropertiesBasic::surfaceDensity() const + { + return pvt_.surfaceDensities(); + } + + /// \param[in] n Number of data points. /// \param[in] s Array of nP saturation values. /// \param[in] cells Array of n cell indices to be associated with the s values. diff --git a/opm/core/fluid/BlackoilPropertiesBasic.hpp b/opm/core/fluid/BlackoilPropertiesBasic.hpp index 24a01a1c0..76dc4bd4e 100644 --- a/opm/core/fluid/BlackoilPropertiesBasic.hpp +++ b/opm/core/fluid/BlackoilPropertiesBasic.hpp @@ -104,6 +104,7 @@ namespace Opm double* dAdp) const; + /// Densities of stock components at reservoir conditions. /// \param[in] n Number of data points. /// \param[in] A Array of nP^2 values, where the P^2 values for a cell give the /// matrix A = RB^{-1} which relates z to u by z = Au. The matrices @@ -114,6 +115,10 @@ namespace Opm const double* A, double* rho) const; + /// Densities of stock components at surface conditions. + /// \return Array of P density values. + virtual const double* surfaceDensity() const; + /// \param[in] n Number of data points. /// \param[in] s Array of nP saturation values. /// \param[in] cells Array of n cell indices to be associated with the s values. diff --git a/opm/core/fluid/BlackoilPropertiesFromDeck.cpp b/opm/core/fluid/BlackoilPropertiesFromDeck.cpp index f582d4458..5aeb58fcc 100644 --- a/opm/core/fluid/BlackoilPropertiesFromDeck.cpp +++ b/opm/core/fluid/BlackoilPropertiesFromDeck.cpp @@ -213,6 +213,13 @@ namespace Opm } } + /// Densities of stock components at surface conditions. + /// \return Array of P density values. + const double* BlackoilPropertiesFromDeck::surfaceDensity() const + { + return pvt_.surfaceDensities(); + } + /// \param[in] n Number of data points. /// \param[in] s Array of nP saturation values. /// \param[in] cells Array of n cell indices to be associated with the s values. diff --git a/opm/core/fluid/BlackoilPropertiesFromDeck.hpp b/opm/core/fluid/BlackoilPropertiesFromDeck.hpp index a9b867960..a6408e066 100644 --- a/opm/core/fluid/BlackoilPropertiesFromDeck.hpp +++ b/opm/core/fluid/BlackoilPropertiesFromDeck.hpp @@ -100,6 +100,7 @@ namespace Opm double* dAdp) const; + /// Densities of stock components at reservoir conditions. /// \param[in] n Number of data points. /// \param[in] A Array of nP^2 values, where the P^2 values for a cell give the /// matrix A = RB^{-1} which relates z to u by z = Au. The matrices @@ -110,6 +111,10 @@ namespace Opm const double* A, double* rho) const; + /// Densities of stock components at surface conditions. + /// \return Array of P density values. + virtual const double* surfaceDensity() const; + /// \param[in] n Number of data points. /// \param[in] s Array of nP saturation values. /// \param[in] cells Array of n cell indices to be associated with the s values. diff --git a/opm/core/fluid/BlackoilPropertiesInterface.hpp b/opm/core/fluid/BlackoilPropertiesInterface.hpp index d3ea428c7..393036a27 100644 --- a/opm/core/fluid/BlackoilPropertiesInterface.hpp +++ b/opm/core/fluid/BlackoilPropertiesInterface.hpp @@ -91,6 +91,7 @@ namespace Opm double* dAdp) const = 0; + /// Densities of stock components at reservoir conditions. /// \param[in] n Number of data points. /// \param[in] A Array of nP^2 values, where the P^2 values for a cell give the /// matrix A = RB^{-1} which relates z to u by z = Au. The matrices @@ -101,6 +102,10 @@ namespace Opm const double* A, double* rho) const = 0; + /// Densities of stock components at surface conditions. + /// \return Array of P density values. + virtual const double* surfaceDensity() const = 0; + /// \param[in] n Number of data points. /// \param[in] s Array of nP saturation values. /// \param[in] cells Array of n cell indices to be associated with the s values.