2012-01-04 16:28:54 -06:00
|
|
|
/*
|
|
|
|
Copyright 2012 SINTEF ICT, Applied Mathematics.
|
|
|
|
|
|
|
|
This file is part of the Open Porous Media project (OPM).
|
|
|
|
|
|
|
|
OPM is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
OPM is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef OPM_BLACKOILPVTPROPERTIES_HEADER_INCLUDED
|
|
|
|
#define OPM_BLACKOILPVTPROPERTIES_HEADER_INCLUDED
|
|
|
|
|
2014-04-24 10:07:41 -05:00
|
|
|
#include <opm/core/props/pvt/PvtInterface.hpp>
|
2013-03-14 04:29:42 -05:00
|
|
|
#include <opm/core/props/BlackoilPhases.hpp>
|
2014-01-24 05:03:21 -06:00
|
|
|
|
|
|
|
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
2014-04-24 10:07:41 -05:00
|
|
|
#include <opm/parser/eclipse/Utility/PvtoTable.hpp>
|
2014-01-24 05:03:21 -06:00
|
|
|
|
2012-01-04 16:28:54 -06:00
|
|
|
#include <string>
|
2013-08-08 05:32:01 -05:00
|
|
|
#include <memory>
|
2014-06-05 07:32:58 -05:00
|
|
|
#include <array>
|
2012-01-04 16:28:54 -06:00
|
|
|
|
|
|
|
namespace Opm
|
|
|
|
{
|
|
|
|
|
|
|
|
/// Class collecting the pvt properties for all active phases.
|
2014-05-13 05:59:11 -05:00
|
|
|
/// For all the methods, the following apply:
|
|
|
|
/// - p and z are expected to be of size n and n*num_phases, respectively.
|
|
|
|
/// - pvtTableIdx specifies the PVT table to be used for each data
|
|
|
|
/// point and is thus expected to be an array of size n
|
|
|
|
/// - Output arrays shall be of size n*num_phases, and must be valid
|
|
|
|
/// before calling the method.
|
2012-01-04 16:28:54 -06:00
|
|
|
/// NOTE: The difference between this interface and the one defined
|
2014-04-24 10:07:41 -05:00
|
|
|
/// by PvtInterface is that this collects all phases' properties,
|
2012-01-04 16:28:54 -06:00
|
|
|
/// and therefore the output arrays are of size n*num_phases as opposed
|
2014-04-24 10:07:41 -05:00
|
|
|
/// to size n in PvtInterface.
|
2012-01-04 16:28:54 -06:00
|
|
|
class BlackoilPvtProperties : public BlackoilPhases
|
|
|
|
{
|
|
|
|
public:
|
2012-01-05 02:34:05 -06:00
|
|
|
/// Default constructor.
|
|
|
|
BlackoilPvtProperties();
|
|
|
|
|
2014-01-24 05:03:21 -06:00
|
|
|
/// Initialize from deck.
|
2014-04-24 10:07:41 -05:00
|
|
|
///
|
2014-01-24 05:03:21 -06:00
|
|
|
/// \param deck An input deck from the opm-parser module.
|
2014-04-24 10:07:41 -05:00
|
|
|
void init(Opm::DeckConstPtr deck,
|
2014-05-13 05:59:11 -05:00
|
|
|
int samples);
|
2014-01-24 05:03:21 -06:00
|
|
|
|
2013-05-13 09:20:00 -05:00
|
|
|
/// \return Object describing the active phases.
|
|
|
|
PhaseUsage phaseUsage() const;
|
|
|
|
|
2012-01-04 16:28:54 -06:00
|
|
|
/// Number of active phases.
|
|
|
|
int numPhases() const;
|
|
|
|
|
|
|
|
/// For each canonical phase, indicates if it is
|
|
|
|
/// active or not (boolean usage of int).
|
|
|
|
/// \return Array of size MaxNumPhases
|
|
|
|
const int* phaseUsed() const;
|
|
|
|
|
|
|
|
/// Positions of canonical phases in arrays of phase
|
|
|
|
/// properties (saturations etc.).
|
|
|
|
/// \return Array of size MaxNumPhases
|
|
|
|
const int* phasePosition() const;
|
|
|
|
|
|
|
|
/// Densities of stock components at surface conditions.
|
2012-01-05 04:40:29 -06:00
|
|
|
/// \return Array of size numPhases().
|
2014-04-24 10:07:41 -05:00
|
|
|
const double* surfaceDensities(int regionIdx = 0) const;
|
2012-01-04 16:28:54 -06:00
|
|
|
|
|
|
|
/// Viscosity as a function of p and z.
|
|
|
|
void mu(const int n,
|
2014-05-13 05:59:11 -05:00
|
|
|
const int *pvtTableIdx,
|
2012-01-04 16:28:54 -06:00
|
|
|
const double* p,
|
|
|
|
const double* z,
|
|
|
|
double* output_mu) const;
|
|
|
|
|
|
|
|
/// Formation volume factor as a function of p and z.
|
|
|
|
void B(const int n,
|
2014-05-13 05:59:11 -05:00
|
|
|
const int *pvtTableIdx,
|
2012-01-04 16:28:54 -06:00
|
|
|
const double* p,
|
|
|
|
const double* z,
|
|
|
|
double* output_B) const;
|
|
|
|
|
|
|
|
/// Formation volume factor and p-derivative as functions of p and z.
|
|
|
|
void dBdp(const int n,
|
2014-05-13 05:59:11 -05:00
|
|
|
const int *pvtTableIdx,
|
2012-01-04 16:28:54 -06:00
|
|
|
const double* p,
|
|
|
|
const double* z,
|
|
|
|
double* output_B,
|
|
|
|
double* output_dBdp) const;
|
|
|
|
|
|
|
|
/// Solution factor as a function of p and z.
|
|
|
|
void R(const int n,
|
2014-05-13 05:59:11 -05:00
|
|
|
const int *pvtTableIdx,
|
2012-01-04 16:28:54 -06:00
|
|
|
const double* p,
|
|
|
|
const double* z,
|
|
|
|
double* output_R) const;
|
|
|
|
|
|
|
|
/// Solution factor and p-derivative as functions of p and z.
|
|
|
|
void dRdp(const int n,
|
2014-05-13 05:59:11 -05:00
|
|
|
const int *pvtTableIdx,
|
2012-01-04 16:28:54 -06:00
|
|
|
const double* p,
|
|
|
|
const double* z,
|
|
|
|
double* output_R,
|
|
|
|
double* output_dRdp) const;
|
|
|
|
|
|
|
|
private:
|
2012-01-04 16:32:21 -06:00
|
|
|
// Disabling copying (just to avoid surprises, since we use shared_ptr).
|
|
|
|
BlackoilPvtProperties(const BlackoilPvtProperties&);
|
|
|
|
BlackoilPvtProperties& operator=(const BlackoilPvtProperties&);
|
|
|
|
|
2012-01-05 02:34:05 -06:00
|
|
|
PhaseUsage phase_usage_;
|
2012-01-04 16:28:54 -06:00
|
|
|
|
2014-05-13 05:59:11 -05:00
|
|
|
// The PVT properties. We need to store one object per PVT
|
|
|
|
// region per active fluid phase.
|
2014-04-24 10:07:41 -05:00
|
|
|
std::vector<std::shared_ptr<PvtInterface> > props_;
|
|
|
|
std::vector<std::array<double, MaxNumPhases> > densities_;
|
2014-05-13 05:59:11 -05:00
|
|
|
|
2012-01-04 16:28:54 -06:00
|
|
|
mutable std::vector<double> data1_;
|
|
|
|
mutable std::vector<double> data2_;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif // OPM_BLACKOILPVTPROPERTIES_HEADER_INCLUDED
|