Added support for pressure-dependent viscosity to SinglePvtConstComp class.

This is the class that handles PVTW and PVCDO inputs.
This commit is contained in:
Atgeirr Flø Rasmussen 2012-05-18 11:08:51 +02:00
parent bfcc856d4b
commit fac1c24fba

View File

@ -50,16 +50,15 @@ namespace Opm
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'.");
}
visc_comp_ = pvtw[region_number][4];
}
SinglePvtConstCompr(double visc)
: ref_press_(0.0),
ref_B_(1.0),
comp_(0.0),
viscosity_(visc)
viscosity_(visc),
visc_comp_(0.0)
{
}
@ -68,12 +67,21 @@ namespace Opm
}
virtual void mu(const int n,
const double* /*p*/,
const double* p,
const double* /*z*/,
double* output_mu) const
{
if (visc_comp_) {
// #pragma omp parallel for
for (int i = 0; i < n; ++i) {
// Computing a polynomial approximation to the exponential.
double x = -visc_comp_*(p[i] - ref_press_);
output_mu[i] = viscosity_/(1.0 + x + 0.5*x*x);
}
} else {
std::fill(output_mu, output_mu + n, viscosity_);
}
}
virtual void B(const int n,
const double* p,
@ -132,6 +140,7 @@ namespace Opm
double ref_B_;
double comp_;
double viscosity_;
double visc_comp_;
};
}