diff --git a/opm/core/fluid/blackoil/BlackoilPvtProperties.cpp b/opm/core/fluid/blackoil/BlackoilPvtProperties.cpp index 6278d1bd..39b4ba05 100644 --- a/opm/core/fluid/blackoil/BlackoilPvtProperties.cpp +++ b/opm/core/fluid/blackoil/BlackoilPvtProperties.cpp @@ -39,7 +39,7 @@ namespace Opm } - void BlackoilPvtProperties::init(const EclipseGridParser& deck,const int samples) + void BlackoilPvtProperties::init(const EclipseGridParser& deck, const int samples) { typedef std::vector > > table_t; // If we need multiple regions, this class and the SinglePvt* classes must change. diff --git a/opm/core/fluid/blackoil/BlackoilPvtProperties.hpp b/opm/core/fluid/blackoil/BlackoilPvtProperties.hpp index 99fd5b8f..191c6fa8 100644 --- a/opm/core/fluid/blackoil/BlackoilPvtProperties.hpp +++ b/opm/core/fluid/blackoil/BlackoilPvtProperties.hpp @@ -47,7 +47,7 @@ namespace Opm BlackoilPvtProperties(); /// Initialize from deck. - void init(const EclipseGridParser& deck,const int samples = 16); + void init(const EclipseGridParser& deck, const int samples = 16); /// Number of active phases. int numPhases() const; diff --git a/opm/core/fluid/blackoil/SinglePvtConstCompr.hpp b/opm/core/fluid/blackoil/SinglePvtConstCompr.hpp index 3044bdb2..557bc1e8 100644 --- a/opm/core/fluid/blackoil/SinglePvtConstCompr.hpp +++ b/opm/core/fluid/blackoil/SinglePvtConstCompr.hpp @@ -106,15 +106,13 @@ namespace Opm 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]; double x = comp_*(p[i] - ref_press_); - double d= (1.0 + x + 0.5*x*x); - output_B[i] = ref_B_/d;//(1.0 + x + 0.5*x*x); - output_dBdp[i] = (- ref_B_/(d*d))*(1 + x) *comp_; + double d = (1.0 + x + 0.5*x*x); + output_B[i] = ref_B_/d; + output_dBdp[i] = (-ref_B_/(d*d))*(1 + x) * comp_; } } else { std::fill(output_B, output_B + n, ref_B_); diff --git a/opm/core/fluid/blackoil/SinglePvtDead.cpp b/opm/core/fluid/blackoil/SinglePvtDead.cpp index b37fdc2d..1a0993be 100644 --- a/opm/core/fluid/blackoil/SinglePvtDead.cpp +++ b/opm/core/fluid/blackoil/SinglePvtDead.cpp @@ -33,7 +33,7 @@ namespace Opm // Member functions //------------------------------------------------------------------------- /// Constructor - SinglePvtDead::SinglePvtDead(const table_t& pvd_table,const int samples) + SinglePvtDead::SinglePvtDead(const table_t& pvd_table, const int samples) { const int region_number = 0; if (pvd_table.size() != 1) { diff --git a/opm/core/fluid/blackoil/SinglePvtDead.hpp b/opm/core/fluid/blackoil/SinglePvtDead.hpp index 5a8f6971..90a7d695 100644 --- a/opm/core/fluid/blackoil/SinglePvtDead.hpp +++ b/opm/core/fluid/blackoil/SinglePvtDead.hpp @@ -37,7 +37,7 @@ namespace Opm { public: typedef std::vector > > table_t; - SinglePvtDead(const table_t& pvd_table,const int samples = 16); + SinglePvtDead(const table_t& pvd_table, const int samples = 16); virtual ~SinglePvtDead(); /// Viscosity as a function of p and z. diff --git a/opm/core/utility/UniformTableLinear.hpp b/opm/core/utility/UniformTableLinear.hpp index 60b3433d..2a0fc55f 100644 --- a/opm/core/utility/UniformTableLinear.hpp +++ b/opm/core/utility/UniformTableLinear.hpp @@ -188,26 +188,25 @@ namespace Opm { UniformTableLinear ::derivative(const double xparam) const { - // Implements derivative consistent - // with ClosestValue policy for function - double value; - if(xparam > xmax_ || xparam < xmin_){ - value=0.0; - }else{ - double x = std::min(xparam, xmax_); - x = std::max(x, xmin_); - - // Lookup is easy since we are uniform in x. - double pos = (x - xmin_)/xdelta_; - double posi = std::floor(pos); - int left = int(posi); - if (left == int(y_values_.size()) - 1) { - // We are at xmax_ - --left; + // Implements derivative consistent + // with ClosestValue policy for function + double value; + if (xparam > xmax_ || xparam < xmin_) { + value = 0.0; + } else { + double x = std::min(xparam, xmax_); + x = std::max(x, xmin_); + // Lookup is easy since we are uniform in x. + double pos = (x - xmin_)/xdelta_; + double posi = std::floor(pos); + int left = int(posi); + if (left == int(y_values_.size()) - 1) { + // We are at xmax_ + --left; + } + value = (y_values_[left + 1] - y_values_[left])/xdelta_; } - value = (y_values_[left + 1] - y_values_[left])/xdelta_; - } - return value; + return value; }