Formatting fixes.
This commit is contained in:
parent
b93bb4fcf9
commit
3e294a4a81
@ -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<std::vector<std::vector<double> > > table_t;
|
||||
// If we need multiple regions, this class and the SinglePvt* classes must change.
|
||||
|
@ -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;
|
||||
|
@ -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_);
|
||||
|
@ -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) {
|
||||
|
@ -37,7 +37,7 @@ namespace Opm
|
||||
{
|
||||
public:
|
||||
typedef std::vector<std::vector<std::vector<double> > > 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.
|
||||
|
@ -188,26 +188,25 @@ namespace Opm {
|
||||
UniformTableLinear<T>
|
||||
::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;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user