Made all the SinglePvt* classes conform to new, more bare-bones interface.
This commit is contained in:
10
Makefile.am
10
Makefile.am
@@ -22,6 +22,10 @@ opm/core/fluid/blackoil/MiscibilityDead.cpp \
|
||||
opm/core/fluid/blackoil/MiscibilityLiveGas.cpp \
|
||||
opm/core/fluid/blackoil/MiscibilityLiveOil.cpp \
|
||||
opm/core/fluid/blackoil/MiscibilityProps.cpp \
|
||||
opm/core/fluid/blackoil/SinglePvtDead.cpp \
|
||||
opm/core/fluid/blackoil/SinglePvtLiveGas.cpp \
|
||||
opm/core/fluid/blackoil/SinglePvtLiveOil.cpp \
|
||||
opm/core/fluid/blackoil/SinglePvtInterface.cpp \
|
||||
opm/core/fluid/BlackoilPropertiesFromDeck.cpp \
|
||||
opm/core/utility/MonotCubicInterpolator.cpp \
|
||||
opm/core/utility/parameters/Parameter.cpp \
|
||||
@@ -82,6 +86,7 @@ opm/core/fluid/BlackoilPropertiesFromDeck.hpp \
|
||||
opm/core/fluid/RockFromDeck.hpp \
|
||||
opm/core/fluid/SimpleFluid2p.hpp \
|
||||
opm/core/fluid/blackoil/BlackoilDefs.hpp \
|
||||
opm/core/fluid/blackoil/BlackoilPhases.hpp \
|
||||
opm/core/fluid/blackoil/BlackoilPVT.hpp \
|
||||
opm/core/fluid/blackoil/FluidMatrixInteractionBlackoil.hpp \
|
||||
opm/core/fluid/blackoil/FluidStateBlackoil.hpp \
|
||||
@@ -90,6 +95,11 @@ opm/core/fluid/blackoil/MiscibilityLiveGas.hpp \
|
||||
opm/core/fluid/blackoil/MiscibilityLiveOil.hpp \
|
||||
opm/core/fluid/blackoil/MiscibilityProps.hpp \
|
||||
opm/core/fluid/blackoil/MiscibilityWater.hpp \
|
||||
opm/core/fluid/blackoil/SinglePvtDead.hpp \
|
||||
opm/core/fluid/blackoil/SinglePvtLiveGas.hpp \
|
||||
opm/core/fluid/blackoil/SinglePvtLiveOil.hpp \
|
||||
opm/core/fluid/blackoil/SinglePvtInterface.hpp \
|
||||
opm/core/fluid/blackoil/SinglePvtConstCompr.hpp \
|
||||
opm/core/utility/Average.hpp \
|
||||
opm/core/utility/ErrorMacros.hpp \
|
||||
opm/core/utility/Factory.hpp \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2010, 2011, 2012 SINTEF ICT, Applied Mathematics.
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
@@ -17,85 +17,22 @@
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPM_BLACKOILDEFS_HEADER_INCLUDED
|
||||
#define OPM_BLACKOILDEFS_HEADER_INCLUDED
|
||||
#ifndef OPM_BLACKOILPHASES_HEADER_INCLUDED
|
||||
#define OPM_BLACKOILPHASES_HEADER_INCLUDED
|
||||
|
||||
|
||||
#include <tr1/array>
|
||||
#include <iostream>
|
||||
#include <boost/static_assert.hpp>
|
||||
|
||||
namespace Opm
|
||||
{
|
||||
|
||||
class BlackoilDefs
|
||||
class BlackoilPhases
|
||||
{
|
||||
public:
|
||||
enum { numComponents = 3 };
|
||||
enum { numPhases = 3 };
|
||||
|
||||
enum ComponentIndex { Water = 0, Oil = 1, Gas = 2 };
|
||||
static const int MaxNumPhases = 3;
|
||||
// enum ComponentIndex { Water = 0, Oil = 1, Gas = 2 };
|
||||
enum PhaseIndex { Aqua = 0, Liquid = 1, Vapour = 2 };
|
||||
|
||||
// We need types with operator= and constructor taking scalars
|
||||
// for the small vectors and matrices, to save us from having to
|
||||
// rewrite a large amount of code.
|
||||
template <typename T, int N>
|
||||
class SmallVec
|
||||
{
|
||||
public:
|
||||
SmallVec()
|
||||
{}
|
||||
SmallVec(const T& elem)
|
||||
{ assign(elem); }
|
||||
SmallVec& operator=(const T& elem)
|
||||
{ assign(elem); return *this; }
|
||||
const T& operator[](int i) const
|
||||
{ return data_[i]; }
|
||||
T& operator[](int i)
|
||||
{ return data_[i]; }
|
||||
template <typename U>
|
||||
void assign(const U& elem)
|
||||
{
|
||||
for (int i = 0; i < N; ++i) {
|
||||
data_[i] = elem;
|
||||
}
|
||||
}
|
||||
private:
|
||||
T data_[N];
|
||||
};
|
||||
template <typename T, int Rows, int Cols>
|
||||
class SmallMat
|
||||
{
|
||||
public:
|
||||
SmallMat()
|
||||
{}
|
||||
SmallMat(const T& elem)
|
||||
{ data_.assign(elem); }
|
||||
SmallMat& operator=(const T& elem)
|
||||
{ data_.assign(elem); return *this; }
|
||||
typedef SmallVec<T, Cols> RowType;
|
||||
const RowType& operator[](int i) const
|
||||
{ return data_[i]; }
|
||||
RowType& operator[](int i)
|
||||
{ return data_[i]; }
|
||||
private:
|
||||
SmallVec<RowType, Rows> data_;
|
||||
};
|
||||
|
||||
typedef double Scalar;
|
||||
typedef SmallVec<Scalar, numComponents> CompVec;
|
||||
typedef SmallVec<Scalar, numPhases> PhaseVec;
|
||||
BOOST_STATIC_ASSERT(int(numComponents) == int(numPhases));
|
||||
typedef SmallMat<Scalar, numComponents, numPhases> PhaseToCompMatrix;
|
||||
typedef SmallMat<Scalar, numPhases, numPhases> PhaseJacobian;
|
||||
// Attempting to guard against alignment issues.
|
||||
BOOST_STATIC_ASSERT(sizeof(CompVec) == numComponents*sizeof(Scalar));
|
||||
BOOST_STATIC_ASSERT(sizeof(PhaseVec) == numPhases*sizeof(Scalar));
|
||||
BOOST_STATIC_ASSERT(sizeof(PhaseToCompMatrix) == numComponents*numPhases*sizeof(Scalar));
|
||||
BOOST_STATIC_ASSERT(sizeof(PhaseJacobian) == numPhases*numPhases*sizeof(Scalar));
|
||||
};
|
||||
|
||||
} // namespace Opm
|
||||
|
||||
#endif // OPM_BLACKOILDEFS_HEADER_INCLUDED
|
||||
#endif // OPM_BLACKOILPHASES_HEADER_INCLUDED
|
||||
|
||||
@@ -1,16 +1,5 @@
|
||||
//===========================================================================
|
||||
//
|
||||
// File: MiscibilityLiveOil.hpp
|
||||
//
|
||||
// Created: Wed Feb 10 09:08:09 2010
|
||||
//
|
||||
// Author: Bjørn Spjelkavik <bsp@sintef.no>
|
||||
//
|
||||
// Revision: $Id$
|
||||
//
|
||||
//===========================================================================
|
||||
/*
|
||||
Copyright 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2010, 2011, 2012 SINTEF ICT, Applied Mathematics.
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
@@ -28,70 +17,119 @@
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef SINTEF_MISCIBILITYLIVEOIL_HEADER
|
||||
#define SINTEF_MISCIBILITYLIVEOIL_HEADER
|
||||
#ifndef OPM_SINGLEPVTCONSTCOMPR_HEADER_INCLUDED
|
||||
#define OPM_SINGLEPVTCONSTCOMPR_HEADER_INCLUDED
|
||||
|
||||
/** Class for miscible live oil.
|
||||
* Detailed description.
|
||||
*/
|
||||
|
||||
#include "MiscibilityProps.hpp"
|
||||
#include <opm/core/fluid/blackoil/SinglePvtInterface.hpp>
|
||||
#include <opm/core/utility/ErrorMacros.hpp>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
|
||||
|
||||
namespace Opm
|
||||
{
|
||||
class MiscibilityLiveOil : public MiscibilityProps
|
||||
class SinglePvtConstCompr : public SinglePvtInterface
|
||||
{
|
||||
public:
|
||||
typedef std::vector<std::vector<std::vector<double> > > table_t;
|
||||
typedef std::vector<std::vector<double> > table_t;
|
||||
|
||||
MiscibilityLiveOil(const table_t& pvto);
|
||||
virtual ~MiscibilityLiveOil();
|
||||
SinglePvtConstCompr(const table_t& pvtw)
|
||||
{
|
||||
const int region_number = 0;
|
||||
if (pvtw.size() != 1) {
|
||||
THROW("More than one PVD-region");
|
||||
}
|
||||
ref_press_ = pvtw[region_number][0];
|
||||
ref_B_ = pvtw[region_number][1];
|
||||
comp_ = pvtw[region_number][2];
|
||||
viscosity_ = pvtw[region_number][3];
|
||||
if (pvtw[region_number].size() > 4 && pvtw[region_number][4] != 0.0) {
|
||||
THROW("SinglePvtConstCompr does not support 'viscosibility'.");
|
||||
}
|
||||
}
|
||||
|
||||
virtual double getViscosity(int region, double press, const surfvol_t& surfvol) const;
|
||||
virtual double R (int region, double press, const surfvol_t& surfvol) const;
|
||||
virtual double dRdp(int region, double press, const surfvol_t& surfvol) const;
|
||||
virtual double B (int region, double press, const surfvol_t& surfvol) const;
|
||||
virtual double dBdp(int region, double press, const surfvol_t& surfvol) const;
|
||||
SinglePvtConstCompr(double visc)
|
||||
: ref_press_(0.0),
|
||||
ref_B_(1.0),
|
||||
comp_(0.0),
|
||||
viscosity_(visc)
|
||||
{
|
||||
}
|
||||
|
||||
virtual void getViscosity(const std::vector<PhaseVec>& pressures,
|
||||
const std::vector<CompVec>& surfvol,
|
||||
int phase,
|
||||
std::vector<double>& output) const;
|
||||
virtual void B(const std::vector<PhaseVec>& pressures,
|
||||
const std::vector<CompVec>& surfvol,
|
||||
int phase,
|
||||
std::vector<double>& output) const;
|
||||
virtual void dBdp(const std::vector<PhaseVec>& pressures,
|
||||
const std::vector<CompVec>& surfvol,
|
||||
int phase,
|
||||
std::vector<double>& output_B,
|
||||
std::vector<double>& output_dBdp) const;
|
||||
virtual void R(const std::vector<PhaseVec>& pressures,
|
||||
const std::vector<CompVec>& surfvol,
|
||||
int phase,
|
||||
std::vector<double>& output) const;
|
||||
virtual void dRdp(const std::vector<PhaseVec>& pressures,
|
||||
const std::vector<CompVec>& surfvol,
|
||||
int phase,
|
||||
std::vector<double>& output_R,
|
||||
std::vector<double>& output_dRdp) const;
|
||||
virtual ~SinglePvtConstCompr()
|
||||
{
|
||||
}
|
||||
|
||||
protected:
|
||||
double evalR(double press, const surfvol_t& surfvol) const;
|
||||
void evalRDeriv(double press, const surfvol_t& surfvol, double& R, double& dRdp) const;
|
||||
double evalB(double press, const surfvol_t& surfvol) const;
|
||||
void evalBDeriv(double press, const surfvol_t& surfvol, double& B, double& dBdp) const;
|
||||
virtual void mu(const int n,
|
||||
const double* /*p*/,
|
||||
const double* /*z*/,
|
||||
double* output_mu) const
|
||||
{
|
||||
std::fill(output_mu, output_mu + n, viscosity_);
|
||||
}
|
||||
|
||||
// item: 1=B 2=mu;
|
||||
double miscible_oil(double press, const surfvol_t& surfvol, int item,
|
||||
bool deriv = false) const;
|
||||
virtual void B(const int n,
|
||||
const double* p,
|
||||
const double* /*z*/,
|
||||
double* output_B) const
|
||||
{
|
||||
if (comp_) {
|
||||
#pragma omp parallel for
|
||||
for (int i = 0; i < n; ++i) {
|
||||
// Computing a polynomial approximation to the exponential.
|
||||
double x = comp_*(p[i] - ref_press_);
|
||||
output_B[i] = ref_B_/(1.0 + x + 0.5*x*x);
|
||||
}
|
||||
} else {
|
||||
std::fill(output_B, output_B + n, ref_B_);
|
||||
}
|
||||
}
|
||||
|
||||
// PVT properties of live oil (with dissolved gas)
|
||||
std::vector<std::vector<double> > saturated_oil_table_;
|
||||
std::vector<std::vector<std::vector<double> > > undersat_oil_tables_;
|
||||
virtual void dBdp(const int n,
|
||||
const double* p,
|
||||
const double* /*z*/,
|
||||
double* output_B,
|
||||
double* output_dBdp) const
|
||||
{
|
||||
B(n, p, 0, output_B);
|
||||
if (comp_) {
|
||||
#pragma omp parallel for
|
||||
for (int i = 0; i < n; ++i) {
|
||||
output_dBdp[i] = -comp_*output_B[i];
|
||||
}
|
||||
} else {
|
||||
std::fill(output_dBdp, output_dBdp + n, 0.0);
|
||||
}
|
||||
}
|
||||
|
||||
virtual void R(const int n,
|
||||
const double* /*p*/,
|
||||
const double* /*z*/,
|
||||
double* output_R) const
|
||||
{
|
||||
std::fill(output_R, output_R + n, 0.0);
|
||||
}
|
||||
|
||||
virtual void dRdp(const int n,
|
||||
const double* /*p*/,
|
||||
const double* /*z*/,
|
||||
double* output_R,
|
||||
double* output_dRdp) const
|
||||
{
|
||||
std::fill(output_R, output_R + n, 0.0);
|
||||
std::fill(output_dRdp, output_dRdp + n, 0.0);
|
||||
}
|
||||
|
||||
private:
|
||||
double ref_press_;
|
||||
double ref_B_;
|
||||
double comp_;
|
||||
double viscosity_;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // SINTEF_MISCIBILITYLIVEOIL_HEADER
|
||||
|
||||
#endif // OPM_SINGLEPVTCONSTCOMPR_HEADER_INCLUDED
|
||||
|
||||
|
||||
@@ -1,16 +1,5 @@
|
||||
//===========================================================================
|
||||
//
|
||||
// File: MiscibilityDead.cpp
|
||||
//
|
||||
// Created: Wed Feb 10 09:06:04 2010
|
||||
//
|
||||
// Author: Bjørn Spjelkavik <bsp@sintef.no>
|
||||
//
|
||||
// Revision: $Id$
|
||||
//
|
||||
//===========================================================================
|
||||
/*
|
||||
Copyright 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2010, 2011, 2012 SINTEF ICT, Applied Mathematics.
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
@@ -28,17 +17,14 @@
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <opm/core/fluid/blackoil/MiscibilityDead.hpp>
|
||||
#include <algorithm>
|
||||
#include <opm/core/utility/ErrorMacros.hpp>
|
||||
#include <opm/core/utility/linInt.hpp>
|
||||
#include <opm/core/fluid/blackoil/SinglePvtDead.hpp>
|
||||
#include <opm/core/utility/buildUniformMonotoneTable.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <string>
|
||||
#include <fstream>
|
||||
#include <algorithm>
|
||||
|
||||
using namespace std;
|
||||
using namespace Dune;
|
||||
// Extra includes for debug dumping of tables.
|
||||
// #include <boost/lexical_cast.hpp>
|
||||
// #include <string>
|
||||
// #include <fstream>
|
||||
|
||||
namespace Opm
|
||||
{
|
||||
@@ -48,7 +34,7 @@ namespace Opm
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
/// Constructor
|
||||
MiscibilityDead::MiscibilityDead(const table_t& pvd_table)
|
||||
SinglePvtDead::SinglePvtDead(const table_t& pvd_table)
|
||||
{
|
||||
const int region_number = 0;
|
||||
if (pvd_table.size() != 1) {
|
||||
@@ -78,102 +64,65 @@ namespace Opm
|
||||
}
|
||||
|
||||
// Destructor
|
||||
MiscibilityDead::~MiscibilityDead()
|
||||
SinglePvtDead::~SinglePvtDead()
|
||||
{
|
||||
}
|
||||
|
||||
double MiscibilityDead::getViscosity(int /*region*/, double press, const surfvol_t& /*surfvol*/) const
|
||||
{
|
||||
return viscosity_(press);
|
||||
}
|
||||
|
||||
void MiscibilityDead::getViscosity(const std::vector<PhaseVec>& pressures,
|
||||
const std::vector<CompVec>&,
|
||||
int phase,
|
||||
std::vector<double>& output) const
|
||||
|
||||
void SinglePvtDead::mu(const int n,
|
||||
const double* p,
|
||||
const double* /*z*/,
|
||||
double* output_mu) const
|
||||
{
|
||||
int num = pressures.size();
|
||||
output.resize(num);
|
||||
#pragma omp parallel for
|
||||
for (int i = 0; i < num; ++i) {
|
||||
output[i] = viscosity_(pressures[i][phase]);
|
||||
for (int i = 0; i < n; ++i) {
|
||||
output_mu[i] = viscosity_(p[i]);
|
||||
}
|
||||
}
|
||||
|
||||
double MiscibilityDead::B(int /*region*/, double press, const surfvol_t& /*surfvol*/) const
|
||||
void SinglePvtDead::B(const int n,
|
||||
const double* p,
|
||||
const double* /*z*/,
|
||||
double* output_B) const
|
||||
{
|
||||
// Interpolate 1/B
|
||||
return 1.0/one_over_B_(press);
|
||||
}
|
||||
|
||||
void MiscibilityDead::B(const std::vector<PhaseVec>& pressures,
|
||||
const std::vector<CompVec>&,
|
||||
int phase,
|
||||
std::vector<double>& output) const
|
||||
{
|
||||
int num = pressures.size();
|
||||
output.resize(num);
|
||||
#pragma omp parallel for
|
||||
for (int i = 0; i < num; ++i) {
|
||||
output[i] = 1.0/one_over_B_(pressures[i][phase]);
|
||||
for (int i = 0; i < n; ++i) {
|
||||
output_B[i] = 1.0/one_over_B_(p[i]);
|
||||
}
|
||||
}
|
||||
|
||||
double MiscibilityDead::dBdp(int region, double press, const surfvol_t& /*surfvol*/) const
|
||||
void SinglePvtDead::dBdp(const int n,
|
||||
const double* p,
|
||||
const double* /*z*/,
|
||||
double* output_B,
|
||||
double* output_dBdp) const
|
||||
{
|
||||
// Interpolate 1/B
|
||||
surfvol_t dummy_surfvol;
|
||||
double Bg = B(region, press, dummy_surfvol);
|
||||
return -Bg*Bg*one_over_B_.derivative(press);
|
||||
}
|
||||
|
||||
void MiscibilityDead::dBdp(const std::vector<PhaseVec>& pressures,
|
||||
const std::vector<CompVec>& surfvols,
|
||||
int phase,
|
||||
std::vector<double>& output_B,
|
||||
std::vector<double>& output_dBdp) const
|
||||
{
|
||||
B(pressures, surfvols, phase, output_B);
|
||||
int num = pressures.size();
|
||||
output_dBdp.resize(num);
|
||||
B(n, p, 0, output_B);
|
||||
#pragma omp parallel for
|
||||
for (int i = 0; i < num; ++i) {
|
||||
for (int i = 0; i < n; ++i) {
|
||||
double Bg = output_B[i];
|
||||
output_dBdp[i] = -Bg*Bg*one_over_B_.derivative(pressures[i][phase]);
|
||||
output_dBdp[i] = -Bg*Bg*one_over_B_.derivative(p[i]);
|
||||
}
|
||||
}
|
||||
|
||||
double MiscibilityDead::R(int /*region*/, double /*press*/, const surfvol_t& /*surfvol*/) const
|
||||
|
||||
void SinglePvtDead::R(const int n,
|
||||
const double* /*p*/,
|
||||
const double* /*z*/,
|
||||
double* output_R) const
|
||||
{
|
||||
return 0.0;
|
||||
std::fill(output_R, output_R + n, 0.0);
|
||||
}
|
||||
|
||||
void MiscibilityDead::R(const std::vector<PhaseVec>& pressures,
|
||||
const std::vector<CompVec>&,
|
||||
int,
|
||||
std::vector<double>& output) const
|
||||
void SinglePvtDead::dRdp(const int n,
|
||||
const double* /*p*/,
|
||||
const double* /*z*/,
|
||||
double* output_R,
|
||||
double* output_dRdp) const
|
||||
{
|
||||
int num = pressures.size();
|
||||
output.clear();
|
||||
output.resize(num, 0.0);
|
||||
}
|
||||
|
||||
double MiscibilityDead::dRdp(int /*region*/, double /*press*/, const surfvol_t& /*surfvol*/) const
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
void MiscibilityDead::dRdp(const std::vector<PhaseVec>& pressures,
|
||||
const std::vector<CompVec>&,
|
||||
int,
|
||||
std::vector<double>& output_R,
|
||||
std::vector<double>& output_dRdp) const
|
||||
{
|
||||
int num = pressures.size();
|
||||
output_R.clear();
|
||||
output_R.resize(num, 0.0);
|
||||
output_dRdp.clear();
|
||||
output_dRdp.resize(num, 0.0);
|
||||
std::fill(output_R, output_R + n, 0.0);
|
||||
std::fill(output_dRdp, output_dRdp + n, 0.0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,16 +1,5 @@
|
||||
//===========================================================================
|
||||
//
|
||||
// File: MiscibilityDead.hpp
|
||||
//
|
||||
// Created: Wed Feb 10 09:05:47 2010
|
||||
//
|
||||
// Author: Bjørn Spjelkavik <bsp@sintef.no>
|
||||
//
|
||||
// Revision: $Id$
|
||||
//
|
||||
//===========================================================================
|
||||
/*
|
||||
Copyright 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2010, 2011, 2012 SINTEF ICT, Applied Mathematics.
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
@@ -28,55 +17,57 @@
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef SINTEF_MISCIBILITYDEAD_HEADER
|
||||
#define SINTEF_MISCIBILITYDEAD_HEADER
|
||||
#ifndef OPM_SINGLEPVTDEAD_HEADER_INCLUDED
|
||||
#define OPM_SINGLEPVTDEAD_HEADER_INCLUDED
|
||||
|
||||
/** Class for immiscible dead oil and dry gas.
|
||||
* Detailed description.
|
||||
*/
|
||||
|
||||
#include <opm/core/fluid/blackoil/MiscibilityProps.hpp>
|
||||
#include <opm/core/fluid/blackoil/SinglePvtInterface.hpp>
|
||||
#include <opm/core/utility/UniformTableLinear.hpp>
|
||||
#include <vector>
|
||||
|
||||
namespace Opm
|
||||
{
|
||||
class MiscibilityDead : public MiscibilityProps
|
||||
|
||||
/// Class for immiscible dead oil and dry gas.
|
||||
class SinglePvtDead : public SinglePvtInterface
|
||||
{
|
||||
public:
|
||||
typedef std::vector<std::vector<std::vector<double> > > table_t;
|
||||
|
||||
MiscibilityDead(const table_t& pvd_table);
|
||||
virtual ~MiscibilityDead();
|
||||
SinglePvtDead(const table_t& pvd_table);
|
||||
virtual ~SinglePvtDead();
|
||||
|
||||
virtual double getViscosity(int region, double press, const surfvol_t& surfvol) const;
|
||||
virtual double B(int region, double press, const surfvol_t& surfvol) const;
|
||||
virtual double dBdp(int region, double press, const surfvol_t& surfvol) const;
|
||||
virtual double R(int region, double press, const surfvol_t& surfvol) const;
|
||||
virtual double dRdp(int region, double press, const surfvol_t& surfvol) const;
|
||||
/// Viscosity as a function of p and z.
|
||||
virtual void mu(const int n,
|
||||
const double* p,
|
||||
const double* z,
|
||||
double* output_mu) const;
|
||||
|
||||
virtual void getViscosity(const std::vector<PhaseVec>& pressures,
|
||||
const std::vector<CompVec>& surfvol,
|
||||
int phase,
|
||||
std::vector<double>& output) const;
|
||||
virtual void B(const std::vector<PhaseVec>& pressures,
|
||||
const std::vector<CompVec>& surfvol,
|
||||
int phase,
|
||||
std::vector<double>& output) const;
|
||||
virtual void dBdp(const std::vector<PhaseVec>& pressures,
|
||||
const std::vector<CompVec>& surfvol,
|
||||
int phase,
|
||||
std::vector<double>& output_B,
|
||||
std::vector<double>& output_dBdp) const;
|
||||
virtual void R(const std::vector<PhaseVec>& pressures,
|
||||
const std::vector<CompVec>& surfvol,
|
||||
int phase,
|
||||
std::vector<double>& output) const;
|
||||
virtual void dRdp(const std::vector<PhaseVec>& pressures,
|
||||
const std::vector<CompVec>& surfvol,
|
||||
int phase,
|
||||
std::vector<double>& output_R,
|
||||
std::vector<double>& output_dRdp) const;
|
||||
/// Formation volume factor as a function of p and z.
|
||||
virtual void B(const int n,
|
||||
const double* p,
|
||||
const double* z,
|
||||
double* output_B) const;
|
||||
|
||||
/// Formation volume factor and p-derivative as functions of p and z.
|
||||
virtual void dBdp(const int n,
|
||||
const double* p,
|
||||
const double* z,
|
||||
double* output_B,
|
||||
double* output_dBdp) const;
|
||||
|
||||
/// Solution factor as a function of p and z.
|
||||
virtual void R(const int n,
|
||||
const double* p,
|
||||
const double* z,
|
||||
double* output_R) const;
|
||||
|
||||
/// Solution factor and p-derivative as functions of p and z.
|
||||
virtual void dRdp(const int n,
|
||||
const double* p,
|
||||
const double* z,
|
||||
double* output_R,
|
||||
double* output_dRdp) const;
|
||||
private:
|
||||
// PVT properties of dry gas or dead oil
|
||||
Dune::utils::UniformTableLinear<double> one_over_B_;
|
||||
@@ -85,5 +76,5 @@ namespace Opm
|
||||
|
||||
}
|
||||
|
||||
#endif // SINTEF_MISCIBILITYDEAD_HEADER
|
||||
#endif // OPM_SINGLEPVTDEAD_HEADER_INCLUDED
|
||||
|
||||
|
||||
@@ -1,16 +1,5 @@
|
||||
//===========================================================================
|
||||
//
|
||||
// File: MiscibilityProps.cpp
|
||||
//
|
||||
// Created: Wed Feb 10 09:05:05 2010
|
||||
//
|
||||
// Author: Bjørn Spjelkavik <bsp@sintef.no>
|
||||
//
|
||||
// Revision: $Id$
|
||||
//
|
||||
//===========================================================================
|
||||
/*
|
||||
Copyright 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2010, 2011, 2012 SINTEF ICT, Applied Mathematics.
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
@@ -28,25 +17,31 @@
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "MiscibilityProps.hpp"
|
||||
#include <opm/core/fluid/blackoil/SinglePvtInterface.hpp>
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace Opm
|
||||
{
|
||||
|
||||
SinglePvtInterface::SinglePvtInterface()
|
||||
: num_phases_(MaxNumPhases)
|
||||
{
|
||||
for (int i = 0; i < MaxNumPhases; ++i) {
|
||||
phase_pos_[i] = i;
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Member functions
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
/// Constructor
|
||||
MiscibilityProps::MiscibilityProps()
|
||||
SinglePvtInterface::~SinglePvtInterface()
|
||||
{
|
||||
}
|
||||
|
||||
MiscibilityProps::~MiscibilityProps()
|
||||
void SinglePvtInterface::setPhaseConfiguration(const int num_phases, const int* phase_pos)
|
||||
{
|
||||
num_phases_ = num_phases;
|
||||
for (int i = 0; i < MaxNumPhases; ++i) {
|
||||
phase_pos_[i] = phase_pos[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} // namespace Opm
|
||||
|
||||
@@ -1,16 +1,5 @@
|
||||
//===========================================================================
|
||||
//
|
||||
// File: MiscibilityProps.hpp
|
||||
//
|
||||
// Created: Wed Feb 10 09:04:35 2010
|
||||
//
|
||||
// Author: Bjørn Spjelkavik <bsp@sintef.no>
|
||||
//
|
||||
// Revision: $Id$
|
||||
//
|
||||
//===========================================================================
|
||||
/*
|
||||
Copyright 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2010, 2011, 2012 SINTEF ICT, Applied Mathematics.
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
@@ -28,60 +17,73 @@
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef SINTEF_MISCIBILITYPROPS_HEADER
|
||||
#define SINTEF_MISCIBILITYPROPS_HEADER
|
||||
#ifndef OPM_SINGLEPVTINTERFACE_HEADER_INCLUDED
|
||||
#define OPM_SINGLEPVTINTERFACE_HEADER_INCLUDED
|
||||
|
||||
/** Base class for properties of fluids and rocks.
|
||||
* Detailed description.
|
||||
*/
|
||||
|
||||
#include "BlackoilDefs.hpp"
|
||||
#include <vector>
|
||||
#include <tr1/array>
|
||||
#include <opm/core/fluid/blackoil/BlackoilPhases.hpp>
|
||||
|
||||
|
||||
namespace Opm
|
||||
{
|
||||
|
||||
|
||||
class MiscibilityProps : public BlackoilDefs
|
||||
class SinglePvtInterface : public BlackoilPhases
|
||||
{
|
||||
public:
|
||||
typedef CompVec surfvol_t;
|
||||
SinglePvtInterface();
|
||||
|
||||
MiscibilityProps();
|
||||
virtual ~MiscibilityProps();
|
||||
virtual ~SinglePvtInterface();
|
||||
|
||||
virtual double getViscosity(int region, double press, const surfvol_t& surfvol) const = 0;
|
||||
virtual double B (int region, double press, const surfvol_t& surfvol) const = 0;
|
||||
virtual double dBdp(int region, double press, const surfvol_t& surfvol) const = 0;
|
||||
virtual double R (int region, double press, const surfvol_t& surfvol) const = 0;
|
||||
virtual double dRdp(int region, double press, const surfvol_t& surfvol) const = 0;
|
||||
/// \param[in] num_phases The number of active phases.
|
||||
/// \param[in] phase_pos Array of BlackpoilPhases::MaxNumPhases
|
||||
/// integers, giving the relative
|
||||
/// positions of the three canonical
|
||||
/// phases A, L, V in order to handle
|
||||
/// arbitrary two-phase situations.
|
||||
void setPhaseConfiguration(const int num_phases, const int* phase_pos);
|
||||
|
||||
virtual void getViscosity(const std::vector<PhaseVec>& pressures,
|
||||
const std::vector<CompVec>& surfvol,
|
||||
int phase,
|
||||
std::vector<double>& output) const = 0;
|
||||
virtual void B(const std::vector<PhaseVec>& pressures,
|
||||
const std::vector<CompVec>& surfvol,
|
||||
int phase,
|
||||
std::vector<double>& output) const = 0;
|
||||
virtual void dBdp(const std::vector<PhaseVec>& pressures,
|
||||
const std::vector<CompVec>& surfvol,
|
||||
int phase,
|
||||
std::vector<double>& output_B,
|
||||
std::vector<double>& output_dBdp) const = 0;
|
||||
virtual void R(const std::vector<PhaseVec>& pressures,
|
||||
const std::vector<CompVec>& surfvol,
|
||||
int phase,
|
||||
std::vector<double>& output) const = 0;
|
||||
virtual void dRdp(const std::vector<PhaseVec>& pressures,
|
||||
const std::vector<CompVec>& surfvol,
|
||||
int phase,
|
||||
std::vector<double>& output_R,
|
||||
std::vector<double>& output_dRdp) const = 0;
|
||||
/// For all the virtual methods, the following apply: p and z
|
||||
/// are expected to be of size n and n*num_phases, respectively.
|
||||
/// Output arrays shall be of size n, and must be valid before
|
||||
/// calling the method.
|
||||
|
||||
/// Viscosity as a function of p and z.
|
||||
virtual void mu(const int n,
|
||||
const double* p,
|
||||
const double* z,
|
||||
double* output_mu) const = 0;
|
||||
|
||||
/// Formation volume factor as a function of p and z.
|
||||
virtual void B(const int n,
|
||||
const double* p,
|
||||
const double* z,
|
||||
double* output_B) const = 0;
|
||||
|
||||
/// Formation volume factor and p-derivative as functions of p and z.
|
||||
virtual void dBdp(const int n,
|
||||
const double* p,
|
||||
const double* z,
|
||||
double* output_B,
|
||||
double* output_dBdp) const = 0;
|
||||
|
||||
/// Solution factor as a function of p and z.
|
||||
virtual void R(const int n,
|
||||
const double* p,
|
||||
const double* z,
|
||||
double* output_R) const = 0;
|
||||
|
||||
/// Solution factor and p-derivative as functions of p and z.
|
||||
virtual void dRdp(const int n,
|
||||
const double* p,
|
||||
const double* z,
|
||||
double* output_R,
|
||||
double* output_dRdp) const = 0;
|
||||
protected:
|
||||
int num_phases_;
|
||||
int phase_pos_[MaxNumPhases];
|
||||
};
|
||||
|
||||
} // namespace Opm
|
||||
|
||||
#endif // SINTEF_MISCIBILITYPROPS_HEADER
|
||||
#endif // OPM_SINGLEPVTINTERFACE_HEADER_INCLUDED
|
||||
|
||||
|
||||
@@ -28,24 +28,24 @@
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include <opm/core/fluid/blackoil/MiscibilityLiveGas.hpp>
|
||||
#include <algorithm>
|
||||
#include <opm/core/fluid/blackoil/SinglePvtLiveGas.hpp>
|
||||
#include <opm/core/utility/ErrorMacros.hpp>
|
||||
#include <opm/core/utility/linInt.hpp>
|
||||
#include <algorithm>
|
||||
|
||||
using namespace std;
|
||||
using namespace Dune;
|
||||
|
||||
namespace Opm
|
||||
{
|
||||
|
||||
using Dune::linearInterpolationExtrap;
|
||||
using Dune::linearInterpolDerivative;
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Member functions
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
/// Constructor
|
||||
MiscibilityLiveGas::MiscibilityLiveGas(const table_t& pvtg)
|
||||
SinglePvtLiveGas::SinglePvtLiveGas(const table_t& pvtg)
|
||||
{
|
||||
// GAS, PVTG
|
||||
const int region_number = 0;
|
||||
@@ -81,135 +81,156 @@ namespace Opm
|
||||
}
|
||||
|
||||
// Destructor
|
||||
MiscibilityLiveGas::~MiscibilityLiveGas()
|
||||
SinglePvtLiveGas::~SinglePvtLiveGas()
|
||||
{
|
||||
}
|
||||
|
||||
double MiscibilityLiveGas::getViscosity(int /*region*/, double press, const surfvol_t& surfvol) const
|
||||
{
|
||||
return miscible_gas(press, surfvol, 2, false);
|
||||
}
|
||||
|
||||
void MiscibilityLiveGas::getViscosity(const std::vector<PhaseVec>& pressures,
|
||||
const std::vector<CompVec>& surfvol,
|
||||
int phase,
|
||||
std::vector<double>& output) const
|
||||
void SinglePvtLiveGas::mu(const int n,
|
||||
const double* p,
|
||||
const double* z,
|
||||
double* output_mu) const
|
||||
{
|
||||
ASSERT(pressures.size() == surfvol.size());
|
||||
int num = pressures.size();
|
||||
output.resize(num);
|
||||
for (int i = 0; i < num; ++i) {
|
||||
output[i] = miscible_gas(pressures[i][phase], surfvol[i], 2, false);
|
||||
#pragma omp parallel for
|
||||
for (int i = 0; i < n; ++i) {
|
||||
output_mu[i] = miscible_gas(p[i], z + num_phases_*i, 2, false);
|
||||
}
|
||||
}
|
||||
|
||||
// Vaporised oil-gas ratio.
|
||||
double MiscibilityLiveGas::R(int /*region*/, double press, const surfvol_t& surfvol) const
|
||||
|
||||
/// Formation volume factor as a function of p and z.
|
||||
void SinglePvtLiveGas::B(const int n,
|
||||
const double* p,
|
||||
const double* z,
|
||||
double* output_B) const
|
||||
{
|
||||
if (surfvol[Liquid] == 0.0) {
|
||||
#pragma omp parallel for
|
||||
for (int i = 0; i < n; ++i) {
|
||||
output_B[i] = evalB(p[i], z + num_phases_*i);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Formation volume factor and p-derivative as functions of p and z.
|
||||
void SinglePvtLiveGas::dBdp(const int n,
|
||||
const double* p,
|
||||
const double* z,
|
||||
double* output_B,
|
||||
double* output_dBdp) const
|
||||
{
|
||||
#pragma omp parallel for
|
||||
for (int i = 0; i < n; ++i) {
|
||||
evalBDeriv(p[i], z + num_phases_*i, output_B[i], output_dBdp[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Solution factor as a function of p and z.
|
||||
void SinglePvtLiveGas::R(const int n,
|
||||
const double* p,
|
||||
const double* z,
|
||||
double* output_R) const
|
||||
{
|
||||
#pragma omp parallel for
|
||||
for (int i = 0; i < n; ++i) {
|
||||
output_R[i] = evalR(p[i], z + num_phases_*i);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Solution factor and p-derivative as functions of p and z.
|
||||
void SinglePvtLiveGas::dRdp(const int n,
|
||||
const double* p,
|
||||
const double* z,
|
||||
double* output_R,
|
||||
double* output_dRdp) const
|
||||
{
|
||||
#pragma omp parallel for
|
||||
for (int i = 0; i < n; ++i) {
|
||||
evalRDeriv(p[i], z + num_phases_*i, output_R[i], output_dRdp[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ---- Private methods ----
|
||||
|
||||
double SinglePvtLiveGas::evalB(const double press, const double* surfvol) const
|
||||
{
|
||||
if (surfvol[phase_pos_[Vapour]] == 0.0) {
|
||||
// To handle no-gas case.
|
||||
return 1.0;
|
||||
}
|
||||
return miscible_gas(press, surfvol, 1, false);
|
||||
}
|
||||
|
||||
void SinglePvtLiveGas::evalBDeriv(const double press, const double* surfvol,
|
||||
double& B, double& dBdp) const
|
||||
{
|
||||
if (surfvol[phase_pos_[Vapour]] == 0.0) {
|
||||
// To handle no-gas case.
|
||||
B = 1.0;
|
||||
dBdp = 0.0;
|
||||
return;
|
||||
}
|
||||
B = miscible_gas(press, surfvol, 1, false);
|
||||
dBdp = miscible_gas(press, surfvol, 1, true);
|
||||
}
|
||||
|
||||
double SinglePvtLiveGas::evalR(const double press, const double* surfvol) const
|
||||
{
|
||||
if (surfvol[phase_pos_[Liquid]] == 0.0) {
|
||||
// To handle no-gas case.
|
||||
return 0.0;
|
||||
}
|
||||
double R = linearInterpolationExtrap(saturated_gas_table_[0],
|
||||
double satR = linearInterpolationExtrap(saturated_gas_table_[0],
|
||||
saturated_gas_table_[3], press);
|
||||
double maxR = surfvol[Liquid]/surfvol[Vapour];
|
||||
if (R < maxR ) { // Saturated case
|
||||
return R;
|
||||
double maxR = surfvol[phase_pos_[Liquid]]/surfvol[phase_pos_[Vapour]];
|
||||
if (satR < maxR ) {
|
||||
// Saturated case
|
||||
return satR;
|
||||
} else {
|
||||
return maxR; // Undersaturated case
|
||||
// Undersaturated case
|
||||
return maxR;
|
||||
}
|
||||
}
|
||||
|
||||
void MiscibilityLiveGas::R(const std::vector<PhaseVec>& pressures,
|
||||
const std::vector<CompVec>& surfvol,
|
||||
int phase,
|
||||
std::vector<double>& output) const
|
||||
void SinglePvtLiveGas::evalRDeriv(const double press, const double* surfvol,
|
||||
double& R, double& dRdp) const
|
||||
{
|
||||
ASSERT(pressures.size() == surfvol.size());
|
||||
int num = pressures.size();
|
||||
output.resize(num);
|
||||
for (int i = 0; i < num; ++i) {
|
||||
output[i] = R(0, pressures[i][phase], surfvol[i]);
|
||||
if (surfvol[phase_pos_[Liquid]] == 0.0) {
|
||||
// To handle no-gas case.
|
||||
R = 0.0;
|
||||
dRdp = 0.0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Vaporised oil-gas ratio derivative
|
||||
double MiscibilityLiveGas::dRdp(int /*region*/, double press, const surfvol_t& surfvol) const
|
||||
{
|
||||
double R = linearInterpolationExtrap(saturated_gas_table_[0],
|
||||
double satR = linearInterpolationExtrap(saturated_gas_table_[0],
|
||||
saturated_gas_table_[3], press);
|
||||
double maxR = surfvol[Liquid]/surfvol[Vapour];
|
||||
if (R < maxR ) { // Saturated case
|
||||
return linearInterpolDerivative(saturated_gas_table_[0],
|
||||
double maxR = surfvol[phase_pos_[Liquid]]/surfvol[phase_pos_[Vapour]];
|
||||
if (satR < maxR ) {
|
||||
// Saturated case
|
||||
R = satR;
|
||||
dRdp = linearInterpolDerivative(saturated_gas_table_[0],
|
||||
saturated_gas_table_[3],
|
||||
press);
|
||||
} else {
|
||||
return 0.0; // Undersaturated case
|
||||
// Undersaturated case
|
||||
R = maxR;
|
||||
dRdp = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void MiscibilityLiveGas::dRdp(const std::vector<PhaseVec>& pressures,
|
||||
const std::vector<CompVec>& surfvol,
|
||||
int phase,
|
||||
std::vector<double>& output_R,
|
||||
std::vector<double>& output_dRdp) const
|
||||
{
|
||||
ASSERT(pressures.size() == surfvol.size());
|
||||
R(pressures, surfvol, phase, output_R);
|
||||
int num = pressures.size();
|
||||
output_dRdp.resize(num);
|
||||
for (int i = 0; i < num; ++i) {
|
||||
output_dRdp[i] = dRdp(0, pressures[i][phase], surfvol[i]); // \TODO Speedup here by using already evaluated R.
|
||||
}
|
||||
}
|
||||
|
||||
double MiscibilityLiveGas::B(int /*region*/, double press, const surfvol_t& surfvol) const
|
||||
{
|
||||
if (surfvol[Vapour] == 0.0) return 1.0; // To handle no-gas case.
|
||||
return miscible_gas(press, surfvol, 1, false);
|
||||
}
|
||||
|
||||
void MiscibilityLiveGas::B(const std::vector<PhaseVec>& pressures,
|
||||
const std::vector<CompVec>& surfvol,
|
||||
int phase,
|
||||
std::vector<double>& output) const
|
||||
{
|
||||
ASSERT(pressures.size() == surfvol.size());
|
||||
int num = pressures.size();
|
||||
output.resize(num);
|
||||
for (int i = 0; i < num; ++i) {
|
||||
output[i] = B(0, pressures[i][phase], surfvol[i]);
|
||||
}
|
||||
}
|
||||
|
||||
double MiscibilityLiveGas::dBdp(int /*region*/, double press, const surfvol_t& surfvol) const
|
||||
{
|
||||
if (surfvol[Vapour] == 0.0) return 0.0; // To handle no-gas case.
|
||||
return miscible_gas(press, surfvol, 1, true);
|
||||
}
|
||||
|
||||
void MiscibilityLiveGas::dBdp(const std::vector<PhaseVec>& pressures,
|
||||
const std::vector<CompVec>& surfvol,
|
||||
int phase,
|
||||
std::vector<double>& output_B,
|
||||
std::vector<double>& output_dBdp) const
|
||||
{
|
||||
ASSERT(pressures.size() == surfvol.size());
|
||||
B(pressures, surfvol, phase, output_B);
|
||||
int num = pressures.size();
|
||||
output_dBdp.resize(num);
|
||||
for (int i = 0; i < num; ++i) {
|
||||
output_dBdp[i] = dBdp(0, pressures[i][phase], surfvol[i]); // \TODO Speedup here by using already evaluated B.
|
||||
}
|
||||
}
|
||||
|
||||
double MiscibilityLiveGas::miscible_gas(double press, const surfvol_t& surfvol, int item,
|
||||
bool deriv) const
|
||||
double SinglePvtLiveGas::miscible_gas(const double press,
|
||||
const double* surfvol,
|
||||
const int item,
|
||||
const bool deriv) const
|
||||
{
|
||||
int section;
|
||||
double R = linearInterpolationExtrap(saturated_gas_table_[0],
|
||||
saturated_gas_table_[3], press,
|
||||
section);
|
||||
double maxR = surfvol[Liquid]/surfvol[Vapour];
|
||||
double maxR = surfvol[phase_pos_[Liquid]]/surfvol[phase_pos_[Vapour]];
|
||||
if (deriv) {
|
||||
if (R < maxR ) { // Saturated case
|
||||
return linearInterpolDerivative(saturated_gas_table_[0],
|
||||
|
||||
@@ -1,16 +1,5 @@
|
||||
//===========================================================================
|
||||
//
|
||||
// File: MiscibilityLiveGas.hpp
|
||||
//
|
||||
// Created: Wed Feb 10 09:21:26 2010
|
||||
//
|
||||
// Author: Bjørn Spjelkavik <bsp@sintef.no>
|
||||
//
|
||||
// Revision: $Id$
|
||||
//
|
||||
//===========================================================================
|
||||
/*
|
||||
Copyright 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2010, 2011, 2012 SINTEF ICT, Applied Mathematics.
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
@@ -28,58 +17,66 @@
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef SINTEF_MISCIBILITYLIVEGAS_HEADER
|
||||
#define SINTEF_MISCIBILITYLIVEGAS_HEADER
|
||||
#ifndef OPM_SINGLEPVTLIVEGAS_HEADER_INCLUDED
|
||||
#define OPM_SINGLEPVTLIVEGAS_HEADER_INCLUDED
|
||||
|
||||
/** Class for miscible wet gas.
|
||||
* Detailed description.
|
||||
*/
|
||||
|
||||
#include "MiscibilityProps.hpp"
|
||||
#include <opm/core/fluid/blackoil/SinglePvtInterface.hpp>
|
||||
#include <vector>
|
||||
|
||||
namespace Opm
|
||||
{
|
||||
class MiscibilityLiveGas : public MiscibilityProps
|
||||
/// Class for miscible wet gas.
|
||||
class SinglePvtLiveGas : public SinglePvtInterface
|
||||
{
|
||||
public:
|
||||
typedef std::vector<std::vector<std::vector<double> > > table_t;
|
||||
|
||||
MiscibilityLiveGas(const table_t& pvto);
|
||||
virtual ~MiscibilityLiveGas();
|
||||
SinglePvtLiveGas(const table_t& pvto);
|
||||
virtual ~SinglePvtLiveGas();
|
||||
|
||||
virtual double getViscosity(int region, double press, const surfvol_t& surfvol) const;
|
||||
virtual double R(int region, double press, const surfvol_t& surfvol) const;
|
||||
virtual double dRdp(int region, double press, const surfvol_t& surfvol) const;
|
||||
virtual double B(int region, double press, const surfvol_t& surfvol) const;
|
||||
virtual double dBdp(int region, double press, const surfvol_t& surfvol) const;
|
||||
/// Viscosity as a function of p and z.
|
||||
virtual void mu(const int n,
|
||||
const double* p,
|
||||
const double* z,
|
||||
double* output_mu) const;
|
||||
|
||||
virtual void getViscosity(const std::vector<PhaseVec>& pressures,
|
||||
const std::vector<CompVec>& surfvol,
|
||||
int phase,
|
||||
std::vector<double>& output) const;
|
||||
virtual void B(const std::vector<PhaseVec>& pressures,
|
||||
const std::vector<CompVec>& surfvol,
|
||||
int phase,
|
||||
std::vector<double>& output) const;
|
||||
virtual void dBdp(const std::vector<PhaseVec>& pressures,
|
||||
const std::vector<CompVec>& surfvol,
|
||||
int phase,
|
||||
std::vector<double>& output_B,
|
||||
std::vector<double>& output_dBdp) const;
|
||||
virtual void R(const std::vector<PhaseVec>& pressures,
|
||||
const std::vector<CompVec>& surfvol,
|
||||
int phase,
|
||||
std::vector<double>& output) const;
|
||||
virtual void dRdp(const std::vector<PhaseVec>& pressures,
|
||||
const std::vector<CompVec>& surfvol,
|
||||
int phase,
|
||||
std::vector<double>& output_R,
|
||||
std::vector<double>& output_dRdp) const;
|
||||
/// Formation volume factor as a function of p and z.
|
||||
virtual void B(const int n,
|
||||
const double* p,
|
||||
const double* z,
|
||||
double* output_B) const;
|
||||
|
||||
/// Formation volume factor and p-derivative as functions of p and z.
|
||||
virtual void dBdp(const int n,
|
||||
const double* p,
|
||||
const double* z,
|
||||
double* output_B,
|
||||
double* output_dBdp) const;
|
||||
|
||||
/// Solution factor as a function of p and z.
|
||||
virtual void R(const int n,
|
||||
const double* p,
|
||||
const double* z,
|
||||
double* output_R) const;
|
||||
|
||||
/// Solution factor and p-derivative as functions of p and z.
|
||||
virtual void dRdp(const int n,
|
||||
const double* p,
|
||||
const double* z,
|
||||
double* output_R,
|
||||
double* output_dRdp) const;
|
||||
|
||||
protected:
|
||||
// item: 1=B 2=mu;
|
||||
double miscible_gas(double press, const surfvol_t& surfvol, int item,
|
||||
bool deriv = false) const;
|
||||
double evalB(double press, const double* surfvol) const;
|
||||
void evalBDeriv(double press, const double* surfvol, double& B, double& dBdp) const;
|
||||
double evalR(double press, const double* surfvol) const;
|
||||
void evalRDeriv(double press, const double* surfvol, double& R, double& dRdp) const;
|
||||
|
||||
// item: 1=>B 2=>mu;
|
||||
double miscible_gas(const double press,
|
||||
const double* surfvol,
|
||||
const int item,
|
||||
const bool deriv = false) const;
|
||||
// PVT properties of wet gas (with vaporised oil)
|
||||
std::vector<std::vector<double> > saturated_gas_table_;
|
||||
std::vector<std::vector<std::vector<double> > > undersat_gas_tables_;
|
||||
@@ -88,5 +85,5 @@ namespace Opm
|
||||
|
||||
}
|
||||
|
||||
#endif // SINTEF_MISCIBILITYLIVEGAS_HEADER
|
||||
#endif // OPM_SINGLEPVTLIVEGAS_HEADER_INCLUDED
|
||||
|
||||
|
||||
@@ -1,16 +1,5 @@
|
||||
//===========================================================================
|
||||
//
|
||||
// File: MiscibiltyLiveOil.cpp
|
||||
//
|
||||
// Created: Wed Feb 10 09:08:25 2010
|
||||
//
|
||||
// Author: Bjørn Spjelkavik <bsp@sintef.no>
|
||||
//
|
||||
// Revision: $Id$
|
||||
//
|
||||
//===========================================================================
|
||||
/*
|
||||
Copyright 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2010, 2011, 2012 SINTEF ICT, Applied Mathematics.
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
@@ -28,24 +17,26 @@
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <opm/core/fluid/blackoil/MiscibilityLiveOil.hpp>
|
||||
#include <opm/core/fluid/blackoil/SinglePvtLiveOil.hpp>
|
||||
#include <opm/core/utility/ErrorMacros.hpp>
|
||||
#include <opm/core/utility/linInt.hpp>
|
||||
#include <algorithm>
|
||||
|
||||
using namespace std;
|
||||
using namespace Dune;
|
||||
|
||||
namespace Opm
|
||||
{
|
||||
|
||||
using Dune::linearInterpolationExtrap;
|
||||
using Dune::linearInterpolDerivative;
|
||||
using Dune::tableIndex;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Member functions
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
/// Constructor
|
||||
MiscibilityLiveOil::MiscibilityLiveOil(const table_t& pvto)
|
||||
SinglePvtLiveOil::SinglePvtLiveOil(const table_t& pvto)
|
||||
{
|
||||
// OIL, PVTO
|
||||
const int region_number = 0;
|
||||
@@ -164,132 +155,108 @@ namespace Opm
|
||||
}
|
||||
}
|
||||
}
|
||||
// Destructor
|
||||
MiscibilityLiveOil::~MiscibilityLiveOil()
|
||||
|
||||
/// Destructor.
|
||||
SinglePvtLiveOil::~SinglePvtLiveOil()
|
||||
{
|
||||
}
|
||||
|
||||
double MiscibilityLiveOil::getViscosity(int /*region*/, double press, const surfvol_t& surfvol) const
|
||||
{
|
||||
return miscible_oil(press, surfvol, 2, false);
|
||||
}
|
||||
|
||||
void MiscibilityLiveOil::getViscosity(const std::vector<PhaseVec>& pressures,
|
||||
const std::vector<CompVec>& surfvol,
|
||||
int phase,
|
||||
std::vector<double>& output) const
|
||||
/// Viscosity as a function of p and z.
|
||||
void SinglePvtLiveOil::mu(const int n,
|
||||
const double* p,
|
||||
const double* z,
|
||||
double* output_mu) const
|
||||
{
|
||||
ASSERT(pressures.size() == surfvol.size());
|
||||
int num = pressures.size();
|
||||
output.resize(num);
|
||||
#pragma omp parallel for
|
||||
for (int i = 0; i < num; ++i) {
|
||||
output[i] = miscible_oil(pressures[i][phase], surfvol[i], 2, false);
|
||||
}
|
||||
}
|
||||
|
||||
// Dissolved gas-oil ratio
|
||||
double MiscibilityLiveOil::R(int /*region*/, double press, const surfvol_t& surfvol) const
|
||||
{
|
||||
return evalR(press, surfvol);
|
||||
}
|
||||
|
||||
void MiscibilityLiveOil::R(const std::vector<PhaseVec>& pressures,
|
||||
const std::vector<CompVec>& surfvol,
|
||||
int phase,
|
||||
std::vector<double>& output) const
|
||||
{
|
||||
ASSERT(pressures.size() == surfvol.size());
|
||||
int num = pressures.size();
|
||||
output.resize(num);
|
||||
#pragma omp parallel for
|
||||
for (int i = 0; i < num; ++i) {
|
||||
output[i] = evalR(pressures[i][phase], surfvol[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// Dissolved gas-oil ratio derivative
|
||||
double MiscibilityLiveOil::dRdp(int /*region*/, double press, const surfvol_t& surfvol) const
|
||||
{
|
||||
double R = linearInterpolationExtrap(saturated_oil_table_[0],
|
||||
saturated_oil_table_[3], press);
|
||||
double maxR = surfvol[Vapour]/surfvol[Liquid];
|
||||
if (R < maxR ) { // Saturated case
|
||||
return linearInterpolDerivative(saturated_oil_table_[0],
|
||||
saturated_oil_table_[3],
|
||||
press);
|
||||
} else {
|
||||
return 0.0; // Undersaturated case
|
||||
}
|
||||
}
|
||||
|
||||
void MiscibilityLiveOil::dRdp(const std::vector<PhaseVec>& pressures,
|
||||
const std::vector<CompVec>& surfvol,
|
||||
int phase,
|
||||
std::vector<double>& output_R,
|
||||
std::vector<double>& output_dRdp) const
|
||||
{
|
||||
ASSERT(pressures.size() == surfvol.size());
|
||||
int num = pressures.size();
|
||||
output_R.resize(num);
|
||||
output_dRdp.resize(num);
|
||||
#pragma omp parallel for
|
||||
for (int i = 0; i < num; ++i) {
|
||||
evalRDeriv(pressures[i][phase], surfvol[i], output_R[i], output_dRdp[i]);
|
||||
}
|
||||
}
|
||||
|
||||
double MiscibilityLiveOil::B(int /*region*/, double press, const surfvol_t& surfvol) const
|
||||
{
|
||||
return evalB(press, surfvol);
|
||||
}
|
||||
|
||||
void MiscibilityLiveOil::B(const std::vector<PhaseVec>& pressures,
|
||||
const std::vector<CompVec>& surfvol,
|
||||
int phase,
|
||||
std::vector<double>& output) const
|
||||
{
|
||||
ASSERT(pressures.size() == surfvol.size());
|
||||
int num = pressures.size();
|
||||
output.resize(num);
|
||||
#pragma omp parallel for
|
||||
for (int i = 0; i < num; ++i) {
|
||||
output[i] = evalB(pressures[i][phase], surfvol[i]);
|
||||
}
|
||||
}
|
||||
|
||||
double MiscibilityLiveOil::dBdp(int /*region*/, double press, const surfvol_t& surfvol) const
|
||||
{
|
||||
// if (surfvol[Liquid] == 0.0) return 0.0; // To handle no-oil case.
|
||||
double Bo = evalB(press, surfvol); // \TODO check if we incur virtual call overhead here.
|
||||
return -Bo*Bo*miscible_oil(press, surfvol, 1, true);
|
||||
}
|
||||
|
||||
void MiscibilityLiveOil::dBdp(const std::vector<PhaseVec>& pressures,
|
||||
const std::vector<CompVec>& surfvol,
|
||||
int phase,
|
||||
std::vector<double>& output_B,
|
||||
std::vector<double>& output_dBdp) const
|
||||
{
|
||||
ASSERT(pressures.size() == surfvol.size());
|
||||
B(pressures, surfvol, phase, output_B);
|
||||
int num = pressures.size();
|
||||
output_dBdp.resize(num);
|
||||
#pragma omp parallel for
|
||||
for (int i = 0; i < num; ++i) {
|
||||
output_dBdp[i] = dBdp(0, pressures[i][phase], surfvol[i]); // \TODO Speedup here by using already evaluated B.
|
||||
for (int i = 0; i < n; ++i) {
|
||||
output_mu[i] = miscible_oil(p[i], z + num_phases_*i, 2, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
double MiscibilityLiveOil::evalR(double press, const surfvol_t& surfvol) const
|
||||
/// Formation volume factor as a function of p and z.
|
||||
void SinglePvtLiveOil::B(const int n,
|
||||
const double* p,
|
||||
const double* z,
|
||||
double* output_B) const
|
||||
{
|
||||
if (surfvol[Vapour] == 0.0) {
|
||||
#pragma omp parallel for
|
||||
for (int i = 0; i < n; ++i) {
|
||||
output_B[i] = evalB(p[i], z + num_phases_*i);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Formation volume factor and p-derivative as functions of p and z.
|
||||
void SinglePvtLiveOil::dBdp(const int n,
|
||||
const double* p,
|
||||
const double* z,
|
||||
double* output_B,
|
||||
double* output_dBdp) const
|
||||
{
|
||||
#pragma omp parallel for
|
||||
for (int i = 0; i < n; ++i) {
|
||||
evalBDeriv(p[i], z + num_phases_*i, output_B[i], output_dBdp[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Solution factor as a function of p and z.
|
||||
void SinglePvtLiveOil::R(const int n,
|
||||
const double* p,
|
||||
const double* z,
|
||||
double* output_R) const
|
||||
{
|
||||
#pragma omp parallel for
|
||||
for (int i = 0; i < n; ++i) {
|
||||
output_R[i] = evalR(p[i], z + num_phases_*i);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Solution factor and p-derivative as functions of p and z.
|
||||
void SinglePvtLiveOil::dRdp(const int n,
|
||||
const double* p,
|
||||
const double* z,
|
||||
double* output_R,
|
||||
double* output_dRdp) const
|
||||
{
|
||||
#pragma omp parallel for
|
||||
for (int i = 0; i < n; ++i) {
|
||||
evalRDeriv(p[i], z + num_phases_*i, output_R[i], output_dRdp[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// ---- Private methods ----
|
||||
|
||||
double SinglePvtLiveOil::evalB(double press, const double* surfvol) const
|
||||
{
|
||||
// if (surfvol[phase_pos_[Liquid]] == 0.0) return 1.0; // To handle no-oil case.
|
||||
return 1.0/miscible_oil(press, surfvol, 1, false);
|
||||
}
|
||||
|
||||
|
||||
void SinglePvtLiveOil::evalBDeriv(const double press, const double* surfvol,
|
||||
double& B, double& dBdp) const
|
||||
{
|
||||
B = evalB(press, surfvol);
|
||||
dBdp = -B*B*miscible_oil(press, surfvol, 1, true);
|
||||
}
|
||||
|
||||
double SinglePvtLiveOil::evalR(double press, const double* surfvol) const
|
||||
{
|
||||
if (surfvol[phase_pos_[Vapour]] == 0.0) {
|
||||
return 0.0;
|
||||
}
|
||||
double R = linearInterpolationExtrap(saturated_oil_table_[0],
|
||||
saturated_oil_table_[3], press);
|
||||
double maxR = surfvol[Vapour]/surfvol[Liquid];
|
||||
double maxR = surfvol[phase_pos_[Vapour]]/surfvol[phase_pos_[Liquid]];
|
||||
if (R < maxR ) { // Saturated case
|
||||
return R;
|
||||
} else {
|
||||
@@ -297,17 +264,17 @@ namespace Opm
|
||||
}
|
||||
}
|
||||
|
||||
void MiscibilityLiveOil::evalRDeriv(const double press, const surfvol_t& surfvol,
|
||||
double& R, double& dRdp) const
|
||||
void SinglePvtLiveOil::evalRDeriv(const double press, const double* surfvol,
|
||||
double& R, double& dRdp) const
|
||||
{
|
||||
if (surfvol[Vapour] == 0.0) {
|
||||
if (surfvol[phase_pos_[Vapour]] == 0.0) {
|
||||
R = 0.0;
|
||||
dRdp = 0.0;
|
||||
return;
|
||||
}
|
||||
R = linearInterpolationExtrap(saturated_oil_table_[0],
|
||||
saturated_oil_table_[3], press);
|
||||
double maxR = surfvol[Vapour]/surfvol[Liquid];
|
||||
double maxR = surfvol[phase_pos_[Vapour]]/surfvol[phase_pos_[Liquid]];
|
||||
if (R < maxR ) {
|
||||
// Saturated case
|
||||
dRdp = linearInterpolDerivative(saturated_oil_table_[0],
|
||||
@@ -321,29 +288,16 @@ namespace Opm
|
||||
}
|
||||
|
||||
|
||||
double MiscibilityLiveOil::evalB(double press, const surfvol_t& surfvol) const
|
||||
{
|
||||
// if (surfvol[Liquid] == 0.0) return 1.0; // To handle no-oil case.
|
||||
return 1.0/miscible_oil(press, surfvol, 1, false);
|
||||
}
|
||||
|
||||
|
||||
void MiscibilityLiveOil::evalBDeriv(const double press, const surfvol_t& surfvol,
|
||||
double& B, double& dBdp) const
|
||||
{
|
||||
B = evalB(press, surfvol);
|
||||
dBdp = -B*B*miscible_oil(press, surfvol, 1, true);
|
||||
}
|
||||
|
||||
|
||||
double MiscibilityLiveOil::miscible_oil(double press, const surfvol_t& surfvol,
|
||||
int item, bool deriv) const
|
||||
double SinglePvtLiveOil::miscible_oil(const double press,
|
||||
const double* surfvol,
|
||||
const int item,
|
||||
const bool deriv) const
|
||||
{
|
||||
int section;
|
||||
double R = linearInterpolationExtrap(saturated_oil_table_[0],
|
||||
saturated_oil_table_[3],
|
||||
press, section);
|
||||
double maxR = (surfvol[Liquid] == 0.0) ? 0.0 : surfvol[Vapour]/surfvol[Liquid];
|
||||
double maxR = (surfvol[phase_pos_[Liquid]] == 0.0) ? 0.0 : surfvol[phase_pos_[Vapour]]/surfvol[phase_pos_[Liquid]];
|
||||
if (deriv) {
|
||||
if (R < maxR ) { // Saturated case
|
||||
return linearInterpolDerivative(saturated_oil_table_[0],
|
||||
|
||||
@@ -1,16 +1,5 @@
|
||||
//===========================================================================
|
||||
//
|
||||
// File: MiscibilityLiveOil.hpp
|
||||
//
|
||||
// Created: Wed Feb 10 09:08:09 2010
|
||||
//
|
||||
// Author: Bjørn Spjelkavik <bsp@sintef.no>
|
||||
//
|
||||
// Revision: $Id$
|
||||
//
|
||||
//===========================================================================
|
||||
/*
|
||||
Copyright 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2010, 2011, 2012 SINTEF ICT, Applied Mathematics.
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
@@ -28,63 +17,67 @@
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef SINTEF_MISCIBILITYLIVEOIL_HEADER
|
||||
#define SINTEF_MISCIBILITYLIVEOIL_HEADER
|
||||
#ifndef OPM_SINGLEPVTLIVEOIL_HEADER_INCLUDED
|
||||
#define OPM_SINGLEPVTLIVEOIL_HEADER_INCLUDED
|
||||
|
||||
/** Class for miscible live oil.
|
||||
* Detailed description.
|
||||
*/
|
||||
|
||||
#include "MiscibilityProps.hpp"
|
||||
#include <opm/core/fluid/blackoil/SinglePvtInterface.hpp>
|
||||
#include <vector>
|
||||
|
||||
namespace Opm
|
||||
{
|
||||
class MiscibilityLiveOil : public MiscibilityProps
|
||||
/// Class for miscible live oil.
|
||||
class SinglePvtLiveOil : public SinglePvtInterface
|
||||
{
|
||||
public:
|
||||
typedef std::vector<std::vector<std::vector<double> > > table_t;
|
||||
|
||||
MiscibilityLiveOil(const table_t& pvto);
|
||||
virtual ~MiscibilityLiveOil();
|
||||
SinglePvtLiveOil(const table_t& pvto);
|
||||
virtual ~SinglePvtLiveOil();
|
||||
|
||||
virtual double getViscosity(int region, double press, const surfvol_t& surfvol) const;
|
||||
virtual double R (int region, double press, const surfvol_t& surfvol) const;
|
||||
virtual double dRdp(int region, double press, const surfvol_t& surfvol) const;
|
||||
virtual double B (int region, double press, const surfvol_t& surfvol) const;
|
||||
virtual double dBdp(int region, double press, const surfvol_t& surfvol) const;
|
||||
/// Viscosity as a function of p and z.
|
||||
virtual void mu(const int n,
|
||||
const double* p,
|
||||
const double* z,
|
||||
double* output_mu) const;
|
||||
|
||||
virtual void getViscosity(const std::vector<PhaseVec>& pressures,
|
||||
const std::vector<CompVec>& surfvol,
|
||||
int phase,
|
||||
std::vector<double>& output) const;
|
||||
virtual void B(const std::vector<PhaseVec>& pressures,
|
||||
const std::vector<CompVec>& surfvol,
|
||||
int phase,
|
||||
std::vector<double>& output) const;
|
||||
virtual void dBdp(const std::vector<PhaseVec>& pressures,
|
||||
const std::vector<CompVec>& surfvol,
|
||||
int phase,
|
||||
std::vector<double>& output_B,
|
||||
std::vector<double>& output_dBdp) const;
|
||||
virtual void R(const std::vector<PhaseVec>& pressures,
|
||||
const std::vector<CompVec>& surfvol,
|
||||
int phase,
|
||||
std::vector<double>& output) const;
|
||||
virtual void dRdp(const std::vector<PhaseVec>& pressures,
|
||||
const std::vector<CompVec>& surfvol,
|
||||
int phase,
|
||||
std::vector<double>& output_R,
|
||||
std::vector<double>& output_dRdp) const;
|
||||
/// Formation volume factor as a function of p and z.
|
||||
virtual void B(const int n,
|
||||
const double* p,
|
||||
const double* z,
|
||||
double* output_B) const;
|
||||
|
||||
protected:
|
||||
double evalR(double press, const surfvol_t& surfvol) const;
|
||||
void evalRDeriv(double press, const surfvol_t& surfvol, double& R, double& dRdp) const;
|
||||
double evalB(double press, const surfvol_t& surfvol) const;
|
||||
void evalBDeriv(double press, const surfvol_t& surfvol, double& B, double& dBdp) const;
|
||||
/// Formation volume factor and p-derivative as functions of p and z.
|
||||
virtual void dBdp(const int n,
|
||||
const double* p,
|
||||
const double* z,
|
||||
double* output_B,
|
||||
double* output_dBdp) const;
|
||||
|
||||
// item: 1=B 2=mu;
|
||||
double miscible_oil(double press, const surfvol_t& surfvol, int item,
|
||||
bool deriv = false) const;
|
||||
/// Solution factor as a function of p and z.
|
||||
virtual void R(const int n,
|
||||
const double* p,
|
||||
const double* z,
|
||||
double* output_R) const;
|
||||
|
||||
/// Solution factor and p-derivative as functions of p and z.
|
||||
virtual void dRdp(const int n,
|
||||
const double* p,
|
||||
const double* z,
|
||||
double* output_R,
|
||||
double* output_dRdp) const;
|
||||
|
||||
private:
|
||||
double evalB(double press, const double* surfvol) const;
|
||||
void evalBDeriv(double press, const double* surfvol, double& B, double& dBdp) const;
|
||||
double evalR(double press, const double* surfvol) const;
|
||||
void evalRDeriv(double press, const double* surfvol, double& R, double& dRdp) const;
|
||||
|
||||
// item: 1=>1/B 2=>mu;
|
||||
double miscible_oil(const double press,
|
||||
const double* surfvol,
|
||||
const int item,
|
||||
const bool deriv = false) const;
|
||||
|
||||
// PVT properties of live oil (with dissolved gas)
|
||||
std::vector<std::vector<double> > saturated_oil_table_;
|
||||
@@ -93,5 +86,5 @@ namespace Opm
|
||||
|
||||
}
|
||||
|
||||
#endif // SINTEF_MISCIBILITYLIVEOIL_HEADER
|
||||
#endif // OPM_SINGLEPVTLIVEOIL_HEADER_INCLUDED
|
||||
|
||||
|
||||
Reference in New Issue
Block a user